Class mmin_constr_pgrad (o2scl)¶
-
template<class func_t = multi_funct, class dfunc_t = grad_funct, class vec_t = boost::numeric::ublas::vector<double>>
class mmin_constr_pgrad : public o2scl::mmin_constr<multi_funct, grad_funct, ool_hfunct, boost::numeric::ublas::vector<double>>¶ Constrained minimization by the projected gradient method (OOL)
This is the simple extension of the steepest descent algorithm to constrained minimization. Each step is a line search is performed along the projected gradient direction subject to the specified constraints.
This algorithm is likely not ideal for most problems and is provided mostly for demonstration and educational purposes. Based on implementation of [Kelley99] in OOL.
Default template arguments
func_t
- multi_functdfunc_t
- grad_functvec_t
- boost::numeric::ublas::vector < double >- Idea for Future:
Replace the explicit norm computation below with the more accurate dnrm2 from linalg
Replace the generic variable ‘tol’ with ‘tolf’ or ‘tolx’ from o2scl::mmin_base.
Public Functions
-
inline mmin_constr_pgrad()¶
-
inline virtual int allocate(const size_t n)¶
Allocate memory.
-
inline virtual int free()¶
Free previously allocated memory.
-
inline virtual int set(func_t &fn, dfunc_t &dfn, vec_t &init)¶
Set the function, the initial guess, and the parameters.
-
inline virtual int restart()¶
Restart the minimizer.
-
inline virtual int iterate()¶
Perform an iteration.
-
inline virtual int is_optimal()¶
See if we’re finished.
-
inline const char *type()¶
Return string denoting type (“mmin_constr_pgrad”)
Public Members
-
double fmin¶
Minimum function value (default \( 10^{-99} \))
If the function value is below this value, then the algorithm assumes that the function is not bounded and exits.
-
double tol¶
Tolerance on infinite norm.
-
double alpha¶
Constant for the sufficient decrease condition (default \( 10^{-4} \))
-
double sigma1¶
Lower bound to the step length reduction.
-
double sigma2¶
Upper bound to the step length reduction.
Protected Types
-
typedef ool_hfunct hfunc_t¶
A convenient typedef for the unused Hessian product type.
Protected Functions
-
inline int line_search()¶
Line search.
Private Functions
-
mmin_constr_pgrad(const mmin_constr_pgrad<func_t, dfunc_t, vec_t>&)¶
-
mmin_constr_pgrad<func_t, dfunc_t, vec_t> &operator=(const mmin_constr_pgrad<func_t, dfunc_t, vec_t>&)¶