Class mmin_conf (o2scl)

O2scl : Class List

template<class func_t = multi_funct, class vec_t = boost::numeric::ublas::vector<double>, class dfunc_t = grad_funct, class auto_grad_t = gradient<multi_funct, boost::numeric::ublas::vector<double>>, class def_auto_grad_t = gradient_gsl<multi_funct, boost::numeric::ublas::vector<double>>>
class o2scl::mmin_conf : public o2scl::mmin_gsl_base<multi_funct, boost::numeric::ublas::vector<double>, grad_funct, gradient<multi_funct, boost::numeric::ublas::vector<double>>, gradient_gsl<multi_funct, boost::numeric::ublas::vector<double>>>

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

This class performs multidimensional minimization by the Fletcher-Reeves conjugate algorithm (GSL). The functions mmin() and mmin_de() a given function until the is smaller than the value of mmin::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 example.

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.

The original variables from the GSL state structure

int iter

Iteration number.

double step

Stepsize.

double tol

Tolerance.

vec_t x1

Desc.

vec_t dx1

Desc.

vec_t x2

Desc.

double pnorm

Desc.

vec_t p

Desc.

double g0norm

Desc.

vec_t g0

Desc.

Store the arguments to set() so we can use them for iterate()

vec_t ugx

Proposed minimum.

vec_t ugg

Gradient.

vec_t udx

Proposed step.

double it_min

Desc.

double lmin_tol

Tolerance for the line minimization (default \( 10^{-4} \))

double step_size

Size of the initial step (default 0.01)

mmin_conf()
~mmin_conf()

GSL-like lower level interface

int iterate()

Perform an iteration.

int allocate(size_t n)

Allocate the memory.

int free()

Free the allocated memory.

int restart()

Reset the minimizer to use the current point as a new starting point.

int set(vec_t &x, double u_step_size, double tol_u, func_t &ufunc)

Set the function and initial guess.

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

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.

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.

const char *type()

Return string denoting type(“mmin_conf”)

mmin_conf(const mmin_conf<func_t, vec_t, dfunc_t, auto_grad_t, def_auto_grad_t>&)
mmin_conf<func_t, vec_t, dfunc_t, auto_grad_t, def_auto_grad_t> &operator=(const mmin_conf<func_t, vec_t, dfunc_t, auto_grad_t, def_auto_grad_t>&)