Skip to content

Commit 0339173

Browse files
authored
Refactor: remove hsolver base class from module_hsolver (#5093)
* remoe hsolver class * change wfc_basis to const value * fix build bug
1 parent c8c0a10 commit 0339173

File tree

3 files changed

+8
-19
lines changed

3 files changed

+8
-19
lines changed

source/module_hsolver/hsolver.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@
1414
namespace hsolver
1515
{
1616

17-
template <typename T, typename Device = base_device::DEVICE_CPU>
18-
class HSolver
19-
{
20-
private:
21-
using Real = typename GetTypeReal<T>::type;
22-
23-
public:
24-
HSolver() {};
25-
};
26-
27-
2817
double set_diagethr_ks(const std::string basis_type,
2918
const std::string esolver_type,
3019
const std::string calculation_in,

source/module_hsolver/hsolver_pw.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ class HSolverPW
7171

7272
void output_iterInfo();
7373

74-
ModulePW::PW_Basis_K* wfc_basis = nullptr;
75-
wavefunc* pwf = nullptr;
74+
ModulePW::PW_Basis_K* wfc_basis;
75+
wavefunc* pwf; // only for diago_PAO_in_pw_k2 func
7676

7777
const std::string calculation_type;
7878
const std::string basis_type;

source/module_hsolver/test/test_hsolver.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include <module_base/macros.h>
1010

11-
template class hsolver::HSolver<std::complex<float>, base_device::DEVICE_CPU>;
12-
template class hsolver::HSolver<std::complex<double>, base_device::DEVICE_CPU>;
11+
// template class hsolver::HSolver<std::complex<float>, base_device::DEVICE_CPU>;
12+
// template class hsolver::HSolver<std::complex<double>, base_device::DEVICE_CPU>;
1313

1414
/************************************************
1515
* unit test of HSolver base class
@@ -34,10 +34,10 @@ template class hsolver::HSolver<std::complex<double>, base_device::DEVICE_CPU>;
3434
class TestHSolver : public ::testing::Test
3535
{
3636
public:
37-
hsolver::HSolver<std::complex<float>, base_device::DEVICE_CPU> hs_cf;
38-
hsolver::HSolver<std::complex<double>, base_device::DEVICE_CPU> hs_cd;
39-
hsolver::HSolver<float, base_device::DEVICE_CPU> hs_f;
40-
hsolver::HSolver<double, base_device::DEVICE_CPU> hs_d;
37+
// hsolver::HSolver<std::complex<float>, base_device::DEVICE_CPU> hs_cf;
38+
// hsolver::HSolver<std::complex<double>, base_device::DEVICE_CPU> hs_cd;
39+
// hsolver::HSolver<float, base_device::DEVICE_CPU> hs_f;
40+
// hsolver::HSolver<double, base_device::DEVICE_CPU> hs_d;
4141

4242
hamilt::Hamilt<std::complex<double>> hamilt_test_cd;
4343
hamilt::Hamilt<std::complex<float>> hamilt_test_cf;

0 commit comments

Comments
 (0)