mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Rename misunderstood "rsd_sq" to "rsq" in MR code
This commit is contained in:
parent
b8ee496ed6
commit
56d32a4afb
@ -63,8 +63,8 @@ template<class Field> class MinimalResidual : public OperatorFunction<Field> {
|
|||||||
RealD guess = norm2(psi);
|
RealD guess = norm2(psi);
|
||||||
assert(std::isnan(guess) == 0);
|
assert(std::isnan(guess) == 0);
|
||||||
|
|
||||||
RealD ssq = norm2(src); // flopcount.addSiteFlops(4*Nc*Ns,s); // stands for "source squared"
|
RealD ssq = norm2(src); // flopcount.addSiteFlops(4*Nc*Ns,s);
|
||||||
RealD rsd_sq = Tolerance * Tolerance * ssq; // flopcount.addSiteFlops(4*Nc*Ns,s); // stands for "residual squared"
|
RealD rsq = Tolerance * Tolerance * ssq; // flopcount.addSiteFlops(4*Nc*Ns,s);
|
||||||
|
|
||||||
Linop.Op(psi, Mr); // flopcount.addFlops(M.nFlops());
|
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: mp " << d << std::endl;
|
||||||
std::cout << GridLogIterative << std::setprecision(4) << "MinimalResidual: cp,r " << cp << std::endl;
|
std::cout << GridLogIterative << std::setprecision(4) << "MinimalResidual: cp,r " << cp << std::endl;
|
||||||
|
|
||||||
if (cp <= rsd_sq) {
|
if (cp <= rsq) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << GridLogIterative << std::setprecision(4)
|
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 LinalgTimer;
|
||||||
GridStopWatch MatrixTimer;
|
GridStopWatch MatrixTimer;
|
||||||
@ -115,11 +115,11 @@ template<class Field> class MinimalResidual : public OperatorFunction<Field> {
|
|||||||
LinalgTimer.Stop();
|
LinalgTimer.Stop();
|
||||||
|
|
||||||
std::cout << GridLogIterative << "MinimalResidual: Iteration " << k
|
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;
|
std::cout << GridLogDebug << "a = " << a << " c = " << c << " d = " << d << std::endl;
|
||||||
|
|
||||||
// Stopping condition
|
// Stopping condition
|
||||||
if (cp <= rsd_sq) {
|
if (cp <= rsq) {
|
||||||
SolverTimer.Stop();
|
SolverTimer.Stop();
|
||||||
|
|
||||||
Linop.Op(psi, Mr);
|
Linop.Op(psi, Mr);
|
||||||
|
@ -58,7 +58,7 @@ int main (int argc, char ** argv)
|
|||||||
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
|
WilsonFermionR Dw(Umu,Grid,RBGrid,mass);
|
||||||
|
|
||||||
MdagMLinearOperator<WilsonFermionR,LatticeFermion> HermOp(Dw);
|
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);
|
GMRES(HermOp,src,result);
|
||||||
|
|
||||||
Grid_finalize();
|
Grid_finalize();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user