class HCL_FunctionalHess_d : public HCL_FunctionalGrad_d

HCL_FunctionalHess_d is the base class for all real-valued functions which can compute their gradients and Hessians

Inheritance:


Public Methods

int CheckHess ( const HCL_Vector_d &, const HCL_Vector_d &, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 )
Check analytic Hessian
virtual HCL_VectorSpace_d& Domain ()
Domain space access
virtual HCL_EvaluateFunctionalHess_d* EvaluateHess ( const HCL_Vector_d & x )
EvaluateHess creates an "evaluation" object, which knows how to compute the function value, gradient,and Hessian at the given x
virtual void Gradient ( const HCL_Vector_d & x, HCL_Vector_d & g )
Gradient computes the gradient at x
virtual HCL_LinearOp_d* Hessian ( const HCL_Vector_d & x )
Hessian computes the gradient at x
virtual double Value ( const HCL_Vector_d & x )
Value evaluates the function at x
virtual ostream& Write ( ostream & str )
Debugging information

Inherited from HCL_FunctionalGrad_d:

Public Methods

int CheckGrad( const HCL_Vector_d & x, const HCL_Vector_d & y, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 )
virtual HCL_EvaluateFunctionalGrad_d* EvaluateGrad( const HCL_Vector_d & x )

Inherited from HCL_Functional_d:

Public Methods

virtual double MaxStep( const HCL_Vector_d & x, const HCL_Vector_d &dir)
void Scan( const HCL_Vector_d & x, const HCL_Vector_d & dx, int N, double hmin, double hmax, char * fname = NULL )

Inherited from HCL_Base:

Public Methods

int Count()
void DecCount()
void IncCount()

Private Fields

int ReferenceCount

Documentation

HCL_FunctionalHess_d is the base class for all real-valued functions which can compute their gradients and Hessians. The primary purpose of this class is to represent objective functions in optimization problems. Since this class provides first and second derivative information, an object of this type would typically be used with an algorithm of type HCL_UMinHess_d.

The primary methods of this class are

In order to define a derived class, one must first define a corresponding HCL_EvaluateFunctionalHess_d class. Defining objective functions is expected to be one of the main activities of users of HCL, since the objective function provides the point of contact between the application software and HCL's optimization code. Please see one of the test programs that comes in the HCLtest directory for examples.

virtual HCL_VectorSpace_d& Domain()
Domain space access. Returns a reference to the HCL_VectorSpace_d which forms the domain of the functional. Note that, in the current design, the domain of a functional must be an entire vector space, although many nonlinear functionals are only defined on an open subset of a vector space. This is a flaw in the design of HCL which may be corrected in some future version of the software. A partial work-around to this problem is provided by the MaxStep method.

int CheckHess( const HCL_Vector_d &, const HCL_Vector_d &, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 )
Check analytic Hessian. This method computes the relative difference between the second directional derivative as computed from the analytic Hessian and the same estimated by a central difference formula. This is done at n equally-spaced points on the line segment [x+hmin*y,x+hmax*y]. The parameters hmin, hmax, and n are optional and default to 0.1, 1.0, and 10, respectively. If the analytic Hessian is correctly implemented and the function is four times continously differentiable, then these errors will lie on a parabola when plotted against the step size. The results are sent to the output stream str.

virtual HCL_EvaluateFunctionalHess_d* EvaluateHess( const HCL_Vector_d & x )
EvaluateHess creates an "evaluation" object, which knows how to compute the function value, gradient,and Hessian at the given x. The purpose of using EvaluateHess rather than Value, Gradient, and Hessian, is for efficiency; many functionals are such that the evaluation of the functional and its derivatives require common intermediate calculations. The evaluation object mechanism gives the functional class implementor a place to store these intermediate results so that they do not have to be re-computed if the the gradient is requested at some point after the value, for example. The implementor of an optimization algorithm should respect this by using EvaluateHess to get a value, gradient, and/or Hessian rather than using Value, Gradient, and/or Hessian.

virtual double Value( const HCL_Vector_d & x )
Value evaluates the function at x. It does so by creating an evaluation object with the EvaluateHess method, getting the value from it, deleting the evaluation object, and returning the value. Value is defined in this (the base) class, so it need not be redefined in a derived class.

virtual void Gradient( const HCL_Vector_d & x, HCL_Vector_d & g )
Gradient computes the gradient at x. It does so by creating an evaluation object with the EvaluateHess method, getting the gradient from it, and deleting the evaluation object. Gradient is defined in this (the base) class, so it need not be redefined in a derived class.

virtual HCL_LinearOp_d* Hessian( const HCL_Vector_d & x )
Hessian computes the gradient at x. It does so by creating an evaluation object with the EvaluateHess method, getting the gradient from it, and deleting the evaluation object. Hessian is defined in this (the base) class, so it need not be redefined in a derived class.

virtual ostream& Write( ostream & str )
Debugging information. Write should be implemented to print a description of the object that will be useful for debugging. If a complete description is lengthy, an implementor should consider just printing out a useful subset. This method will likely be used to send information to the screen when a error condition is encountered.


Direct child classes:
HCL_QuadRegFunctional_d
HCL_LinCombFcnlHess_d
HCL_LeastSquaresFcnlHess_d
HCL_DiagFunctionalHess_d
HCL_ALFcnlHess_d
HCL_RestrictedFunctionalHess_d

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de