I have the difficulty in making a user-defined function having another
user defined function as the input.
Please refer to the following script and point out whatâs wrongâŚ
I am not well in c++, but I think the problem is that
your function âDouble_t fn2(Double_t *x, Double_t *par)â as an argument
takes a Double_t pointers, but in your program fn1 returns simple Double_t.
very good, rafopar! Itâs that and it starts even earlier: you call fn1(x[0],par) where x is a Double_t* and thus x[0] is a Double_t. But there is only a fn1 taking a Double_t* - so you should call fn1(x,par) or change the signature of fn1 to take Double_t instead of Double_t*.