multi_min Class Template Reference

#include <multi_min.h>

Inheritance diagram for multi_min:

gsl_mmin_base< param_t, func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, gradient< param_t, func_t, ovector_view_tlate >, simple_grad< param_t, func_t, ovector_view_tlate > > gsl_mmin_base< param_t, multi_vfunct< param_t, nv >, double, double, array_alloc< double[nv]>, grad_vfunct< param_t, nv >, gradient_array< param_t, multi_vfunct< param_t, nv >, nv >, simple_grad_array< param_t, multi_vfunct< param_t, nv >, nv > > ool_constr_mmin ool_constr_mmin< param_t, func_t, dfunc_t, ool_hfunct< void * >, vec_t, alloc_vec_t, alloc_t > ool_mmin_pgrad ool_mmin_spg

Detailed Description

template<class param_t, class func_t, class dfunc_t = func_t, class vec_t = ovector_view>
class multi_min< param_t, func_t, dfunc_t, vec_t >

Multidimensional minimization base.

The template parameters: The template parameter func_t specifies the function to minimize and should be a class containing a definition

      func_t::operator()(size_t nv, const vec_t &x, double &f, param_t &pa);
where f is the value of the function at x with parameter pa where x is a array-like class defining operator[] of size nv. The parameter dfunc_t (if used) should provide the gradient with
      func_t::operator()(size_t nv, const vec_t &x, vec_t &g, param_t &pa);
where g is the gradient of the function at x.

Definition at line 414 of file multi_min.h.


Public Member Functions

virtual int mmin (size_t nvar, vec_t &x, double &fmin, param_t &pa, func_t &func)
 Calculate the minimum min of func w.r.t. the array x of size nvar.
virtual int mmin_de (size_t nvar, vec_t &x, double &fmin, param_t &pa, func_t &func, dfunc_t &dfunc)
 Calculate the minimum min of func w.r.t. the array x of size nvar with gradient dfunc.
template<class vec2_t>
int print_iter (size_t nv, vec2_t &x, double y, int iter, double value, double limit, std::string comment)
 Print out iteration information.
const char * type ()
 Return string denoting type ("multi_min").

Data Fields

int verbose
 Output control.
int ntrial
 Maximum number of iterations.
double tolf
 Tolerance.
double tolx
 The minimum allowable stepsize.
int last_ntrial
 The number of iterations for in the most recent minimization.

Member Function Documentation

int print_iter ( size_t  nv,
vec2_t &  x,
double  y,
int  iter,
double  value,
double  limit,
std::string  comment 
) [inline]

Print out iteration information.

Depending on the value of the variable verbose, this prints out the iteration information. If verbose=0, then no information is printed, while if verbose>1, then after each iteration, the present values of x and y are output to std::cout along with the iteration number. If verbose>=2 then each iteration waits for a character.

Definition at line 473 of file multi_min.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