Skip to content

Commit c40f414

Browse files
committed
add const before std::set
1 parent db47c6e commit c40f414

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

source/module_lr/esolver_lrtd_lcao.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ inline int cal_nupdown_form_occ(const ModuleBase::matrix& wg)
8686
template<typename T, typename TR>
8787
void LR::ESolver_LR<T, TR>::parameter_check()const
8888
{
89-
std::set<std::string> lr_solvers = { "dav", "lapack" , "spectrum", "dav_subspace", "cg" };
90-
std::set<std::string> xc_kernels = { "rpa", "lda", "pwlda", "pbe", "hf" , "hse" };
89+
const std::set<std::string> lr_solvers = { "dav", "lapack" , "spectrum", "dav_subspace", "cg" };
90+
const std::set<std::string> xc_kernels = { "rpa", "lda", "pwlda", "pbe", "hf" , "hse" };
9191
if (lr_solvers.find(this->input.lr_solver) == lr_solvers.end()) {
9292
throw std::invalid_argument("ESolver_LR: unknown type of lr_solver");
9393
}
@@ -471,7 +471,7 @@ void LR::ESolver_LR<T, TR>::runner(int istep, UnitCell& cell)
471471
// solve the Casida equation
472472
LR::HSolver::solve(hlr, this->X[is].template data<T>(), nloc_per_band, nstates,
473473
this->pelec->ekb.c + is * nstates, this->input.lr_solver, this->input.lr_thr/*,
474-
!std::set<std::string>({ "hf", "hse" }).count(this->xc_kernel)*/); //whether the kernel is Hermitian
474+
!const std::set<std::string>({ "hf", "hse" }).count(this->xc_kernel)*/); //whether the kernel is Hermitian
475475
if (input.out_wfc_lr) { write_states(spin_types[is], this->pelec->ekb.c + is * nstates, this->X[is].template data<T>(), nloc_per_band, nstates); }
476476
}
477477
}

source/module_lr/potentials/pot_hxc_lrtd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace LR
2525

2626
this->pot_hartree = LR_Util::make_unique<elecstate::PotHartree>(this->rho_basis_);
2727

28-
std::set<std::string> local_xc = { "lda", "pwlda", "pbe", "hse" };
28+
const std::set<std::string> local_xc = { "lda", "pwlda", "pbe", "hse" };
2929
if (local_xc.find(this->xc_kernel) != local_xc.end())
3030
{
3131
XC_Functional::set_xc_type(this->xc_kernel); // for hse, (1-alpha) and omega are set here
@@ -34,7 +34,7 @@ namespace LR
3434

3535
if (lr_init_xc_kernel[0] == "file")
3636
{
37-
std::set<std::string> lda_xc = { "lda", "pwlda" };
37+
const std::set<std::string> lda_xc = { "lda", "pwlda" };
3838
assert(lda_xc.count(this->xc_kernel));
3939
const int spinsize = (1 == nspin) ? 1 : 3;
4040
std::vector<double> v2rho2(spinsize * nrxx);

0 commit comments

Comments
 (0)