28 #ifndef _MATRIX_SCALAPACK_HPP_
29 #define _MATRIX_SCALAPACK_HPP_
56 explicit Matrix(
const MPI_Comm& comm);
70 const C*
head()
const;
74 void global_index(
size_t i,
size_t& g_row,
size_t& g_col)
const;
75 bool local_index(
size_t g_row,
size_t g_col,
size_t& i)
const;
77 size_t& lindex)
const;
91 template <
typename UnaryOperation>
99 void bcast(D* buffer,
int count,
int root)
const;
114 std::vector<int> desc;
115 static const size_t BLOCK_SIZE;
116 size_t local_row_size_;
117 size_t local_col_size_;
126 mutable bool has_local_to_global;
127 mutable bool has_global_to_local;
128 mutable std::vector<size_t>
130 mutable std::vector<size_t>
132 mutable std::vector<size_t>
134 mutable std::vector<size_t>
136 mutable std::vector<int>
138 mutable std::vector<int>
140 mutable std::vector<int> lld_list;
146 template <
typename C>
148 const std::vector<size_t>& local_position,
150 template <
typename C>
152 const std::vector<size_t>& local_position,
154 template <
typename C>
156 const std::vector<size_t>& local_position,
159 template <
typename C>
161 template <
typename C>
165 template <
typename C>
167 template <
typename C>
170 template <
typename C>
172 template <
typename C>
174 template <
typename C>
176 template <
typename C>
178 template <
typename C>
185 template <
typename C>
187 template <
typename C>
189 template <
typename C>
191 template <
typename C>
Definition: blacsgrid.hpp:39
Distributed matrix using ScaLAPACK.
Definition: matrix_scalapack.hpp:47
int n_row() const
Definition: matrix_scalapack_impl.hpp:144
Matrix & operator*=(C rhs)
Definition: matrix_scalapack_impl.hpp:372
const int * descriptor() const
Definition: matrix_scalapack_impl.hpp:136
void bcast(D *buffer, int count, int root) const
Definition: matrix_scalapack_impl.hpp:441
void print_info(std::ostream &) const
Definition: matrix_scalapack_impl.hpp:351
void prep_local_to_global() const
Preprocess for fast conversion from local index to global one.
Definition: matrix_scalapack_impl.hpp:240
C value_type
Definition: matrix_scalapack.hpp:49
size_t local_row_index(size_t lindex) const
Definition: matrix_scalapack_impl.hpp:217
bool local_index(size_t g_row, size_t g_col, size_t &i) const
Definition: matrix_scalapack_impl.hpp:176
void global_index(size_t i, size_t &g_row, size_t &g_col) const
Definition: matrix_scalapack_impl.hpp:165
MPI_Comm comm_type
Definition: matrix_scalapack.hpp:50
int n_col() const
Definition: matrix_scalapack_impl.hpp:149
size_t local_row_size() const
Definition: matrix_scalapack_impl.hpp:207
Matrix & operator-=(const Matrix &rhs)
Definition: matrix_scalapack_impl.hpp:365
const C * head() const
Definition: matrix_scalapack_impl.hpp:103
Matrix()
Definition: matrix_scalapack_impl.hpp:70
Matrix & map(UnaryOperation op)
void init(size_t n_row, size_t n_col)
Definition: matrix_scalapack_impl.hpp:321
C allreduce_sum(C value) const
Definition: matrix_scalapack_impl.hpp:435
std::vector< C > flatten()
Definition: matrix_scalapack_impl.hpp:417
const MPI_Comm & get_comm() const
Definition: matrix_scalapack_impl.hpp:121
Matrix & operator/=(C rhs)
Definition: matrix_scalapack_impl.hpp:378
void barrier() const
Definition: matrix_scalapack_impl.hpp:430
void local_position(size_t g_row, size_t g_col, int &comm_rank, size_t &lindex) const
Definition: matrix_scalapack_impl.hpp:197
const Matrix transpose()
Definition: matrix_scalapack_impl.hpp:391
void save_index(const std::string &filename) const
Definition: matrix_scalapack_impl.hpp:446
size_t local_col_index(size_t lindex) const
Definition: matrix_scalapack_impl.hpp:222
size_t local_size() const
Definition: matrix_scalapack_impl.hpp:113
constexpr static size_t matrix_type_tag
Definition: matrix_scalapack.hpp:52
constexpr static char * matrix_type_name
Definition: matrix_scalapack.hpp:53
size_t global_row_index(size_t lindex_row) const
Definition: matrix_scalapack_impl.hpp:227
int get_comm_size() const
Definition: matrix_scalapack_impl.hpp:126
int get_comm_rank() const
Definition: matrix_scalapack_impl.hpp:131
void prep_global_to_local() const
Preprocess for fast conversion from global index to local one.
Definition: matrix_scalapack_impl.hpp:271
Matrix & operator+=(const Matrix &rhs)
Definition: matrix_scalapack_impl.hpp:358
const C & operator[](size_t i) const
Definition: matrix_scalapack_impl.hpp:93
size_t local_col_size() const
Definition: matrix_scalapack_impl.hpp:212
size_t global_col_index(size_t lindex_col) const
Definition: matrix_scalapack_impl.hpp:233
std::string filename(const std::string &prefix, int proc_size)
Definition: common.hpp:32
constexpr size_t MATRIX_TYPE_TAG_SCALAPACK
Definition: matrix.hpp:35
Implementation of scalapack::Matrix class.
int matrix_qr(Matrix< C > &a, Matrix< C > &r)
double min_abs(const Matrix< C > &a)
Definition: matrix_scalapack_impl.hpp:719
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_scalapack_impl.hpp:472
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_scalapack_impl.hpp:638
double max(const Matrix< C > &a)
int matrix_svd(Matrix< C > &a, Matrix< C > &u, std::vector< double > &s, Matrix< C > &v)
double min(const Matrix< C > &a)
double max_abs(const Matrix< C > &a)
Definition: matrix_scalapack_impl.hpp:707
C matrix_trace(const Matrix< C > &a)
int matrix_solve(Matrix< C > &a, Matrix< C > &b)
int matrix_eigh(Matrix< C > &a, std::vector< double > &s, Matrix< C > &u)
void matrix_product(const Matrix< C > &a, const Matrix< C > &b, Matrix< C > &c)
Definition: complex.hpp:34