diff --git a/source/module_elecstate/module_dm/density_matrix.cpp b/source/module_elecstate/module_dm/density_matrix.cpp index bdd1947d627..53de6eb3e64 100644 --- a/source/module_elecstate/module_dm/density_matrix.cpp +++ b/source/module_elecstate/module_dm/density_matrix.cpp @@ -272,27 +272,6 @@ TK* DensityMatrix::get_DMK_pointer(const int ik) const return const_cast(this->_DMK[ik].data()); } -// get _DMK[ik] vector -template -std::vector> DensityMatrix::get_DMK_vector() const -{ - return this->_DMK; -} - -// get _paraV pointer -template -const Parallel_Orbitals* DensityMatrix::get_paraV_pointer() const -{ - return this->_paraV; -} - -// get _kv pointer -template -const K_Vectors* DensityMatrix::get_kv_pointer() const -{ - return this->_kv; -} - // set DMK using a pointer template void DensityMatrix::set_DMK_pointer(const int ik, TK* DMK_in) diff --git a/source/module_elecstate/module_dm/density_matrix.h b/source/module_elecstate/module_dm/density_matrix.h index 1c758ae1395..62554018506 100644 --- a/source/module_elecstate/module_dm/density_matrix.h +++ b/source/module_elecstate/module_dm/density_matrix.h @@ -139,9 +139,11 @@ class DensityMatrix * @brief get pointer vector of DMR * @return HContainer* vector of DMR */ - std::vector*> get_DMR_vector() const {return this->_DMR;} + const std::vector*>& get_DMR_vector() const {return this->_DMR;} + std::vector*>& get_DMR_vector() {return this->_DMR;} - std::vector> get_DMR_save() const {return _DMR_save;} + const std::vector>& get_DMR_save() const {return this->_DMR_save;} + std::vector>& get_DMR_save() {return this->_DMR_save;} /** * @brief get pointer of DMK @@ -153,7 +155,8 @@ class DensityMatrix /** * @brief get pointer vector of DMK */ - std::vector> get_DMK_vector() const; + const std::vector>& get_DMK_vector() const {return this->_DMK;} + std::vector>& get_DMK_vector() {return this->_DMK;} /** * @brief set _DMK using a input TK* pointer @@ -164,9 +167,9 @@ class DensityMatrix /** * @brief get pointer of paraV */ - const Parallel_Orbitals* get_paraV_pointer() const; + const Parallel_Orbitals* get_paraV_pointer() const {return this->_paraV;} - const K_Vectors* get_kv_pointer() const; + const K_Vectors* get_kv_pointer() const {return this->_kv;} /** * @brief calculate density matrix DMR from dm(k) using blas::axpy