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

Class of dense matrix. More...

#include <dense_matrix.hpp>

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

Public Member Functions

 DenseMatrixClass ()
 The constructor of DenseMatrixClass. More...
 
 DenseMatrixClass (const DenseMatrixClass< T > &mat)
 The copy constructor of DenseMatrixClass. More...
 
 DenseMatrixClass (DenseMatrixClass< T > &&mat)
 The move constructor of DenseMatrixClass. More...
 
DenseMatrixClass< T > & operator= (const DenseMatrixClass< T > &mat)
 The = operator of DenseMatrixClass. More...
 
DenseMatrixClass< T > & operator= (DenseMatrixClass< T > &&mat)
 The = operator of DenseMatrixClass. More...
 
virtual ~DenseMatrixClass ()
 The destructor of DenseMatrixClass. More...
 
int Setup (int nrows, int ncols)
 Free the current matrix, and malloc memory to create a new matrix on the host. More...
 
int Setup (int nrows, int ncols, bool setzero)
 Free the current matrix, and malloc memory to create a new matrix. More...
 
int Setup (int nrows, int ncols, int location, bool setzero)
 Free the current matrix, and malloc memory to create a new matrix. More...
 
int SetupPtr (T *data, int nrows, int ncols, int ldim, int location)
 Free the current matrix, and point the matrix to data. More...
 
int SetupPtr (const DenseMatrixClass< T > &mat_in, int row_start, int col_start, int num_rows, int num_cols)
 Free the current matrix, and point the matrix to a submatrix of another matrix. More...
 
int SubMatrix (int row_start, int col_start, int num_rows, int num_cols, int location, DenseMatrixClass< T > &mat_out)
 Copy data to extract a submatrix of the current matrix. More...
 
T & operator() (int row, int col)
 Get the reference of a value in the matrix based on the index. More...
 
virtual int Clear ()
 Free the current matrix. More...
 
virtual int GetDataLocation () const
 Get the data location of the matrix. More...
 
virtual int GetNumRowsLocal () const
 Get the local number of rows of the matrix. More...
 
virtual int GetNumColsLocal () const
 Get the local number of columns of the matrix. More...
 
virtual long int GetNumNonzeros () const
 Get the number of nonzeros in this matrix. More...
 
T * GetData () const
 Get the data pointer of the matrix. More...
 
SequentialVectorClass< T > & GetDataVector ()
 Get the reference to the data vector. More...
 
const SequentialVectorClass< T > & GetDataVector () const
 Get the reference to the data vector. More...
 
int GetLeadingDimension () const
 Get the leading dimension of the matrix. More...
 
bool IsHoldingData () const
 Check if the matrix holding its own data. More...
 
virtual int Eye ()
 Create an indentity matrix. More...
 
int Rand ()
 Create an random matrix, real value in between (0, 1), complex value real and imag part in between (0, 1). More...
 
virtual int Fill (const T &v)
 Fill the matrix with constant value. More...
 
virtual int MoveData (const int &location)
 Move the data to another memory location. More...
 
virtual int Scale (const T &alpha)
 Scale the current . More...
 
virtual int MatVec (char trans, const T &alpha, const VectorClass< T > &x, const T &beta, VectorClass< T > &y)
 In place dense 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...
 
int MatMat (const T &alpha, const DenseMatrixClass< T > &A, char transa, const DenseMatrixClass< T > &B, char transb, const T &beta)
 Dense Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C where C is this matrix. More...
 
int Invert ()
 Invert the matrix. More...
 
int InvertUpperTriangular ()
 Invert the matrix. Only works when current matrix is upper triangular. More...
 
int Hess (DenseMatrixClass< T > &Q)
 Transform this matrix A into hessenberg matrix Q^HAQ = Hess. More...
 
int Hess (DenseMatrixClass< T > &Q, int start, int end)
 Transform this matrix A into hessenberg matrix Q^HAQ = Hess. More...
 
int HessSchur (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &wr, SequentialVectorClass< T > &wi)
 Transform this Hess matrix A into the schur form matrix U = Q^HAQ. More...
 
int HessSchur (DenseMatrixClass< T > &Q, int start, int end, SequentialVectorClass< T > &wr, SequentialVectorClass< T > &wi)
 Transform this Hess matrix A into the schur form matrix U = Q^HAQ. More...
 
int HessSchur (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &w)
 Transform this matrix A into the schur form matrix U = Q^HAQ. More...
 
int HessSchur (DenseMatrixClass< T > &Q, int start, int end, SequentialVectorClass< T > &w)
 Transform this matrix A into the schur form matrix U = Q^HAQ. More...
 
int Schur (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &wr, SequentialVectorClass< T > &wi)
 Transform this matrix A (real) into the schur form matrix U = Q^HAQ. More...
 
int Schur (DenseMatrixClass< T > &Q, int start, int end, SequentialVectorClass< T > &wr, SequentialVectorClass< T > &wi)
 Transform this matrix A (real) into the schur form matrix U = Q^HAQ. More...
 
int Schur (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &w)
 Transform this matrix A (complex) into the schur form matrix U = Q^HAQ. More...
 
int Schur (DenseMatrixClass< T > &Q, int start, int end, SequentialVectorClass< T > &w)
 Transform this matrix A (complex) into the schur form matrix U = Q^HAQ. More...
 
int HessEig (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &wr, SequentialVectorClass< T > &wi)
 Compute the Eigen decomposition of real dense hessenberg matrix A, AQ = QD. A is this matrix and is not modified. More...
 
int HessEig (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &w)
 Compute the Eigen decomposition of complex dense hessenberg matrix A, AQ = QD. A is this matrix and is not modified. More...
 
int Eig (DenseMatrixClass< T > &QS, DenseMatrixClass< T > &QE, SequentialVectorClass< T > &wr, SequentialVectorClass< T > &wi)
 Compute the Schur decomposition of real dense matrix A, U = QS^HAQS, and the Eigen decomposition UQE = QED. A is this matrix and on return be set to U. More...
 
int Eig (DenseMatrixClass< T > &QS, DenseMatrixClass< T > &QE, SequentialVectorClass< T > &w)
 Compute the Schur decomposition of complex dense matrix A, U = QS^HAQS, and the Eigen decomposition UQE = QED. A is this matrix and on return be set to U. More...
 
int OrdSchur (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &wr, SequentialVectorClass< T > &wi, vector_int &select)
 Reorder the this real schur decomposition, puch selected eigenvalues to the leading part. More...
 
int OrdSchur (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &w, vector_int &select)
 Reorder the this complex schur decomposition, puch selected eigenvalues to the leading part. More...
 
int OrdSchurClusters (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &wr, SequentialVectorClass< T > &wi, vector_int &clusters)
 Reorder the this real schur decomposition, puch selected eigenvalues to the leading part. More...
 
int OrdSchurClusters (DenseMatrixClass< T > &Q, SequentialVectorClass< T > &w, vector_int &clusters)
 Reorder the this complex schur decomposition, puch selected eigenvalues to the leading part. More...
 
int Plot (int conditiona, int conditionb, int width)
 Plot the dense matrix to the terminal output. Function for testing purpose. More...
 
- Public Member Functions inherited from pargemslr::MatrixClass< T >
 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 ~MatrixClass ()
 The destructor of MatrixClass. More...
 
PrecisionEnum GetPrecision () const
 Return the precision of the matrix. More...
 

Detailed Description

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

Class of dense matrix.

Constructor & Destructor Documentation

◆ DenseMatrixClass() [1/3]

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

The constructor of DenseMatrixClass. The default memory location is the host memory.

◆ DenseMatrixClass() [2/3]

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

The copy constructor of DenseMatrixClass.

Parameters
[in]matThe target matrix.

◆ DenseMatrixClass() [3/3]

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

The move constructor of DenseMatrixClass.

Parameters
[in]matThe target matrix.

◆ ~DenseMatrixClass()

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

The destructor of DenseMatrixClass. Simply a call to the free function.

Member Function Documentation

◆ Clear()

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

Free the current matrix.

Returns
Return error message.

Reimplemented from pargemslr::MatrixClass< T >.

◆ Eig() [1/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::Eig ( DenseMatrixClass< T > &  QS,
DenseMatrixClass< T > &  QE,
SequentialVectorClass< T > &  w 
)

Compute the Schur decomposition of complex dense matrix A, U = QS^HAQS, and the Eigen decomposition UQE = QED. A is this matrix and on return be set to U.

Parameters
[out]QSthe SQ matrix U = QS^HAQS.
[out]QEthe QE matrix UQE = QED.
[in,out]wArray of eigenvalues.
Returns
Return error message.

◆ Eig() [2/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::Eig ( DenseMatrixClass< T > &  QS,
DenseMatrixClass< T > &  QE,
SequentialVectorClass< T > &  wr,
SequentialVectorClass< T > &  wi 
)

Compute the Schur decomposition of real dense matrix A, U = QS^HAQS, and the Eigen decomposition UQE = QED. A is this matrix and on return be set to U.

Parameters
[out]QSthe SQ matrix U = QS^HAQS.
[out]QEthe QE matrix UQE = QED.
[in,out]wrArray of real part of eigenvalues.
[in]wiArray of imag part of eigenvalues.
Returns
Return error message.

◆ Eye()

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

Create an indentity matrix.

Returns
Return error message.

Reimplemented from pargemslr::MatrixClass< T >.

◆ Fill()

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

Fill the matrix with constant value.

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

Reimplemented from pargemslr::MatrixClass< T >.

◆ GetData()

template<typename T >
template complexd * pargemslr::DenseMatrixClass< T >::GetData ( ) const

Get the data pointer of the matrix.

Returns
Return the data pointer.

◆ GetDataLocation()

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

Get the data location of the matrix.

Returns
Return the data location of the matrix.

Reimplemented from pargemslr::MatrixClass< T >.

◆ GetDataVector() [1/2]

template<typename T >
template SequentialVectorClass< complexd > & pargemslr::DenseMatrixClass< T >::GetDataVector ( )

Get the reference to the data vector.

Returns
Return the reference to the data vector.

◆ GetDataVector() [2/2]

template<typename T >
template const SequentialVectorClass< complexd > & pargemslr::DenseMatrixClass< T >::GetDataVector ( ) const

Get the reference to the data vector.

Returns
Return the reference to the data vector.

◆ GetLeadingDimension()

template<typename T >
template int pargemslr::DenseMatrixClass< T >::GetLeadingDimension ( ) const

Get the leading dimension of the matrix.

Returns
Return the leading dimension of the matrix.

◆ GetNumColsLocal()

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

Get the local number of columns of the matrix.

Returns
Return the local number of columns of the matrix.

Implements pargemslr::MatrixClass< T >.

◆ GetNumNonzeros()

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

Get the number of nonzeros in this matrix.

Returns
Return the number of nonzeros of the matrix.

Reimplemented from pargemslr::MatrixClass< T >.

◆ GetNumRowsLocal()

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

Get the local number of rows of the matrix.

Returns
Return the local number of rows of the matrix.

Implements pargemslr::MatrixClass< T >.

◆ Hess() [1/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::Hess ( DenseMatrixClass< T > &  Q)

Transform this matrix A into hessenberg matrix Q^HAQ = Hess.

Parameters
[out]Qthe Q matrix.
Returns
Return error message.

◆ Hess() [2/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::Hess ( DenseMatrixClass< T > &  Q,
int  start,
int  end 
)

Transform this matrix A into hessenberg matrix Q^HAQ = Hess.

Parameters
[out]Qthe Q matrix.
[in]start
[in]endOutside [start, end) the matrix is already hessenberg.
Returns
Return error message.

◆ HessEig() [1/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::HessEig ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  w 
)

Compute the Eigen decomposition of complex dense hessenberg matrix A, AQ = QD. A is this matrix and is not modified.

Parameters
[out]Qthe Q matrix AQ = QD.
[in,out]wArray of eigenvalues.
Returns
Return error message.

◆ HessEig() [2/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::HessEig ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  wr,
SequentialVectorClass< T > &  wi 
)

Compute the Eigen decomposition of real dense hessenberg matrix A, AQ = QD. A is this matrix and is not modified.

Parameters
[out]Qthe Q matrix AQ = QD.
[in,out]wrArray of real part of eigenvalues.
[in]wiArray of imag part of eigenvalues.
Returns
Return error message.

◆ HessSchur() [1/4]

template<typename T >
int pargemslr::DenseMatrixClass< T >::HessSchur ( DenseMatrixClass< T > &  Q,
int  start,
int  end,
SequentialVectorClass< T > &  w 
)

Transform this matrix A into the schur form matrix U = Q^HAQ.
Only works if the current matrix is a hessenberg matrix, otherwise please call the Schur function.

Parameters
[out]QThe Q matrix.
[in]start
[in]endOutside [start, end) the matrix is already upper triangular.
[out]wThe vector of eignelvalues.
Returns
Return error message.

◆ HessSchur() [2/4]

template<typename T >
int pargemslr::DenseMatrixClass< T >::HessSchur ( DenseMatrixClass< T > &  Q,
int  start,
int  end,
SequentialVectorClass< T > &  wr,
SequentialVectorClass< T > &  wi 
)

Transform this Hess matrix A into the schur form matrix U = Q^HAQ.
Only works if the current matrix is a hessenberg matrix, otherwise please call the Schur function.

Parameters
[out]QThe Q matrix.
[in]start
[in]endOutside [start, end) the matrix is already upper triangular.
[out]wrThe vector of the real part of the eignelvalues.
[out]wiThe vector of the imag part of the eignelvalues.
Returns
Return error message.

◆ HessSchur() [3/4]

template<typename T >
int pargemslr::DenseMatrixClass< T >::HessSchur ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  w 
)

Transform this matrix A into the schur form matrix U = Q^HAQ.
Only works if the current matrix is a hessenberg matrix, otherwise please call the Schur function.

Parameters
[out]QThe Q matrix.
[out]wThe vector of eignelvalues.
Returns
Return error message.

◆ HessSchur() [4/4]

template<typename T >
int pargemslr::DenseMatrixClass< T >::HessSchur ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  wr,
SequentialVectorClass< T > &  wi 
)

Transform this Hess matrix A into the schur form matrix U = Q^HAQ.
Only works if the current matrix is a hessenberg matrix, otherwise please call the Schur function.

Parameters
[out]QThe Q matrix.
[out]wrThe vector of the real part of the eignelvalues.
[out]wiThe vector of the imag part of the eignelvalues.
Returns
Return error message.

◆ Invert()

template<typename T >
template int pargemslr::DenseMatrixClass< T >::Invert ( )

Invert the matrix. Only work on the host.

Returns
Return error message.

◆ InvertUpperTriangular()

template<typename T >
template int pargemslr::DenseMatrixClass< T >::InvertUpperTriangular ( )

Invert the matrix. Only works when current matrix is upper triangular. Only work on the host.

Returns
Return error message.

◆ IsHoldingData()

template<typename T >
template bool pargemslr::DenseMatrixClass< T >::IsHoldingData ( ) const

Check if the matrix holding its own data.

Returns
Return true if matrix holding data.

◆ MatMat()

template<typename T >
template int pargemslr::DenseMatrixClass< T >::MatMat ( const T &  alpha,
const DenseMatrixClass< T > &  A,
char  transa,
const DenseMatrixClass< T > &  B,
char  transb,
const T &  beta 
)

Dense Matrix-Matrix multiplication, C = alpha*transa(A)*transb(B)+beta*C where C is this matrix.
If C is not pre-allocated, C will be allocated such that it has the same location as A.

Parameters
[in]alphaThe alpha value.
[in]AThe first dense matrix.
[in]transaWhether we transpose A or not.
[in]betaThe beta value.
[in]BThe second dense matrix.
[in]transbWhether we transpose B or not.
Returns
Return error message.

◆ MatVec() [1/2]

template<typename T >
int pargemslr::DenseMatrixClass< 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 from pargemslr::MatrixClass< T >.

◆ MatVec() [2/2]

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

In place dense 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 left vector.
[in]betaThe beta value.
[in,out]yThe product vector.
Returns
return GEMSLR_SUCESS or error information.

Reimplemented from pargemslr::MatrixClass< T >.

◆ MoveData()

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

Move the data to another memory location.

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

Reimplemented from pargemslr::MatrixClass< T >.

◆ operator()()

template<typename T >
template complexd & pargemslr::DenseMatrixClass< T >::operator() ( int  row,
int  col 
)

Get the reference of a value in the matrix based on the index.

Parameters
[in]rowThe row index.
[in]colThe column index.
Returns
return the reference to the target value.

◆ operator=() [1/2]

template<typename T >
DenseMatrixClass< T > & pargemslr::DenseMatrixClass< T >::operator= ( const DenseMatrixClass< T > &  mat)

The = operator of DenseMatrixClass.

Parameters
[in]matThe target matrix.
Returns
Return the matrix.

◆ operator=() [2/2]

template<typename T >
DenseMatrixClass< T > & pargemslr::DenseMatrixClass< T >::operator= ( DenseMatrixClass< T > &&  mat)

The = operator of DenseMatrixClass.

Parameters
[in]matThe target matrix.
Returns
Return the matrix.

◆ OrdSchur() [1/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::OrdSchur ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  w,
vector_int select 
)

Reorder the this complex schur decomposition, puch selected eigenvalues to the leading part.

Parameters
[in,out]QThis matrix and Q are the original schur decomposition, on return, the new decomposition.
[out]wArray of eigenvalues.
[in]selectEigenvalues corresponting to positive entries in select vector will be put in the leading part.
Returns
Return error message.

◆ OrdSchur() [2/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::OrdSchur ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  wr,
SequentialVectorClass< T > &  wi,
vector_int select 
)

Reorder the this real schur decomposition, puch selected eigenvalues to the leading part. A 2x2 block on the diagonal of Q need to be in the same cluster.

Parameters
[in,out]QThis matrix and Q are the original schur decomposition, on return, the new decomposition.
[out]wrArray of real part of eigenvalues.
[out]wiArray of imag part of eigenvalues.
[in]selectEigenvalues corresponting to positive entries in select vector will be put in the leading part.
Returns
Return error message.

◆ OrdSchurClusters() [1/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::OrdSchurClusters ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  w,
vector_int clusters 
)

Reorder the this complex schur decomposition, puch selected eigenvalues to the leading part.

Parameters
[in,out]QThis matrix and Q are the original schur decomposition, on return, the new decomposition.
[out]wArray of eigenvalues.
[in]clustersEigenvalues corresponding to positive entries in the clusters vector will be put in the leading part.
The order of those eigenvalues are based on the values in the cluster vector in descending order.
Returns
Return error message.

◆ OrdSchurClusters() [2/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::OrdSchurClusters ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  wr,
SequentialVectorClass< T > &  wi,
vector_int clusters 
)

Reorder the this real schur decomposition, puch selected eigenvalues to the leading part. A 2x2 block on the diagonal of Q need to be in the same cluster.

Parameters
[in,out]QThis matrix and Q are the original schur decomposition, on return, the new decomposition.
[out]wrArray of real part of eigenvalues.
[out]wiArray of imag part of eigenvalues.
[in]clustersEigenvalues corresponding to positive entries in the clusters vector will be put in the leading part.
The order of those eigenvalues are based on the values in the cluster vector in descending order.
Returns
Return error message.

◆ Plot()

template<typename T >
template int pargemslr::DenseMatrixClass< T >::Plot ( int  conditiona,
int  conditionb,
int  width 
)

Plot the dense matrix to the terminal output. Function for testing purpose.

Parameters
[in]conditionaFirst condition.
[in]conditionbSecend condition, only spy when conditiona == conditionb.
[in]widthThe plot width.
Returns
Return error message.

◆ Rand()

template<typename T >
template int pargemslr::DenseMatrixClass< T >::Rand ( )

Create an random matrix, real value in between (0, 1), complex value real and imag part in between (0, 1).

Returns
Return error message.

◆ Scale()

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

Scale the current .

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

Reimplemented from pargemslr::MatrixClass< T >.

◆ Schur() [1/4]

template<typename T >
int pargemslr::DenseMatrixClass< T >::Schur ( DenseMatrixClass< T > &  Q,
int  start,
int  end,
SequentialVectorClass< T > &  w 
)

Transform this matrix A (complex) into the schur form matrix U = Q^HAQ.

Parameters
[out]QThe Q matrix.
[in]start
[in]endOutside [start, end) the matrix is already upper triangular.
[out]wThe vector of eignelvalues.
Returns
Return error message.

◆ Schur() [2/4]

template<typename T >
int pargemslr::DenseMatrixClass< T >::Schur ( DenseMatrixClass< T > &  Q,
int  start,
int  end,
SequentialVectorClass< T > &  wr,
SequentialVectorClass< T > &  wi 
)

Transform this matrix A (real) into the schur form matrix U = Q^HAQ.
Only works if the current matrix is a hessenberg matrix, otherwise please call the Schur function.

Parameters
[out]QThe Q matrix.
[in]start
[in]endOutside [start, end) the matrix is already hessenberg.
[out]wrThe vector of the real part of the eignelvalues.
[out]wiThe vector of the imag part of the eignelvalues.
Returns
Return error message.

◆ Schur() [3/4]

template<typename T >
int pargemslr::DenseMatrixClass< T >::Schur ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  w 
)

Transform this matrix A (complex) into the schur form matrix U = Q^HAQ.

Parameters
[out]QThe Q matrix.
[out]wThe vector of eignelvalues.
Returns
Return error message.

◆ Schur() [4/4]

template<typename T >
int pargemslr::DenseMatrixClass< T >::Schur ( DenseMatrixClass< T > &  Q,
SequentialVectorClass< T > &  wr,
SequentialVectorClass< T > &  wi 
)

Transform this matrix A (real) into the schur form matrix U = Q^HAQ.
Only works if the current matrix is a hessenberg matrix, otherwise please call the Schur function.

Parameters
[out]QThe Q matrix.
[out]wrThe vector of the real part of the eignelvalues.
[out]wiThe vector of the imag part of the eignelvalues.
Returns
Return error message.

◆ Setup() [1/3]

template<typename T >
template int pargemslr::DenseMatrixClass< T >::Setup ( int  nrows,
int  ncols 
)

Free the current matrix, and malloc memory to create a new matrix on the host. The memory location is controlled by _location.
The _ldim is set to be equal to nrow.

Parameters
[in]nrowsThe number of rows.
[in]ncolsThe number fo columns.
Returns
Return error message.

◆ Setup() [2/3]

template<typename T >
template int pargemslr::DenseMatrixClass< T >::Setup ( int  nrows,
int  ncols,
bool  setzero 
)

Free the current matrix, and malloc memory to create a new matrix. The memory location is controlled by _location.
The _ldim is set to be equal to nrow.

Parameters
[in]nrowsThe number of rows.
[in]ncolsThe number fo columns.
[in]setzeroSet to true to use calloc instead of malloc.
Returns
Return error message.

◆ Setup() [3/3]

template<typename T >
template int pargemslr::DenseMatrixClass< T >::Setup ( int  nrows,
int  ncols,
int  location,
bool  setzero 
)

Free the current matrix, and malloc memory to create a new matrix. The memory location is controlled by _location.
The _ldim is set to be equal to nrow.

Parameters
[in]nrowsThe number of rows.
[in]ncolsThe number fo columns.
[in]locationThe location of the data.
[in]setzeroSet to true to use calloc instead of malloc.
Returns
Return error message.

◆ SetupPtr() [1/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::SetupPtr ( const DenseMatrixClass< T > &  mat_in,
int  row_start,
int  col_start,
int  num_rows,
int  num_cols 
)

Free the current matrix, and point the matrix to a submatrix of another matrix.

Parameters
[in]mat_inThe matrix holding data.
[in]row_startThe starting row of that submatrix.
[in]col_startThe starting column of that submatrix.
[in]num_rowsThe number of rows.
[in]num_colsThe number fo cols.
Returns
Return error message.

◆ SetupPtr() [2/2]

template<typename T >
int pargemslr::DenseMatrixClass< T >::SetupPtr ( T *  data,
int  nrows,
int  ncols,
int  ldim,
int  location 
)

Free the current matrix, and point the matrix to data.

Parameters
[in]dataPointer to the data.
[in]nrowsThe number of rows.
[in]ncolsThe number fo columns.
[in]ldimThe leading dimension of the matrix.
[in]locationThe location of the data.
Returns
Return error message.

◆ SubMatrix()

template<typename T >
template int pargemslr::DenseMatrixClass< T >::SubMatrix ( int  row_start,
int  col_start,
int  num_rows,
int  num_cols,
int  location,
DenseMatrixClass< T > &  mat_out 
)

Copy data to extract a submatrix of the current matrix.

Parameters
[in]row_startThe starting row of that submatrix.
[in]col_startThe starting column of that submatrix.
[in]num_rowsThe number of rows.
[in]num_colsThe number fo cols.
[in]locationThe location of the submatrix.
[in]mat_outThe submatrix.
Returns
Return error message.

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