The correct syntax for member function is
void (algorithm::*ODE)(double * timeDeri, double * var)
As you mention, you need in fact be generic and use:
void (T::*ODE)(double * timeDeri, double * var)
So you may use CRTP for that:
template <typename T>
class algorithm
{
public:
// You may use typedef:
// typedef void (T::*ODE_T)(double * timeDeri, double * var);
// ODE_T ODE;
void (T::*ODE)(double * timeDeri, double * var);
void simulation()
{
double d1, d2;
(static_cast<T*>(this)->*ODE)(&d1, &d2);
//use ODE to do simulation
}
//explicit algorithm(ODE_T someODE)
explicit algorithm(void (T::*someODE)(double * timeDeri, double * var))
{
ODE = someODE;
}
};
class model : private algorithm<model>
{
friend algorithm<model>; // As you inherit privately from algorithm<T>.
public:
void specificODE(double * timeDeri, double * var)
{
//detail of the ODE
}
model() : algorithm(&model::specificODE)
{
//some initialization
}
};