82 const int* row_atom_begin,
83 const int* col_atom_begin,
85 T* existed_matrix =
nullptr);
94 const int* row_atom_begin,
95 const int* col_atom_begin,
97 T* existed_matrix =
nullptr);
114 void allocate(
T* data_array =
nullptr,
bool if_zero =
false);
143 void set_size(
const int& col_size_in,
const int& row_size_in);
163 bool identify(
const int& atom_i_,
const int& atom_j_)
const;
195 int find_R(
const int& rx_in,
const int& ry_in,
const int& rz_in)
const;
207 T&
get_value(
const int& row,
const int& col)
const;
252 const std::complex<T>& kphase,
253 const int hk_type = 0)
const;
259 void add_to_matrix(
T* hk,
const int ld_hk,
const T& kphase,
const int hk_type = 0)
const;
263 const std::complex<T>& kphase,
264 const int hk_type = 0);
266 void add_from_matrix(
const T* hk,
const int ld_hk,
const T& kphase,
const int hk_type = 0);
272 void add_to_array(std::complex<T>* target_array,
const std::complex<T>& kphase)
const;
291 assert(this->R_index.size() == this->values.size());
294 return this->R_index.size();
304 std::vector<ModuleBase::Vector3<int>>
R_index;
3 elements vector
Definition vector3.h:22
Definition parallel_orbitals.h:9
Definition atom_pair.h:42
BaseMatrix< T > & get_HR_values(int rx_in, int ry_in, int rz_in)
get target BaseMatrix of target cell for const AtomPair, it will return a const BaseMatrix<T> object,...
Definition atom_pair.cpp:393
int atom_i
Definition atom_pair.h:320
void merge(const AtomPair< T > &other, bool skip_R=false)
merge another AtomPair to this AtomPair
Definition atom_pair.cpp:538
T * get_pointer(int ir=-1) const
get pointer of value from a submatrix
Definition atom_pair.cpp:844
const Parallel_Orbitals * get_paraV() const
get Parallel_Orbitals pointer of this AtomPair for checking 2d-block parallel
Definition atom_pair.cpp:358
int current_R
Definition atom_pair.h:317
bool operator<(const AtomPair &other) const
Definition atom_pair.cpp:300
const Parallel_Orbitals * paraV
Definition atom_pair.h:310
int get_size() const
get size = col_size * row_size
Definition atom_pair.h:148
void add_to_matrix(std::complex< T > *hk, const int ld_hk, const std::complex< T > &kphase, const int hk_type=0) const
Add this->value[current_R] * kphase as a block matrix of hk.
Definition atom_pair.cpp:603
const BaseMatrix< T > * find_matrix(const int &rx_in, const int &ry_in, const int &rz_in) const
Definition atom_pair.cpp:471
int get_col_size() const
get col_size for this AtomPair
Definition atom_pair.cpp:318
int row_size
Definition atom_pair.h:326
int col_ap
Definition atom_pair.h:325
int col_size
Definition atom_pair.h:327
bool identify(const AtomPair< T > &other) const
use atom_i and atom_j to identify the atom-pair
Definition atom_pair.cpp:365
AtomPair & operator=(const AtomPair &other)
Definition atom_pair.cpp:243
T & get_value(const int &i) const
Definition atom_pair.cpp:818
void set_size(const int &col_size_in, const int &row_size_in)
set col_size and row_size
Definition atom_pair.cpp:346
std::vector< BaseMatrix< T > > values
Definition atom_pair.h:307
size_t get_R_size() const
Definition atom_pair.h:288
void allocate(T *data_array=nullptr, bool if_zero=false)
allocate memory for all the BaseMatrix
Definition atom_pair.cpp:212
int find_R(const int &rx_in, const int &ry_in, const int &rz_in) const
Definition atom_pair.cpp:441
int get_row_size() const
get row_size for this AtomPair
Definition atom_pair.cpp:325
std::tuple< std::vector< int >, T * > get_matrix_values(int ir=-1) const
get values of this->values[ir] for a whole matrix
Definition atom_pair.cpp:787
void merge_to_gamma()
merge all values in this AtomPair to one BaseMatrix with R-index (0, 0, 0) in this case,...
Definition atom_pair.cpp:575
int get_atom_j() const
Definition atom_pair.cpp:339
void add_from_matrix(const std::complex< T > *hk, const int ld_hk, const std::complex< T > &kphase, const int hk_type=0)
Definition atom_pair.cpp:684
int get_begin_col() const
Definition atom_pair.h:125
void set_zero()
set values in every BaseMatrix to zero
Definition atom_pair.cpp:233
int atom_j
Definition atom_pair.h:321
void add_to_array(std::complex< T > *target_array, const std::complex< T > &kphase) const
Add this->value[current_R] * kphase to an array. T = double or float.
Definition atom_pair.cpp:777
int get_atom_i() const
get atom_i and atom_j for this AtomPair
Definition atom_pair.cpp:332
std::vector< ModuleBase::Vector3< int > > R_index
Definition atom_pair.h:304
ModuleBase::Vector3< int > get_R_index() const
Definition atom_pair.cpp:810
void set_paraV(const Parallel_Orbitals *paraV_in)
set Parallel_Orbitals pointer of this AtomPair for checking 2d-block parallel
Definition atom_pair.h:159
~AtomPair()
Definition atom_pair.cpp:15
void convert_add(const BaseMatrix< T > &target, int rx_in, int ry_in, int rz_in)
Definition atom_pair.cpp:527
int row_ap
Definition atom_pair.h:323
size_t get_memory_size() const
get total memory size of AtomPair
Definition atom_pair.cpp:859
int get_begin_row() const
get begin index of this AtomPair
Definition atom_pair.h:124
Definition base_matrix.h:20
#define T
Definition exp.cpp:237