4#ifndef DUNE_ISTL_OPERATORS_HH
5#define DUNE_ISTL_OPERATORS_HH
7#include <dune-istl-config.hh>
15#include <dune/common/exceptions.hh>
16#include <dune/common/shared_ptr.hh>
67 template<
class X,
class Y>
81 virtual void apply (
const X& x, Y& y)
const = 0;
91#if DUNE_ISTL_SUPPORT_OLD_CATEGORY_INTERFACE
93 DUNE_THROW(Dune::Exception,
"It is necessary to implement the category method in a derived classes, in the future this method will pure virtual.");
109 template<
class M,
class X,
class Y>
133 template<
class M,
class X,
class Y>
150 void apply (
const X& x, Y& y)
const override
158 _A_->usmv(alpha,x,y);
174 const std::shared_ptr<const M> _A_;
Definition allocator.hh:11
A linear operator.
Definition operators.hh:68
virtual ~LinearOperator()
every abstract base class has a virtual destructor
Definition operators.hh:87
X::field_type field_type
The field type of the operator.
Definition operators.hh:75
virtual void applyscaleadd(field_type alpha, const X &x, Y &y) const =0
apply operator to x, scale and add:
virtual SolverCategory::Category category() const =0
Category of the linear operator (see SolverCategory::Category).
Y range_type
The type of the range of the operator.
Definition operators.hh:73
virtual void apply(const X &x, Y &y) const =0
apply operator to x: The input vector is consistent and the output must also be consistent on the in...
X domain_type
The type of the domain of the operator.
Definition operators.hh:71
A linear operator exporting itself in matrix form.
Definition operators.hh:110
virtual const M & getmat() const =0
get reference to matrix
X domain_type
Definition operators.hh:114
X::field_type field_type
Definition operators.hh:116
Y range_type
Definition operators.hh:115
M matrix_type
export types, usually they come from the derived class
Definition operators.hh:113
MatrixAdapter(std::shared_ptr< const M > A)
constructor: store an std::shared_ptr to a matrix
Definition operators.hh:147
MatrixAdapter(const M &A)
constructor: just store a reference to a matrix
Definition operators.hh:144
void applyscaleadd(field_type alpha, const X &x, Y &y) const override
apply operator to x, scale and add:
Definition operators.hh:156
BlockVector range_type
Definition operators.hh:140
BlockVector domain_type
Definition operators.hh:139
BlockVector::field_type field_type
Definition operators.hh:141
const M & getmat() const override
get reference to matrix
Definition operators.hh:162
SolverCategory::Category category() const override
Category of the solver (see SolverCategory::Category).
Definition operators.hh:168
void apply(const X &x, Y &y) const override
apply operator to x:
Definition operators.hh:150
BCRSMatrix matrix_type
Definition operators.hh:138
Category
Definition solvercategory.hh:23
@ sequential
Category for sequential solvers.
Definition solvercategory.hh:25