GCBM
Public Member Functions | Static Public Member Functions | List of all members
LmEval Class Reference

#include <lmeval.h>

Collaboration diagram for LmEval:
Collaboration graph

Public Member Functions

 LmEval ()=delete
 

Static Public Member Functions

static void lm_evaluate_default (double *par, int m_dat, double *fvec, void *data, int *info)
 
static void lm_print_default (int n_par, double *par, int m_dat, double *fvec, void *data, int iflag, int iter, int nfev)
 

Constructor & Destructor Documentation

◆ LmEval()

LmEval ( )
delete

Member Function Documentation

◆ lm_evaluate_default()

void lm_evaluate_default ( double *  par,
int  m_dat,
double *  fvec,
void *  data,
int *  info 
)
static

Evaluation function

Description of the paraeters :
par is an input array. At the end of the minimization, it contains the approximate solution vector.
m_dat is a positive integer input variable set to the number of functions
fvec is an output array of length m_dat which contains the function values the square sum of which ought to be minimized.
data is a read-only pointer to lm_data_type, as specified by lm_eval.h.
info is an integer output variable. If set to a negative value, the minimization procedure will stop.

Create a pointer variable mydata, of type lm_data_type. Type cast parameter data to lm_data_type * and assign it to mydata
For index in the range 0 to parameter m_dat, set fvec[index] to the difference of
user_y[index] and user_func(user_t[index], par) on mydata
Set parameter *info to *info to prevent a 'unused variable' warning

Parameters
pardouble*
m_datint
fvecdouble*
datavoid*
infoint*
Returns
void

◆ lm_print_default()

void lm_print_default ( int  n_par,
double *  par,
int  m_dat,
double *  fvec,
void *  data,
int  iflag,
int  iter,
int  nfev 
)
static

Description of the parameters :
data : for soft control of printout behaviour, add control variables to the data struct
iflag : 0 (init) 1 (outer loop) 2(inner loop) -1(terminated)
iter : outer loop counter
nfev : number of calls to *evaluate
Create 3 variables f, y, t of type double, a pointer variable mydata, of type lm_data_type. Type cast parameter data to lm_data_type * and assign it to mydata
For index in the range 0 to parameter n_par, if parameter iflag is -1, set variable t to mydata->user_t[index], variable y to mydata->user_y[index], and variable f to mydata->user_func(t, par) on mydata

Parameters
n_parint
pardouble*
m_datint
fvecdouble*
datavoid*
iflagint
iterint
nfevint
Returns
void

The documentation for this class was generated from the following files: