191 const std::vector<int> *ijr_info);
198 this->
paraV = paraV_in;
203 ap.set_paraV(paraV_in);
221 void allocate(
T *data_array =
nullptr,
bool if_zero =
false);
350 bool fix_R(
int rx_in,
int ry_in,
int rz_in)
const;
408 int find_R(
const int &rx_in,
const int &ry_in,
const int &rz_in)
const;
423 T *
data(
int i,
int j)
const;
433 T *
data(
int i,
int j,
int *R)
const;
458 for (
int iap = 0; iap < this->
atom_pairs.size(); ++iap)
Canonical atom-major flattening of the LCAO basis hierarchy.
Definition basis_flattened_indexing.h:40
3 elements vector
Definition vector3.h:21
Parallel block-cyclic matrix distribution.
Definition parallel_blkcyc.h:25
Definition parallel_orbitals.h:16
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition atom_pair.h:45
Definition base_matrix.h:20
Definition hcontainer.h:147
void loop_R(const size_t &index, int &rx, int &ry, int &rz) const
interface for call a R loop for HContainer it can return a new R-index with (rx,ry,...
Definition hcontainer.cpp:810
HContainer()
Definition hcontainer.cpp:30
void fix_gamma()
restrict R indexes of all atom-pair to 0, 0, 0 add BaseMatrix<T> with non-zero R index to this->atom_...
Definition hcontainer.cpp:715
void unfix_R() const
set current_R to -1, which means R is not fixed clear this->tmp_atom_pairs
Definition hcontainer.cpp:706
std::vector< AtomPair< T > > atom_pairs
Definition hcontainer.h:518
std::vector< int > get_ijr_info() const
get infomation of IJR pairs in HContainer the return vector format is {size_I, I1,...
Definition hcontainer.cpp:1077
size_t get_nnr() const
calculate total size of data in HContainer, named nnr inherited from history all AtomPairs and BaseMa...
Definition hcontainer.h:455
HContainer & operator=(const HContainer< T > &HR_in)=delete
void insert_pair(const AtomPair< T > &atom_ij)
a AtomPair object can be inserted into HContainer, two steps: 1, find AtomPair with atom index atom_i...
Definition hcontainer.cpp:880
const BasisFlattenedIndexing * basis_index
Definition hcontainer.h:552
bool fix_R(int rx_in, int ry_in, int rz_in) const
save atom-pair pointers into this->tmp_atom_pairs for selected R index
Definition hcontainer.cpp:670
T * wrapper_pointer
if wrapper_pointer is not nullptr, this HContainer is a wrapper there is only one case that "wrapper_...
Definition hcontainer.h:544
T * data(int i, int j) const
get data pointer of AtomPair with index of I, J
Definition hcontainer.cpp:848
bool is_gamma_only() const
judge if gamma_only
Definition hcontainer.cpp:1005
size_t size_atom_pairs() const
calculate number of AtomPairs for current R index
Definition hcontainer.cpp:832
int get_current_R() const
get current_R
Definition hcontainer.cpp:998
int get_nbasis() const
get number of basis in each H matrix
Definition hcontainer.cpp:281
size_t allocated_size
Definition hcontainer.h:525
BaseMatrix< T > * find_matrix(int i, int j, int rx, int ry, int rz)
find BaseMatrix with atom index atom_i and atom_j and R index (rx, ry, rz) This interface can be used...
Definition hcontainer.cpp:426
int find_R(const int &rx_in, const int &ry_in, const int &rz_in) const
find index of R in tmp_R_index, used when current_R is fixed
Definition hcontainer.cpp:738
int current_R
Definition hcontainer.h:534
bool allocated
Definition hcontainer.h:545
const std::vector< std::vector< int > > & get_sparse_ap() const
get sparse_ap
Definition hcontainer.h:502
size_t size_R_loop() const
calculate number of R index which has counted AtomPairs
Definition hcontainer.cpp:775
const Parallel_Blkcyclic * matrix_dist
Definition hcontainer.h:553
bool same_layout(const HContainer< T > &other) const
Definition hcontainer.cpp:291
bool gamma_only
Definition hcontainer.h:536
void add_value_intersection(const HContainer< T > &other, T factor=T(1))
value-add over the SHARED sparsity only: for every (atom_i, atom_j, R) BaseMatrix present in BOTH con...
Definition hcontainer.cpp:594
void insert_ijrs(const std::vector< int > *ijrs)
use infomation of IJ pairs to expand HContainer the input vector format is {size_IJ_pairs,...
Definition hcontainer.cpp:1107
void set_paraV(const Parallel_Orbitals *paraV_in)
set parallel orbital pointer to check parallel information
Definition hcontainer.h:196
void add_value_union(const HContainer< T > &other, T factor=T(1))
value-add over the UNION sparsity: for every (atom_i, atom_j, R) BaseMatrix of other,...
Definition hcontainer.cpp:634
~HContainer()
Definition hcontainer.cpp:17
size_t get_memory_size() const
get total memory bites of HContainer
Definition hcontainer.cpp:1012
void shape_synchron(const HContainer< T > &other)
synchronization of atom-pairs for read-in HContainer new <IJR> pair from read-in HContainer will be i...
Definition hcontainer.cpp:1038
void allocate(T *data_array=nullptr, bool if_zero=false)
allocate memory for all <IJR> matrix if data_array is not nullptr, use memory after data_array for ea...
Definition hcontainer.cpp:324
void set_zero()
set values of all <IJR> matrix to zero
Definition hcontainer.cpp:369
std::vector< std::vector< int > > sparse_ap_index
Definition hcontainer.h:522
std::vector< ModuleBase::Vector3< int > > tmp_R_index
Definition hcontainer.h:532
AtomPair< T > & get_atom_pair(int i, int j) const
return a reference of AtomPair with index of atom I and J in atom_pairs
Definition hcontainer.cpp:528
T * get_wrapper() const
return the wrapper_pointer
Definition hcontainer.h:490
int find_matrix_offset(int i, int j, int rx, int ry, int rz) const
find the offset of BaseMatrix with atom index atom_i and atom_j and R index (rx, ry,...
Definition hcontainer.cpp:494
const Parallel_Orbitals * get_paraV() const
get parallel orbital pointer to check parallel information
Definition hcontainer.h:210
const std::vector< std::vector< int > > & get_sparse_ap_index() const
get sparse_ap_index
Definition hcontainer.h:508
const Parallel_Orbitals * paraV
pointer of Parallel_Orbitals, which is used to get atom-pair information
Definition hcontainer.h:550
std::vector< std::vector< int > > sparse_ap
Definition hcontainer.h:521
AtomPair< T > * find_pair(int i, int j) const
find AtomPair with atom index atom_i and atom_j This interface can be used to find AtomPair,...
Definition hcontainer.cpp:378
std::vector< const AtomPair< T > * > tmp_atom_pairs
temporary atom-pair lists to loop selected R index
Definition hcontainer.h:530
void add(const HContainer< T > &other)
operator() for accessing value with indexes this interface is not implemented now,...
Definition hcontainer.cpp:583
#define T
Definition exp.cpp:237