1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-05 19:55:56 +01:00

Rename misunderstood "rsd_sq" to "rsq" in MR code

This commit is contained in:
Daniel Richtmann 2017-11-08 13:50:34 +01:00
parent b8ee496ed6
commit 56d32a4afb
No known key found for this signature in database
GPG Key ID: B33C490AF0772057
2 changed files with 7 additions and 7 deletions

View File

@ -63,8 +63,8 @@ template<class Field> class MinimalResidual : public OperatorFunction<Field> {
RealD guess = norm2(psi);
assert(std::isnan(guess) == 0);
RealD ssq = norm2(src); // flopcount.addSiteFlops(4*Nc*Ns,s); // stands for "source squared"
RealD rsd_sq = Tolerance * Tolerance * ssq; // flopcount.addSiteFlops(4*Nc*Ns,s); // stands for "residual squared"
RealD ssq = norm2(src); // flopcount.addSiteFlops(4*Nc*Ns,s);
RealD rsq = Tolerance * Tolerance * ssq; // flopcount.addSiteFlops(4*Nc*Ns,s);
Linop.Op(psi, Mr); // flopcount.addFlops(M.nFlops());
@ -77,12 +77,12 @@ template<class Field> class MinimalResidual : public OperatorFunction<Field> {
std::cout << GridLogIterative << std::setprecision(4) << "MinimalResidual: mp " << d << std::endl;
std::cout << GridLogIterative << std::setprecision(4) << "MinimalResidual: cp,r " << cp << std::endl;
if (cp <= rsd_sq) {
if (cp <= rsq) {
return;
}
std::cout << GridLogIterative << std::setprecision(4)
<< "MinimalResidual: k=0 residual " << cp << " target " << rsd_sq << std::endl;
<< "MinimalResidual: k=0 residual " << cp << " target " << rsq << std::endl;
GridStopWatch LinalgTimer;
GridStopWatch MatrixTimer;
@ -115,11 +115,11 @@ template<class Field> class MinimalResidual : public OperatorFunction<Field> {
LinalgTimer.Stop();
std::cout << GridLogIterative << "MinimalResidual: Iteration " << k
<< " residual " << cp << " target " << rsd_sq << std::endl;
<< " residual " << cp << " target " << rsq << std::endl;
std::cout << GridLogDebug << "a = " << a << " c = " << c << " d = " << d << std::endl;
// Stopping condition
if (cp <= rsd_sq) {
if (cp <= rsq) {
SolverTimer.Stop();
Linop.Op(psi, Mr);

View File

@ -58,7 +58,7 @@ int main (int argc, char ** argv)
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
GeneralisedMinimalResidual<LatticeFermion> GMRES(1.0e-8,10000, 1);
GeneralisedMinimalResidual<LatticeFermion> GMRES(1.0e-8, 10000, 5);
GMRES(HermOp,src,result);
Grid_finalize();