In Numerical Recipes they use something I've never seen done before, and couldn't easily find info on:
void fun( std::vector<double> derivatives(const double, const std::vector<double> &) ) { ...; derivatives(...); ...; }
Which I'm guessing is passing the function by reference (is this correct)? Why would this be favorable to using a function pointer? In which situation is each method prefered?
I have a second issue: When I invoke the function for the first time the program hangs for several seconds. Now, the argument function I pass in, itself, invokes a different function from a function pointer i.e.
vector<double>(*pfI)(const double) = NULL;
...
pfI = pointedToFun;
void argFun() { ...; deRefPointedFun = (*Theta::pfI)(t); deRefPointedFun(); }
What's the better way to handle 2 levels of referenced/pointer functions?