ParGeMSLR
Public Member Functions | List of all members
pargemslr::VectorClass< T > Class Template Referenceabstract

The virtual class of real/complex vector class. More...

#include <vector.hpp>

Inheritance diagram for pargemslr::VectorClass< T >:
pargemslr::VectorVirtualClass< T >

Public Member Functions

 VectorClass ()
 The constructor of VectorClass. More...
 
 VectorClass (const VectorClass< T > &vec)
 The copy constructor of VectorClass. More...
 
 VectorClass (VectorClass< T > &&vec)
 The move constructor of VectorClass. More...
 
virtual int Clear ()
 Free the current vector. More...
 
virtual ~VectorClass ()
 The destructor of VectorClass. More...
 
virtual T & operator[] (int i)=0
 Get the reference of an index in the vector. More...
 
virtual T * GetData () const =0
 Get the data pointer of the vector. More...
 
virtual int GetDataLocation () const =0
 Get the data location of the vector. More...
 
virtual int GetLengthLocal () const =0
 Get the local length of the vector. More...
 
virtual long int GetLengthGlobal () const =0
 Get the global length of the vector. More...
 
virtual long int GetStartGlobal () const =0
 Get the global start index of the vector. More...
 
virtual int Fill (const T &v)=0
 Fill the vector with constant value. More...
 
virtual int Rand ()=0
 Fill the vector with random value. More...
 
virtual int Scale (const T &alpha)=0
 Scale the vector by x = alpha*x, where x is this vector. More...
 
virtual int Axpy (const T &alpha, const VectorClass< T > &x)=0
 Compute y = alpha * x + y, where y is this vector. Currenlty we don't support x == y. More...
 
virtual int Axpy (const T &alpha, const VectorClass< T > &x, VectorClass< T > &y)=0
 Compute z = alpha * x + y, where z is this vector. Currenlty we don't support x == y, x == z or y == z. More...
 
virtual int Axpy (const T &alpha, const VectorClass< T > &x, const T &beta, VectorClass< T > &y)=0
 Compute z = alpha * x + beta * y, where z is this vector. Currenlty we don't support x == y, x == z or y == z. More...
 
virtual int Norm2 (float &norm) const =0
 Compute the 2-norm of a vector, result is type float. More...
 
virtual int Norm2 (double &norm) const =0
 Compute the 2-norm of a vector, result is type double. More...
 
virtual int NormInf (float &norm)=0
 Compute the inf-norm of a vector, result is type float. More...
 
virtual int NormInf (double &norm)=0
 Compute the inf-norm of a vector, result is type double. More...
 
virtual int Dot (const VectorClass< T > &y, T &t) const =0
 Compute the dot product. More...
 
virtual int MoveData (const int &location)=0
 Move the data to another memory location. More...
 
- Public Member Functions inherited from pargemslr::VectorVirtualClass< T >
 VectorVirtualClass ()
 The constructor of VectorVirtualClass. More...
 
 VectorVirtualClass (const VectorVirtualClass< T > &vec)
 The copy constructor of VectorVirtualClass. More...
 
 VectorVirtualClass (VectorVirtualClass< T > &&vec)
 The move constructor of VectorVirtualClass. More...
 
virtual ~VectorVirtualClass ()
 The destructor of VectorVirtualClass. More...
 
virtual bool IsParallel () const
 Tell if this is a prallel vector. More...
 
PrecisionEnum GetPrecision () const
 Get the data precision of the vector. More...
 

Detailed Description

template<typename T>
class pargemslr::VectorClass< T >

The virtual class of real/complex vector class.

Constructor & Destructor Documentation

◆ VectorClass() [1/3]

template<typename T >
template pargemslr::VectorClass< T >::VectorClass ( )

The constructor of VectorClass.

◆ VectorClass() [2/3]

template<typename T >
pargemslr::VectorClass< T >::VectorClass ( const VectorClass< T > &  vec)

The copy constructor of VectorClass.

◆ VectorClass() [3/3]

template<typename T >
pargemslr::VectorClass< T >::VectorClass ( VectorClass< T > &&  vec)

The move constructor of VectorClass.

◆ ~VectorClass()

template<typename T >
template pargemslr::VectorClass< T >::~VectorClass ( )
virtual

The destructor of VectorClass.

Member Function Documentation

◆ Axpy() [1/3]

template<typename T >
virtual int pargemslr::VectorClass< T >::Axpy ( const T &  alpha,
const VectorClass< T > &  x 
)
pure virtual

Compute y = alpha * x + y, where y is this vector. Currenlty we don't support x == y.

Parameters
[in]alphaThe alpha value.
[out]xThe vector.
Returns
Return error message.

◆ Axpy() [2/3]

template<typename T >
virtual int pargemslr::VectorClass< T >::Axpy ( const T &  alpha,
const VectorClass< T > &  x,
const T &  beta,
VectorClass< T > &  y 
)
pure virtual

Compute z = alpha * x + beta * y, where z is this vector. Currenlty we don't support x == y, x == z or y == z.

Parameters
[in]alphaThe alpha value.
[in]xThe first vector.
[in]betaThe beta value.
[in]yThe second vector.
Returns
Return error message.

◆ Axpy() [3/3]

template<typename T >
virtual int pargemslr::VectorClass< T >::Axpy ( const T &  alpha,
const VectorClass< T > &  x,
VectorClass< T > &  y 
)
pure virtual

Compute z = alpha * x + y, where z is this vector. Currenlty we don't support x == y, x == z or y == z.

Parameters
[in]alphaThe alpha value.
[in]xThe first vector.
[in]yThe second vector.
Returns
Return error message.

◆ Clear()

template<typename T >
template int pargemslr::VectorClass< T >::Clear ( )
virtual

Free the current vector.

Returns
Return error message.

Reimplemented from pargemslr::VectorVirtualClass< T >.

◆ Dot()

template<typename T >
virtual int pargemslr::VectorClass< T >::Dot ( const VectorClass< T > &  y,
T &  t 
) const
pure virtual

Compute the dot product.

Parameters
[in]yThe vector.
[out]tThe result.
Returns
Return error message.

◆ Fill()

template<typename T >
virtual int pargemslr::VectorClass< T >::Fill ( const T &  v)
pure virtual

Fill the vector with constant value.

Parameters
[in]vThe value to be filled.
Returns
Return error message.

Implements pargemslr::VectorVirtualClass< T >.

◆ GetData()

template<typename T >
virtual T* pargemslr::VectorClass< T >::GetData ( ) const
pure virtual

Get the data pointer of the vector.

Returns
Return the data pointer.

Implements pargemslr::VectorVirtualClass< T >.

◆ GetDataLocation()

template<typename T >
virtual int pargemslr::VectorClass< T >::GetDataLocation ( ) const
pure virtual

Get the data location of the vector.

Returns
Return the data location of the vector.

Implements pargemslr::VectorVirtualClass< T >.

◆ GetLengthGlobal()

template<typename T >
virtual long int pargemslr::VectorClass< T >::GetLengthGlobal ( ) const
pure virtual

Get the global length of the vector.

Returns
Return the length of the vector.

◆ GetLengthLocal()

template<typename T >
virtual int pargemslr::VectorClass< T >::GetLengthLocal ( ) const
pure virtual

Get the local length of the vector.

Returns
Return the length of the vector.

Implements pargemslr::VectorVirtualClass< T >.

◆ GetStartGlobal()

template<typename T >
virtual long int pargemslr::VectorClass< T >::GetStartGlobal ( ) const
pure virtual

Get the global start index of the vector.

Returns
Return the global start index of the vector.

◆ MoveData()

template<typename T >
virtual int pargemslr::VectorClass< T >::MoveData ( const int &  location)
pure virtual

Move the data to another memory location.

Parameters
[in]locationThe location move to.
Returns
Return error message.

Implements pargemslr::VectorVirtualClass< T >.

◆ Norm2() [1/2]

template<typename T >
virtual int pargemslr::VectorClass< T >::Norm2 ( double &  norm) const
pure virtual

Compute the 2-norm of a vector, result is type double.

Parameters
[out]normThe 2-norm.
Returns
Return error message.

◆ Norm2() [2/2]

template<typename T >
virtual int pargemslr::VectorClass< T >::Norm2 ( float &  norm) const
pure virtual

Compute the 2-norm of a vector, result is type float.

Parameters
[out]normThe 2-norm.
Returns
Return error message.

◆ NormInf() [1/2]

template<typename T >
virtual int pargemslr::VectorClass< T >::NormInf ( double &  norm)
pure virtual

Compute the inf-norm of a vector, result is type double.

Parameters
[out]normThe inf-norm.
Returns
Return error message.

◆ NormInf() [2/2]

template<typename T >
virtual int pargemslr::VectorClass< T >::NormInf ( float &  norm)
pure virtual

Compute the inf-norm of a vector, result is type float.

Parameters
[out]normThe inf-norm.
Returns
Return error message.

◆ operator[]()

template<typename T >
virtual T& pargemslr::VectorClass< T >::operator[] ( int  i)
pure virtual

Get the reference of an index in the vector.

Parameters
[in]iThe index.
Returns
The reference of the value on that index.

Implements pargemslr::VectorVirtualClass< T >.

◆ Rand()

template<typename T >
virtual int pargemslr::VectorClass< T >::Rand ( )
pure virtual

Fill the vector with random value.

Returns
Return error message.

◆ Scale()

template<typename T >
virtual int pargemslr::VectorClass< T >::Scale ( const T &  alpha)
pure virtual

Scale the vector by x = alpha*x, where x is this vector.

Parameters
[in]alphaThe scale.
Returns
Return error message.

The documentation for this class was generated from the following files: