I am writing a code using the numerical recipes library and I would like to minimize a function which is actually the method of a class. I have this type of code:
class cl{
Doub instance(VecDoub_I &x)
{
return x[0]*x[0] + x[1]*x[1];
};
};
And I want to minimize this function using the Powell method, in the following code
// enter code here
int main(void)
{
cl test;
Powell<Doub (VecDoub_I &)> powell(test.instance);
}
But when I compile I get the following error :
main.cpp:241:22: error: invalid use of member function (did you forget the ‘()’ ?)
main.cpp:242:54: error: no matching function for call to ‘Powell<double(const NRvector<double>&)>::Powell(<unresolved overloaded function type>)’
Has anybody already ecountered this problem ? Thanks in advance