ChaseMpiMatrices¶
-
template<class
T
>
classchase::mpi
::
ChaseMpiMatrices
¶ A class to setup the buffers of matrices and vectors which will be used by ChaseMpi.
This class provides three constructors:
Allocating the buffers for ChaseMpi without MPI support.
Allocating the buffers for ChaseMpi with MPI support.
Allocating the buffers for ChaseMpi with MPI support in which the buffer to store the matrix to be diagonalised is externally allocated and provided by users.
- Template Parameters
T
: the scalar type used for the application. ChASE is templated for real and complex scalar with both Single Precision and Double Precision, thusT
can be one offloat
,double
,std::complex<float>
andstd::complex<double>
.
Public Functions
-
ChaseMpiMatrices
(std::size_t N, std::size_t max_block, T *V1 = nullptr, Base<T> *ritzv = nullptr, T *H = nullptr, T *V2 = nullptr, Base<T> *resid = nullptr)¶ A constructor of ChaseMpiMatrices for Non-MPI case which allocates everything required.
The private members of this class are initialized by the parameters of this constructor.
For
H__
andH_
, they are of sizeN * N
.For
V1__
,V1_
,V2__
andV1_
, they are of sizeN * max_block
.For
ritzv__
,ritzv_
,resid__
andresid_
, they are of sizemax_block
.- Parameters
N
: size of the square matrix defining the eigenproblem.max_block
: Maximum column number of matrixV1_
andV2_
. It equals tonev_ + nex_
.V1
: a pointer to the bufferV1_
.ritz
: a pointer to the bufferritz_
.H
: a pointer to the bufferH_
.V2
: a pointer to the bufferV2_
.resid
: a pointer to the bufferresid_
.
-
ChaseMpiMatrices
(MPI_Comm comm, std::size_t N, std::size_t m, std::size_t n, std::size_t max_block, T *V1 = nullptr, Base<T> *ritzv = nullptr, T *V2 = nullptr, Base<T> *resid = nullptr)¶ A constructor of ChaseMpiMatrices for MPI case which allocates everything necessary except
H_
.The private members of this class are initialized by the parameters of this constructor.
For
V1__
andV1_
, they are of sizem_ * max_block
.For
V2__
andV2_
, they are of sizen_ * max_block
.For
ritzv__
,ritzv_
,resid__
andresid_
, they are of sizemax_block
.H_
is allocated here of sizem_ * n_
m
andn
can be obtained through ChaseMpiProperties::get_m() and ChaseMpiProperties::get_n(), respecitvely.- Parameters
comm
: the working MPI communicator of ChASE.N
: size of the square matrix defining the eigenproblem.m
: row number ofH_
.m
can be obtained through ChaseMpiProperties::get_m()n
: column number ofH_
.n
can be obtained through ChaseMpiProperties::get_n()max_block
: Maximum column number of matrixV1_
andV2_
. It equals tonev_ + nex_
.V1
: a pointer to the bufferV1_
.ritz
: a pointer to the bufferritz_
.V2
: a pointer to the bufferV2_
.resid
: a pointer to the bufferresid_
.
-
ChaseMpiMatrices
(MPI_Comm comm, std::size_t N, std::size_t m, std::size_t n, std::size_t max_block, T *H, std::size_t ldh, T *V1 = nullptr, Base<T> *ritzv = nullptr, T *V2 = nullptr, Base<T> *resid = nullptr)¶ A constructor of ChaseMpiMatrices for MPI case which allocates everything necessary except
H_
.The private members of this class are initialized by the parameters of this constructor.
For
V1__
andV1_
, they are of sizem_ * max_block
.For
V2__
andV2_
, they are of sizen_ * max_block
.For
ritzv__
,ritzv_
,resid__
andresid_
, they are of sizemax_block
.H_
is allocated externally based the users, it is of sizeldh_ * n_
withldh_>=m_
.m
andn
can be obtained through ChaseMpiProperties::get_m() and ChaseMpiProperties::get_n(), respecitvely.- Parameters
comm
: the working MPI communicator of ChASE.N
: size of the square matrix defining the eigenproblem.m
: row number ofH_
.m
can be obtained through ChaseMpiProperties::get_m()n
: column number ofH_
.n
can be obtained through ChaseMpiProperties::get_n()max_block
: Maximum column number of matrixV1_
andV2_
. It equals tonev_ + nex_
.H
: the pointer to the user-provided buffer of matrix to be diagonalised.ldh
: The leading dimension of local part of Symmetric/Hermtian matrix on each MPI proc.V1
: a pointer to the bufferV1_
.ritz
: a pointer to the bufferritz_
.V2
: a pointer to the bufferV2_
.resid
: a pointer to the bufferresid_
.
-
T *
get_H
()¶ Return buffer stores the (local part if applicable) matrix A.
- Return
H_
, a private member of this class.
-
T *
get_V1
()¶ Return the buffer
V1_
which will be right-multiplied toA
during the process of ChASE.- Return
V1_
, a private member of this class.
-
T *
get_V2
()¶ Return the buffer
V2_
whose conjugate transpose will be left-multiplied toA
during the process of ChASE.- Return
V2_
, a private member of this class.
-
Base<T> *
get_Ritzv
()¶ Return the buffer which stores the computed Ritz values.
- Return
ritzv_
, a private member of this class.
-
Base<T> *
get_Resid
()¶ Return the buffer which stores the residual of computed Ritz pairs.
- Return
resid_
, a private member of this class.
-
std::size_t
get_ldh
()¶ Return leading dimension of local part of Symmetric/Hermtian matrix on each MPI proc.
- Return
ldh_
, a private member of this class.
Private Members
-
std::unique_ptr<T[]>
H__
¶ A smart pointer which manages the buffer of
H_
which stores (local part if applicable) matrixA
.
-
std::unique_ptr<T[]>
V1__
¶ A smart pointer which manages the buffer of
V1_
which will be right-multiplied toA
during the process of ChASE. The eigenvectors obtained will also stored inV1_
.
-
std::unique_ptr<T[]>
V2__
¶ A smart pointer which manages the buffer of
V2_
whose conjugate transpose will be left-multiplied toA
during the process of ChASE.
-
std::unique_ptr<Base<T>[]>
ritzv__
¶ A smart pointer which manages the buffer which stores the computed Ritz values.
-
std::unique_ptr<Base<T>[]>
resid__
¶ A smart pointer which manages the buffer which stores the residual of computed Ritz pairs.
-
T *
V1_
¶ The buffer of
V1_
which will be right-multiplied toA
during the process of ChASE. The eigenvectors obtained will also be stored inV_
.
-
T *
V2_
¶ The buffer of
V2_
whose conjugate transpose will be left-multiplied toA
during the process of ChASE.
-
std::size_t
ldh_
¶ The leading dimension of local part of Symmetric/Hermtian matrix on each MPI proc.