Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Data Fields
gsl_mmin_conf< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t > 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< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t >:
gsl_mmin_base< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t > multi_min< func_t, func_t, vec_t > gsl_mmin_conp< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t >

Detailed Description

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

This class performs 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::tol_rel (which defaults to $ 10^{-4} $ ).

This class has a high-level interface using mmin() or mmin_de() which automatically performs the memory allocation and minimization, or a GSL-like interface using allocate(), free(), interate() and set() or set_simplex().

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

Default template arguments

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.

Definition at line 401 of file gsl_mmin_conf.h.

Public Member Functions

virtual const char * type ()
 Return string denoting type("gsl_mmin_conf")
GSL-like lower level interface
virtual int iterate ()
 Perform an iteration.
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)
 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)
 Set the function and initial guess.
Basic usage
virtual int mmin (size_t nn, vec_t &xx, double &fmin, 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, 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

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

Member Function Documentation

template<class func_t = multi_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc, class dfunc_t = grad_funct<ovector_base>, class auto_grad_t = gradient<func_t,ovector_base>, class def_auto_grad_t = simple_grad<func_t,ovector_base>>
virtual int gsl_mmin_conf< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t >::set ( vec_t &  x,
double  u_step_size,
double  tol_u,
func_t &  ufunc 
) [inline, virtual]

Evaluate the function and its gradient

Definition at line 614 of file gsl_mmin_conf.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.