So, I have a function, called Romberg, that takes a function as first parameter:
int Romberg(double (*f)(double), ... );
When executed, it applies the passed function to several values.
In a class, I have defined the following methods:
double Funktion::q(double x){
return(sqrt(1.0+fd(x)*fd(x)));
};
void Funktion::compute_bogen(){
Romberg(q, ... );
};
Where fd
is another method from the same class. This however, doesn't work! I tried altering the code in the following way, which ends up with successfully passing the method to the Romberg function; but then it fails to apply the passed function:
int Romberg(double (Funktion::* &f)(double), ... );
void Funktion::compute_bogen(){
Romberg(&Funktion::q, ... );
};
I get the following error message:
error C2064: term does not evaluate to a function taking 1 arguments
Right now, I do not see how to make this work without throwing away the whole class system I built.