Base minimization routines for mmin_conf and mmin_conp. More...
#include <mmin_conf.h>
This class is used by the mmin_conf and mmin_conp minimizers to perform the line minimization along a specified direction. It is not intended for a casual end-user.
Default template arguments
func_t - multi_functvec_t - boost::numeric::ublas::vector <double >dfunc_t - mm_functauto_grad_t - gradient < func_t >def_auto_grad_t - gradient_gsl <func_t > Definition at line 69 of file mmin_conf.h.
Public Member Functions | |
| int | base_set (func_t &ufunc, auto_grad_t &u_def_grad) |
| Set the function. | |
| int | base_set_de (func_t &ufunc, dfunc_t &udfunc) |
| Set the function and the gradient. | |
| int | base_allocate (size_t nn) |
| Allocate memory. | |
| int | base_free () |
| Clear allocated memory. | |
Public Member Functions inherited from o2scl::mmin_base< multi_funct, multi_funct, boost::numeric::ublas::vector< double > > | |
| mmin_base (const mmin_base< multi_funct, multi_funct, boost::numeric::ublas::vector< double > > &mb) | |
| Copy constructor. | |
| int | set_verbose_stream (std::ostream &out, std::istream &in) |
| Set streams for verbose I/O. More... | |
| virtual int | mmin (size_t nvar, boost::numeric::ublas::vector< double > &x, double &fmin, multi_funct &func)=0 |
Calculate the minimum min of func w.r.t. the array x of size nvar. | |
| virtual int | mmin_de (size_t nvar, boost::numeric::ublas::vector< double > &x, double &fmin, multi_funct &func, multi_funct &dfunc) |
Calculate the minimum min of func w.r.t. the array x of size nvar with gradient dfunc. | |
| int | print_iter (size_t nv, vec2_t &x, double y, int iter, double value, double limit, std::string comment) |
| Print out iteration information. More... | |
| const char * | type () |
| Return string denoting type ("mmin_base") | |
| mmin_base< multi_funct, multi_funct, boost::numeric::ublas::vector< double > > & | operator= (const mmin_base< multi_funct, multi_funct, boost::numeric::ublas::vector< double > > &mb) |
| Copy constructor from operator=. | |
Public Attributes | |
| double | deriv_h |
Stepsize for finite-differencing ( default ) | |
| int | nmaxiter |
| Maximum iterations for line minimization (default 10) | |
| def_auto_grad_t | def_grad |
| Default automatic gradient object. | |
Public Attributes inherited from o2scl::mmin_base< multi_funct, multi_funct, boost::numeric::ublas::vector< double > > | |
| int | verbose |
| Output control. | |
| int | ntrial |
| Maximum number of iterations. | |
| double | tol_rel |
| Function value tolerance. | |
| double | tol_abs |
| The independent variable tolerance. | |
| int | last_ntrial |
| The number of iterations for in the most recent minimization. | |
| bool | err_nonconv |
| If true, call the error handler if the routine does not "converge". | |
Protected Types | |
| typedef boost::numeric::ublas::vector< double > | ubvector |
| typedef boost::numeric::ublas::matrix< double > | ubmatrix |
Protected Member Functions | |
| void | take_step (const vec_t &x, const vec_t &px, double stepx, double lambda, vec_t &x1x, vec_t &dx) |
| Take a step. | |
| void | intermediate_point (const vec_t &x, const vec_t &px, double lambda, double pg, double stepa, double stepc, double fa, double fc, vec_t &x1x, vec_t &dx, vec_t &gradient, double *stepx, double *f) |
| Line minimization. More... | |
| void | min (const vec_t &x, const vec_t &xp, double lambda, double stepa, double stepb, double stepc, double fa, double fb, double fc, double xtol, vec_t &x1x, vec_t &dx1x, vec_t &x2x, vec_t &dx2x, vec_t &gradient, double *xstep, double *f, double *gnorm_u) |
| Perform the minimization. More... | |
Protected Attributes | |
| func_t * | func |
| User-specified function. | |
| dfunc_t * | grad |
| User-specified gradient. | |
| auto_grad_t * | agrad |
| Automatic gradient object. | |
| bool | grad_given |
| If true, a gradient has been specified. | |
| size_t | dim |
| Memory size. | |
Protected Attributes inherited from o2scl::mmin_base< multi_funct, multi_funct, boost::numeric::ublas::vector< double > > | |
| std::ostream * | outs |
| Stream for verbose output. | |
| std::istream * | ins |
| Stream for verbose input. | |
|
inlineprotected |
Do a line minimisation in the region (xa,fa) (xc,fc) to find an intermediate (xb,fb) satisifying fa > fb < fc. Choose an initial xb based on parabolic interpolation.
Definition at line 113 of file mmin_conf.h.
|
inlineprotected |
Starting at (x0, f0) move along the direction p to find a minimum f(x0 - lambda * p), returning the new point x1 = x0-lambda*p, f1=f(x1) and g1 = grad(f) at x1.
Definition at line 186 of file mmin_conf.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).