28 #ifndef _MATRIX_LAPACK_HPP_
29 #define _MATRIX_LAPACK_HPP_
35 #include "../complex.hpp"
67 const C*
head()
const;
71 void global_index(
size_t i,
size_t& g_row,
size_t& g_col)
const;
72 bool local_index(
size_t g_row,
size_t g_col,
size_t& i)
const;
74 size_t& lindex)
const;
88 template <
typename UnaryOperation>
96 void bcast(D* buffer,
int count,
int root)
const;
116 template <
typename C>
118 const std::vector<size_t>& local_position,
120 template <
typename C>
122 const std::vector<int>& dest_rank,
123 const std::vector<size_t>& local_position,
125 template <
typename C>
127 const std::vector<size_t>& local_position,
130 template <
typename C>
133 template <
typename C>
135 template <
typename C>
139 template <
typename C>
142 template <
typename C>
146 template <
typename C>
149 template <
typename C>
152 template <
typename C>
155 template <
typename C>
158 template <
typename C>
162 template <
typename C>
165 template <
typename C>
168 template <
typename C>
171 template <
typename C>
173 template <
typename C>
Non-distributed matrix using LAPACK.
Definition: matrix_lapack.hpp:44
void print_info(std::ostream &) const
Definition: matrix_lapack_impl.hpp:213
size_t global_col_index(size_t lindex_col) const
Definition: matrix_lapack_impl.hpp:200
int n_row() const
Definition: matrix_lapack_impl.hpp:137
int get_comm_size() const
Always returns 1.
Definition: matrix_lapack_impl.hpp:126
Matrix & operator/=(C rhs)
Definition: matrix_lapack_impl.hpp:238
size_t local_row_index(size_t lindex) const
Definition: matrix_lapack_impl.hpp:185
C value_type
Definition: matrix_lapack.hpp:46
Matrix & operator*=(C rhs)
Definition: matrix_lapack_impl.hpp:232
void save_index(const std::string &filename) const
Definition: matrix_lapack_impl.hpp:300
Matrix & operator+=(const Matrix &rhs)
Definition: matrix_lapack_impl.hpp:218
std::vector< C > flatten()
Definition: matrix_lapack_impl.hpp:267
constexpr static char * matrix_type_name
Definition: matrix_lapack.hpp:50
size_t local_size() const
Definition: matrix_lapack_impl.hpp:114
int get_comm_rank() const
Always returns 0.
Definition: matrix_lapack_impl.hpp:132
const comm_type & get_comm() const
Always returns 0.
Definition: matrix_lapack_impl.hpp:120
const Matrix transpose()
Definition: matrix_lapack_impl.hpp:251
Matrix & operator-=(const Matrix &rhs)
Definition: matrix_lapack_impl.hpp:225
Matrix()
Default constructor.
Definition: matrix_lapack_impl.hpp:58
void prep_local_to_global() const
Do nothing.
Definition: matrix_lapack_impl.hpp:289
size_t global_row_index(size_t lindex_row) const
Definition: matrix_lapack_impl.hpp:195
void global_index(size_t i, size_t &g_row, size_t &g_col) const
Definition: matrix_lapack_impl.hpp:147
const C & operator[](size_t i) const
Definition: matrix_lapack_impl.hpp:94
void init(size_t n_row, size_t n_col)
Definition: matrix_lapack_impl.hpp:205
size_t local_row_size() const
Definition: matrix_lapack_impl.hpp:175
size_t local_col_index(size_t lindex) const
Definition: matrix_lapack_impl.hpp:190
int comm_type
Definition: matrix_lapack.hpp:47
size_t local_col_size() const
Definition: matrix_lapack_impl.hpp:180
constexpr static size_t matrix_type_tag
Definition: matrix_lapack.hpp:49
void prep_global_to_local() const
Do nothing.
Definition: matrix_lapack_impl.hpp:295
void local_position(size_t g_row, size_t g_col, int &comm_rank, size_t &lindex) const
Convert a global index to an index of local storage.
Definition: matrix_lapack_impl.hpp:168
void bcast(D *buffer, int count, int root) const
Definition: matrix_lapack_impl.hpp:283
const C * head() const
Definition: matrix_lapack_impl.hpp:104
C allreduce_sum(C value) const
Definition: matrix_lapack_impl.hpp:277
bool local_index(size_t g_row, size_t g_col, size_t &i) const
Definition: matrix_lapack_impl.hpp:154
void barrier() const
Definition: matrix_lapack_impl.hpp:272
int n_col() const
Definition: matrix_lapack_impl.hpp:142
Matrix & map(UnaryOperation op)
std::string filename(const std::string &prefix, int proc_size)
Definition: common.hpp:32
constexpr size_t MATRIX_TYPE_TAG_LAPACK
Definition: matrix.hpp:34
Implemation of mptensor::lapack::Matrix.
int matrix_eig(Matrix< C > &a, std::vector< complex > &s, Matrix< complex > &u)
void matrix_product(const Matrix< C > &a, const Matrix< C > &b, Matrix< C > &c)
double min(const Matrix< C > &a)
double max(const Matrix< C > &a)
C matrix_trace(const Matrix< C > &a)
Definition: matrix_lapack_impl.hpp:374
int matrix_solve(Matrix< C > &a, Matrix< C > &b)
int matrix_eigh(Matrix< C > &a, std::vector< double > &s, Matrix< C > &u)
void replace_matrix_data(const Matrix< C > &M, const std::vector< int > &dest_rank, const std::vector< size_t > &local_position, Matrix< C > &M_new)
Definition: matrix_lapack_impl.hpp:323
double max_abs(const Matrix< C > &a)
Definition: matrix_lapack_impl.hpp:388
int matrix_svd(Matrix< C > &a, Matrix< C > &u, std::vector< double > &s, Matrix< C > &v)
double min_abs(const Matrix< C > &a)
Definition: matrix_lapack_impl.hpp:398
int matrix_qr(Matrix< C > &a, Matrix< C > &r)
void sum_matrix_data(const Matrix< C > &M, const std::vector< int > &dest_rank, const std::vector< size_t > &local_position, Matrix< C > &M_new)
Definition: matrix_lapack_impl.hpp:357
Definition: complex.hpp:34