diff --git a/examples/Example_Laplacian_smearing.cc b/examples/Example_Laplacian_smearing.cc index 327c5ca9..9780e8a0 100644 --- a/examples/Example_Laplacian_smearing.cc +++ b/examples/Example_Laplacian_smearing.cc @@ -112,8 +112,8 @@ int main(int argc, char ** argv) PowerMethod PM; PM(HermOp,kronecker); - Chebyshev ChebySmear(lo,hi,20,DistillationSmearing); - // Chebyshev ChebySmear(lo,hi,20,MomentumSmearing); + // Chebyshev ChebySmear(lo,hi,20,DistillationSmearing); + Chebyshev ChebySmear(lo,hi,20,MomentumSmearing); { std::ofstream of("chebysmear"); ChebySmear.csv(of); diff --git a/examples/Example_Laplacian_solver.cc b/examples/Example_Laplacian_solver.cc index 88275df8..4dc00280 100644 --- a/examples/Example_Laplacian_solver.cc +++ b/examples/Example_Laplacian_solver.cc @@ -15,8 +15,7 @@ void SimpleConjugateGradient(LinearOperatorBase &HPDop,const Field &b, Fi r = b - mmp; p = r; - alpha = norm2(p); - cp = alpha; + cp = alpha = norm2(p); ssq = norm2(b); RealD rsq = Tolerance * Tolerance * ssq; @@ -26,11 +25,12 @@ void SimpleConjugateGradient(LinearOperatorBase &HPDop,const Field &b, Fi HPDop.HermOp(p, mmp); - ComplexD dc = innerProduct(p,mmp); - d = dc.real(); + d = real(innerProduct(p,mmp)); + alpha = c / d; - cp = axpy_norm(r, -alpha, mmp, r); + r = r - alpha *mmp; + cp = norm2(r); beta = cp / c; x = x + alpha* p ; @@ -121,7 +121,9 @@ int main(int argc, char ** argv) r=kronecker-r; std::cout << "True residual "<< norm2(r) <