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
![]() | Domain () Domain returns a reference to the domain of the underlying function |
![]() | Gradient ( HCL_Vector_d & g ) Gradient computes the gradient of the function |
![]() | GradientRef () GradientRef computes the gradient of the function and returns a reference to it |
![]() | Value () Value computes the value of the function |
![]() | ValueRef () ValueRef calls Value to compute the value of the functional at the given point, saves it, and returns it |
![]() | Write ( ostream & str ) Debugging information |
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:
- Domain Returns a reference to the domain of the underlying functional.
- Value Computes the value of the functional at the point at which this object was created. Must be implemented by the creator of a concrete class.
- ValueRef Calls Value, if necessary, to compute the functional value, saves it, and returns it. Implemented in the base class.
- Gradient Computes the gradient of the functional at the point at which this object was created. Must be implemented by the creator of a concrete class.
- GradientRef Calls Gradient, if necessary, to compute the functional gradient, saves it, and returns a reference to it. Implemented in the base class.
virtual double Value()
virtual double ValueRef()
virtual void Gradient( HCL_Vector_d & g )
virtual const HCL_Vector_d& GradientRef()
virtual ostream& Write( ostream & str )
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de