I am having a problem calling a global function that takes a function pointer as a parameter. Here is the global function declaration:
int lmdif ( minpack_func_mn fcn, void *p, int m, int n, double *x, double *fvec, double ftol)
The symbol "minpack_func_mn" is a typedef for a pointer to a function defined as:
typedef int (*minpack_func_mn)(void *p, int m, int n, const double *x, double *fvec, int iflag );
I want to call the "lmdif" function with a pointer to a function that is a member of the class I created, and here is the declaration of this class function:
int LT_Calibrator::fcn(void *p, int m, int n, const double *x, double *fvec,int iflag)
I call the global function as follows:
info=lmdif(<_Calibrator::fcn, 0, m, n, x, fvec, ftol)
Unfortunately, I get a compiler error saying: "error C2664: 'lmdif': cannot convert parameter 1 from 'int (__thiscall LT_Calibrator :: *) (void *, int, int, const double *, double *, int ) 'to' minpack_func_mn '1> There is no context in which this conversion is possible "
Is there any way to solve this problem?