13class DiagPreconditioner
17 typedef AlgebraT AlgebraType ;
18 typedef typename AlgebraType::Matrix MatrixType;
19 typedef typename AlgebraType::Vector VectorType;
20 typedef typename MatrixType::ValueType ValueType;
23 DiagPreconditioner(AlgebraType& algebra,
24 MatrixType
const& matrix)
29 virtual ~DiagPreconditioner(){};
34 m_algebra.allocate(AlgebraType::resource(m_matrix), m_inv_diag);
35 m_algebra.assign(m_inv_diag, 1.);
36 m_algebra.computeInvDiag(m_matrix, m_inv_diag);
44 template <
typename AlgebraType>
45 void solve(AlgebraType& algebra,
49 algebra.pointwiseMult(m_inv_diag, x, y);
53 AlgebraType& m_algebra;
54 MatrixType
const& m_matrix;
55 VectorType m_inv_diag;