HCL_RnVector_d is the simplest vector class
![]() | HCL_RnVector_d ( const HCL_RnVector_d & x ) Copy constructor |
![]() | HCL_RnVector_d ( HCL_RnSpace_d * s ) Construct a vector belonging to the HCL_RnSpace_d s. |
![]() | HCL_RnVector_d ( int n, double *data = NULL ) Construct a vector belonging to n-space, and optionally initialize with the contents of the "data" array by COPYING a pointer to double - note that in this case the destructor will NOT DELETE the data pointer, as it presumably belongs to some other object |
![]() | HCL_RnVector_d ( const HCL_RnSpace_d & s, char * fname = NULL ) Construct a ``new'' vector belonging to the HCL_RnSpace_d 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 |
![]() | Dim () const Dim returns the dimension of the vector space. |
![]() | Space () const Space returns a reference to the vector space to which this vector belongs |
![]() | operator) ( int i ) The () operator is a function for accessing the components of the vector |
![]() | operator) ( int i ) const The () operator is a function for accessing the components of the vector |
![]() | Data () Data returns a pointer to an array containing the component values of the vector |
![]() | Save ( char * fname ) Save to a file |
![]() | Write ( ostream & str ) const Write prints the dimension of the vector, followed by the first 10 components of the vector (or all of the componenents if the dimension is less than 10) |
![]() | Vector operations (z is *this, which is C++-ese for the instance
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | Array operations - ``Matlab'' methods. In describing these,
|
Vector operations (z is the object invoking the method).
Access to components.
Array operations - ``Matlab'' methods.
HCL_RnVector_d is the simplest vector class. The components of a vector are stored in a 1D Fortran-style array. Operations on the vectors are implemented using explicit loops.
HCL_RnVector_d( HCL_RnSpace_d * s )
HCL_RnVector_d( int n, double *data = NULL )
HCL_RnVector_d( const HCL_RnSpace_d & s, char * fname = NULL )
HCL_RnVector_d( char * fname, int save = 1 )
virtual int Dim() const
virtual HCL_VectorSpace_d& Space() const
double& operator)( int i )
double operator)( int i ) const
virtual double* Data()
Vector operations (z is *this, which is C++-ese for the instance
virtual void Copy( const HCL_Vector_d & x )
virtual void Neg()
virtual void Mul( const double & a )
virtual void Mul( const double & a, const HCL_Vector_d & x )
virtual void Add( const HCL_Vector_d & x )
virtual void Add( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual double Inner( const HCL_Vector_d & x ) const
virtual void Sub( const HCL_Vector_d & x )
virtual void Sub( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual void ScaleAdd( const double & a, const HCL_Vector_d & x )
virtual void AddScale( const double & a, const HCL_Vector_d & x )
virtual void AddScale( const double & a, const HCL_Vector_d & x, const HCL_Vector_d & y )
Array operations - ``Matlab'' methods. In describing these,
denotes the ith component of the current array, i.e. the
data array of the HCL_Vector object
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 Fill( double a )
virtual void Zero()
virtual void Random()
.
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 double Max() const
virtual double Min() const
virtual double Sum() const
virtual void Max( const HCL_Vector_d & x )
virtual void Max( const HCL_Vector_d & x, const HCL_Vector_d & y )
virtual void Min( const HCL_Vector_d & x )
virtual void Min( const HCL_Vector_d & x, const HCL_Vector_d & y )
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 & y, double t )
virtual void Sign( double t, const HCL_Vector_d & y )
virtual void Greater( double t )
if
>
, else 0
virtual void Greater( const HCL_Vector_d & x )
if
>
, else 0
virtual void Greater( const HCL_Vector_d & x, const HCL_Vector_d & y )
if
>
, else 0
virtual void Greater( const HCL_Vector_d & y, double t )
if
>
, else 0
virtual void Greater( double, const HCL_Vector_d & y )
if
>
, else 0
virtual void Power( double )
- 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.
void Save( char * fname )
virtual ostream& Write( ostream & str ) const
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