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

The virtual class of all matrix classes. More...

#include <matrix.hpp>

Inheritance diagram for pargemslr::MatrixClass< T >:
pargemslr::CooMatrixClass< T > pargemslr::DenseMatrixClass< T >

Public Member Functions

 MatrixClass ()
 The constructor of MatrixClass. More...
 
 MatrixClass (const MatrixClass< T > &mat)
 The copy constructor of MatrixClass. More...
 
 MatrixClass (MatrixClass< T > &&mat)
 The move constructor of MatrixClass. More...
 
virtual int Clear ()
 Free the current matrix. More...
 
virtual ~MatrixClass ()
 The destructor of MatrixClass. More...
 
virtual int GetDataLocation () const
 Get the data location of the matrix. More...
 
virtual int GetNumRowsLocal () const =0
 Get the local number of rows of the matrix. More...
 
virtual int GetNumColsLocal () const =0
 Get the local number of columns of the matrix. More...
 
virtual long int GetNumNonzeros () const
 Get the number of nonzeros in this matrix. More...
 
virtual int Eye ()
 Create an indentity matrix. More...
 
virtual int Fill (const T &v)
 Fill the matrix pattern with constant value. More...
 
virtual int Scale (const T &alpha)
 Scale the matrix. More...
 
virtual int MatVec (char trans, const T &alpha, const VectorClass< T > &x, const T &beta, VectorClass< T > &y)
 In place Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y. More...
 
virtual int MatVec (char trans, const T &alpha, const VectorClass< T > &x, const T &beta, const VectorClass< T > &y, VectorClass< T > &z)
 In place Matrix-Vector product ==> z := alpha*A*x + beta*y, or z := alpha*A'*x + beta*y. More...
 
virtual int MoveData (const int &location)
 Move the data to another memory location. More...
 
PrecisionEnum GetPrecision () const
 Return the precision of the matrix. More...
 

Detailed Description

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

The virtual class of all matrix classes.

Constructor & Destructor Documentation

◆ MatrixClass() [1/3]

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

The constructor of MatrixClass.

◆ MatrixClass() [2/3]

template<typename T >
pargemslr::MatrixClass< T >::MatrixClass ( const MatrixClass< T > &  mat)

The copy constructor of MatrixClass.

Parameters
[in]matThe other matrix.

◆ MatrixClass() [3/3]

template<typename T >
pargemslr::MatrixClass< T >::MatrixClass ( MatrixClass< T > &&  mat)

The move constructor of MatrixClass.

Parameters
[in]matThe other matrix.

◆ ~MatrixClass()

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

The destructor of MatrixClass.

Member Function Documentation

◆ Clear()

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

Free the current matrix.

Returns
Return error message.

Reimplemented in pargemslr::DenseMatrixClass< T >, pargemslr::DenseMatrixClass< DataType >, and pargemslr::CooMatrixClass< T >.

◆ Eye()

template<typename T >
template int pargemslr::MatrixClass< T >::Eye ( )
virtual

Create an indentity matrix.

Returns
Return error message.

Reimplemented in pargemslr::DenseMatrixClass< T >, pargemslr::DenseMatrixClass< DataType >, and pargemslr::CooMatrixClass< T >.

◆ Fill()

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

Fill the matrix pattern with constant value.

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

Reimplemented in pargemslr::DenseMatrixClass< T >, pargemslr::CooMatrixClass< T >, and pargemslr::DenseMatrixClass< DataType >.

◆ GetDataLocation()

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

Get the data location of the matrix.

Returns
Return the data location of the matrix.

Reimplemented in pargemslr::DenseMatrixClass< T >, pargemslr::DenseMatrixClass< DataType >, and pargemslr::CooMatrixClass< T >.

◆ GetNumColsLocal()

template<typename T >
virtual int pargemslr::MatrixClass< T >::GetNumColsLocal ( ) const
pure virtual

Get the local number of columns of the matrix.

Returns
Return the local number of columns of the matrix.

Implemented in pargemslr::DenseMatrixClass< T >, pargemslr::DenseMatrixClass< DataType >, and pargemslr::CooMatrixClass< T >.

◆ GetNumNonzeros()

template<typename T >
template long int pargemslr::MatrixClass< T >::GetNumNonzeros ( ) const
virtual

Get the number of nonzeros in this matrix.

Returns
Return the number of nonzeros in this matrix.

Reimplemented in pargemslr::DenseMatrixClass< T >, pargemslr::DenseMatrixClass< DataType >, and pargemslr::CooMatrixClass< T >.

◆ GetNumRowsLocal()

template<typename T >
virtual int pargemslr::MatrixClass< T >::GetNumRowsLocal ( ) const
pure virtual

Get the local number of rows of the matrix.

Returns
Return the local number of rows of the matrix.

Implemented in pargemslr::DenseMatrixClass< T >, pargemslr::DenseMatrixClass< DataType >, and pargemslr::CooMatrixClass< T >.

◆ GetPrecision()

template<typename T >
template PrecisionEnum pargemslr::MatrixClass< T >::GetPrecision ( ) const

Return the precision of the matrix.

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

◆ MatVec() [1/2]

template<typename T >
int pargemslr::MatrixClass< T >::MatVec ( char  trans,
const T &  alpha,
const VectorClass< T > &  x,
const T &  beta,
const VectorClass< T > &  y,
VectorClass< T > &  z 
)
virtual

In place Matrix-Vector product ==> z := alpha*A*x + beta*y, or z := alpha*A'*x + beta*y.

Parameters
[in]transWhether or not transpose matrix A.
[in]alphaThe alpha value.
[in]xThe first vector.
[in]betaThe beta value.
[in]yThe second vector.
[out]zThe output vector.
Returns
Return error message.

Reimplemented in pargemslr::DenseMatrixClass< T >, and pargemslr::DenseMatrixClass< DataType >.

◆ MatVec() [2/2]

template<typename T >
int pargemslr::MatrixClass< T >::MatVec ( char  trans,
const T &  alpha,
const VectorClass< T > &  x,
const T &  beta,
VectorClass< T > &  y 
)
virtual

In place Matrix-Vector product ==> y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y.

Parameters
[in]transWhether or not transpose matrix A.
[in]alphaThe alpha value.
[in]xThe first vector.
[in]betaThe beta value.
[in,out]yThe second vector.
Returns
Return error message.

Reimplemented in pargemslr::DenseMatrixClass< T >, and pargemslr::DenseMatrixClass< DataType >.

◆ MoveData()

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

Move the data to another memory location.

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

Reimplemented in pargemslr::DenseMatrixClass< T >, pargemslr::DenseMatrixClass< DataType >, and pargemslr::CooMatrixClass< T >.

◆ Scale()

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

Scale the matrix.

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

Reimplemented in pargemslr::DenseMatrixClass< T >, pargemslr::CooMatrixClass< T >, and pargemslr::DenseMatrixClass< DataType >.


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