class HCL_EvaluateFunctional_d : public HCL_Base

This class represents an "evaluation" object that will be created by a instance of HCL_Functional object to implement the value, gradient, and Hessian of the functional at a point

Inheritance:


Public Methods

virtual HCL_VectorSpace_d& Domain () const
Domain returns a reference to the domain of the underlying functional
virtual double Value () const
Value computes the value of the function
virtual double ValueRef () const
ValueRef calls Value to compute the value of the functional at the given point, saves it, and returns it
virtual void Gradient ( HCL_Vector_d & g ) const
Gradient computes the gradient of the function
virtual const HCL_Vector_d& GradientRef () const
GradientRef computes the gradient of the function and returns a reference to it
virtual HCL_LinearOp_d* Hessian () const
Hessian computes the Hessian of the function
virtual const HCL_LinearOp_d& HessianRef () const
HessianRef computes the Hessian of the function and returns a reference to it

Protected Methods

virtual void HessianImage ( const HCL_Vector_d & dx, HCL_Vector_d & dy ) const
HessianImage computes the action of the Hessian operator on the input dx, yielding dy
virtual void HessianInvImage ( const HCL_Vector_d & dy, HCL_Vector_d & dx ) const
HessianInvImage computes the action of the inverse Hessian operator on the input dy, yielding the output dx

Inherited from HCL_Base:

Public Methods

void IncCount() const
void DecCount() const
int Count() const
virtual ostream& Write(ostream &) const

Documentation

This class represents an "evaluation" object that will be created by a instance of HCL_Functional object to implement the value, gradient, and Hessian of the functional at a point. That is, if the HCL_Functional represents , the the evaluation object represents the triple . The purpose of having an evaluation object is to deal with the common situation in which the functional value and derivatives share some intermediate calculations. A typical implementation of such a functional involves defining an evaluation object whose constructor performs these intermediate calculations. The Value method then completes the computation of the functional value, while the Gradient and Hessian methods complete the calculation of the derivatives.

Note that if one is defining a functional for which there are no (significant) common computations shared by , , and , then need not define an evaluation object explicitly. Instead, the concrete class derived from HCL_Functional can create an instance of HCL_FunctionalDefaultEval. For more details, see the documentation for HCL_Functional, and also the Technical Report referenced at the end of this documentation.

There is also a special mechanism for implementing the Hessian operator. The method Hessian must create an instance of HCL_LinearOp to represent . In many cases, this operator can be implemented using existing HCL classes (such as the matrix operator classes). However, when this is not the case, one can use the default class HCL_FunctionalDefaultHessian as follows. In the class derived from HCL_EvaluateFunctional, the virtual protected methods HessianImage and HessianInvImage (if desired) are overridden to implement the action of the Hessian operator and its inverse. The method Hessian is not overriddent in the derived class, for then the default implementation will create an instance of HCL_FunctionalDefaultHessian (which will contain a pointer to the evaluation object and can then invoke HessianImage and HessianInvImage as needed).

When an optimization (or other) algorithm is implemented, the functional value, gradient, and Hessian should be accessed through the ValueRef, GradientRef, and HessianRef methods. These are methods implemented in the base class (i.e. they do not need to be redefined in a derived class). The ValueRef method invokes Value to get the function value, stores it, and sets a flag to indicate that the value has already been computed. On subsequent calls, ValueRef merely returns the stored value. GradientRef and HessianRef work in a similar fashion; note that these method manage the storage of the gradient and Hessian, so the calling program does not need to allocate storage.

Here is a summary of the primary methods of the class HCL_EvaluateFunctional:

For more information about functional and evaluation classes, see "Implementing functionals in HCL", Technical Report 99-24, Department of Computational and Applied Mathematics, Rice University, PO Box 1892, Houston, TX 77251-1892. This report is available on the HCL home page.

virtual void HessianImage( const HCL_Vector_d & dx, HCL_Vector_d & dy ) const
HessianImage computes the action of the Hessian operator on the input dx, yielding dy. The method HessianImage (and, optionally, HessianInvImage) must be implemented in a derived class if the implementor wishes to implement the Hessian operator using HCL_FunctionalDefaultHessian. This method is implemented in this class as an error, and need not be overridden if HCL_FunctionalDefaultHessian is not to be used.

virtual void HessianInvImage( const HCL_Vector_d & dy, HCL_Vector_d & dx ) const
HessianInvImage computes the action of the inverse Hessian operator on the input dy, yielding the output dx. This method can be overridden in a derived class if HCL_FunctionalDefaultHessian is used to implement the Hessian operator, and the inverse image of the operator is needed. This method is implemented in this class as an error, and need not be overridden if HCL_FunctionalDefaultHessian is not to be used.

virtual HCL_VectorSpace_d& Domain() const
Domain returns a reference to the domain of the underlying functional. Pure virtual: must be implemented in any derived instantiable class.

virtual double Value() const
Value computes the value of the function. This function must be implemented in each concrete derived class. It is recommended that any calculations that are required for both the value and derivatives be done in the constructor; Value should then complete the computation of the functional value. Pure virtual: must be implemented in any derived instantiable class.

virtual double ValueRef() const
ValueRef calls Value to compute the value of the functional at the given point, saves it, and returns it. Successive calls to ValueRef will retrieve the stored value. This method is implemented in this (the base) class, and need not be redefined in a concrete derived class. This method is implemented in this class.

virtual void Gradient( HCL_Vector_d & g ) const
Gradient computes the gradient of the function. It is recommended that any calculations that are required for both the value and derivatives be done in the constructor; Gradient should then complete the computation of the gradient. Pure virtual: must be implemented in any derived instantiable class.

virtual const HCL_Vector_d& GradientRef() const
GradientRef computes the gradient of the function and returns a reference to it. This causes the Evaluation object to manage the storage. This method is implemented in this class.

virtual HCL_LinearOp_d* Hessian() const
Hessian computes the Hessian of the function. It is recommended that any calculations that are required for both the value and derivatives be done in the constructor; Hessian should then complete the computation of the Hessian. Note that Hessian is implemented in the base class to create an instance of HCL_FunctionalDefaultEval and need not be overridden in a derived class unless there is a better way to implement the Hessian. Note, however, that if Hessian is not overridden, then the Hessian operator cannot be used unless the protected methods HessianImage and HessianInvImage (if desired) are overridden in the derived class.

virtual const HCL_LinearOp_d& HessianRef() const
HessianRef computes the Hessian of the function and returns a reference to it. This causes the Evaluation object to manage the storage. This method is implemented in this class.


Direct child classes:
HCL_EvalQuadFunctional_d
HCL_EvalLinCombFcnl_d
HCL_EvalLSFcnl_d
HCL_EvalLSFcnlGN_d
HCL_EvalBigMFcnl_d
HCL_EvalALFcnl_d
HCL_EvalRestrictedFunctional_d
HCL_EvalFunctionalProductDomain_d
HCL_FunctionalDefaultEval_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