DDMat
This class is used to represent [nrows][ncols] Distributed Dense Matrix by a 1D vector. More…
#include "DDMat.h"
Public Functions
Name | |
---|---|
DDMat() Constructs an empty object. |
|
DDMat(const iReg nrows, const iReg ncols) Constructs the object. |
|
~DDMat() Deletes the object. |
|
void | overlap(iReg nrows, iReg ncols, rExt * coef) Fills object assigning pointer. |
void | assign_null() Assign null pointer. |
void | resize_DDMat(const iReg nrows, const iReg ncols) Resize the structure. |
void | copy_DDMat(DDMat & other) Copy members. |
DDMat & | operator=(DDMat & other) Copy operator. |
void | Redist(const type_MPI_iReg rank, const type_MPI_iReg size, const VEC< iGlo > & vec_part, const VEC< iGlo > & vec_iperm, DDMat & mat_AP) Redistributes the entries currently stored locally into this process to all the other process according to a partition generated by metis. The new partition is stored in the array part and every entry in part contains the id of the process it entry will belong to. |
void | LocalPermute(const bool Inverse_Flag, const VEC< iReg > & vec_perm_in, const VEC< iReg > & vec_iperm_in, DDMat & mat_AP) Performs a local permutation to the entries currently stored in this DDMat instance. |
iReg | get_nrows() Retrieve the number of rows. |
iReg | get_nrows() const |
iReg | get_ncols() Retrieve the number of columns. |
iReg | get_ncols() const |
rExt * | get_ptr_coef_data() Retrieve the pointer to the coef data. |
const rExt * | get_ptr_coef_data() const |
void | print_coef(const string &restrict filename) const Print coef. |
void | set_all_coef(const rExt input_value) Set all coef values. |
void | set_col_coef(const iReg input_icol, const rExt input_value) Set column coef values. |
void | Orthonorm(DDMat &restrict Ortho_Mat) Orthonormalize a matrix using the modified Gram-Schmidt process. |
void | MxM_dot(const rExt alpha, const rExt beta, const DDMat & B, DDMat & C, VEC< rExt > * vec_reduc =nullptr) const Computes the matrix by matrix product: |
void | Orthonorm_RLGS(DDMat * DDMat_reduc =nullptr) Orthonormalize a matrix using the Right-Looking Gram-Schmidt process which should be numerically equivalent to modified Gram-Schmidt. The matrix is orthonormalized in place. reduc is an optional argument. |
void | Allgather(DDMat &restrict MasterMat) Gathers all the DDMats from the other processes. |
Public Attributes
Name | |
---|---|
VEC< rExt > | coef Coefficients of the dense matrix. |
Detailed Description
class DDMat;
This class is used to represent [nrows][ncols] Distributed Dense Matrix by a 1D vector.
class DDMat.
Public Functions Documentation
function DDMat
inline DDMat()
Constructs an empty object.
function DDMat
DDMat(
const iReg nrows,
const iReg ncols
)
Constructs the object.
Parameters:
- nrows number of rows.
- ncols number of columns.
function ~DDMat
~DDMat()
Deletes the object.
function overlap
void overlap(
iReg nrows,
iReg ncols,
rExt * coef
)
Fills object assigning pointer.
function assign_null
void assign_null()
Assign null pointer.
function resize_DDMat
void resize_DDMat(
const iReg nrows,
const iReg ncols
)
Resize the structure.
Parameters:
- nrows number of rows.
- ncols number of columns.
function copy_DDMat
inline void copy_DDMat(
DDMat & other
)
Copy members.
function operator=
inline DDMat & operator=(
DDMat & other
)
Copy operator.
function Redist
void Redist(
const type_MPI_iReg rank,
const type_MPI_iReg size,
const VEC< iGlo > & vec_part,
const VEC< iGlo > & vec_iperm,
DDMat & mat_AP
)
Redistributes the entries currently stored locally into this process to all the other process according to a partition generated by metis. The new partition is stored in the array part and every entry in part contains the id of the process it entry will belong to.
function LocalPermute
void LocalPermute(
const bool Inverse_Flag,
const VEC< iReg > & vec_perm_in,
const VEC< iReg > & vec_iperm_in,
DDMat & mat_AP
)
Performs a local permutation to the entries currently stored in this DDMat instance.
function get_nrows
iReg get_nrows()
Retrieve the number of rows.
function get_nrows
iReg get_nrows() const
function get_ncols
iReg get_ncols()
Retrieve the number of columns.
function get_ncols
iReg get_ncols() const
function get_ptr_coef_data
rExt * get_ptr_coef_data()
Retrieve the pointer to the coef data.
function get_ptr_coef_data
const rExt * get_ptr_coef_data() const
function print_coef
void print_coef(
const string &__restrict__ filename
) const
Print coef.
Parameters:
- filename name of the output file.
function set_all_coef
void set_all_coef(
const rExt input_value
)
Set all coef values.
Parameters:
- input_value value to set.
function set_col_coef
void set_col_coef(
const iReg input_icol,
const rExt input_value
)
Set column coef values.
Parameters:
- input_icol column index to set.
- input_value value to set.
function Orthonorm
void Orthonorm(
DDMat &__restrict__ Ortho_Mat
)
Orthonormalize a matrix using the modified Gram-Schmidt process.
Parameters:
- Ortho_Mat Orthonormalized matrix.
function MxM_dot
void MxM_dot(
const rExt alpha,
const rExt beta,
const DDMat & B,
DDMat & C,
VEC< rExt > * vec_reduc =nullptr
) const
Computes the matrix by matrix product:
Parameters:
- alpha scalar factor to multily A and B.
- berta scalar factor to multily C.
- B matrix multiplied by this.
- C resulting matrix.
- vec_reduc optional reduction vector.
C = alpha*At*B + beta*C, with A = this
The scratch vector must be of size at least A.ncols*B.ncols*nthread
The same result is stored in each rank of the communicator
function Orthonorm_RLGS
void Orthonorm_RLGS(
DDMat * DDMat_reduc =nullptr
)
Orthonormalize a matrix using the Right-Looking Gram-Schmidt process which should be numerically equivalent to modified Gram-Schmidt. The matrix is orthonormalized in place. reduc is an optional argument.
Parameters:
- DDMat_reduc optional scratch DDMat used for reduction.
function Allgather
void Allgather(
DDMat &__restrict__ MasterMat
)
Gathers all the DDMats from the other processes.
Parameters:
- MasterMat master matrix.
Public Attributes Documentation
variable coef
VEC< rExt > coef;
Coefficients of the dense matrix.
Updated on 12 February 2021 at 11:59:50 CET