gsl_mmin_conf Class Template Reference

Multidimensional minimization by the Fletcher-Reeves conjugate gradient algorithm (GSL). More...

#include <gsl_mmin_conf.h>

Inheritance diagram for gsl_mmin_conf:

gsl_mmin_base multi_min gsl_mmin_conf_array gsl_mmin_conp gsl_mmin_conp_array

Detailed Description

template<class param_t, class func_t = multi_funct<param_t>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc, class dfunc_t = grad_funct<param_t,ovector_base>, class auto_grad_t = gradient<param_t,func_t,ovector_base>, class def_auto_grad_t = simple_grad<param_t,func_t,ovector_base>>
class gsl_mmin_conf< param_t, func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t >

Multidimensional minimization by the Fletcher-Reeves conjugate gradient algorithm (GSL).

The functions mmin() and mmin_de() minimize a given function until the gradient is smaller than the value of multi_min::tolf (which defaults to $ 10^{-4} $ ).

See an example for the usage of this class in Multidimensional minimizer example .

Idea for future:
A bit of needless copying is required in the function wrapper to convert from gsl_vector to the templated vector type. This can be fixed, probably by rewriting take_step to produce a vec_t &x1 rather than a gsl_vector *x1;
Note that the state variable max_iter has not been included here, because it was not really used in the original GSL code for these minimizers.

Default template arguments

Definition at line 415 of file gsl_mmin_conf.h.


Public Member Functions

virtual int iterate ()
 Perform an iteration.
virtual const char * type ()
 Return string denoting type("gsl_mmin_conf").
virtual int allocate (size_t n)
 Allocate the memory.
virtual int free ()
 Free the allocated memory.
int restart ()
 Reset the minimizer to use the current point as a new starting point.
virtual int set (vec_t &x, double u_step_size, double tol_u, func_t &ufunc, param_t &pa)
 Set the function and initial guess.
virtual int set_de (vec_t &x, double u_step_size, double tol_u, func_t &ufunc, dfunc_t &udfunc, param_t &pa)
 Set the function and initial guess.
virtual int mmin (size_t nn, vec_t &xx, double &fmin, param_t &pa, func_t &ufunc)
 Calculate the minimum min of func w.r.t the array x of size nvar.
virtual int mmin_de (size_t nn, vec_t &xx, double &fmin, param_t &pa, func_t &ufunc, dfunc_t &udfunc)
 Calculate the minimum min of func w.r.t the array x of size nvar.

Data Fields

double lmin_tol
 Tolerance for the line minimization (default $ 10^{-4} $).
double step_size
 Size of the initial step (default 0.01).

Protected Attributes

alloc_vec_t avt5
 Temporary vector.
alloc_vec_t avt6
 Temporary vector.
alloc_vec_t avt7
 Temporary vector.
alloc_vec_t avt8
 Temporary vector.
The original variables from the GSL state structure
int iter
 Iteration number.
double step
 Stepsize.
double tol
 Tolerance.
gsl_vector * x1
 Desc.
gsl_vector * dx1
 Desc.
gsl_vector * x2
 Desc.
double pnorm
 Desc.
gsl_vector * p
 Desc.
double g0norm
 Desc.
gsl_vector * g0
 Desc.
Store the arguments to set() so we can use them for iterate()
gsl_vector * ugx
 Proposed minimum.
gsl_vector * ugg
 Gradient.
gsl_vector * udx
 Proposed step.
double it_min
 Desc.

Member Function Documentation

virtual int allocate ( size_t  n  )  [inline, virtual]

Allocate the memory.

Idea for future:
Use a gsl_alloc_arrays() like function for this (but keep in mind these are calloc, not malloc statements

Definition at line 600 of file gsl_mmin_conf.h.

virtual int set ( vec_t &  x,
double  u_step_size,
double  tol_u,
func_t &  ufunc,
param_t &  pa 
) [inline, virtual]

Set the function and initial guess.

Evaluate the function and its gradient

Definition at line 717 of file gsl_mmin_conf.h.


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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page