1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Set precision and formatting only once in MR code

This commit is contained in:
Daniel Richtmann 2017-11-08 13:57:06 +01:00
parent 7f4ed6c2e5
commit 0c1c1d9900
No known key found for this signature in database
GPG Key ID: B33C490AF0772057

View File

@ -72,17 +72,17 @@ template<class Field> class MinimalResidual : public OperatorFunction<Field> {
RealD cp = norm2(r); // Cp = |r[0]|^2 // 2 Nc Ns flops // flopcount.addSiteFlops(4*Nc*Ns, s);
std::cout << GridLogIterative << std::setprecision(4) << "MinimalResidual: guess " << guess << std::endl;
std::cout << GridLogIterative << std::setprecision(4) << "MinimalResidual: src " << ssq << std::endl;
std::cout << GridLogIterative << std::setprecision(4) << "MinimalResidual: mp " << d << std::endl;
std::cout << GridLogIterative << std::setprecision(4) << "MinimalResidual: cp,r " << cp << std::endl;
std::cout << std::setprecision(4) << std::scientific << std::endl;
std::cout << GridLogIterative << "MinimalResidual: guess " << guess << std::endl;
std::cout << GridLogIterative << "MinimalResidual: src " << ssq << std::endl;
std::cout << GridLogIterative << "MinimalResidual: mp " << d << std::endl;
std::cout << GridLogIterative << "MinimalResidual: cp,r " << cp << std::endl;
if (cp <= rsq) {
return;
}
std::cout << GridLogIterative << std::setprecision(4)
<< "MinimalResidual: k=0 residual " << cp << " target " << rsq << std::endl;
std::cout << GridLogIterative << "MinimalResidual: k=0 residual " << cp << " target " << rsq << std::endl;
GridStopWatch LinalgTimer;
GridStopWatch MatrixTimer;