#include <lmeval.h>
 | 
| 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) | 
|   | 
◆ LmEval()
◆ 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
 - 
  
    | par | double*  | 
    | m_dat | int  | 
    | fvec | double*  | 
    | data | void*  | 
    | info | int*  | 
  
   
- 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_par | int  | 
    | par | double*  | 
    | m_dat | int  | 
    | fvec | double*  | 
    | data | void*  | 
    | iflag | int  | 
    | iter | int  | 
    | nfev | int  | 
  
   
- Returns
 - void 
 
 
 
The documentation for this class was generated from the following files:
- /home/runner/work/moja.canada/moja.canada/Source/moja.modules.cbm/include/moja/modules/cbm/lmeval.h
 
- /home/runner/work/moja.canada/moja.canada/Source/moja.modules.cbm/src/lmeval.cpp