10 template<
typename T,
typename CR>
15 const Real& RsdBiCGStab,
22 FlopCounter flopcount;
24 const Subset&
s =
A.subset();
32 flopcount.addSiteFlops(4*Nc*Ns,
s);
43 flopcount.addFlops(
A.nFlops());
47 flopcount.addSiteFlops(2*Nc*Ns,
s);
74 for(
int k = 1;
k <= MaxBiCGStab && !convP ;
k++) {
80 if( toBool( real(rho) == 0 ) && toBool( imag(rho) == 0 ) ) {
81 QDPIO::cout <<
"BiCGStab breakdown: rho = 0" << std::endl;
96 tmp[
s] =
p - omega_r*v;
109 if( toBool( real(ctmp) == 0 ) && toBool( imag(ctmp) == 0 ) ) {
110 QDPIO::cout <<
"BiCGStab breakdown: <r_0|v> = 0" << std::endl;
133 if( toBool(t_norm == 0) ) {
134 QDPIO::cerr <<
"Breakdown || Ms || = || t || = 0 " << std::endl;
186 flopcount.addSiteFlops(80*Nc*Ns,
s);
187 flopcount.addFlops(2*
A.nFlops());
194 QDPIO::cout <<
"InvBiCGStab: k = " << ret.
n_count <<
" resid = " << ret.
resid << std::endl;
195 flopcount.report(
"invbicgstab", swatch.getTimeInSeconds());
197 if ( ret.
n_count == MaxBiCGStab ) {
198 QDPIO::cerr <<
"Nonconvergence of BiCGStab. MaxIters reached " << std::endl;
207 SystemSolverResults_t
209 const LatticeFermion&
chi,
211 const Real& RsdBiCGStab,
216 return InvBiCGStab_a<LatticeFermion, Complex>(
A,
chi,
psi, RsdBiCGStab, MaxBiCGStab,
isign);
221 SystemSolverResults_t
223 const LatticeFermionF&
chi,
224 LatticeFermionF&
psi,
225 const Real& RsdBiCGStab,
230 return InvBiCGStab_a<LatticeFermionF, ComplexF>(
A,
chi,
psi, RsdBiCGStab, MaxBiCGStab,
isign);
234 SystemSolverResults_t
236 const LatticeFermionD&
chi,
237 LatticeFermionD&
psi,
238 const Real& RsdBiCGStab,
243 return InvBiCGStab_a<LatticeFermionD, ComplexD>(
A,
chi,
psi, RsdBiCGStab, MaxBiCGStab,
isign);
248 SystemSolverResults_t
250 const LatticeStaggeredFermion&
chi,
251 LatticeStaggeredFermion&
psi,
252 const Real& RsdBiCGStab,
257 return InvBiCGStab_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 InvBiCGStab(const LinearOperator< LatticeFermionF > &A, const LatticeFermionF &chi, LatticeFermionF &psi, const Real &RsdBiCGStab, int MaxBiCGStab, enum PlusMinus isign)
multi1d< LatticeFermion > chi(Ncb)
SystemSolverResults_t InvBiCGStab_a(const LinearOperator< T > &A, const T &chi, T &psi, const Real &RsdBiCGStab, int MaxBiCGStab, enum PlusMinus isign)
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double
Holds return info from SystemSolver call.