26 #ifndef _nmrCallBackLSNonLinSolver_h
27 #define _nmrCallBackLSNonLinSolver_h
37 #define nmrUNIQUE_IDENTIFIER_LINE ( __LINE__ + 0x0000 )
38 #if CISST_OS == CISST_WINDOWS
39 #define CISST_DECLSPEC_THREAD __declspec( thread )
41 #define CISST_DECLSPEC_THREAD
44 template <
int _instanceLine,
class _elementType>
61 void Set(_elementType *obj,
int (_elementType::*methodPointer)
69 static int FunctionFlmdif (
long int *m,
long int *n,
double *x,
double *fvec,
90 static long int iflag = 0;
101 template <
int _instanceLine,
class _elementType>
105 template <
int _instanceLine,
class _elementType>
142 long int *ldfjac,
long int *iflag) {
153 long int *ldfjac,
long int *iflag) {
164 template <
int _instanceLine,
class _elementType>
168 template <
int _instanceLine,
class _elementType>
183 void Set(_elementType *obj,
void (_elementType::*methodPointer)
199 template <
int _instanceLine,
class _elementType>
203 template <
int _instanceLine,
class _elementType>
222 void Set(_elementType *obj,
void (_elementType::*methodPointer)
232 double x[],
double con[],
int err[]) {
240 fprintf(stderr,
"%d, %d, %d", n, nonlin, type);
241 for (
int l = 1; l <= liste[0]; l++) fprintf(stderr,
"%d, ", liste[l]);
242 for (
int bb = 1; bb <= n; bb++) fprintf(stderr,
"%f, ", x[bb]);
243 for (
int cc = 1; cc <= nonlin; cc++) fprintf(stderr,
"%f, ", con[cc]);
244 for (
int dd = 1; dd <= nonlin; dd++) fprintf(stderr,
"%d, ", err[dd]);
245 fprintf(stderr,
"\n");
252 template <
int _instanceLine,
class _elementType>
257 template <
int _instanceLine,
class _elementType>
258 class nmrCallBackFunctionCG {
260 _elementType *Object;
265 nmrCallBackFunctionCG():Object(0), MethodPointer(0) {
266 nmrCallBackFunctionCG::This = NULL;
268 nmrCallBackFunctionCG(_elementType *obj,
int (_elementType::*methodPointer)
272 MethodPointer(methodPointer) {
273 nmrCallBackFunctionCG::This =
this;
275 void Set(_elementType *obj,
int (_elementType::*methodPointer)
280 MethodPointer = methodPointer;
281 nmrCallBackFunctionCG::This =
this;
284 static int FunctionFdonlp2 (
long int n,
long int nonlin,
long int liste[] ,
long int shift ,
double x[],
286 static int iflag = 0;
287 if (nmrCallBackFunctionCG::This != NULL) {
292 return (This->Object->*This->MethodPointer)(XRef, *fx, iflag);
297 template <
int _instanceLine,
class _elementType>
298 nmrCallBackFunctionCG <_instanceLine, _elementType>* nmrCallBackFunctionCG<_instanceLine, _elementType>::This = NULL;
301 #endif // _nmrCallBackLSNonLinSolver_h
void Set(_elementType *obj, int(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Y, long int &Flag))
Definition: nmrCallBack.h:61
Declaration of vctDynamicMatrix.
void Set(_elementType *obj, void(_elementType::*methodPointer)(int Type, vctDynamicVectorRef< int > &ListE, vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Con, vctDynamicVectorRef< int > &Err))
Definition: nmrCallBack.h:222
_elementType * Object
Definition: nmrCallBack.h:109
static int FunctionFdonlp2(long int *n, double x[], double fgraf[])
Definition: nmrCallBack.h:89
nmrCallBackFunctionF1()
Definition: nmrCallBack.h:175
static CISST_DECLSPEC_THREAD nmrCallBackFunctionJ * This
Definition: nmrCallBack.h:118
nmrCallBackFunctionC(_elementType *obj, void(_elementType::*methodPointer)(int Type, vctDynamicVectorRef< int > &ListE, vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Con, vctDynamicVectorRef< int > &Err))
Definition: nmrCallBack.h:215
Definition: nmrCallBack.h:169
static CISST_DECLSPEC_THREAD nmrCallBackFunctionF1 * This
Definition: nmrCallBack.h:173
Definition: nmrCallBack.h:204
int(_elementType::* MethodPointer)(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Y, long int &Flag)
Definition: nmrCallBack.h:48
nmrCallBackFunctionF1(_elementType *obj, void(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, double *F))
Definition: nmrCallBack.h:178
int(_elementType::* MethodPointer)(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &J, long int &Flag)
Definition: nmrCallBack.h:112
static void FunctionFdonlp2(int n, int nonlin, int type, int liste[], double x[], double con[], int err[])
Definition: nmrCallBack.h:231
void Set(_elementType *obj, int(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &J, long int &Flag))
Definition: nmrCallBack.h:133
Declaration of vctDynamicVector.
static void FunctionFdonlp2(int n, double x[], double *fx)
Definition: nmrCallBack.h:190
Definition: nmrCallBack.h:45
static int FunctionFhybrd(long int *n, double *x, double *fvec, long int *iflag)
Definition: nmrCallBack.h:79
nmrCallBackFunctionF(_elementType *obj, int(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Y, long int &Flag))
Definition: nmrCallBack.h:55
static int FunctionFlmdif(long int *m, long int *n, double *x, double *fvec, long int *iflag)
Definition: nmrCallBack.h:69
void(_elementType::* MethodPointer)(int Type, vctDynamicVectorRef< int > &ListE, vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Con, vctDynamicVectorRef< int > &Err)
Definition: nmrCallBack.h:207
Definition: nmrCallBack.h:106
Declaration of vctDynamicMatrixRef.
static int FunctionFhybrj2(long int *n, double *x, double *fdjac, long int *ldfjac, long int *iflag)
Definition: nmrCallBack.h:141
#define CISST_DECLSPEC_THREAD
Definition: nmrCallBack.h:39
void(_elementType::* MethodPointer)(vctDynamicVectorRef< double > &X, double *F)
Definition: nmrCallBack.h:172
_elementType * Object
Definition: nmrCallBack.h:206
Declaration of vctDynamicVectorRef.
nmrCallBackFunctionC()
Definition: nmrCallBack.h:212
nmrCallBackFunctionJ()
Definition: nmrCallBack.h:123
static CISST_DECLSPEC_THREAD nmrCallBackFunctionF * This
Definition: nmrCallBack.h:50
_elementType * Object
Definition: nmrCallBack.h:171
nmrCallBackFunctionJ(_elementType *obj, int(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &J, long int &Flag))
Definition: nmrCallBack.h:126
static int FunctionFlmder2(long int *m, long int *n, double *x, double *fdjac, long int *ldfjac, long int *iflag)
Definition: nmrCallBack.h:152
nmrCallBackFunctionF()
Definition: nmrCallBack.h:52
_elementType * Object
Definition: nmrCallBack.h:47
void Set(_elementType *obj, void(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, double *F))
Definition: nmrCallBack.h:183
static CISST_DECLSPEC_THREAD nmrCallBackFunctionC * This
Definition: nmrCallBack.h:210