Skip to content

Commit

Permalink
boys.h is again usable with c++11
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev committed Jun 20, 2022
1 parent dd2faea commit 704f581
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions include/libint2/boys.h
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,11 @@ namespace libint2 {
Real Gmp1; // will contain G[m+1]
Gmm1 = pfac * (erfc_k + erfc_l) * oo_sqrt_U; // G_{-1}
Gm = pfac * (erfc_k - erfc_l) * oo_sqrt_T; // G_{0}
if constexpr (!Exp) {
if
#if __cplusplus >= 201703L
constexpr
#endif
(!Exp) {
Gm_vec[0] = Gm;
}
else {
Expand All @@ -1055,7 +1059,11 @@ namespace libint2 {

for(unsigned int m=0, two_m_minus_1=1; m<mmax; ++m, two_m_minus_1+=2) {
Gmp1 = oo_two_T * (two_m_minus_1 * Gm + two_U * Gmm1 - exp_mT);
if constexpr (!Exp) {
if
#if __cplusplus >= 201703L
constexpr
#endif
(!Exp) {
Gm_vec[m + 1] = Gmp1;
} else {
Gm_vec[m + 1] = (Gm - Gmp1) * zeta_over_two_rho;
Expand Down Expand Up @@ -1160,7 +1168,11 @@ namespace libint2 {
// precision of interpolation for m=-1,0 can be insufficient, just evaluate explicitly
Real G0;
std::tie(Exp ? G0 : Gm_vec[0], Gmm1) = eval_G0_and_maybe_Gm1<Exp>(T, U);
if constexpr (Exp) {
if
#if __cplusplus >= 201703L
constexpr
#endif
(Exp) {
Gm_vec[0] = (Gmm1 - G0) * zeta_over_two_rho;
Gmm1 = G0;
}
Expand Down Expand Up @@ -1273,7 +1285,11 @@ namespace libint2 {
}
#endif // AVX

if constexpr (!Exp) {
if
#if __cplusplus >= 201703L
constexpr
#endif
(!Exp) {
Gm_vec[m] = Gm;
}
else {
Expand Down

0 comments on commit 704f581

Please sign in to comment.