42class DummyPreconditioner
46 typedef Backend backend_type;
48 typedef typename Backend::matrix matrix;
49 typedef typename Backend::vector vector;
50 typedef typename Backend::value_type value_type;
51 typedef typename Backend::col_type col_type;
52 typedef typename Backend::ptr_type ptr_type;
53 typedef typename BuiltinBackend<value_type, col_type, ptr_type>::matrix build_matrix;
56 typedef typename Backend::params backend_params;
58 template <
class Matrix>
59 DummyPreconditioner(
const Matrix& M,
60 const params& = params(),
61 const backend_params& bprm = backend_params())
62 : A(Backend::copy_matrix(std::make_shared<build_matrix>(M), bprm))
66 DummyPreconditioner(std::shared_ptr<build_matrix> M,
67 const params& = params(),
68 const backend_params& bprm = backend_params())
69 : A(Backend::copy_matrix(M, bprm))
73 template <
class Vec1,
class Vec2>
74 void apply(
const Vec1& rhs, Vec2&& x)
const
76 backend::copy(rhs, x);
79 std::shared_ptr<matrix> system_matrix_ptr()
const
84 const matrix& system_matrix()
const
96 std::shared_ptr<matrix> A;
98 friend std::ostream& operator<<(std::ostream& os,
const DummyPreconditioner& p)
100 os <<
"identity matrix as preconditioner" << std::endl;
101 os <<
" unknowns: " << backend::nbRow(p.system_matrix()) << std::endl;
102 os <<
" nonzeros: " << backend::nonzeros(p.system_matrix()) << std::endl;