7#ifndef TBCI_SOLVER_CHEBY_H
8#define TBCI_SOLVER_CHEBY_H
10#include "tbci/basics.h"
11#include "tbci/solver/precond.h"
31#ifndef HAVE_BCXX_TYPENAME_BUG
59template < typename T, typename SysMatrix, typename SysVector >
65 unsigned int dim = A.rows();
66 T alpha(0), beta,
c, d;
67 SysVector
p(dim), q(dim), z(dim);
69 double normb =
b.fabs();
70 SysVector r(
b - A *
x);
75 if ((resid = r.fabs() / normb) <= tol)
82 c = (eigmax - eigmin) / 2.0;
83 d = (eigmax + eigmin) / 2.0;
85 for (
unsigned int i = 1;
i <= max_iter;
i++)
95 beta =
c * alpha / 2.0;
97 alpha = 1.0 / (d - beta);
105 if ((resid = r.fabs() / normb) <= tol)
const Vector< T > const Vector< T > const Vector< T > & p
const Vector< T > const Vector< T > & x
NAMESPACE_TBCI Vector< T > class NN friend int CHEBY(const BdMatrix< T > &, Vector< T > &, const Vector< T > &, const Preconditioner_Sig< T, BdMatrix< T > > &, unsigned int &, double &, T, T)
The class BdMatrix is an implementation to store and do operations on sparse Matrices with a band str...
Abstract base class for all Preconditioners.
virtual TVector< T > solve(const Vector< T > &) const =0