Class mmin_conf (o2scl)¶
-
template<class
func_t
= multi_funct, classvec_t
= boost::numeric::ublas::vector<double>, classdfunc_t
= grad_funct, classauto_grad_t
= gradient<multi_funct, boost::numeric::ublas::vector<double>>, classdef_auto_grad_t
= gradient_gsl<multi_funct, boost::numeric::ublas::vector<double>>>
classo2scl
::
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
func_t
- multi_functvec_t
- boost::numeric::ublas::vector < double >dfunc_t
- grad_functauto_grad_t
- gradient < func_t >def_auto_grad_t
- gradient_gsl < func_t >
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.
-
double
pnorm
¶ Desc.
-
double
g0norm
¶ Desc.
Store the arguments to set() so we can use them for iterate()
-
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.
Basic usage
-
int
mmin
(size_t nn, vec_t &xx, double &fmin, func_t &ufunc)¶ Calculate the minimum
min
offunc
w.r.t the arrayx
of sizenvar
.
-
int
mmin_de
(size_t nn, vec_t &xx, double &fmin, func_t &ufunc, dfunc_t &udfunc)¶ Calculate the minimum
min
offunc
w.r.t the arrayx
of sizenvar
.
-
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>&)¶