1.2.0
CCC
 
foxleg.cpp File Reference
#include "geoslib_old_f.h"
#include "Enum/EJustify.hpp"
#include "Basic/Utilities.hpp"
#include "Basic/File.hpp"
#include "Basic/String.hpp"
#include "Basic/OptDbg.hpp"
#include <math.h>

Functions

int foxleg_f (int ndat, int npar, int ncont, const MatrixRectangular &acont, VectorDouble &param, VectorDouble &lower, VectorDouble &upper, VectorDouble &scale, const Option_AutoFit &mauto, int flag_title, void(*func_evaluate)(int ndat, int npar, VectorDouble &param, VectorDouble &work), VectorDouble &tabexp, VectorDouble &tabwgt)
 
int add_sill_constraints (Constraints &constraints, double constantSill)
 
int add_unit_sill_constraints (Constraints &constraints)
 

Function Documentation

int add_sill_constraints ( Constraints constraints,
double  constantSill 
)

Add constraints to the Option_AutoFit structure

Returns
Error return code
Parameters
[in]constraintsConstraints structure
[in]constantSillConstant value for the Sill as a constraint
int add_unit_sill_constraints ( Constraints constraints)

Add constraints (all equal to 1) to the Option_AutoFit structure

Returns
Error return code
Parameters
[in]constraintsConstraints structure
int foxleg_f ( int  ndat,
int  npar,
int  ncont,
const MatrixRectangular acont,
VectorDouble param,
VectorDouble lower,
VectorDouble upper,
VectorDouble scale,
const Option_AutoFit mauto,
int  flag_title,
void(*)(int ndat, int npar, VectorDouble &param, VectorDouble &work)  func_evaluate,
VectorDouble tabexp,
VectorDouble tabwgt 
)

Foxleg algorithm

Returns
Error returned code
0 : Correct termination
-1 : The convergence has not been reached
1 : Core problem
Parameters
[in]ndatNumber of control points
[in]nparNumber of parameters to estimate
[in]ncontNumber of additional constraints
[in]acontMatrix of additional constraints (Dimension = ncont * npar)
[in]paramCurrent values of the parameters
[in]lowerArray of lower values
[in]upperArray of upper values
[in]scaleArray of scale
[in]mautoOption_AutoFit structure
[in]flag_titlePrint the title after func_evaluate()
[in]func_evaluateFunction for evaluating the model
[in]tabexpArray of values at control points
[in]tabwgtArray of weights at control points
Remarks
The evaluation function func_evaluate() is called with the
following arguments:
ndat : Number of control points
npar : Number of parameters
param : Vector of current values for the parameters
work : Output vector for the values at control points
evaluated using the current parameter values
Some additional constraints may be applied on the parameters
When not used, we must set: ncont=0, acont=empty()