My question is related to numerical recipes. I have a global function which computes the vector of functions to be minimized
VecDoub vecfunc(VecDoub_I x) {
// code is here
}
In a class function run, I tried to call the Numerical Recipes function newt, which reads my function vecfunc as shown,
class A {
void run() {
VecDoub_IO pt;
pt.resize(2);
pt[0] = 0.5;
pt[1] = 0.5;
bool check = false;
newt<VecDoub>(pt, check, &vecfunc);
}
}
Function newt is declared as
template <class T>
void newt(VecDoub_IO &x, Bool &check, T &vecfunc)
Why do I get the following compiler error?
error C2664: 'newt' : cannot convert parameter 3 from 'VecDoub (__cdecl *)(VecDoub_I)' to 'VecDoub &'