class HCL_EvaluateFunctionalGrad_d : public HCL_Base

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

Inheritance:


Public Methods

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

Inherited from HCL_Base:

Public Methods

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

Private Fields

int ReferenceCount

Documentation

This class represents an "evaluation" object that will be created by a HCL_FunctionalGrad_d object to implement the value and gradient of the functional at a point. The purpose of having an evaluation object is to deal with the common situation in which the functional value and gradient 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 method completes the calculation of the gradient.

The functional value and gradient should then be accessed through the ValueRef and GradientRef 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 works in a similar fashion; note that GradientRef manages the storage of the gradient, so the calling program does not need to allocate storage for the vector.

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

virtual HCL_VectorSpace_d& Domain()
Domain returns a reference to the domain of the underlying function

virtual double Value()
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 gradient be done in the constructor; Value should then complete the computation of the functional value.

virtual double ValueRef()
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.

virtual void Gradient( HCL_Vector_d & g )
Gradient computes the gradient of the function. It is recommended that any calculations that are required for both the value and gradient be done in the constructor; Gradient should then complete the computation of the gradient.

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

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_EvalLinCombFcnlGrad_d
HCL_EvalDiagFcnlGrad_d
HCL_EvalALFcnlGrad_d
HCL_EvalRestrictedFunctionalGrad_d
HCL_EvalFunctionalProductDomainGrad_d
HCL_EvaluateFunctionalHess_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