class HCL_RnVector_d : public HCL_EuclideanVector_d

HCL_RnVector_d is a memory-based vector class representing vectors in Rn

Inheritance:


Public

Constructors
HCL_RnVector_d ( const HCL_RnVector_d & x )
Copy constructor
HCL_RnVector_d ( HCL_RnSpace_d * s )
Construct a vector belonging to the Rn vector space s
HCL_RnVector_d ( int n, double *data = NULL )
Construct a vector belonging to Rn, and optionally initialize with the contents of the "data" array
HCL_RnVector_d ( const HCL_RnSpace_d & s, char * fname = NULL )
Construct a ``new'' vector belonging to the HCL_RnSpace s, and optionally specify an ASCII file to which the data will be saved
HCL_RnVector_d ( char * fname, int save = 1 )
Construct a ``old'' vector by reading the contents of the specified ASCII file
Data Access
double* Data ()
Return a pointer to an array containing the component values of the vector
void Save ( char * fname )
Save to a file

Inherited from HCL_EuclideanVector_d:

Public

Access to components.

virtual double operator)( int i )
returns value, does not permit change of data array
virtual double& operator)( int i )
returns reference, permits change of data array

Access to dimension

virtual int Dim()
returns dimension of space

Array operations - ``Matlab'' methods.

virtual void Fill( double a )
virtual void Zero()
virtual void Random()
pseudorandom numbers uniformly distributed between -1 and 1
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_EuclideanVector_d & x )
- matrix multiply by diag(x)
virtual void DiagScale( const HCL_EuclideanVector_d & x, const HCL_EuclideanVector_d & y )
virtual void DiagRecipScale( const HCL_EuclideanVector_d & x, double tol=0.0)
- matrix division by diag(x)
virtual void DiagRecipScale( const HCL_EuclideanVector_d & x, const HCL_EuclideanVector_d & y, double tol=0.0)
- matrix division by diag(x)
virtual void DotStar( const HCL_EuclideanVector_d & x )
"Matlab" name for DiagScale, first version
virtual void DotStar( const HCL_EuclideanVector_d & x, const HCL_EuclideanVector_d & y )
"Matlab" name for DiagScale, second version
virtual void DotSlash( const HCL_EuclideanVector_d & x, double tol=0.0)
"Matlab" name for DiagRecipScale, first version.
virtual void DotSlash( const HCL_EuclideanVector_d & x, const HCL_EuclideanVector_d & y, double tol=0.0)
"Matlab" name for DiagRecipScale, second version.
virtual double Max()
returns largest of components or -FLT_MAX
virtual void Max( const HCL_EuclideanVector_d & x )
virtual void Max( const HCL_EuclideanVector_d & x, const HCL_EuclideanVector_d & y )
virtual double Min()
returns smallest of components or FLT_MAX
virtual void Min( const HCL_EuclideanVector_d & x )
virtual void Min( const HCL_EuclideanVector_d & x, const HCL_EuclideanVector_d & y )
virtual double Sum()
returns
virtual void Abs()
virtual void Abs( const HCL_EuclideanVector_d & x )
virtual void Sign()
virtual void Sign( double t )
virtual void Sign( const HCL_EuclideanVector_d & x )
virtual void Sign( const HCL_EuclideanVector_d & x, const HCL_EuclideanVector_d & y )
virtual void Sign( const HCL_EuclideanVector_d & x, double t )
virtual void Sign( double t, const HCL_EuclideanVector_d & y )
virtual void Greater( double t )
Mask function: if > , else 0
virtual void Greater( const HCL_EuclideanVector_d & x )
Mask function: if > , else 0
virtual void Greater( const HCL_EuclideanVector_d & x, const HCL_EuclideanVector_d & y )
Mask function: if > , else 0
virtual void Greater( const HCL_EuclideanVector_d & x, double t )
Mask function: if > , else 0
virtual void Greater( double t, const HCL_EuclideanVector_d & x )
Mask function: if > , else 0
virtual void Power( double p )
- arbitrary real power
virtual void Power( double p, const HCL_EuclideanVector_d & x )
- arbitrary real power
virtual void Sqrt()
- componentwise square root
virtual void Sqrt( const HCL_EuclideanVector_d & x )
- componentwise square root
virtual void Exp()
virtual void Exp( const HCL_EuclideanVector_d & x )
virtual void Log()
- componentwise natural log
virtual void Log( const HCL_EuclideanVector_d & x )
- componentwise natural log

constructors and destructor

HCL_EuclideanVector_d()
Default constructor.
HCL_EuclideanVector_d( const HCL_EuclideanVector_d & x)
Copy constructor
virtual ~HCL_EuclideanVector_d()
destructor

Subarray extraction.

virtual HCL_EuclideanVector_d* SubArray(int begin, int end)
returns subarray of components starting with begin, ending with end
virtual HCL_EuclideanVector_d* SubArray(int begin, int stride, int end)
same but with index increment stride

Inherited from HCL_Vector_d:

Public Methods

virtual ostream& Write(ostream &)

Public

Vector operations (z is *this, which is C++-ese for the instance of the class 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 Add( const HCL_Vector_d & x )
z <-- z + x
virtual void Mul( const double & a, const HCL_Vector_d & x )
z <-- a*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 HCL_VectorSpace_d& Space()
Returns a reference to the space of which z is a member
virtual void Zero()
z <-- 0
virtual void Random()
Returns a "random" vector

Inherited from HCL_Base:

Public Methods

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

Private Fields

int ReferenceCount

Documentation

HCL_RnVector_d is a memory-based vector class representing vectors in Rn. Vectors are stored as arrays, and most operations on the vectors take advantage of level-1 BLAS operations.
Constructors

HCL_RnVector_d( const HCL_RnVector_d & x )
Copy constructor

HCL_RnVector_d( HCL_RnSpace_d * s )
Construct a vector belonging to the Rn vector space s

HCL_RnVector_d( int n, double *data = NULL )
Construct a vector belonging to Rn, and optionally initialize with the contents of the "data" array

HCL_RnVector_d( const HCL_RnSpace_d & s, char * fname = NULL )
Construct a ``new'' vector belonging to the HCL_RnSpace s, and optionally specify an ASCII file to which the data will be saved. The format for the file is an integer specifying the dimension, followed by whitespace or newline-separated values.

HCL_RnVector_d( char * fname, int save = 1 )
Construct a ``old'' vector by reading the contents of the specified ASCII file. The format for the file is an integer specifying the dimension, followed by whitespace or newline- separated values. If the save flag is set the contents are saved back to the file on destruction - this is the default behaviour.

Data Access

double* Data()
Return a pointer to an array containing the component values of the vector. This is the actual storage array in the vector, so changing it will change the components of the vector. This pointer belongs to the HCL_RnVector_d object, and should not be deleted.

void Save( char * fname )
Save to a file. The file format is an integer specifying the dimension, followed by the data values, one per line.


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