class HCL_LinCombFcnl_d : public HCL_Functional_d

HCL_LinCombFcnl_d represents a linear combination of real-valued functionals:

Inheritance:


Public Methods

HCL_LinCombFcnl_d ( HCL_VectorSpace_d * dom, int n )
Usual constructor; takes the domain and the number of functions in the sum
HCL_LinCombFcnl_d ( HCL_Functional_d * f1, double w1, HCL_Functional_d * f2, double w2 )
Special constructor
virtual HCL_VectorSpace_d& Domain () const
Domain space access
virtual double MaxStep ( const HCL_Vector_d & x, const HCL_Vector_d &dir) const
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
virtual HCL_EvaluateFunctional_d* Evaluate ( const HCL_Vector_d & x ) const
Evaluate creates an "evaluation" object, which knows how to compute the function value and gradient at the given x
void SetNext ( HCL_Functional_d * eval, double w )
SetNext allows the next term in the linear combination to be added
virtual ostream& Write ( ostream & str ) const
Debugging information

Inherited from HCL_Functional_d:

Public Methods

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 double Value1( const HCL_Vector_d & x ) const
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_LinCombFcnl_d represents a linear combination of real-valued functionals: . This object is useful for representing penalty functionals and similar linear combinations.

For the primary methods of this class, see HCL_Functional_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 terms, there is a constructor which takes a pointer to the domain of the functional and the integer . The terms in the linear combination must then be added one-by-one using the SetNext method.

Example:


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

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

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

HCL_LinCombFcnl_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_LinCombFcnl_d( HCL_Functional_d * f1, double w1, HCL_Functional_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() const
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) const
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_EvaluateFunctional_d* Evaluate( const HCL_Vector_d & x ) const
Evaluate creates an "evaluation" object, which knows how to compute the function value and gradient at the given x

void SetNext( HCL_Functional_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 ) const
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