48 LatticeFermion
r =
b - zeta*
x;
54 Real delta = sqrt(norm2(
r));
57 if( toBool( delta <
epsilon*sqrt(norm2(
b)) ) )
64 Complex phihat = Real(1)/delta;
67 Complex tauhat = delta/rho;
69 LatticeFermion w_old,
p, v_old;
79 Complex
phi = Real(0);
81 Complex lambda = Real(0);
85 Complex r1_old = Real(1);
86 Complex gamma = Real(1);
91 LatticeFermion v, vtilde;
92 Real ftmp = Real(1)/delta;
100 for(
int iter = 1; iter <= MaxSUMR && !convP; iter++) {
112 sigma = sqrt( Real(1) - real( conj(gamma)*gamma ) );
115 Complex
alpha = - gamma * delta;
121 Complex r1hat =
alpha*phihat+conj(
c)*zeta/rho;
130 Real abs_rhat_sq = real(conj(r1hat)*r1hat);
131 Real abs_sigma_sq = sigma*sigma;
132 Real tmp_length = sqrt(abs_rhat_sq + abs_sigma_sq);
134 c = conj(r1hat)/tmp_length;
135 s = - sigma / tmp_length;
138 Complex r1 = -
c*r1hat + cmplx(
s*sigma,0);
141 Complex tau = -
c*tauhat;
147 Complex
eta = tau / r1;
159 LatticeFermion w_minus_v;
160 w_minus_v = w_old - v_old;
163 p =
p - lambda*w_minus_v;
170 x =
x -
eta*w_minus_v;
180 if( toBool( sqrt(real(conj(sigma)*sigma)) >
epsilon) ) {
186 phi = -
c*phihat +
s*conj(gamma)/delta;
192 phihat =
s* phihat + conj(
c) * conj(gamma)/delta;
198 v =
u + gamma*vtilde;
199 Real
ftmp2 = Real(1)/sigma;
203 Complex gconj = conj(gamma);
204 Complex csigma=cmplx(sigma,0);
205 vtilde = csigma*vtilde + gconj*v;
209 Real ftmp3 = Real(1)/sqrt(norm2(vtilde));
216 Real taumod = sqrt(real(conj(tauhat)*tauhat));
217 if ( toBool(taumod <
epsilon) ) convP =
true;
219 QDPIO::cout <<
"Iter " << iter <<
": | tauhat |=" << taumod << std::endl;
233 if(
n_count == MaxSUMR && ! convP ) {
234 QDPIO::cout <<
"Solver Nonconvergence Warning " << std::endl;
242 const LatticeFermion&
b,
Primary include file for CHROMA library code.
Conjugate-Gradient algorithm for a generic Linear Operator.
int epsilon(int i, int j, int k)
BinaryReturn< C1, C2, FnInnerProduct >::Type_t innerProduct(const QDPSubType< T1, C1 > &s1, const QDPType< T2, C2 > &s2)
static const LatticeInteger & alpha(const int dim)
Asqtad Staggered-Dirac operator.
static multi1d< LatticeColorMatrix > u
LinOpSysSolverMGProtoClover::T T
void InvSUMR_a(const LinearOperator< T > &U, const T &b, T &x, const Complex &zeta, const Real &rho, const Real &epsilon, int MaxSUMR, int &n_count)
void InvSUMR(const LinearOperator< LatticeFermion > &U, const LatticeFermion &b, LatticeFermion &x, const Complex &zeta, const Real &rho, const Real &epsilon, int MaxSUMR, int &n_count)
multi1d< LatticeFermion > s(Ncb)
multi1d< LatticeColorMatrix > U