Constrained minimization by the spectral projected gradient method (OOL) More...
#include <mmin_constr_spg.h>
This class applies a non-monotone line search strategy to the classical projected gradient method.
As in Birgin00, this class applies a nonmonotone Armijo sufficient decrease condition for accepting trial points as an improvement over the classical spectral projected gradient method. This method may be competitive with large problems because it has low memory requirements.
Default template arguments
func_t
- multi_functdfunc_t
- grad_functvec_t
- boost::numeric::ublas::vector < double >
Definition at line 84 of file mmin_constr_spg.h.
Public Member Functions | |
virtual int | allocate (const size_t n) |
Allocate memory. | |
virtual int | free () |
Free previously allocated memory. | |
virtual int | set (func_t &fn, dfunc_t &dfn, vec_t &init) |
Set the function, the initial guess, and the parameters. | |
virtual int | restart () |
Restart the minimizer. | |
virtual int | iterate () |
Perform an iteration. | |
virtual int | is_optimal () |
See if we're finished. | |
const char * | type () |
Return string denoting type ("mmin_constr_spg") | |
![]() | |
virtual int | set (multi_funct &fn, grad_funct &dfn, boost::numeric::ublas::vector< double > &init) |
Set the function, the gradient, and the initial guess. | |
virtual int | set_hess (multi_funct &fn, grad_funct &dfn, ool_hfunct &hfn, boost::numeric::ublas::vector< double > &init) |
Set the function, the gradient, the Hessian product, and the initial guess. | |
virtual int | set_constraints (size_t nc, boost::numeric::ublas::vector< double > &lower, boost::numeric::ublas::vector< double > &upper) |
Set the constraints. | |
virtual int | mmin (size_t nvar, boost::numeric::ublas::vector< double > &xx, double &fmin, multi_funct &ff) |
Calculate the minimum min of func w.r.t. the array x of size nvar . More... | |
virtual int | mmin_hess (size_t nvar, boost::numeric::ublas::vector< double > &xx, double &fmin, multi_funct &ff, grad_funct &df, ool_hfunct &hf) |
Calculate the minimum min of ff w.r.t. the array x of size nvar with gradient df and hessian vector product hf . | |
virtual int | mmin_de (size_t nvar, boost::numeric::ublas::vector< double > &xx, double &fmin, multi_funct &ff, grad_funct &df) |
Calculate the minimum min of func w.r.t. the array x of size nvar with gradient dfunc . | |
const char * | type () |
Return string denoting type ("mmin_constr") | |
![]() | |
mmin_base (const mmin_base< multi_funct, grad_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... | |
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, grad_funct, boost::numeric::ublas::vector< double > > & | operator= (const mmin_base< multi_funct, grad_funct, boost::numeric::ublas::vector< double > > &mb) |
Copy constructor from operator=. | |
Public Attributes | |
double | fmin |
Minimum function value (default ![]() | |
double | tol |
Tolerance on infinite norm (default ![]() | |
double | alphamin |
Lower bound to spectral step size (default ![]() | |
double | alphamax |
Upper bound to spectral step size (default ![]() | |
double | gamma |
Sufficient decrease parameter (default ![]() | |
double | sigma1 |
Lower bound to the step length reduction (default 0.1) | |
double | sigma2 |
Upper bound to the step length reduction (default 0.9) | |
size_t | M |
Monotonicity parameter (M=1 forces monotonicity) (default 10) | |
![]() | |
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 ool_hfunct | hfunc_t |
A convenient typedef for the unused Hessian product type. | |
Protected Member Functions | |
int | line_search () |
Line search. | |
int | proj (vec_t &xt) |
Project into feasible region. | |
![]() | |
void | shrink (const size_t nind, gsl_vector_uint *Ind, const boost::numeric::ublas::vector< double > &V) |
Shrink vector V from the full to the reduced space. | |
void | expand (const size_t nind, gsl_vector_uint *Ind, const boost::numeric::ublas::vector< double > &V) |
Expand vector V from the reduced to the full space. | |
double | calc_f (const size_t nind, gsl_vector_uint *Ind, boost::numeric::ublas::vector< double > &X, boost::numeric::ublas::vector< double > &Xc) |
Evaluate the objective function from the reduced space. | |
int | calc_g (const size_t nind, gsl_vector_uint *Ind, boost::numeric::ublas::vector< double > &X, boost::numeric::ublas::vector< double > &Xc, boost::numeric::ublas::vector< double > &G) |
Compute gradient in the reduced space. | |
int | calc_Hv (const size_t nind, gsl_vector_uint *Ind, boost::numeric::ublas::vector< double > &X, boost::numeric::ublas::vector< double > &Xc, boost::numeric::ublas::vector< double > &V, boost::numeric::ublas::vector< double > &Hv) |
Evaluate a hessian times a vector from the reduced space. More... | |
Protected Attributes | |
double | alpha |
Armijo parameter. | |
vec_t | xx |
Temporary vector. | |
vec_t | d |
Temporary vector. | |
vec_t | s |
Temporary vector. | |
vec_t | y |
Temporary vector. | |
vec_t | fvec |
Temporary vector. | |
size_t | m |
Non-monotone parameter. | |
int | tail |
Desc. | |
![]() | |
double | f |
The current function value. | |
double | size |
Desc. | |
boost::numeric::ublas::vector< double > | x |
The current minimum vector. | |
boost::numeric::ublas::vector< double > | gradient |
The current gradient vector. | |
boost::numeric::ublas::vector< double > | dx |
Desc. | |
size_t | fcount |
Number of function evaluations. | |
size_t | gcount |
Number of gradient evaluations. | |
size_t | hcount |
Number of Hessian evaluations. | |
size_t | dim |
Number of parameters. | |
size_t | nconstr |
Number of constraints. | |
multi_funct * | func |
User-supplied function. | |
grad_funct * | dfunc |
Gradient function. | |
ool_hfunct * | hfunc |
Hessian function. | |
boost::numeric::ublas::vector< double > | L |
Lower bound constraints. | |
boost::numeric::ublas::vector< double > | U |
Upper bound constraints. | |
bool | requires_hess |
If true, the algorithm requires the hessian vector product. | |
![]() | |
std::ostream * | outs |
Stream for verbose output. | |
std::istream * | ins |
Stream for verbose input. | |
Private Member Functions | |
mmin_constr_spg (const mmin_constr_spg< func_t, dfunc_t, vec_t > &) | |
mmin_constr_spg< func_t, dfunc_t, vec_t > & | operator= (const mmin_constr_spg< func_t, dfunc_t, vec_t > &) |
double o2scl::mmin_constr_spg< func_t, dfunc_t, vec_t >::fmin |
If the function value is below this value, then the algorithm assumes that the function is not bounded and exits.
Definition at line 245 of file mmin_constr_spg.h.
Documentation generated with Doxygen. Provided under the
GNU Free Documentation License (see License Information).