Minuit fit using derivatives

Hi,
I am having a problem using Minuit with PyRoot. I have a working fitting application and am now trying to add calculated derivatives to my fcn.

The argument list for fcn, called from inside Minuit, is:

def chisq( npar, gin, f, par, iflag ):

but when I try to set the value of gin (thats the gradient) I get an error:

gin[0] = theValueOfMyDerivative
TypeError: ‘bad argument type for built-in operation’

(I notice that gin has an unusual type, ROOT.PyDoubleBuffer, while f, the thing being minimized, is a python list.) So the question is: how can I change the values of gin?

thanks,

Aaron

Hi,

seems to be a new problem with p2.6: the setitem call goes through as_mapping rather than through as_sequence as used to be for p2.5 and older.

Will fix …

Cheers,
Wim

Hi,

fixed in trunk … and again, it’s only needed for p2.6 and later.

Cheers,
Wim