The problem was in Pythonize.cxx, where I was off by 1 when counting arguments. I’m pretty sure that 5.06 has the problem.
when you set the number of parameters to 1 (default is 0) like you do here:
then your function will get 2 arguments, the first will be a double* array of size 4 for the coordinates, the second will be a double* array for the parameters, with size as given to the constructor. So, if the number of parameters is > 0, your function needs to be at least:
Where the callback will fill in x only (it is a TF1, after all), and any parameters that you set through SetParameters will appear in par (maximum 1, as that was your choice in the ctor).
In my previous posting, I used the example of 0 for the number of parameters, in which case there will be no “par” (as above) to the function.
Now, in order to be more “pythonistic” here’s another example:[code]from math import sin
from ROOT import TF1
def init( self, a, b, c ):
self.a = a
self.b = b
self.c = c
def call( self, x ):
myf = MyF( 3, 4, 7 )
f = TF1( ‘f’, myf, 0., 100., 0 )
after which you can get/set your parameters through “myf.a”, “myf.b”, and “myf.c”.