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
44template <
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,
74 return (
This->Object->*
This->MethodPointer)(XRef, FRef, *iflag);
84 return (
This->Object->*
This->MethodPointer)(XRef, FRef, *iflag);
90 static long int iflag = 0;
94 return (
This->Object->*
This->MethodPointer)(XRef, FRef, iflag);
101template <
int _instanceLine,
class _elementType>
105template <
int _instanceLine,
class _elementType>
142 long int *ldfjac,
long int *iflag) {
146 return (
This->Object->*
This->MethodPointer)(XRef, JRef, *iflag);
153 long int *ldfjac,
long int *iflag) {
157 return (
This->Object->*
This->MethodPointer)(XRef, JRef, *iflag);
164template <
int _instanceLine,
class _elementType>
168template <
int _instanceLine,
class _elementType>
183 void Set(_elementType *obj,
void (_elementType::*methodPointer)
193 (
This->Object->*
This->MethodPointer)(XRef, fx);
199template <
int _instanceLine,
class _elementType>
203template <
int _instanceLine,
class _elementType>
222 void Set(_elementType *obj,
void (_elementType::*methodPointer)
232 double x[],
double con[],
int err[]) {
238 (
This->Object->*
This->MethodPointer)(type, ListERef, XRef, ConRef, ErrRef);
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");
252template <
int _instanceLine,
class _elementType>
257template <
int _instanceLine,
class _elementType>
258class 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);
297template <
int _instanceLine,
class _elementType>
298nmrCallBackFunctionCG <_instanceLine, _elementType>* nmrCallBackFunctionCG<_instanceLine, _elementType>::This = NULL;
static void FunctionFdonlp2(int n, int nonlin, int type, int liste[], double x[], double con[], int err[])
Definition nmrCallBack.h:231
void(_elementType::*) MethodPointer(int Type, vctDynamicVectorRef< int > &ListE, vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Con, vctDynamicVectorRef< int > &Err)
Definition nmrCallBack.h:207
static CISST_DECLSPEC_THREAD nmrCallBackFunctionC * This
Definition nmrCallBack.h:210
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
nmrCallBackFunctionC(_elementType *obj, void(_elementType::*methodPointer)(int Type, vctDynamicVectorRef< int > &ListE, vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Con, vctDynamicVectorRef< int > &Err))
Definition nmrCallBack.h:215
nmrCallBackFunctionC()
Definition nmrCallBack.h:212
_elementType * Object
Definition nmrCallBack.h:206
void Set(_elementType *obj, void(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, double *F))
Definition nmrCallBack.h:183
static CISST_DECLSPEC_THREAD nmrCallBackFunctionF1 * This
Definition nmrCallBack.h:173
_elementType * Object
Definition nmrCallBack.h:171
static void FunctionFdonlp2(int n, double x[], double *fx)
Definition nmrCallBack.h:190
void(_elementType::*) MethodPointer(vctDynamicVectorRef< double > &X, double *F)
Definition nmrCallBack.h:172
nmrCallBackFunctionF1()
Definition nmrCallBack.h:175
nmrCallBackFunctionF1(_elementType *obj, void(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, double *F))
Definition nmrCallBack.h:178
static int FunctionFlmdif(long int *m, long int *n, double *x, double *fvec, long int *iflag)
Definition nmrCallBack.h:69
nmrCallBackFunctionF()
Definition nmrCallBack.h:52
int(_elementType::*) MethodPointer(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Y, long int &Flag)
Definition nmrCallBack.h:48
static CISST_DECLSPEC_THREAD nmrCallBackFunctionF * This
Definition nmrCallBack.h:50
static int FunctionFhybrd(long int *n, double *x, double *fvec, long int *iflag)
Definition nmrCallBack.h:79
static int FunctionFdonlp2(long int *n, double x[], double fgraf[])
Definition nmrCallBack.h:89
void Set(_elementType *obj, int(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Y, long int &Flag))
Definition nmrCallBack.h:61
nmrCallBackFunctionF(_elementType *obj, int(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &Y, long int &Flag))
Definition nmrCallBack.h:55
_elementType * Object
Definition nmrCallBack.h:47
static CISST_DECLSPEC_THREAD nmrCallBackFunctionJ * This
Definition nmrCallBack.h:118
int(_elementType::*) MethodPointer(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &J, long int &Flag)
Definition nmrCallBack.h:112
_elementType * Object
Definition nmrCallBack.h:109
static int FunctionFhybrj2(long int *n, double *x, double *fdjac, long int *ldfjac, long int *iflag)
Definition nmrCallBack.h:141
nmrCallBackFunctionJ()
Definition nmrCallBack.h:123
void Set(_elementType *obj, int(_elementType::*methodPointer)(vctDynamicVectorRef< double > &X, vctDynamicVectorRef< double > &J, long int &Flag))
Definition nmrCallBack.h:133
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
Dynamic matrix referencing existing memory.
Definition vctDynamicMatrixRef.h:75
Dynamic vector referencing existing memory.
Definition vctDynamicVectorRef.h:78
#define CISST_DECLSPEC_THREAD
Definition nmrCallBack.h:39
nmrCallBackFunctionF< _instanceLine, _elementType > * nmrCallBackFunctionF< _instanceLine, _elementType >::This
Definition nmrCallBack.h:102
const value_type & Y(void) const
Definition vctDynamicConstVectorBase.h:271
const value_type & X(void) const
Definition vctDynamicConstVectorBase.h:263
Declaration of vctDynamicMatrix.
Declaration of vctDynamicMatrixRef.
Declaration of vctDynamicVector.
Declaration of vctDynamicVectorRef.