5 #error "THIS ROUTINE IS NOT FULLY CONVERTED"
77 const multi1d<Real>& shifts,
78 const multi1d<Real>&
RsdMR,
84 const Subset& sub =
A.subset();
86 if (shifts.size() !=
RsdMR.size())
88 QDPIO::cerr <<
"MInvMR: number of shifts and residuals must match" << std::endl;
92 int n_shift = shifts.size();
96 QDPIO::cerr <<
"MInvMR: You must supply at least 1 mass: mass.size() = "
97 << n_shift << std::endl;
101 multi1d<LatticeFermion> ltmp(
Ncb);
102 multi1d<LatticeFermion>
r(
Ncb);
103 multi1d<LatticeFermion> Ar(
Ncb);
104 multi1d<LatticeComplex>
lc(
Ncb);
118 multi1d<Real> ass(Nmass);
119 multi1d<Complex> rhos(Nmass);
122 multi1d<Boolean> convsP(Nmass);
127 multi1d<Real> rsdmr_sq(Nmass);
143 rsdmr_sq = localNorm2(
RsdMR);
157 for(
k = 1;
k <= MaxMR && ! convP ; ++
k)
172 lc = trace(adj[Ar] *
r);
190 for(
s = 0;
s < Nmass; ++
s)
192 if (convsP[
s])
continue;
196 atmp += adj(
a) * asq;
197 asq = localNorm2(atmp);
202 as = rhos[
s] * atmp2;
203 atmp2 = rhos[
s] * atmp;
206 ass[
s] = localNorm2(as);
223 for(
s = 0;
s < Nmass; ++
s)
225 if (convsP[
s])
continue;
239 PRINTF(
"MInvMR: k = %d s = %d r = %g d = %g\n",
k,
s,sqrt(cs),sqrt(
d));
240 FLUSH_WRITE_NAMELIST(stdout);
251 for(
s = 0;
s < Nmass; ++
s)
265 PRINTF(
"MInvMR (conv): s = %d r = %g m = %g\n",
s,sqrt(
cp),
mass[
s]);
281 void MInvMR(
const LinearOperator<LatticeFermion>& M,
282 const LatticeFermion&
chi,
283 multi1d<LatticeFermion>&
psi,
284 const multi1d<Real>& shifts,
285 const multi1d<Real>&
RsdMR,
295 void MInvMR(
const DiffLinearOperator<LatticeFermion,
296 multi1d<LatticeColorMatrix>,
297 multi1d<LatticeColorMatrix> >& M,
298 const LatticeFermion&
chi,
299 multi1d<LatticeFermion>&
psi,
300 const multi1d<Real>& shifts,
301 const multi1d<Real>&
RsdMR,
void GramSchm(multi1d< LatticeFermion > &psi, const int Npsi, const multi1d< LatticeFermion > &vec, const int Nvec, const Subset &sub)
Gramm-Schmidt orthogonolization.
void MInvMR_a(const LinearOperator< T > &A, const T &chi, multi1d< T > &psi, const multi1d< Real > &shifts, const multi1d< Real > &RsdMR, int MaxMR, int &n_count)
Multishift Conjugate-Gradient (CG1) algorithm for a Linear Operator.
void MInvMR(const LinearOperator< LatticeFermion > &M, const LatticeFermion &chi, multi1d< LatticeFermion > &psi, const multi1d< Real > &shifts, const multi1d< Real > &RsdMR, int MaxMR, int &n_count)
Multishift Conjugate-Gradient (CG1) algorithm for a Linear Operator.
Multishift Conjugate-Gradient algorithm for a Linear Operator.
Asqtad Staggered-Dirac operator.
QDP_error_exit("too many BiCG iterations", n_count, rsd_sq, cp, c, re_rvr, im_rvr, re_a, im_a, re_b, im_b)
multi1d< LatticeFermion > chi(Ncb)
multi1d< LatticeComplex > lc(Ncb)
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
PRINTF("TrLnSolve: n_count = %d, RsdMR = %16.8e, MaxRsd = %16.8e\n", n_count, RsdMR, MaxRsd)