class HCL_EvaluateOp_d : public HCL_Base

This class represents an "evaluation" object that will be created by an HCL_Op_d object to represent the image and derivatives of the operator at a point

Inheritance:


Public Methods

virtual HCL_VectorSpace_d& Domain () const
Domain returns a reference to the domain of the underlying operator
virtual HCL_VectorSpace_d& Range () const
Range returns a reference to the range of the underlying operator
virtual void Image ( HCL_Vector_d & y ) const
Image computes the image of the operator and assigns it to y
virtual void ImageAdd ( HCL_Vector_d & y, double a=1.0, double b=1.0 ) const
ImageAdd computes
virtual void ImageAdd ( const HCL_Vector_d & z, HCL_Vector_d & y, double a=1.0, double b=1.0 ) const
ImageAdd computes
virtual const HCL_Vector_d& ImageRef () const
ImageRef returns a reference to the image of the operator at this point
virtual HCL_LinearOp_d* Deriv () const
Deriv computes the derivative of the operator
virtual const HCL_LinearOp_d& DerivRef () const
DerivRef returns a reference to the derivative at this point
virtual HCL_BiLinearOp_d* SecondDeriv () const
SecondDeriv computes the second derivative of the operator
virtual const HCL_BiLinearOp_d& SecondDerivRef () const
SecondDerivRef returns a reference to the second derivative at this point

Protected Methods

virtual void DerivImage ( const HCL_Vector_d & dx, HCL_Vector_d & dy ) const
DerivImage computes the image of the derivative on dx, yielding dy
virtual void DerivAdjImage ( const HCL_Vector_d & dy, HCL_Vector_d & dx ) const
DerivAdjImage computes the image of the adjoint of the derivative on dy, yielding dx
virtual void DerivInvImage ( const HCL_Vector_d & dy, HCL_Vector_d & dx ) const
DerivInvImage computes the image of the inverse of the derivative on dy, yielding dx
virtual void DerivInvAdjImage ( const HCL_Vector_d & dx, HCL_Vector_d & dy ) const
DerivInvAdjImage computes the image of the inverse of the adjoint of the derivative on dx, yielding dy
virtual void SecondDerivImage ( const HCL_Vector_d & dx1, const HCL_Vector_d & dx2, HCL_Vector_d & dy ) const
SecondDerivImage computes the image of the second derivative on dx1 and dx2, yielding dy
virtual void SecondDerivPartialAdjImage (const HCL_Vector_d & dx1, const HCL_Vector_d & dy, HCL_Vector_d & dx2 ) const
SecondDerivPartialAdjImage computes the image of the so-called "partial adjoint" of the second derivative (which is a bilinear operator) on dx1 and dy, yielding dx2

Inherited from HCL_Base:

Public Methods

void IncCount() const
void DecCount() const
int Count() const
virtual ostream& Write(ostream &) const

Documentation

This class represents an "evaluation" object that will be created by an HCL_Op_d object to represent the image and derivatives of the operator at a point. Thus, if is a nonlinear operator and is a vector in the domain, then the evaluation object represents the triple The purpose of having an evaluation object is to deal with the common situation in which the operator image and derivatives share some intermediate calculations. A typical implementation of such an operator involves defining an evaluation object whose constructor performs these intermediate calculations. The Image method then completes the computation of the operator image, while the Deriv and SecondDeriv methods complete the calculation of the derivatives.

The operator image and derivatives should then be accessed through the ImageRef, DerivRef, and SecondDerivRef methods. These are methods implemented in the base class (i.e. they do not need to be redefined in a derived class). The ImageRef method invokes Image to get the image and returns a reference to it. On subsequent calls, ImageRef merely references the stored value. The other "reference" methods work in a similar fashion.

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

In addition to the above methods, HCL_EvaluateOp_d has a number of protected virtual functions that allow the user to avoid writing distinct derivative classes if desired. If these methods, which include DerivImage, SecondDerivImage, and others, are over-ridden in a derived class, then the default Deriv and SecondDeriv methods can be used, which create instances of HCL_OpDefaultDeriv_d and HCL_OpDefaultSecondDeriv_d.

See the following report for more details and concrete examples.

"Implementing operators in HCL", Technical Report 99-22, Department of Computational and Applied Mathematics, Rice University, Houston, TX 77251-1892.

downloadable from the HCL home page.

virtual void DerivImage( const HCL_Vector_d & dx, HCL_Vector_d & dy ) const
DerivImage computes the image of the derivative on dx, yielding dy. Default implementation returns an error message and exits. To use the default Deriv method in a derived class, you must override the default implementation of this method with one that actually implements the derivative. In that case the linear operator (HCL_LinearOp_d) returned by Deriv will be an instance of HCL_OpDefaultDeriv_d.

virtual void DerivAdjImage( const HCL_Vector_d & dy, HCL_Vector_d & dx ) const
DerivAdjImage computes the image of the adjoint of the derivative on dy, yielding dx. Default implementation returns an error message and exits. To use the default Deriv method in a derived class, you must override the default implementation of this method with one that actually implements the derivative. In that case the linear operator (HCL_LinearOp_d) returned by Deriv will be an instance of HCL_OpDefaultDeriv_d.

virtual void DerivInvImage( const HCL_Vector_d & dy, HCL_Vector_d & dx ) const
DerivInvImage computes the image of the inverse of the derivative on dy, yielding dx. Default implementation returns an error message and exits. To use the default Deriv method in a derived class, you must override the default implementation of this method with one that actually implements the derivative. In that case the linear operator (HCL_LinearOp_d) returned by Deriv will be an instance of HCL_OpDefaultDeriv_d.

virtual void DerivInvAdjImage( const HCL_Vector_d & dx, HCL_Vector_d & dy ) const
DerivInvAdjImage computes the image of the inverse of the adjoint of the derivative on dx, yielding dy. Default implementation returns an error message and exits. To use the default Deriv method in a derived class, you must override the default implementation of this method with one that actually implements the derivative. In that case the linear operator ( HCL_LinearOp_d) returned by Deriv will be an instance of HCL_OpDefaultDeriv_d.

virtual void SecondDerivImage( const HCL_Vector_d & dx1, const HCL_Vector_d & dx2, HCL_Vector_d & dy ) const
SecondDerivImage computes the image of the second derivative on dx1 and dx2, yielding dy. Default implementation returns an error message and exits. To use the default SecondDeriv method in a derived class, you must override the default implementation of this method with one that actually implements the derivative. In that case the bilinear operator (HCL_BiLinearOp_d) returned by SeondDeriv will be an instance of HCL_OpDefaultDeriv_d.

virtual void SecondDerivPartialAdjImage(const HCL_Vector_d & dx1, const HCL_Vector_d & dy, HCL_Vector_d & dx2 ) const
SecondDerivPartialAdjImage computes the image of the so-called "partial adjoint" of the second derivative (which is a bilinear operator) on dx1 and dy, yielding dx2. See the documentation for HCL_BiLinearOp_d for more details about bilinear operators and partial adjoints. Note that since the second derivative of a (sufficiently smooth) operator is symmetric, there is no ambiguity about which partial adjoint is intended. Default implementation returns an error message and exits. To use the default SecondDeriv method in a derived class, you must override the default implementation of this method with one that actually implements the derivative. In that case the bilinear operator (HCL_BiLinearOp_d) returned by SeondDeriv will be an instance of HCL_OpDefaultDeriv_d.

virtual HCL_VectorSpace_d& Domain() const
Domain returns a reference to the domain of the underlying operator. Pure virtual: must be implemented in any derived instantiable class.

virtual HCL_VectorSpace_d& Range() const
Range returns a reference to the range of the underlying operator. Pure virtual: must be implemented in any derived instantiable class.

virtual void Image( HCL_Vector_d & y ) const
Image computes the image of the operator and assigns it to y. Pure virtual: must be implemented in any derived instantiable class.

virtual void ImageAdd( HCL_Vector_d & y, double a=1.0, double b=1.0 ) const
ImageAdd computes . This method is given a default implementation in the base class, and need not be re-implemented in a derived class unless it is desired to obtain the gain in efficiency from "loop-fusion". Note that the scalars a and b are optional and default to 1.0.

virtual void ImageAdd( const HCL_Vector_d & z, HCL_Vector_d & y, double a=1.0, double b=1.0 ) const
ImageAdd computes . This method is given a default implementation in the base class, and need not be re-implemented in a derived class unless it is desired to obtain the gain in efficiency from "loop-fusion". Note that the scalars a and b are optional and default to 1.0.

virtual const HCL_Vector_d& ImageRef() const
ImageRef returns a reference to the image of the operator at this point. The user has a choice of calling Image, in which case the storage for the result is managed by the calling routine, or calling ImageRef, in which the Evaluation object manages the storage. This method is implemented in this class.

virtual HCL_LinearOp_d* Deriv() const
Deriv computes the derivative of the operator. Note that this method constructs an HCL_LinearOp_d, which the calling program is responsible for deleting with HCL_delete. The default implementation requires that default implementations of DerivImage and related methods be overridden with code that really does the job - see documentation on these classes, above.

virtual const HCL_LinearOp_d& DerivRef() const
DerivRef returns a reference to the derivative at this point. The programmer has a choice of calling Deriv, in which case the calling routine is responsible for managing the storage, or calling DerivRef, in which case the Evaluation object does. This method is implemented in this class.

virtual HCL_BiLinearOp_d* SecondDeriv() const
SecondDeriv computes the second derivative of the operator. The second derivative is a bilinear operator which knows how to compute all relevant adjoints. The default implementation requires that default implementations of SecondDerivImage and related methods be overridden with code that really does the job - see documentation on these classes, above.

virtual const HCL_BiLinearOp_d& SecondDerivRef() const
SecondDerivRef returns a reference to the second derivative at this point. The programmer has a choice of calling SecondDeriv, in which case the calling routine is responsible for managing the storage, or calling SecondDerivRef, in which case the Evaluation object does. This method is implemented in this class.


Direct child classes:
HCL_EvalLNLOp_d
HCL_EvalOpProductDomain_d
HCL_OpDefaultEval_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