21 #ifndef SELDON_FILE_ITERATIVE_BICGCR_CXX
45 #ifdef SELDON_WITH_VIRTUAL
46 template<
class T,
class Vector1>
47 int BiCgcr(
const VirtualMatrix<T>& A, Vector1& x,
const Vector1& b,
48 Preconditioner_Base<T>& M,
49 Iteration<
typename ClassComplexType<T>::Treal>& iter)
51 template <
class Titer,
class Matrix1,
class Vector1,
class Preconditioner>
52 int BiCgcr(
const Matrix1& A, Vector1& x,
const Vector1& b,
56 const int N = A.GetM();
60 typedef typename Vector1::value_type Complexe;
61 Complexe rho, mu, alpha, beta, tau;
62 Vector1 v(b), w(b), s(b), z(b), p(b), a(b);
67 v.Fill(zero); w.Fill(zero); s.Fill(zero);
68 z.Fill(zero); p.Fill(zero); a.Fill(zero);
71 int success_init = iter.
Init(b);
72 if (success_init != 0)
78 iter.
MltAdd(-one, A, x, one, v);
84 M.Solve(A, v, s); Copy(s, p);
86 iter.
Mlt(A, p, a); M.Solve(A, a, w);
98 iter.
Fail(1,
"Bicgcr breakdown #1");
114 iter.
Fail(2,
"Bicgcr breakdown #2");
135 #define SELDON_FILE_ITERATIVE_BICGCR_CXX