class HCL_Op_d : public HCL_Base

HCL_Op_d is the base class for (presumably nonlinear) operators

Inheritance:


Public Methods

int CheckPartialDeriv ( const HCL_Vector_d &, const HCL_Vector_d &, int ind, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 )
Check partial derivatives
virtual HCL_LinearOpAdj_d* DerivAdj ()
DerivAdj computes the derivative, as a linear operator with adjoint, of the operator
virtual const HCL_LinearOpAdj_d& DerivAdjRef ()
DerivAdjRef returns a reference to the derivative at this point
virtual HCL_VectorSpace_d& Domain ()
Domain space access
virtual HCL_VectorSpace_d& Domain ()
Domain returns a reference to the domain of the underlying operator
virtual HCL_VectorSpace_d& Domain ()
Domain space access
virtual HCL_EvaluateOpDerivAdj_d* EvaluateDerivAdj ( const HCL_Vector_d & x )
EvaluateDerivAdj creates an evaluation object which knows how to compute the image and the derivative (as a linear operator with adjoint) at a point
HCL_EvalOpProductDomainDerivAdj_d ( int n )
Constructor called by derived classes; needs the number of factors in the domain space
virtual void Image ( HCL_Vector_d & y )
Image computes the image of the operator.
virtual void Image ( const HCL_Vector_d & x, HCL_Vector_d & y )
Image computes the image of x under the operator, giving y
virtual double MaxStep ( const HCL_Vector_d & x, const HCL_Vector_d &dir)
MaxStep computes the longest vector from x in the direction dir that will lie in the domain of definition of the operator, i
virtual HCL_LinearOpAdj_d* PartialDerivAdj ( const HCL_Vector_d & x, int i )
PartialDerivAdj computes the partial derivative of the operator, with respect to the ith component of the independent variable
virtual HCL_LinearOpAdj_d* PartialDerivAdj ( int i )
PartialDerivAdj computes the partial derivative, with respect to the ith variable, as a linear operator with adjoint
virtual const HCL_LinearOpAdj_d& PartialDerivAdjRef ( int i )
PartialDerivAdjRef returns a reference to the partial derivative with respect to the ith variable
virtual HCL_ProductVectorSpace_d& ProductDomain ()
Access to the domain, explicitly as a product vector space
virtual HCL_ProductVectorSpace_d& ProductDomain ()
ProductDomain returns a reference to the domain as a product vector space
virtual HCL_VectorSpace_d& Range ()
Range space access
virtual HCL_VectorSpace_d& Range ()
Range returns a reference to the range of the underlying operator.
virtual HCL_VectorSpace_d& Range ()
Range space access
virtual ostream& Write ( ostream & str )
Debugging information
virtual ostream& Write ( ostream & str )
Debugging information
virtual ostream& Write ( ostream & str )
Debugging information

Inherited from HCL_Base:

Public Methods

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

Private Fields

int ReferenceCount

Documentation

HCL_Op_d is the base class for (presumably nonlinear) operators. Such an operator maps one vector space into another, say F:X --> Y.

The primary methods of this class are:

Defining operators is expected to be one of the main activities of users of HCL, since the many optimization problems involve operators in the definition of the objective function or constraints. Please see one of the test programs that comes in the HCLtest directory for examples.

HCL_EvalOpProductDomainDerivAdj_d( int n )
Constructor called by derived classes; needs the number of factors in the domain space

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

virtual HCL_ProductVectorSpace_d& ProductDomain()
ProductDomain returns a reference to the domain as a product vector space

virtual HCL_VectorSpace_d& Range()
Range returns a reference to the range of the underlying operator.

virtual void Image( HCL_Vector_d & y )
Image computes the image of the operator.

virtual HCL_LinearOpAdj_d* DerivAdj()
DerivAdj computes the derivative, as a linear operator with adjoint, of the operator. Note that this method constructs a HCL_LinearOpAdj_d, which the calling program is responsible for deleting with HCL_delete. DerivAdj is implemented int this (the base) class, so it need not be re-defined in derived classes.

virtual const HCL_LinearOpAdj_d& DerivAdjRef()
DerivAdjRef returns a reference to the derivative at this point. The programmer has a choice of calling DerivAdj, in which case the calling routine is responsible for managing the storage, or calling DerivAdjRef, in which case the Evaluation object does.

virtual HCL_LinearOpAdj_d* PartialDerivAdj( int i )
PartialDerivAdj computes the partial derivative, with respect to the ith variable, as a linear operator with adjoint

virtual const HCL_LinearOpAdj_d& PartialDerivAdjRef( int i )
PartialDerivAdjRef returns a reference to the partial derivative with respect to the ith variable

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.

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

virtual HCL_ProductVectorSpace_d& ProductDomain()
Access to the domain, explicitly as a product vector space

virtual HCL_VectorSpace_d& Range()
Range space access. Returns a reference to the HCL_VectorSpace_d which forms the range of the operator.

virtual HCL_EvaluateOpDerivAdj_d* EvaluateDerivAdj( const HCL_Vector_d & x )
EvaluateDerivAdj creates an evaluation object which knows how to compute the image and the derivative (as a linear operator with adjoint) at a point. The purpose of using an evaluation object in place of getting the image or derivative directly is that, for many operators, the computation of the image and derivative involve some common intermediate calculations. These calculations can be done once (at each point) in the evaluation object.

virtual HCL_LinearOpAdj_d* PartialDerivAdj( const HCL_Vector_d & x, int i )
PartialDerivAdj computes the partial derivative of the operator, with respect to the ith component of the independent variable. It does this by constructing an evaluation object, extracting the partial derivative, and then deleting the evaluation object. PartialDerivAdj is defined in this (the base) class, and need not be redefined in a derived class.

int CheckPartialDeriv( const HCL_Vector_d &, const HCL_Vector_d &, int ind, ostream & str, int n=10, double hmin=0.1, double hmax=1.0 )
Check partial derivatives. This method computes the relative difference between the directional derivative as computed from the analytic partial derivative 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, and n are optional and default to 0.1, 1.0, and 10, respectively. If the partial derivative 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.

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.

virtual HCL_VectorSpace_d& Domain()
Domain space access. Returns a reference to the HCL_VectorSpace_d which forms the domain of the operator. Note that, in the current design, the domain of an operator must be an entire vector space, although many nonlinear operators are only defined on an open subset of a vector space. This is a flaw in the design of HCL which may be corrected in some future version of the software. A partial work-around to this problem is provided by the MaxStep method.

virtual HCL_VectorSpace_d& Range()
Range space access. Returns a reference to the range of the operator, which is a HCL_VectorSpace_d.

virtual double MaxStep( const HCL_Vector_d & x, const HCL_Vector_d &dir)
MaxStep computes the longest vector from x in the direction dir that will lie in the domain of definition of the operator, i.e. it computes the greatest a such that x + a*dir lies in the domain. By default (i.e. unless this virtual function is implemented in a derived class), the domain is assumed to be the whole space, and MaxStep return Inf. This method is used in some of the optimization algorithms and provides a partial solution to the problem that many operators are not defined on an entire vector space, but rather only on a subset.

virtual void Image( const HCL_Vector_d & x, HCL_Vector_d & y )
Image computes the image of x under the operator, giving y

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_OpDerivAdj_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