Class mmin_constr (o2scl)¶
-
template<class func_t, class dfunc_t = func_t, class hfunc_t = func_t, class vec_t = boost::numeric::ublas::vector<double>>
class mmin_constr : public o2scl::mmin_base<func_t, func_t, boost::numeric::ublas::vector<double>>¶ Constrained multidimensional minimization (OOL) [abstract base].
- Idea for Future:
Implement automatic computations of and Hessian
Construct a more difficult example for the “examples” directory
Finish mmin() interface
Implement a direct computation of the hessian as the jacobian of the gradient
Subclassed by o2scl::mmin_constr_pgrad< func_t, dfunc_t, vec_t >, o2scl::mmin_constr_spg< func_t, dfunc_t, vec_t >
Public Functions
-
inline mmin_constr()¶
-
inline virtual ~mmin_constr()¶
-
inline virtual int allocate(const size_t n)¶
Allocate memory.
-
inline virtual int restart()¶
Restart the minimizer.
-
inline virtual int set(func_t &fn, dfunc_t &dfn, vec_t &init)¶
Set the function, the gradient, and the initial guess.
-
inline virtual int set_hess(func_t &fn, dfunc_t &dfn, hfunc_t &hfn, vec_t &init)¶
Set the function, the gradient, the Hessian product, and the initial guess.
-
virtual int iterate() = 0¶
Perform an iteration.
-
virtual int is_optimal() = 0¶
See if we’re finished.
-
inline virtual int mmin(size_t nvar, vec_t &xx, double &fmin, func_t &ff)¶
Calculate the minimum
min
offunc
w.r.t. the arrayx
of sizenvar
.Note
This is unimplemented.
-
inline virtual int mmin_hess(size_t nvar, vec_t &xx, double &fmin, func_t &ff, dfunc_t &df, hfunc_t &hf)¶
Calculate the minimum
min
offf
w.r.t. the arrayx
of sizenvar
with gradientdf
and hessian vector producthf
.
-
inline virtual int mmin_de(size_t nvar, vec_t &xx, double &fmin, func_t &ff, dfunc_t &df)¶
Calculate the minimum
min
offunc
w.r.t. the arrayx
of sizenvar
with gradientdfunc
.
-
inline const char *type()¶
Return string denoting type (“mmin_constr”)
Protected Functions
-
inline void shrink(const size_t nind, gsl_vector_uint *Ind, const vec_t &V)¶
Shrink vector
V
from the full to the reduced space.
-
inline void expand(const size_t nind, gsl_vector_uint *Ind, const vec_t &V)¶
Expand vector
V
from the reduced to the full space.
-
inline double calc_f(const size_t nind, gsl_vector_uint *Ind, vec_t &X, vec_t &Xc)¶
Evaluate the objective function from the reduced space.
Protected Attributes
-
double f¶
The current function value.
-
double size¶
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.
-
bool requires_hess¶
If true, the algorithm requires the hessian vector product.