class HCL_LinCombFcnlGrad_d : public HCL_FunctionalGrad_d

HCL_LinCombFcnlGrad_d represents a linear combination of real-valued functions with gradients

Inheritance:


Public Methods

virtual HCL_VectorSpace_d& Domain ()
Domain space access
virtual HCL_EvaluateFunctionalGrad_d* 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
HCL_LinCombFcnlGrad_d ( HCL_FunctionalGrad_d * f1, double w1, HCL_FunctionalGrad_d * f2, double w2 )
Special constructor
HCL_LinCombFcnlGrad_d ( HCL_VectorSpace_d * dom, int n )
Usual constructor
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 the functional; that is, it computes the greatest a such that x + a*dir lies in the domain
Table& Parameters ()
Access to parameter table
void SetNext ( HCL_FunctionalGrad_d * eval, double w )
SetNext allows the next term in the linear combination to be added
virtual ostream& Write ( ostream & str )
Debugging information

Inherited from HCL_FunctionalGrad_d:

Public Methods

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 )
virtual void Gradient( const HCL_Vector_d & x, HCL_Vector_d & g )
virtual double Value( const HCL_Vector_d & x )

Inherited from HCL_Functional_d:

Public Methods

void Scan( const HCL_Vector_d & x, const HCL_Vector_d & dx, int N, double hmin, double hmax, char * fname = NULL )

Inherited from HCL_Base:

Public Methods

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

Private Fields

int ReferenceCount

Documentation

HCL_LinCombFcnlGrad_d represents a linear combination of real-valued functions with gradients. This object is useful for representing penalty functionals and similar linear combinations.

For the primary methods of this class, see HCL_FunctionalGrad_d.

There are two ways to construct a linear combination of functionals. There is a special constructor for th common case of two terms:


For the more general case of $n$ terms, there is a constructor which takes a pointer to the domain of the functional and the integer $n$. The terms in the linear combination must then be added one-by-one using the SetNext method.

Example:


   // Assume HCL_FunctionalGrad_d's f1, f2, g1, g2, and g3 have been defined.

   // Create the linear combination F(x) = f1(x) + 100*f2(x)
   HCL_LinCombFcnlGrad_d F( &f1,1.0,&f2,100.0 ); 

   // Create the linear combination G(x) = g1(x) + 100*g2(x) + 10*g3(x)
   HCL_LinCombFcnlGrad_d G( &(g1.Domain()),3 );
   G.SetNext( &g1,1.0 );
   G.SetNext( &g2,100.0 );
   G.SetNext( &g3,10.0 );

HCL_LinCombFcnlGrad_d( HCL_VectorSpace_d * dom, int n )
Usual constructor. Takes the domain and the number of functions in the sum. The terms in the linear combination must be added one-by-one using the SetNext method.

HCL_LinCombFcnlGrad_d( HCL_FunctionalGrad_d * f1, double w1, HCL_FunctionalGrad_d * f2, double w2 )
Special constructor. This constructor makes it easy to create a linear combination with two terms. It just takes pointers to the two functionals and the two weights.

virtual HCL_VectorSpace_d& Domain()
Domain space access. Returns a reference to the domain of the functional, which is required to be a vector space.

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 the functional; that is, it computes the greatest a such that x + a*dir lies in the domain. It does this by calling MaxStep for each functional in the linear combination, and taking the minimum of the results.

Table& Parameters()
Access to parameter table. The weights for the linear combination can be accessed with Parameters().GetArrayValue( "Weights",i,val ) or changed with Parameters().PutArrayValue( "Weights",i,val ).

virtual HCL_EvaluateFunctionalGrad_d* 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

void SetNext( HCL_FunctionalGrad_d * eval, double w )
SetNext allows the next term in the linear combination to be added. This method takes the functional and the weight.

virtual ostream& Write( ostream & str )
Debugging information. Prints out the weights and the individual functionals.


This class has no child classes.

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