Skip to content

Commit dcee5b3

Browse files
committed
a usage of std::inner_product
1 parent fe45e8d commit dcee5b3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

source/module_lr/esolver_lrtd_lcao.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ void LR::ESolver_LR<T, TR>::set_dimension()
126126
if (input.ri_hartree_benchmark == "aims" && !input.aims_nbasis.empty())
127127
{
128128
this->nbasis = [&]() -> int { int nbas = 0; for (int it = 0;it < ucell.ntype;++it) { nbas += ucell.atoms[it].na * input.aims_nbasis[it]; };return nbas;}();
129+
this->nbasis = std::inner_product(input.aims_nbasis.begin(), input.aims_nbasis.end(), ucell.atoms, 0, std::plus<int>(), [](const int& a, const Atom& b) { return a * b.na; });
129130
std::cout << "nbasis from aims: " << this->nbasis << std::endl;
130131
}
131132
}

source/module_lr/potentials/xc_kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void LR::KernelXC::f_xc_libxc(const int& nspin, const double& omega, const doubl
3737

3838
// -----------------------------------------------------------------------------------
3939
// for GGA
40-
const bool is_gga = std::any_of(funcs.begin(), funcs.end(), [](const xc_func_type& f) { f.info->family == XC_FAMILY_GGA || f.info->family == XC_FAMILY_HYB_GGA; });
40+
const bool is_gga = std::any_of(funcs.begin(), funcs.end(), [](const xc_func_type& f)->bool { return f.info->family == XC_FAMILY_GGA || f.info->family == XC_FAMILY_HYB_GGA; });
4141

4242
std::vector<std::vector<ModuleBase::Vector3<double>>> gradrho; // \nabla \rho
4343
std::vector<double> sigma; // |\nabla\rho|^2

0 commit comments

Comments
 (0)