Skip to content

Commit a040fb2

Browse files
committed
remove useless code
1 parent 4c477da commit a040fb2

File tree

3 files changed

+5
-61
lines changed

3 files changed

+5
-61
lines changed

source/module_lr/utils/lr_util.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,6 @@ namespace LR_Util
109109
assert(psi_kfirst.get_nk() == 1);
110110
assert(nk_in * nbasis_in == psi_kfirst.get_nbasis());
111111

112-
// std::vector<int> ngk_vector(nk_in, 0);
113-
// for (size_t i = 0; i < ngk_vector.size(); i++)
114-
// {
115-
// ngk_vector[i] = psi_kfirst.get_ngk_pointer()[i];
116-
// }
117-
118112
int ib_now = psi_kfirst.get_current_b();
119113
psi_kfirst.fix_b(0); // for get_pointer() to get the head pointer
120114
psi::Psi<T, Device> psi_bfirst(psi_kfirst.get_pointer(), nk_in, psi_kfirst.get_nbands(), nbasis_in, false);
@@ -129,12 +123,6 @@ namespace LR_Util
129123
int ib_now = psi_bfirst.get_current_b();
130124
int ik_now = psi_bfirst.get_current_k();
131125

132-
// std::vector<int> ngk_vector(psi_bfirst.get_nk(), 0);
133-
// for (size_t i = 0; i < ngk_vector.size(); i++)
134-
// {
135-
// ngk_vector[i] = psi_bfirst.get_ngk_pointer()[i];
136-
// }
137-
138126
psi_bfirst.fix_kb(0, 0); // for get_pointer() to get the head pointer
139127
psi::Psi<T, Device> psi_kfirst(psi_bfirst.get_pointer(), 1, psi_bfirst.get_nbands(), psi_bfirst.get_nk() * psi_bfirst.get_nbasis(), true);
140128
psi_bfirst.fix_kb(ik_now, ib_now);

source/module_psi/psi.cpp

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ Psi<T, Device>::~Psi()
4444
}
4545
}
4646

47-
// template <typename T, typename Device> Psi<T, Device>::Psi(const int* ngk_in)
48-
// {
49-
// this->ngk = ngk_in;
50-
// this->npol = PARAM.globalv.npol;
51-
// this->device = base_device::get_device_type<Device>(this->ctx);
52-
// }
53-
5447
template <typename T, typename Device>
5548
Psi<T, Device>::Psi(const int nk_in, const int nbd_in, const int nbs_in, const int* ngk_in, const bool k_first_in)
5649
{
@@ -70,40 +63,16 @@ Psi<T, Device>::Psi(const int nk_in, const int nbd_in, const int nbs_in, const i
7063
}
7164

7265
// Constructor 8-1:
73-
// template <typename T, typename Device>
74-
// Psi<T, Device>::Psi(T* psi_pointer,
75-
// const int nk_in,
76-
// const int nbd_in,
77-
// const int nbs_in,
78-
// const int* ngk_in,
79-
// const bool k_first_in)
80-
// {
81-
// this->k_first = k_first_in;
82-
// this->ngk = ngk_in;
83-
// this->current_b = 0;
84-
// this->current_k = 0;
85-
// this->npol = PARAM.globalv.npol;
86-
// this->device = base_device::get_device_type<Device>(this->ctx);
87-
// this->nk = nk_in;
88-
// this->nbands = nbd_in;
89-
// this->nbasis = nbs_in;
90-
// this->current_nbasis = nbs_in;
91-
// this->psi_current = this->psi = psi_pointer;
92-
// this->allocate_inside = false;
93-
// // Currently only GPU's implementation is supported for device recording!
94-
// base_device::information::print_device_info<Device>(this->ctx, GlobalV::ofs_device);
95-
// }
96-
97-
// Constructor 8-3:
9866
template <typename T, typename Device>
9967
Psi<T, Device>::Psi(T* psi_pointer,
10068
const int nk_in,
10169
const int nbd_in,
10270
const int nbs_in,
71+
const std::vector<int>& ngk_vector_in,
10372
const bool k_first_in)
10473
{
10574
this->k_first = k_first_in;
106-
this->ngk = nullptr;
75+
this->ngk = ngk_vector_in.data();
10776
this->current_b = 0;
10877
this->current_k = 0;
10978
this->npol = PARAM.globalv.npol;
@@ -120,15 +89,10 @@ Psi<T, Device>::Psi(T* psi_pointer,
12089

12190
// Constructor 8-2:
12291
template <typename T, typename Device>
123-
Psi<T, Device>::Psi(T* psi_pointer,
124-
const int nk_in,
125-
const int nbd_in,
126-
const int nbs_in,
127-
const std::vector<int>& ngk_vector_in,
128-
const bool k_first_in)
92+
Psi<T, Device>::Psi(T* psi_pointer, const int nk_in, const int nbd_in, const int nbs_in, const bool k_first_in)
12993
{
13094
this->k_first = k_first_in;
131-
this->ngk = ngk_vector_in.data();
95+
this->ngk = nullptr;
13296
this->current_b = 0;
13397
this->current_k = 0;
13498
this->npol = PARAM.globalv.npol;

source/module_psi/psi.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ class Psi
5858
Psi(const Psi<T_in, Device_in>& psi_in);
5959

6060
// Constructor 8-1: a pointer version of constructor 3
61-
// Psi(T* psi_pointer,
62-
// const int nk_in,
63-
// const int nbd_in,
64-
// const int nbs_in,
65-
// const int* ngk_in = nullptr,
66-
// const bool k_first_in = true);
67-
68-
// Constructor 8-2: a pointer version of constructor 3
6961
// only used in hsolver-pw function pointer.
7062
Psi(T* psi_pointer,
7163
const int nk_in,
@@ -74,7 +66,7 @@ class Psi
7466
const std::vector<int>& ngk_vector_in,
7567
const bool k_first_in = true);
7668

77-
// Constructor 8-3: a pointer version of constructor 3
69+
// Constructor 8-2: a pointer version of constructor 3
7870
// only used in operator.cpp call_act func
7971
Psi(T* psi_pointer,
8072
const int nk_in,

0 commit comments

Comments
 (0)