HCL_FunctionalGrad_d is the base class for all real-valued functions which can compute their gradients
![]() | CheckGrad ( const HCL_Vector_d & x, const HCL_Vector_d & y, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 ) Check analytic gradient |
![]() | Domain () Domain space access |
![]() | EvaluateGrad ( const HCL_Vector_d & x ) EvaluateGrad creates an "evaluation" object, which knows how to compute the function value and gradient at the given x |
![]() | Gradient ( const HCL_Vector_d & x, HCL_Vector_d & g ) Gradient computes the gradient at x |
![]() | Value ( const HCL_Vector_d & x ) Value evaluates the function at x |
![]() | Write ( ostream & str ) Debugging information |
HCL_FunctionalGrad_d is the base class for all real-valued functions which can compute their gradients. The primary purpose of this class is to represent objective functions in optimization problems. Since this class provides only first derivative information, an object of this type would typically be used in a gradient-based algorithm, for example, an algorithm of type HCL_UMinGrad_d.The primary methods of this class are
- Domain Returns a reference to the domain of the functional, which is a vector space. This is used primarily for error-checking; for example:
if( x.Space() != f.Domain() ) // Error condition- Value Returns the value of the functional at a point. Example:
double fx = f.Value( x );- Gradient Computes the gradient of the functional at a point. Example:
HCL_Vector_d * g = f.Domain().Member(); // Get a vector to hold the gradient f.Gradient( x,*g ); // Fill *g with the gradient of f at x- {EvaluateGrad} Returns an "evaluation object", that is, an object of class HCL_EvaluateFunctional_d, which knows the value and gradient of the functional at given point. Typically, this method will be used to compute the value and gradient of the functional, rather than Value and Gradient.
In order to define a derived class, one must first define a corresponding HCL_EvaluateFunctionalGrad_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()
virtual HCL_EvaluateFunctionalGrad_d* EvaluateGrad( const HCL_Vector_d & x )
virtual double Value( const HCL_Vector_d & x )
virtual void Gradient( const HCL_Vector_d & x, HCL_Vector_d & g )
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