This has been extensively discussed in the past . Go to roottalk digest and query for "fcn TMinuit member" --- Christian Hansen <christian.hansen@cern.ch> wrote: > > > > see example in $ROOTSYS/test/minexam.cxx > > > > Rene Brun > > > > Hi Rene, > > thank you very much for the help! But I'm afraid it did not > give me enough hints since minexam.cxx is no class. In the > attached tar file I have a class called MinuitTest (.C and .h), > where the function to be minimized with TVirtualFitter, 'fcn', > is defined as a member function of the class. But the line > > minuit->SetFCN(fcn); > > does not go through the compiler, it says: > > MinuitTest.C:14: no matching function for call to > `TVirtualFitter::SetFCN(<unknown type>)' > > even though I have defined fcn() in MinuitTest.h as > > private: > void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, > Int_t iflag); > > > Why does this not work and how should I do instead? > (I have tried many different ways, > but without success.) > > With best regards > /Christian > > > > > > > > > > > > On Fri, 9 Jul 2004, Christian > > Hansen wrote: > > > > > > > > Dear Rooters, > > > > > > I'm trying to call TMinuit from a c++ class in a similar way > > > that I've used TMinuit in a program called directly from > > > ROOT, but now I do not know how to define the 'fcn' > > > function in order for TMinuit to recognice it with the > > > SetFCN(fcn) > > > I've tried many different ways (attached is a small example) > > > but my code does not want to compile. Could anyone help me how > > > to change this so that the attached code goes through the > compilation? > > > > > > Thanks!!! > > > > > > > > > -- > / Christian Hansen > > > > =============================================== > Box 535 Office: +46-(0)18-471 32 57 > S-751 21 Uppsala Office: 82104 > Sweden > ----------------------------------------------- > Mobile : +46-(0)708-887617 > Home Page : http://welcome.to/Christian_Hansen > http://www.cern.ch/Christian.Hansen > > ATTACHMENT part 2 application/x-gzip name=minuitTest.tgz
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET