ool_constr_mmin Class Template Reference

#include <ool_constr_mmin.h>

Inheritance diagram for ool_constr_mmin:

multi_min

Detailed Description

template<class param_t, class func_t, class dfunc_t = func_t, class hfunc_t = func_t, class vec_t = ovector_view, class alloc_vec_t = ovector, class alloc_t = ovector_alloc>
class ool_constr_mmin< param_t, func_t, dfunc_t, hfunc_t, vec_t, alloc_vec_t, alloc_t >

Constrained multidimensional minimization base (OOL).

Todo:
Implement automatic computations of gradient and Hessian
Todo:
Construct a non-trivial example for the "examples" directory
Todo:
Finish mmin() interface

Definition at line 304 of file ool_constr_mmin.h.


Public Member Functions

virtual int allocate (const size_t n)
 Allocate memory.
virtual int free ()
 Free previously allocated memory.
virtual int restart ()
 Restart the minimizer.
virtual int set (func_t &fn, dfunc_t &dfn, vec_t &init, param_t &par)
 Set the function, the initial guess, and the parameters.
virtual int set_hess (func_t &fn, dfunc_t &dfn, hfunc_t &hfn, vec_t &init, param_t &par)
 Set the function, the initial guess, and the parameters.
virtual int set_constraints (size_t nc, vec_t &lower, vec_t &upper)
 Set the constraints.
virtual int iterate ()
 Perform an iteration.
virtual int is_optimal ()
 See if we're finished.
virtual int mmin (size_t nvar, vec_t &xx, double &fmin, param_t &pa, func_t &ff)
 Calculate the minimum min of func w.r.t. the array x of size nvar.
virtual int mmin_hess (size_t nvar, vec_t &xx, double &fmin, param_t &pa, func_t &ff, dfunc_t &df, hfunc_t &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, vec_t &xx, double &fmin, param_t &pa, func_t &ff, dfunc_t &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 ("ool_constr_mmin").

Static Public Attributes

OOL-specific error codes
static const int OOL_UNBOUNDEDF = 1101
 Lower unbounded function.
static const int OOL_INFEASIBLE = 1102
 Infeasible point.
static const int OOL_FINNERIT = 1103
 Too many inner iterations.
static const int OOL_FLSEARCH = 1104
 Line search failed.
static const int OOL_FDDIR = 1105
 Unable to find a descent direction.

Protected Member Functions

void shrink (const size_t nind, gsl_vector_uint *Ind, const vec_t &V)
 Shrink vector V from the full to the reduced space.
void expand (const size_t nind, gsl_vector_uint *Ind, const vec_t &V)
 Expand vector V from the reduced to the full space.
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.
int calc_g (const size_t nind, gsl_vector_uint *Ind, vec_t &X, vec_t &Xc, vec_t &G)
 Compute gradient in the reduced space.
int calc_Hv (const size_t nind, gsl_vector_uint *Ind, vec_t &X, vec_t &Xc, vec_t &V, vec_t &Hv)
 Evaluate a hessian times a vector from the reduced space.

Protected Attributes

double f
 The current function value.
double size
 Desc.
alloc_t ao
 Memory allocation object.
alloc_vec_t x
 The current minimum vector.
alloc_vec_t gradient
 The current gradient vector.
alloc_vec_t 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.
func_t * func
 User-supplied function.
dfunc_t * dfunc
 Gradient function.
hfunc_t * hfunc
 Hessian function.
param_t * param
 User-specified parameters.
alloc_vec_t L
 Lower bound constraints.
alloc_vec_t U
 Upper bound constraints.
bool requires_hess
 If true, the algorithm requires the hessian vector product.

Member Function Documentation

int calc_Hv ( const size_t  nind,
gsl_vector_uint *  Ind,
vec_t &  X,
vec_t &  Xc,
vec_t &  V,
vec_t &  Hv 
) [inline, protected]

Evaluate a hessian times a vector from the reduced space.

Expand to full space

Definition at line 459 of file ool_constr_mmin.h.

virtual int mmin ( size_t  nvar,
vec_t &  xx,
double &  fmin,
param_t &  pa,
func_t &  ff 
) [inline, virtual]

Calculate the minimum min of func w.r.t. the array x of size nvar.

Todo:
Need to finish this function somehow since it's pure virtual in multi_min.

Implements multi_min.

Definition at line 614 of file ool_constr_mmin.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page