FCNAdapter use in MINUIT2


I am trying to upgrade code presently using MnMigrad, MnUserParameters, and an Fcn class inheriting from FCNBase to use Minuit2Minimizer. My FCN is somewhat complicated depending on constructors
both to import data and to do calculations with an embedded function class. I suspect the FCNAdapter class is written to facilitate this upgrade but can’t find its use in a tutorial or documentation. Does anyone have a simple example of its use? Or possibly do I have to modify my FCN to inherit from IMultiGenFunction class instead of FCNBase?
I’d really appreciate some pointers

_ROOT Version:_6.26/10

Platform: fedora37
Compiler: (GCC) 12.3.1


Hi @olin,

Thanks for reaching out on the forum. Maybe @moneta could help here?

Cheers,
Marta

Hello,

To use the Minuit2Minimizer interface, the simplest solution is to write the FCN as a functor class (you can also use a lambda function or a std::function), implementing the operator(const double *).
A simple example (using a free function) is this tutorial:
https://root.cern.ch/doc/master/NumericalMinimization_8C.html

If you have further questions please let me know

Cheers

Lorenzo

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.