23 template <
class Matrix,
class Vector,
class Preconditioner,
class Real,
26 CHEBY(
const Matrix &A, Vector &x,
const Vector &b,
27 const Preconditioner &M,
int &max_iter, Real &tol,
28 Type eigmin, Type eigmax)
31 Type alpha, beta, c, d;
40 if ((resid =
norm(r) / normb) <= tol) {
46 c = (eigmax - eigmin) / 2.0;
47 d = (eigmax + eigmin) / 2.0;
49 for (
int i = 1; i <= max_iter; i++) {
56 beta = c * alpha / 2.0;
58 alpha = 1.0 / (d - beta);
66 if ((resid =
norm(r) / normb) <= tol) {
A::value_type norm(const A &a)
Euklidean norm of array or expression.
int CHEBY(const Matrix &A, Vector &x, const Vector &b, const Preconditioner &M, int &max_iter, Real &tol, Type eigmin, Type eigmax)