mptensor  v0.3.0
Parallel Library for Tensor Network Methods
matrix_interface_doc.hpp
Go to the documentation of this file.
1 /*
2  mptensor - Parallel Library for Tensor Network Methods
3 
4  Copyright 2016 Satoshi Morita
5 
6  mptensor is free software: you can redistribute it and/or modify it
7  under the terms of the GNU Lesser General Public License as
8  published by the Free Software Foundation, either version 3 of the
9  License, or (at your option) any later version.
10 
11  mptensor is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with mptensor. If not, see
18  <https://www.gnu.org/licenses/>.
19 */
20 
28 #ifndef _MATRIX_INTERFACE_DOC_HPP_
29 #define _MATRIX_INTERFACE_DOC_HPP_
30 
31 namespace mptensor {
32 
34 
38 namespace matrix_interface {
39 
41 
51 template <typename C>
52 class Matrix;
53 
55 
58 template <typename C>
59 Matrix<C>::Matrix<C>();
60 
62 
65 template <typename C>
66 explicit Matrix<C>::Matrix<C>(const comm_type& comm);
67 
69 
74 template <typename C>
75 Matrix<C>::Matrix<C>(size_t n_row, size_t n_col);
76 
78 
83 template <typename C>
84 Matrix<C>::Matrix<C>(const comm_type& comm, size_t n_row, size_t n_col);
85 
87 
90 template <typename C>
91 const C& Matrix<C>::operator[](size_t i) const;
92 
94 
97 template <typename C>
98 C& Matrix<C>::operator[](size_t i);
99 
101 
104 template <typename C>
105 size_t Matrix<C>::local_size() const;
106 
108 
111 template <typename C>
112 const typename Matrix<C>::comm_type& Matrix<C>::get_comm() const;
113 
115 
118 template <typename C>
119 int Matrix<C>::get_comm_size() const;
120 
122 
125 template <typename C>
126 int Matrix<C>::get_comm_rank() const;
127 
129 
132 template <typename C>
133 std::vector<C> Matrix<C>::flatten();
134 
136 template <typename C>
137 void Matrix<C>::barrier() const;
138 
140 
143 template <typename C>
144 C Matrix<C>::allreduce_sum(C val) const;
145 
147 
152 template <typename C>
153 template <typename D>
154 void Matrix<C>::bcast(D* buffer, int count, int root) const;
155 
157 template <typename C>
159 
161 template <typename C>
163 
165 
172 template <typename C>
173 int matrix_eigh(Matrix<C>& a, std::vector<double>& s);
174 
176 
183 template <typename C>
184 int matrix_solve(Matrix<C>& a, Matrix<C>& b);
185 
187 
192 template <typename C>
193 double max(const Matrix<C>& a);
194 
196 
201 template <typename C>
202 double min(const Matrix<C>& a);
203 
205 
209 template <typename C>
210 double max_abs(const Matrix<C>& a);
211 
213 
217 template <typename C>
218 double min_abs(const Matrix<C>& a);
219 
220 } // namespace matrix_interface
221 } // namespace mptensor
222 
223 #endif // _MATRIX_INTERFACE_DOC_HPP_
std::vector< C > flatten()
Return the flattened vector.
size_t local_size() const
Return the number of elements in this process.
C allreduce_sum(C value) const
Return the summation of a scalar. Every processes returns the same value.
void prep_global_to_local() const
Preprocess for fast conversion from local index to global one.
const C & operator[](size_t i) const
Const array subscript operator.
int comm_type
Set MPI_Comm for MPI programm.
Definition: matrix_interface.hpp:41
void prep_local_to_global() const
Preprocess for fast conversion from local index to global one.
void bcast(D *buffer, int count, int root) const
Wrapper of MPI_Bcast.
int get_comm_size() const
Return the size of the MPI communicator.
const comm_type & get_comm() const
Return the MPI communicator.
int get_comm_rank() const
Return the MPI rank.
void barrier() const
Wrapper of MPI_Barrier.
double min(const Matrix< C > &a)
Return the minimum element.
int matrix_eigh(Matrix< C > &a, std::vector< double > &s, Matrix< C > &u)
double max_abs(const Matrix< C > &a)
Return the maximum of the absolute value of elements.
double max(const Matrix< C > &a)
Return the maximum element.
double min_abs(const Matrix< C > &a)
Return the minimum of the absolute value of elements.
int matrix_solve(Matrix< C > &a, Matrix< C > &b)
Solve linear equation .
Definition: complex.hpp:34