20 #ifndef GEOS_LINEARALGEBRA_INTERFACES_LINEAROPERATOR_HPP_
21 #define GEOS_LINEARALGEBRA_INTERFACES_LINEAROPERATOR_HPP_
33 template<
typename VECTOR >
73 r.axpby( 1.0, b, -1.0 );
111 virtual MPI_Comm
comm()
const = 0;
Abstract base class for linear operators.
virtual globalIndex numGlobalCols() const =0
Get the number of global columns.
VECTOR Vector
Alias for template parameter.
LinearOperator()=default
Constructor.
virtual globalIndex numGlobalRows() const =0
Get the number of global rows.
virtual void residual(Vector const &x, Vector const &b, Vector &r) const
Compute residual r = b - this(x).
virtual localIndex numLocalRows() const =0
Get the number of local rows.
virtual ~LinearOperator()=default
Destructor.
virtual void apply(Vector const &src, Vector &dst) const =0
Apply operator to a vector, dst = this(src).
virtual localIndex numLocalCols() const =0
Get the number of local columns.
virtual MPI_Comm comm() const =0
Get the MPI communicator the matrix was created with.
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).