Skip to content

Commit 55c095f

Browse files
authored
Merge pull request #226 from nils-asmussen/fix/Gauss
Fix compiling of MSource::Gauss for single precision
2 parents c2c4252 + e3966aa commit 55c095f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Hadrons/Modules/MSource/Gauss.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ void TGauss<FImpl>::execute(void)
114114
const int dim=env().getNd()-1;
115115
const Real fact=-0.5/std::pow(par().width,2);
116116
const Complex i(0.0, 1.0);
117+
const Real Pi(M_PI);
117118
const SitePropagator idMat=[](){ SitePropagator s; s=1.; return s; }();
118119

119120
ScalarRho=zero;
@@ -129,7 +130,7 @@ void TGauss<FImpl>::execute(void)
129130
LatticeCoordinate(compHelper, mu);
130131

131132
//spatial dimensions of momentum phase
132-
ScalarRho+=(i*(mom_[mu]*2*M_PI/Lmu))*component;
133+
ScalarRho+=(i*(mom_[mu]*2*Pi/Lmu))*component;
133134

134135
//Gauss distribution
135136
component-=Complex(posMu);
@@ -150,10 +151,10 @@ void TGauss<FImpl>::execute(void)
150151

151152
//time component of momentum phase
152153
LatticeCoordinate(component, dim);
153-
ScalarRho+=(i*(mom_.at(dim)*2*M_PI/env().getDim(dim)))*component;
154+
ScalarRho+=(i*(mom_.at(dim)*2*Pi/env().getDim(dim)))*component;
154155

155156
//compute scalar result
156-
ScalarRho=exp(ScalarRho)*Complex(std::pow(sqrt(2*M_PI)*par().width,-dim));
157+
ScalarRho=exp(ScalarRho)*Complex(std::pow(sqrt(2*Pi)*par().width,-dim));
157158

158159
//select time slices
159160
LatticeCoordinate(compHelper, dim);

0 commit comments

Comments
 (0)