class HCL_GenericProductVector_d : public HCL_ProductVector_d

HCL_GenericProductVector_d is a concrete product vector class; it represents a vector from a vector space which is defined as a product of several existing vector spaces

Inheritance:


Public Methods

HCL_GenericProductVector_d ()
Default constructor---for use by derived classes that wish to assign the space and length
HCL_GenericProductVector_d (const HCL_GenericProductSpace_d & p)
Constructor to create a vector from the space
HCL_GenericProductVector_d ( HCL_GenericProductSpace_d * p )
Constructor to create a vector from the space (copies pointer).
HCL_GenericProductVector_d ( HCL_Vector_d * v1, HCL_Vector_d * v2 )
Creates a vector from a product space with two factors
HCL_GenericProductVector_d ( int n )
This constructor creates a product vector with n factors
virtual ~HCL_GenericProductVector_d ()
Destructor.
int Initialized () const
Initialized is a boolean method indicating whether the factors in the vector have been initialized
int IsSet ( int i ) const
IsSet is a boolean method indicating whether the indicated factor has been set
virtual HCL_Vector_d& operator) (int i) const
The () operator returns a reference to the ith factor.
virtual HCL_VectorSpace_d& Space () const
Space returns a reference to the space to which this vector belongs
virtual int Number () const
Number returns the number of factors in the product.
void SetNext ( HCL_Vector_d * x )
SetNext specifies the next vector in the product
void Set ( int i, HCL_Vector_d * x )
Set specifies an arbitrary vector in the product

Inherited from HCL_ProductVector_d:

Public Methods

virtual HCL_ProductSpace_d& ProductSpace() const
virtual ostream& Write(ostream &) const

Public

Vector operations (z is the object invoking the method).

virtual void Copy( const HCL_Vector_d & x )
z <-- x
virtual void Neg()
z <-- (-z)
virtual void Mul( const double & a )
z <-- a*z
virtual void Mul( const double & a, const HCL_Vector_d & x )
z <-- a*x
virtual void Add( const HCL_Vector_d & x )
z <-- z + x
virtual void Add( const HCL_Vector_d & x, const HCL_Vector_d & y )
z <-- x + y
virtual void Sub( const HCL_Vector_d & x )
z <-- z - x
virtual void Sub(const HCL_Vector_d & x, const HCL_Vector_d & y )
z <-- x - y
virtual void ScaleAdd(const double & a, const HCL_Vector_d & x )
z <-- a*z + x
virtual void AddScale(const double & a, const HCL_Vector_d & x )
z <-- z + a*x
virtual void AddScale(const double & a, const HCL_Vector_d & x, const HCL_Vector_d & y )
z <-- x + a*y
virtual double Inner( const HCL_Vector_d & x ) const
Inner product of z with x.
virtual double Norm() const
Norm of z.
virtual double Norm2() const
Norm squared of z.
virtual void Zero()
z <-- 0
virtual void Random()
Returns a "random" vector

Array operations - ``Matlab'' methods.

virtual void Fill( double a )
virtual void Add( double a )
- overload of Add with scalar argument a la Matlab
virtual void Add( const HCL_Vector_d & x, double a )
- overload of Add with scalar argument a la Matlab
virtual void DiagScale( const HCL_Vector_d & x )
- matrix multiply by diag(x)
virtual void DiagScale( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual void DiagRecipScale( const HCL_Vector_d & x, double tol=0.0)
- matrix division by diag(x)
virtual void DiagRecipScale( const HCL_Vector_d & x, const HCL_Vector_d & y, double tol=0.0)
- matrix division by diag(x)
virtual double Max() const
returns largest of components or -FLT_MAX
virtual void Max( const HCL_Vector_d & x )
virtual void Max( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual double Min() const
returns smallest of components or FLT_MAX
virtual void Min( const HCL_Vector_d & x )
virtual void Min( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual double Sum() const
returns
virtual void Abs()
virtual void Abs( const HCL_Vector_d & x )
virtual void Sign()
virtual void Sign( double t )
virtual void Sign( const HCL_Vector_d & x )
virtual void Sign( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual void Sign( const HCL_Vector_d & x, double t )
virtual void Sign( double t, const HCL_Vector_d & y )
virtual void Greater( double t )
Mask function: if > , else 0
virtual void Greater( const HCL_Vector_d & x )
Mask function: if > , else 0
virtual void Greater( const HCL_Vector_d & x, const HCL_Vector_d & y )
Mask function: if > , else 0
virtual void Greater( const HCL_Vector_d & x, double t )
Mask function: if > , else 0
virtual void Greater( double t, const HCL_Vector_d & x )
Mask function: if > , else 0
virtual void Power( double p )
- arbitrary real power
virtual void Power( double p, const HCL_Vector_d & x )
- arbitrary real power
virtual void Sqrt()
- componentwise square root
virtual void Sqrt( const HCL_Vector_d & x )
- componentwise square root
virtual void Exp()
virtual void Exp( const HCL_Vector_d & x )
virtual void Log()
- componentwise natural log
virtual void Log( const HCL_Vector_d & x )
- componentwise natural log

Inherited from HCL_Vector_d:

Public

Access to components.

virtual int Dim() const
Dim returns dimension of space.
virtual double* Data()
Data returns a pointer to the array of components, which is assumed to exist or to be created for this purpose

Inherited from HCL_Base:

Public Methods

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

Documentation

HCL_GenericProductVector_d is a concrete product vector class; it represents a vector from a vector space which is defined as a product of several existing vector spaces.

There are three ways to create such a vector.

First of all, if x and y are two existing vectors (i.e. instances of classes derived from HCL_Vector_d), then the vector z = (x,y) can be created as follows:

   HCL_GenericProductVector_d z( &x,&y );
Note that using this construction, z points to x and y, and any change in z is also a change in x and/or y, and vice versa.

Secondly, if x1, x2, ... xn are existing vectors, then the vector z = (x1,x2,...,xn) can be created as follows:

   HCL_GenericProductVector_d z( n );  // n is the number of factors
   z.SetNext( &x1 );
   z.SetNext( &x2 );
   .
   .
   .
   z.SetNext( &xn );
Again, z points to the vector x1, x2, ..., xn, and any changes in one is a change in the other.

Finally, the general constructor takes an instance of HCL_GenericProductSpace_d (either a reference or a pointer), and creates a vector from that space.

HCL_GenericProductVector_d()
Default constructor---for use by derived classes that wish to assign the space and length

HCL_GenericProductVector_d(const HCL_GenericProductSpace_d & p)
Constructor to create a vector from the space. Creates an independent copy of the space.

HCL_GenericProductVector_d( HCL_GenericProductSpace_d * p )
Constructor to create a vector from the space (copies pointer).

HCL_GenericProductVector_d( HCL_Vector_d * v1, HCL_Vector_d * v2 )
Creates a vector from a product space with two factors. This object copies pointers to the two given vectors.

HCL_GenericProductVector_d( int n )
This constructor creates a product vector with n factors. The factors must be specified with the SetNext method.

virtual ~HCL_GenericProductVector_d()
Destructor.

int Initialized() const
Initialized is a boolean method indicating whether the factors in the vector have been initialized

int IsSet( int i ) const
IsSet is a boolean method indicating whether the indicated factor has been set

virtual HCL_Vector_d& operator)(int i) const
The () operator returns a reference to the ith factor.

virtual HCL_VectorSpace_d& Space() const
Space returns a reference to the space to which this vector belongs

virtual int Number() const
Number returns the number of factors in the product.

void SetNext( HCL_Vector_d * x )
SetNext specifies the next vector in the product. This is used with the constructor that takes only the number of vectors in the product.

void Set( int i, HCL_Vector_d * x )
Set specifies an arbitrary vector in the product. This is used with the constructor that takes only the number of vectors in the product.


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