class HCL_PartitionedRnVector_d : public HCL_ProductVector_d

HCL_PartitionedRnVector_d represents a vector from a product space in which each factor is an instance of HCL_RnSpace_d

Inheritance:


Public Methods

virtual double* Data ()
Data returns a pointer to the (long) array of components
virtual int Dim ()
Return the dimension of the vector space
HCL_PartitionedRnVector_d ( char * fname )
Special constructor; reads the vector from an ASCII file
HCL_PartitionedRnVector_d ( HCL_PartitionedRnSpace_d * s )
General constructor; constructs a vector based on an instance of HCL_PartitionedRnVector_d
HCL_PartitionedRnVector_d (int m, int n)
Special constructor for the case of n identical factors, each with dimension m
virtual HCL_Vector_d& operator) (int i)
The () operator returns a reference to the ith factor
void Save ( char * fname )
Save stores the vector in an ASCII file, in the following format: The first entry is an integer n, the number of factors
virtual HCL_VectorSpace_d& Space ()
Space returns a reference to the underlying vector space.

Inherited from HCL_ProductVector_d:

Public Methods

virtual int Number()
virtual HCL_ProductSpace_d& ProductSpace()
virtual ostream& Write(ostream &)

Public

Access to components.

virtual double Component( int i )
Returns value, does not permit change of data array.
virtual double& Component( int i )
Returns reference, permits change of data array.

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()
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()
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()
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

Vector operations (z is *this, which is C++-ese for the instance

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 )
Inner product of z with x.
virtual double Norm()
Norm of z.
virtual double Norm2()
Norm squared of z.
virtual void Zero()
z <-- 0
virtual void Random()
Returns a "random" vector

Inherited from HCL_Vector_d:


Inherited from HCL_Base:

Public Methods

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

Private Fields

int ReferenceCount

Documentation

HCL_PartitionedRnVector_d represents a vector from a product space in which each factor is an instance of HCL_RnSpace_d. The product vector is implemented as a "long vector"; that is, the components are stored in a single array. The purpose of the class is to make it convenient to view the vector as a product (and hence convenient to manipulate the factors), but also to enable the use of direct linear algebra techniques on the long vector.

See HCL_RnVector_d and HCL_ProductVector_d for more details.

HCL_PartitionedRnVector_d(int m, int n)
Special constructor for the case of n identical factors, each with dimension m

HCL_PartitionedRnVector_d( char * fname )
Special constructor; reads the vector from an ASCII file. The format of the file is as follows: The first entry is an integer n, the number of factors. Subsequent entries consist of n blocks, each having the dimension of the factor followed by its components.

HCL_PartitionedRnVector_d( HCL_PartitionedRnSpace_d * s )
General constructor; constructs a vector based on an instance of HCL_PartitionedRnVector_d

virtual int Dim()
Return the dimension of the vector space

virtual HCL_Vector_d& operator)(int i)
The () operator returns a reference to the ith factor. The result can be safely cast to type HCL_RnVector_d.

virtual double* Data()
Data returns a pointer to the (long) array of components

virtual HCL_VectorSpace_d& Space()
Space returns a reference to the underlying vector space.

void Save( char * fname )
Save stores the vector in an ASCII file, in the following format: The first entry is an integer n, the number of factors. Subsequent entries consist of n blocks, each having the dimension of the factor followed by its components.


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