I am trying to use the example provided in NumericalMinimization.C in the fit tutorials to minimize a python function.
I start with the RosenBrock function from the example but get an error with the line
f = ROOT.Math.Functor(Rosenbrock(),2).
I am aware that this is a super old topic, but I am trying to do the very same and I ran into similar troubles.
I am trying the exact same thing as pkmas explained, I would like to translate the example NumericalMinimization.C into python. I also setup a class that inherits from TPyMultiGenFunction (see the reply above this one), but I get the following error when setting the function:
min.SetFunction(rosenbrock)
TypeError: none of the 2 overloaded methods succeeded. Full details:
attempt to access a null-pointer
void ROOT::Math::Minimizer::SetFunction(const ROOT::Math::IGradientFunctionMultiDimTempl<double>& func) =>
could not convert argument 1
This could be because the approach from above is quite old, maybe things changed (?) - does anyone know how to resolve this?