10 template<
typename T,
typename CR>
15 const Real& RsdBiCGStab,
22 FlopCounter flopcount;
24 const Subset&
s =
A.subset();
31 flopcount.addSiteFlops(4*Nc*Ns,
s);
42 flopcount.addFlops(
A.nFlops());
46 flopcount.addSiteFlops(2*Nc*Ns,
s);
83 for(
int k = 1;
k <= MaxBiCGStab && !convP ;
k++) {
89 if( toBool( real(rho) == 0 ) && toBool( imag(rho) == 0 ) ) {
90 QDPIO::cout <<
"BiCGStab breakdown: rho = 0" << std::endl;
105 tmp[
s] =
p - omega_r*v;
118 if( toBool( real(ctmp) == 0 ) && toBool( imag(ctmp) == 0 ) ) {
119 QDPIO::cout <<
"BiCGStab breakdown: <r_0|v> = 0" << std::endl;
142 if( toBool(t_norm == 0) ) {
143 QDPIO::cerr <<
"Breakdown || Ms || = || t || = 0 " << std::endl;
195 flopcount.addSiteFlops(80*Nc*Ns,
s);
196 flopcount.addFlops(2*
A.nFlops());
203 QDPIO::cout <<
"InvBiCRStab: k = " << ret.
n_count <<
" resid = " << ret.
resid << std::endl;
204 flopcount.report(
"invbicrstab", swatch.getTimeInSeconds());
206 if ( ret.
n_count == MaxBiCGStab ) {
207 QDPIO::cerr <<
"Nonconvergence of BiCGStab. MaxIters reached " << std::endl;
216 SystemSolverResults_t
218 const LatticeFermion&
chi,
220 const Real& RsdBiCGStab,
225 return InvBiCGStab_a<LatticeFermion, Complex>(
A,
chi,
psi, RsdBiCGStab, MaxBiCGStab,
isign);
230 SystemSolverResults_t
232 const LatticeFermionF&
chi,
233 LatticeFermionF&
psi,
234 const Real& RsdBiCGStab,
239 return InvBiCRStab_a<LatticeFermionF, ComplexF>(
A,
chi,
psi, RsdBiCGStab, MaxBiCGStab,
isign);
243 SystemSolverResults_t
245 const LatticeFermionD&
chi,
246 LatticeFermionD&
psi,
247 const Real& RsdBiCGStab,
252 return InvBiCRStab_a<LatticeFermionD, ComplexD>(
A,
chi,
psi, RsdBiCGStab, MaxBiCGStab,
isign);
257 SystemSolverResults_t
259 const LatticeStaggeredFermion&
chi,
260 LatticeStaggeredFermion&
psi,
261 const Real& RsdBiCGStab,
266 return InvBiCRStab_a<LatticeStaggeredFermion, Complex>(
A,
chi,
psi, RsdBiCGStab, MaxBiCGStab,
isign);
Primary include file for CHROMA library code.
Conjugate-Gradient algorithm for a generic Linear Operator.
BinaryReturn< C1, C2, FnInnerProduct >::Type_t innerProduct(const QDPSubType< T1, C1 > &s1, const QDPType< T2, C2 > &s2)
static const LatticeInteger & beta(const int dim)
static const LatticeInteger & alpha(const int dim)
Asqtad Staggered-Dirac operator.
LinOpSysSolverMGProtoClover::T T
SystemSolverResults_t InvBiCRStab_a(const LinearOperator< T > &A, const T &chi, T &psi, const Real &RsdBiCGStab, int MaxBiCGStab, enum PlusMinus isign)
SystemSolverResults_t InvBiCGStab(const LinearOperator< LatticeFermionF > &A, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdBiCGStab, int MaxBiCGStab, enum PlusMinus isign)
SystemSolverResults_t InvBiCRStab(const LinearOperator< LatticeFermionF > &A, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdBiCGStab, int MaxBiCGStab, enum PlusMinus isign)
multi1d< LatticeFermion > chi(Ncb)
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
Holds return info from SystemSolver call.