class HCL_Vector_d : public HCL_Base

HCL_Vector_d is the base class for all vectors in HCL

Inheritance:


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 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 ) const
Inner product of z with x.
virtual double Norm () const
Norm of z.
virtual double Norm2 () const
Norm squared of z.
virtual HCL_VectorSpace_d& Space () const
Returns a reference to the space of which z is a member
virtual void Zero ()
z <-- 0
virtual void Random ()
Returns a "random" vector
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
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 void DotStar ( const HCL_Vector_d & x )
"Matlab" name for DiagScale, first version
virtual void DotStar ( const HCL_Vector_d & x, const HCL_Vector_d & y )
"Matlab" name for DiagScale, second version
virtual void DotSlash ( const HCL_Vector_d & x, double tol=0.0)
"Matlab" name for DiagRecipScale, first version.
virtual void DotSlash ( const HCL_Vector_d & x, const HCL_Vector_d & y, double tol=0.0)
"Matlab" name for DiagRecipScale, second version.
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_Base:

Public Methods

void IncCount() const
void DecCount() const
int Count() const
virtual ostream& Write(ostream &) const

Documentation

HCL_Vector_d is the base class for all vectors in HCL. Vectors are implemented as concrete classes derived from HCL_Vector_d so that the optimization code need make no assumptions about the data structures used to implement the vectors. This is essential when nonstandard data structures (such as disk files for very large problems) are used.

Note that each class derived from HCL_Vector_d must correspond to a class derived from HCL_VectorSpace_d. That is, if one wishes to create a class MyVector, derived from HCL_Vector_d, one is obligated to first define MyVectorSpace, derived from HCL_VectorSpace_d.

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 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 ) const
Inner product of z with x.

virtual double Norm() const
Norm of z.

virtual double Norm2() const
Norm squared of z.

virtual HCL_VectorSpace_d& Space() const
Returns a reference to the space of which z is a member

virtual void Zero()
z <-- 0

virtual void Random()
Returns a "random" vector. The meaning of random is left up to the implementor of each derived class.

Access to components.
Dim and Data return the dimension of the data and a pointer to the internal data array, respectively. Efficient access to the data of the vector object is usually most easily implemented using these two functions.

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. The default implementation returns NULL so that the method need not be re-implemented for, e.g., out-of-core classes.

Array operations - ``Matlab'' methods.
In describing these, denotes the ith component of the current array.

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). Safeguarded against overflow - if tol is less that the smallest safe divisor sfmin as defined by LAPACK::[SD]LAMCH, then tol is replaced by sfmin - thus the default is tol=0.0, which effectively means tol=sfmin.

virtual void DiagRecipScale( const HCL_Vector_d & x, const HCL_Vector_d & y, double tol=0.0)
- matrix division by diag(x). Safeguarded against overflow - if tol is less that the smallest safe divisor sfmin as defined by LAPACK::[SD]LAMCH, then tol is replaced by sfmin - thus the default is tol=0.0, which effectively means tol=sfmin.

virtual void DotStar( const HCL_Vector_d & x )
"Matlab" name for DiagScale, first version

virtual void DotStar( const HCL_Vector_d & x, const HCL_Vector_d & y )
"Matlab" name for DiagScale, second version

virtual void DotSlash( const HCL_Vector_d & x, double tol=0.0)
"Matlab" name for DiagRecipScale, first version.

virtual void DotSlash( const HCL_Vector_d & x, const HCL_Vector_d & y, double tol=0.0)
"Matlab" name for DiagRecipScale, second version.

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()
. Sign returns 1 for positive arguments, -1 for negative arguments, and 0 for zero arguments.

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. Should only be invoked for nonintegral when , but have not found a good way to enforce this constraint, so rely on runtime

virtual void Power( double p, const HCL_Vector_d & x )
- arbitrary real power. should only be invoked for nonintegral when , but have not found a good way to enforce this constraint, so rely on runtime

virtual void Sqrt()
- componentwise square root. exits with error condition if any component is negative.

virtual void Sqrt( const HCL_Vector_d & x )
- componentwise square root. exits with error condition if any component is negative.

virtual void Exp()

virtual void Exp( const HCL_Vector_d & x )

virtual void Log()
- componentwise natural log. exits with error condition if any component is nonpositive.

virtual void Log( const HCL_Vector_d & x )
- componentwise natural log. exits with error condition if any component is nonpositive.


Direct child classes:
HCL_ProductVector_d
SGFVector_d
HCL_RnVector_d

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