Skip to content

Commit

Permalink
Fix: use std::abs() instead of abs() (deepmodeling#4076)
Browse files Browse the repository at this point in the history
  • Loading branch information
WHUweiqingzhou authored Apr 30, 2024
1 parent a2a0e19 commit 1439426
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/module_elecstate/module_charge/charge_mixing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void Charge_Mixing::mix_rho_recip(Charge* chr)
{
chr->rhog[0][ig] = rhog_magabs[ig]; // rhog
double norm = std::sqrt(chr->rho[1][ig] * chr->rho[1][ig] + chr->rho[2][ig] * chr->rho[2][ig] + chr->rho[3][ig] * chr->rho[3][ig]);
if (abs(norm) < 1e-10) continue;
if (std::abs(norm) < 1e-10) continue;
double rescale_tmp = rho_magabs[npw + ig] / norm;
chr->rho[1][ig] *= rescale_tmp;
chr->rho[2][ig] *= rescale_tmp;
Expand Down

0 comments on commit 1439426

Please sign in to comment.