YANE-Framework 1.1.0
Public Member Functions

yane::MinProg::GaussNewton Class Reference

Class to solve an optimization problem using the Gauss-Newton method. More...

List of all members.

Public Member Functions

void calcParams (double *a, int datalength, double *rpar, int *ipar)
 Funtion to start the optimization.
 GaussNewton (int dim_x, int dim_a, int dim_y, double *x, double *y, T_GNFUNC function, T_GNFUNC grad=0)
 Constructor.
int iterations ()
 Function to obtain the number of iteration steps.
void resize (int dim_x, int dim_a, int dim_y)
 Funtion to resize the minimization problem.
void setAccuracy (double acc)
 Function to set the accuracy of a GaussNewton object.
void setData (double *x, double *y)
 Function to initialize a GaussNewton object with data values.
void setFunction (T_GNFUNC function, T_GNFUNC grad=0)
 Funtion to initialize a GaussNewton object with function pointers.
virtual void setMaxIterations (int max_it)
 Function to set the maximal number of iterations of a GaussNewton object.
 ~GaussNewton ()
 Destructor.

Detailed Description

Class to solve a minimization problem using GaussNewton. Setup :

\begin{eqnarray*} \mbox{Minimize} \; & \sum\limits_{i=1}^{dim\_y}(f(x_{i,1}, ..., x_{i,dim\_x}) - y_{i})^2 \\ \mbox{Model function} \; & f(x_{1}, ..., x_{dim\_x}) = y \\ \mbox{with parameters} \; & a_{1}, ..., a_{dim\_a} \\ \mbox{and measurement data} \; & (x_{i},y_{i}) \qquad 1 \le i \le dim\_y \end{eqnarray*}

Therefore x is an 1-dim array with length dim_x*dim_y, y an 1-dim array with length dim_y and a an 1-dim array with length dim_a.

Usually this class is used as following:


Constructor & Destructor Documentation

LIB_EXPORT yane::MinProg::GaussNewton::GaussNewton ( int  dim_x,
int  dim_a,
int  dim_y,
double *  x,
double *  y,
T_GNFUNC  function,
T_GNFUNC  grad = 0 
)
Parameters:
dim_xDimension of the measurement instances
dim_aDimension of the modelfunction parameter
dim_yAmount of measurement values
xMeasurement instances with dimension dim_x * dim_y
yMeasurement values with dimension dim_y
functionModel function
gradGradient respective a of the model function

Member Function Documentation

LIB_EXPORT void yane::MinProg::GaussNewton::calcParams ( double *  a,
int  datalength,
double *  rpar,
int *  ipar 
)
Parameters:
aOptimal parameter of the fitting problem, initialized with starting values with dimension <= dim_y
datalengthAmount of measurement values
Exceptions:
yane::MinProg::SolverErrorIs thrown of solver input is invalid
yane::MinProg::SolverErrorIs thrown if Cholesky failed
yane::MinProg::SolverWarningIs thrown if GaussNewton neede to many steps
yane::MinProg::SolverWarningIs thrown if parameter improvement is impossible
LIB_EXPORT int yane::MinProg::GaussNewton::iterations ( )
Returns:
Number of executed optimization steps
LIB_EXPORT void yane::MinProg::GaussNewton::resize ( int  dim_x,
int  dim_a,
int  dim_y 
)
Parameters:
dim_xDimension of the measurement instances
dim_aDimension of the modelfunction parameters
dim_yAmount of measurement values
LIB_EXPORT void yane::MinProg::GaussNewton::setAccuracy ( double  acc)
Parameters:
epsilonAccuracy of the minimization
LIB_EXPORT void yane::MinProg::GaussNewton::setData ( double *  x,
double *  y 
)
Parameters:
xMeasurement instances
yMeasurement values
LIB_EXPORT void yane::MinProg::GaussNewton::setFunction ( T_GNFUNC  function,
T_GNFUNC  grad = 0 
)
Parameters:
functionModel function
gradGradient of the model function
LIB_EXPORT void yane::MinProg::GaussNewton::setMaxIterations ( int  max_it) [virtual]
Parameters:
max_itMaximal number of iterations