![]() |
mptensor
v0.3.0
Parallel Library for Tensor Network Methods
|
Inteface of Matrix class. More...
#include <matrix_interface.hpp>
Public Types | |
| typedef C | value_type |
double or complex More... | |
| typedef int | comm_type |
Set MPI_Comm for MPI programm. More... | |
Public Member Functions | |
| Matrix () | |
| Constructor of a size-zero matrix. More... | |
| Matrix (const comm_type &comm) | |
| Constructor of a size-zero matrix. More... | |
| Matrix (size_t n_row, size_t n_col) | |
| Constructor of a (n_row, n_col) matrix. More... | |
| Matrix (const comm_type &comm, size_t n_row, size_t n_col) | |
| Constructor of a (n_row, n_col) matrix. More... | |
| void | init (size_t n_row, size_t n_col) |
| const comm_type & | get_comm () const |
| Return the MPI communicator. More... | |
| int | get_comm_size () const |
| Return the size of the MPI communicator. More... | |
| int | get_comm_rank () const |
| Return the MPI rank. More... | |
| void | print_info (std::ostream &) const |
| const C & | operator[] (size_t i) const |
| Const array subscript operator. More... | |
| C & | operator[] (size_t i) |
| Array subscript operator. More... | |
| const C * | head () const |
| C * | head () |
| size_t | local_size () const |
| Return the number of elements in this process. More... | |
| void | global_index (size_t i, size_t &g_row, size_t &g_col) const |
| bool | local_index (size_t g_row, size_t g_col, size_t &i) const |
| void | local_position (size_t g_row, size_t g_col, int &comm_rank, size_t &lindex) const |
| size_t | local_row_size () const |
| size_t | local_col_size () const |
| size_t | local_row_index (size_t lindex) const |
| size_t | local_col_index (size_t lindex) const |
| size_t | global_row_index (size_t lindex_row) const |
| size_t | global_col_index (size_t lindex_col) const |
| Matrix & | operator+= (const Matrix &rhs) |
| Matrix & | operator-= (const Matrix &rhs) |
| Matrix & | operator*= (C rhs) |
| Matrix & | operator/= (C rhs) |
| template<typename UnaryOperation > | |
| Matrix & | map (UnaryOperation op) |
| std::vector< C > | flatten () |
| Return the flattened vector. More... | |
| void | barrier () const |
| Wrapper of MPI_Barrier. More... | |
| C | allreduce_sum (C value) const |
| Return the summation of a scalar. Every processes returns the same value. More... | |
| template<typename D > | |
| void | bcast (D *buffer, int count, int root) const |
| Wrapper of MPI_Bcast. More... | |
| void | prep_local_to_global () const |
| Preprocess for fast conversion from local index to global one. More... | |
| void | prep_global_to_local () const |
| Preprocess for fast conversion from local index to global one. More... | |
| void | save_index (const std::string &filename) const |
Static Public Attributes | |
| constexpr static size_t | matrix_type_tag = MATRIX_TYPE_TAG_INTERFACE |
| constexpr static char * | matrix_type_name = (char*)"Interface" |
Related Functions | |
(Note that these are not member functions.) | |
| template<typename C > | |
| int | matrix_eigh (Matrix< C > &a, std::vector< double > &s) |
| Eigenvalues of a hermite (symmetric) matrix. More... | |
Inteface of Matrix class.
This class shows the list of members, which should be implemented in a Matrix class.
| C | type of elements (double or complex). |
| typedef int mptensor::matrix_interface::Matrix< C >::comm_type |
Set MPI_Comm for MPI programm.
| typedef C mptensor::matrix_interface::Matrix< C >::value_type |
double or complex
| mptensor::matrix_interface::Matrix< C >::Matrix< C > | ( | ) |
Constructor of a size-zero matrix.
|
explicit |
Constructor of a size-zero matrix.
| [in] | comm | MPI communicator. |
| mptensor::matrix_interface::Matrix< C >::Matrix< C > | ( | size_t | n_row, |
| size_t | n_col | ||
| ) |
Constructor of a (n_row, n_col) matrix.
| [in] | n_row | size of row. |
| [in] | n_col | size of column. |
| mptensor::matrix_interface::Matrix< C >::Matrix< C > | ( | const comm_type & | comm, |
| size_t | n_row, | ||
| size_t | n_col | ||
| ) |
Constructor of a (n_row, n_col) matrix.
| [in] | comm | MPI communicator. |
| [in] | n_row | size of row. |
| [in] | n_col | size of column. |
| C mptensor::matrix_interface::Matrix< C >::allreduce_sum | ( | C | value | ) | const |
Return the summation of a scalar. Every processes returns the same value.
| void mptensor::matrix_interface::Matrix< C >::barrier | ( | ) | const |
Wrapper of MPI_Barrier.
| void mptensor::matrix_interface::Matrix< C >::bcast | ( | D * | buffer, |
| int | count, | ||
| int | root | ||
| ) | const |
Wrapper of MPI_Bcast.
| [in] | buffer | Starting address of buffer. |
| [in] | count | Number of entries in buffer. |
| [in] | root | Rank of broadcast root. |
| std::vector< C > mptensor::matrix_interface::Matrix< C >::flatten | ( | ) |
Return the flattened vector.
| const Matrix< C >::comm_type & mptensor::matrix_interface::Matrix< C >::get_comm | ( | ) | const |
Return the MPI communicator.
| int mptensor::matrix_interface::Matrix< C >::get_comm_rank | ( | ) | const |
Return the MPI rank.
| int mptensor::matrix_interface::Matrix< C >::get_comm_size | ( | ) | const |
Return the size of the MPI communicator.
| size_t mptensor::matrix_interface::Matrix< C >::global_col_index | ( | size_t | lindex_col | ) | const |
| void mptensor::matrix_interface::Matrix< C >::global_index | ( | size_t | i, |
| size_t & | g_row, | ||
| size_t & | g_col | ||
| ) | const |
| size_t mptensor::matrix_interface::Matrix< C >::global_row_index | ( | size_t | lindex_row | ) | const |
| C* mptensor::matrix_interface::Matrix< C >::head | ( | ) |
| const C* mptensor::matrix_interface::Matrix< C >::head | ( | ) | const |
| void mptensor::matrix_interface::Matrix< C >::init | ( | size_t | n_row, |
| size_t | n_col | ||
| ) |
| size_t mptensor::matrix_interface::Matrix< C >::local_col_index | ( | size_t | lindex | ) | const |
| size_t mptensor::matrix_interface::Matrix< C >::local_col_size | ( | ) | const |
| bool mptensor::matrix_interface::Matrix< C >::local_index | ( | size_t | g_row, |
| size_t | g_col, | ||
| size_t & | i | ||
| ) | const |
| void mptensor::matrix_interface::Matrix< C >::local_position | ( | size_t | g_row, |
| size_t | g_col, | ||
| int & | comm_rank, | ||
| size_t & | lindex | ||
| ) | const |
| size_t mptensor::matrix_interface::Matrix< C >::local_row_index | ( | size_t | lindex | ) | const |
| size_t mptensor::matrix_interface::Matrix< C >::local_row_size | ( | ) | const |
| size_t mptensor::matrix_interface::Matrix< C >::local_size | ( | ) | const |
Return the number of elements in this process.
| Matrix& mptensor::matrix_interface::Matrix< C >::map | ( | UnaryOperation | op | ) |
| Matrix& mptensor::matrix_interface::Matrix< C >::operator*= | ( | C | rhs | ) |
| Matrix& mptensor::matrix_interface::Matrix< C >::operator+= | ( | const Matrix< C > & | rhs | ) |
| Matrix& mptensor::matrix_interface::Matrix< C >::operator-= | ( | const Matrix< C > & | rhs | ) |
| Matrix& mptensor::matrix_interface::Matrix< C >::operator/= | ( | C | rhs | ) |
| C & mptensor::matrix_interface::Matrix< C >::operator[] | ( | size_t | i | ) |
Array subscript operator.
| const C & mptensor::matrix_interface::Matrix< C >::operator[] | ( | size_t | i | ) | const |
Const array subscript operator.
| void mptensor::matrix_interface::Matrix< C >::prep_global_to_local | ( | ) | const |
Preprocess for fast conversion from local index to global one.
| void mptensor::matrix_interface::Matrix< C >::prep_local_to_global | ( | ) | const |
Preprocess for fast conversion from local index to global one.
| void mptensor::matrix_interface::Matrix< C >::print_info | ( | std::ostream & | ) | const |
| void mptensor::matrix_interface::Matrix< C >::save_index | ( | const std::string & | filename | ) | const |
|
related |
Eigenvalues of a hermite (symmetric) matrix.
| [in] | a | The hermite or symmetric matrix. On exit, it may be destroyed. |
| [out] | s | The eigenvalues in ascending order. |
|
staticconstexpr |
|
staticconstexpr |