class HCL_FunctionalProductDomain_d : public HCL_Functional_d

HCL_FunctionalProductDomain_d is an abstract base class used to represents functionals defined on product spaces

Inheritance:


Public Methods

virtual HCL_VectorSpace_d& Domain () const
Domain space access
virtual HCL_ProductSpace_d& ProductDomain () const
Access to the domain, explicitly as a product vector space
virtual HCL_EvaluateFunctional_d* Evaluate ( const HCL_Vector_d & x ) const
Evaluate creates an "evaluation" object, which knows how to compute the function value, gradient,and Hessian at the given x
virtual void PartialGradient ( int i, const HCL_Vector_d & x, HCL_Vector_d & g ) const
PartialGradient computes the gradient with respect to the ith component of the independent variable, at x
virtual HCL_LinearOp_d* HessianBlock ( int i, int j, const HCL_Vector_d & x ) const
HessianBlock computes the (i,j) block of the Hessian operator
int CheckHessianBlock ( const HCL_Vector_d &, const HCL_Vector_d &, const HCL_Vector_d &, int i, int j, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 ) const
Check correctness of Hessian blocks
int CheckHessianBlock ( const HCL_Vector_d &, const HCL_Vector_d &, int ind, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 ) const
This version of CheckHessianBlock checks the ``pure'' (not mixed) second partial derivative using the usual central difference formula
int CheckHessianBlockAdj ( const HCL_Vector_d &, const HCL_Vector_d &, const HCL_Vector_d &, int i, int j, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 ) const
CheckHessianBlockAdj calls CheckHessianBlock to test the correctness of the (i,j) block of the Hessian, and then calls the HCL_LinearOp_d method CheckAdj to test the correctness of the adjoint of the block
virtual ostream& Write ( ostream & str ) const
Debugging information

Protected Methods

virtual double Value1 ( const HCL_Vector_d & x ) const
Value1 computes the value of at
virtual void PartialGradient1 ( int i, const HCL_Vector_d & x, HCL_Vector_d & y ) const
PartialGradient1 computes the gradient of at with respect to the th component of
virtual HCL_LinearOp_d* HessianBlock1 ( int i, int j, const HCL_Vector_d & x ) const
HessianBlock1 computes the block of the Hessian of at
virtual void HessianBlockImage ( int i, int j, const HCL_Vector_d & x, const HCL_Vector_d & dx, HCL_Vector_d & dy ) const
HessianBlockImage computes the image of the block of the Hessian of at , acting on

Inherited from HCL_Functional_d:

Public Methods

virtual double MaxStep( const HCL_Vector_d & x, const HCL_Vector_d & dir) const
virtual double Value( const HCL_Vector_d & x ) const
virtual void Gradient( const HCL_Vector_d & x, HCL_Vector_d & g ) const
virtual HCL_LinearOp_d* Hessian( const HCL_Vector_d & x ) const
void Scan( const HCL_Vector_d & x, const HCL_Vector_d & dx, int N, double hmin, double hmax, char * fname = NULL )
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 )
int CheckHess( const HCL_Vector_d &, const HCL_Vector_d &, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 )

Protected Methods

virtual void Gradient1( const HCL_Vector_d & x, HCL_Vector_d & y ) const
virtual void HessianImage( const HCL_Vector_d & x, const HCL_Vector_d & dx, HCL_Vector_d & dy ) const
virtual void HessianInvImage( const HCL_Vector_d & x, const HCL_Vector_d & dy, HCL_Vector_d & dx ) const
virtual HCL_LinearOp_d* Hessian1( const HCL_Vector_d & x ) const

Inherited from HCL_Base:

Public Methods

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

Documentation

HCL_FunctionalProductDomain_d is an abstract base class used to represents functionals defined on product spaces. That is, this class represents a functional of the form where The gradient and Hessian of such a function can be expressed in terms of partial derivatives; Therefore, the basic methods of this class are Value, PartialGradient, and HessianBlock. Value1 computes , PartialGradient computes the gradient of with respect to one of the components of , and HessianBlock computes a block of the Hessian corresponding to one of the second partial derivatives of . To be precise, the partial gradient of is defined by where is the partial derivative of with respect to the th component of . Similarly, defines the block of the Hessian.

HCL_FunctionalProductDomain_d is derived from HCL_Functional_d. As in the case of an ordinary functional represented by a class derived from HCL_Functional_d, an evaluation class is defined to represent the triple . The documentation for HCL_Functional_d, as well as the report "Implementing functionals in HCL", Technical Report 99-24, Department of Computational and Applied Mathematics, Rice University, PO Box 1892, Houston, TX 77251-1892. should be consulted for general information about functionals, including the rationale for the existence of the evaluation class. The implementor of a derived class need not implement a separate class to represent the evaluation object if there is no efficiency gain in doing so. By implementing the protected virtual functions Value1, PartialGradient1, and HessianBlock1 or HessianBlockImage, the use of the default evaluation class HCL_FunctionalProductDomainDefaultEval_d is enabled.

A forthcoming report, "Implementing HCL functionals and operators on product spaces", will explain in detail the different models for implementing derived classes. This report should be available in early 2000 from the Rice University address given above.

virtual double Value1( const HCL_Vector_d & x ) const
Value1 computes the value of at . If Value1, PartialGradient1, and HessianBlock1 or HessianBlockImage are implemented, then the default implementation of the Evaluate method can be used. This creates an instance of HCL_FunctionProductDomainDefaultEval_d.

virtual void PartialGradient1( int i, const HCL_Vector_d & x, HCL_Vector_d & y ) const
PartialGradient1 computes the gradient of at with respect to the th component of . If Value1, PartialGradient1, and HessianBlock1 or HessianBlockImage are implemented, then the default implementation of the Evaluate method can be used. This creates an instance of HCL_FunctionProductDomainDefaultEval_d.

virtual HCL_LinearOp_d* HessianBlock1( int i, int j, const HCL_Vector_d & x ) const
HessianBlock1 computes the block of the Hessian of at . If Value1, PartialGradient1, and HessianBlock1 or HessianBlockImage are implemented, then the default implementation of the Evaluate method can be used. This creates an instance of HCL_FunctionProductDomainDefaultEval_d.

virtual void HessianBlockImage( int i, int j, const HCL_Vector_d & x, const HCL_Vector_d & dx, HCL_Vector_d & dy ) const
HessianBlockImage computes the image of the block of the Hessian of at , acting on . If Value1, PartialGradient1, and HessianBlock1 or HessianBlockImage are implemented, then the default implementation of the Evaluate method can be used. This creates an instance of HCL_FunctionProductDomainDefaultEval_d.

virtual HCL_VectorSpace_d& Domain() const
Domain space access. Returns a reference to the HCL_VectorSpace_d which forms the domain of the functional.

virtual HCL_ProductSpace_d& ProductDomain() const
Access to the domain, explicitly as a product vector space. This method is implemented using Domain, and need not be re-implemented in a derived class.

virtual HCL_EvaluateFunctional_d* Evaluate( const HCL_Vector_d & x ) const
Evaluate creates an "evaluation" object, which knows how to compute the function value, gradient,and Hessian at the given x. The purpose of using Evaluate 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 Evaluate to get a value, gradient, and/or Hessian rather than using Value, Gradient, and/or Hessian. Note as explained in the class documentation, if there is no advantage in having an evaluation object, then the implementor can simply not override Evaluate in the derived class, in which case the default implementation will create an instance of HCL_FunctionalProductDomainDefaultEval. In this case, the implementor must override the virtual protected methods Value1, PartialGradient1, and either HessianBlock1 or HessianBlockImage.

virtual void PartialGradient( int i, const HCL_Vector_d & x, HCL_Vector_d & g ) const
PartialGradient computes the gradient with respect to the ith component of the independent variable, at x. It does so by creating an evaluation object with the Evaluate method, getting the partial gradient from it, and deleting the evaluation object. PartialGradient is defined in this (the base) class, so it need not be redefined in a derived class.

virtual HCL_LinearOp_d* HessianBlock( int i, int j, const HCL_Vector_d & x ) const
HessianBlock computes the (i,j) block of the Hessian operator. It does so by creating an evaluation object with the Evaluate method, getting the partial gradient from it, and deleting the evaluation object. HessianBlock is defined in this (the base) class, so it need not be redefined in a derived class.

int CheckHessianBlock( const HCL_Vector_d &, const HCL_Vector_d &, const HCL_Vector_d &, int i, int j, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 ) const
Check correctness of Hessian blocks. This method computes the relative difference between the second directional derivative as computed from the analytic Hessian block 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,d and n are optional and default to 0.1, 1.0, and 10, respectively. If the Hessian block is correctly implemented and the function is sufficiently smooth, then these errors will lie on a parabola when plotted against the step size. The results are sent to the output stream str.

int CheckHessianBlock( const HCL_Vector_d &, const HCL_Vector_d &, int ind, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 ) const
This version of CheckHessianBlock checks the ``pure'' (not mixed) second partial derivative using the usual central difference formula

int CheckHessianBlockAdj( const HCL_Vector_d &, const HCL_Vector_d &, const HCL_Vector_d &, int i, int j, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 ) const
CheckHessianBlockAdj calls CheckHessianBlock to test the correctness of the (i,j) block of the Hessian, and then calls the HCL_LinearOp_d method CheckAdj to test the correctness of the adjoint of the block

virtual ostream& Write( ostream & str ) const
Debugging information. Write must be implemented in derived classes, and should print a description of the object that will be useful for debugging.


Direct child classes:
HCL_LeastSquaresFcnlProductDomain_d
HCL_LeastSquaresFcnlGNProductDomain_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