// the fitter
TVirtualFitter *_minuit;
// ...
// function to be passed to fitter
void calcChi2(Int_t &, Double_t *, Double_t &f, Double_t *x, Int_t iflag);
A way to avoid that problem is to declare calcChi2 method as static, but then I cannot access the data that I pass to class c’tor.
So, How can I call TVirtualFitter methods in a class?
Many thanks in advance!
Regards,
Marco
PS root-version: 5.20
arch: linux - 32 bit
distro: Ubuntu (7.04)
gcc version 4.1.2 SbtGrandFit.tar (20 KB)
it crashes when it tries to use new ROOT::Math::Minimizer.
I was able to find the problematic line:
std::vector<double> xmin(func.NDim() );
If I ask for func.NDim() in this way: std::cout << "func.NDim() = " << func.NDim() << "\n";
I get:[quote]
*** Break *** illegal instruction
func.NDim() = Using host libthread_db library "[/quote]
I’m using version 5.20 on a linux machine.
Do you have an idea of what’s wrong here?
Many thanks in advance!
Test new ROOT::Math::Minimizer
Minimizer is GSLMultiMin ConjugateFR
Error in TUnixSystem::DynamicPathName: MathMore[.so | .sl | .dl | .a | .dll] does not exist in .:/home/bomben/work/root-520/root/lib::/home/bomben/work/root-520/root/lib:/home/bomben/work/root-520/root/lib:/home/bomben/work/root-520/root/cint/cint/stl
Error using minimizer GSLMultiMin ConjugateFR
Test new ROOT::Math::Minimizer
Minimizer is GSLMultiMin ConjugatePR
Error in TUnixSystem::DynamicPathName: MathMore[.so | .sl | .dl | .a | .dll] does not exist in .:/home/bomben/work/root-520/root/lib::/home/bomben/work/root-520/root/lib:/home/bomben/work/root-520/root/lib:/home/bomben/work/root-520/root/cint/cint/stl
Error using minimizer GSLMultiMin ConjugatePR
Test new ROOT::Math::Minimizer
Minimizer is GSLMultiMin BFGS
Error in TUnixSystem::DynamicPathName: MathMore[.so | .sl | .dl | .a | .dll] does not exist in .:/home/bomben/work/root-520/root/lib::/home/bomben/work/root-520/root/lib:/home/bomben/work/root-520/root/lib:/home/bomben/work/root-520/root/cint/cint/stl
Error using minimizer GSLMultiMin BFGS
(int)(-1)
[/quote]
something works…
Since your idea was to use SetFunction method via Minimizer (and it looks that this part is working in that macro) I will try to implement that in my class.
But I’m interested in getting that example working too, of course
I cannot reproduce your first problem, but I am using 5.22.
The other error is due to a missing MathMore library. For running all the test you need to have built libMathMore and this is possible only if you have before a version of GSL (>=1. installed in your system.
The other tests however seem to work.
Dear Lorenzo,
thanks for quick reply.
Yes, MathMore library was missing 'cause gsl was missing too.
Now testChebyQuad() works, though main() still not.
[quote]Now testChebyQuad() works, though main() still not.[/quote]Which is the expected behavior. ‘main’ is to be used only if you compile the example as a standalone executable (and hence execute things that ought to be executed once and are already executed by the main in root.exe ).