I think this is about how TF1 works. I don’t have ROOT documentation on hand, but if I remember correctly, the first argument of TF1 constructor has to have name of callback function. In your case “fit”. Correct me
if I am wrong, Rene.
BTW, right forum for this topic is “ROOT support”, I think.
I think this is about how TF1 works. I don’t have ROOT documentation on hand, but if I remember correctly, the first argument of TF1 constructor has to have name of callback function. In your case “fit”. Correct me
if I am wrong, Rene.
[/quote]
I tried to provide “fit” as the first argument of the TF1 constructor and again
TF1 failed to compile the fit function.
My problem is not how TF1 works, but how to feed a funtion pointer to a C++ method via CINT’s API. TF1’s ctor is an example method.
I see. Indeed, that was the title of your posting.
Let me explain how you can feed function pointers in Cint.
In a sense, it is as simple as giving function name. For example,
But how it works is not simple at all. There are several different
cases.
Interpreted function
1.1. bytecode compiled interpreted function
1.2. bare interpreted function
This case, cint returns pointer to proprietary data which
points to the function. Implementation is different for
bytecode and non-bytecode function. But, either case,
only cint understands meaning of that pointer.
Compiled function
For compiled function, what cint returns depends on how
you compiled Cint. If -DG__TRUEP2F is defined for cint
build, true pointer to function which can be directly used
by native code will be returned. If not, cint returns pointer
to wrapper function.
Member function.
Cint can not handle pointer to member function.
This is quite complex. For more information, please refer to
cint/ref.txt and search G__isinterpretedp2f API. You’ll find
example code.