QDPIO::cout << "WlInvCG: k = " << k << "  cp = " << cp << endl;
QDPIO::cout << "InvCG1: k = " << k << "  cp = " << cp << endl;
void InvCG1_a(const LinearOperator<T>& A,	      const T& chi,	      T& psi,	      const Real& RsdCG, 	      int MaxCG, 	      int& n_count){  const OrderedSubset& s = A.subset();  Real rsd_sq = (RsdCG * RsdCG) * Real(norm2(chi,s));  //  //  r[0]  :=  Chi - A . Psi[0]       //                      //  r  :=  [ Chi  -  A . psi ]  T tmp1, tmp2;  tmp1 = tmp2 = zero;   T r = zero;  // A is Hermitian  A(tmp1, psi, PLUS);  r[s] = chi - tmp1;  //  p[1]  :=  r[0]  T p = zero;  p[s] = r;    //  Cp = |r[0]|^2  Double cp = norm2(r, s);   	       	   /* 2 Nc Ns  flops */  QDPIO::cout << "InvCG1: k = 0  cp = " << cp << "  rsd_sq = " << rsd_sq << endl;  //  IF |r[0]| <= RsdCG |Chi| THEN RETURN;  if ( toBool(cp  <=  rsd_sq) )  {    n_count = 0;    return;  }  //  //  FOR k FROM 1 TO MaxCG DO  //  T    ap;  Real b;  Double c;  Complex a;  Real d;  for(int k = 1; k <= MaxCG; ++k)  {    //  c  =  | r[k-1] |**2    c = cp;    //  a[k] := | r[k-1] |**2 / < p[k], Ap[k] > ;    //      	       	       	       	       	  +    //  First compute  d  =  < p, A.p >        // SCRAP THIS IDEA FOR NOW AND DO <p, A.p> TO KEEP TRACK OF     // "PRECONDITIONING" So ap =MdagMp    A(ap, p, PLUS);        // d = <p,A.p>    d = innerProductReal(p, ap, s);    //    a = Real(c);    a = Real(c)/d;    //  Psi[k] += a[k] p[k]    psi[s] += a * p;	/* 2 Nc Ns  flops */    //  r[k] -= a[k] A . p[k] ;    //      	          //  r  =  r  - a A p      r[s] -= a * ap;    //  IF |r[k]| <= RsdCG |Chi| THEN RETURN;    //  cp  =  | r[k] |**2    cp = norm2(r, s);	                /* 2 Nc Ns  flops */#if 0    QDPIO::cout << "WlInvCG: k = " << k << "  cp = " << cp << endl;#endif    if ( toBool(cp  <=  rsd_sq) )    {      n_count = k;      return;    }    //  b[k+1] := |r[k]|**2 / |r[k-1]|**2    b = Real(cp) / Real(c);    //  p[k+1] := r[k] + b[k+1] p[k]    p[s] = r + b*p;	/* Nc Ns  flops */  }  n_count = MaxCG;  QDP_error_exit("too many CG iterations: count = %d", n_count);}