|
Boost Users : |
From: Philippe Després (pdespres_at_[hidden])
Date: 2005-03-16 01:12:50
Hello,
I am using Numerical Recipes routines and I am trying to call this function
void mrqmin(Vec_I_DP &x, Vec_I_DP &y, Vec_I_DP &sig, Vec_IO_DP &a,
Vec_I_BOOL &ia, Mat_O_DP &covar, Mat_O_DP &alpha, DP &chisq,
void funcs(const DP, Vec_I_DP &, DP &, Vec_O_DP &), DP &alamda);
and I would like to call it with funcs being a member function pointer
of one of my class. I can declare the member as static but then I
cannot access member variable, which is the goal here. Someone suggested
to use boost to solve the problem. His solution is here
http://www.numerical-recipes.com/forum/showthread.php?s=&threadid=526
I tried to implement this but the result is this
error: cannot convert `boost::function<void ()(double, const Vec_I_DP&,
double&, Vec_O_DP&), std::allocator<void> >' to `void (*)(DP, const
Vec_I_DP&, DP&, Vec_O_DP&)' for argument `9' to `void NR::mrqmin(const
Vec_I_DP&, const Vec_I_DP&, const Vec_I_DP&, Vec_IO_DP&, const
Vec_I_BOOL&, Mat_O_DP&, Mat_O_DP&, DP&, void (*)(DP, const Vec_I_DP&,
DP&, Vec_O_DP&), DP&)'
Any idea how I could do that?
Thanks
-- Philippe
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net