42 #ifndef TPETRA_ROWMATRIX_DECL_HPP
43 #define TPETRA_ROWMATRIX_DECL_HPP
45 #include <Teuchos_Describable.hpp>
46 #include <Kokkos_DefaultNode.hpp>
48 #include "Tpetra_ConfigDefs.hpp"
49 #include "Tpetra_Operator.hpp"
50 #include "Tpetra_RowGraph.hpp"
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60 template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
63 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
65 #endif // DOXYGEN_SHOULD_SKIP_THIS
94 template <
class Scalar,
95 class LocalOrdinal = int,
96 class GlobalOrdinal = LocalOrdinal,
97 class Node = Kokkos::DefaultNode::DefaultNodeType>
99 virtual public Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node>,
126 virtual const Teuchos::RCP<const Teuchos::Comm<int> > &
getComm()
const = 0;
129 virtual Teuchos::RCP<Node>
getNode()
const = 0;
132 virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > &
getRowMap()
const = 0;
135 virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > &
getColMap()
const = 0;
138 virtual Teuchos::RCP<const RowGraph<LocalOrdinal,GlobalOrdinal,Node> >
getGraph()
const = 0;
262 const Teuchos::ArrayView<GlobalOrdinal> &Indices,
263 const Teuchos::ArrayView<Scalar> &Values,
264 size_t &NumEntries)
const = 0;
288 const Teuchos::ArrayView<LocalOrdinal> &Indices,
289 const Teuchos::ArrayView<Scalar> &Values,
290 size_t &NumEntries)
const = 0;
318 ArrayView<const GlobalOrdinal> &indices,
319 ArrayView<const Scalar> &values)
const = 0;
347 ArrayView<const LocalOrdinal> &indices,
348 ArrayView<const Scalar> &values)
const = 0;
389 virtual typename ScalarTraits<Scalar>::magnitudeType
getFrobeniusNorm()
const = 0;
442 virtual Teuchos::RCP<RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
443 add (
const Scalar& alpha,
448 const Teuchos::RCP<Teuchos::ParameterList>& params=Teuchos::null)
const;
460 pack (
const Teuchos::ArrayView<const LocalOrdinal>& exportLIDs,
461 Teuchos::Array<char>& exports,
462 const Teuchos::ArrayView<size_t>& numPacketsPerLID,
463 size_t& constantNumPackets,
468 #endif // TPETRA_ROWMATRIX_DECL_HPP
virtual void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const =0
Get a constant, nonpersisting, locally indexed view of the given row of the matrix.
virtual global_size_t getGlobalNumDiags() const =0
The number of global diagonal entries, based on global row/column index comparisons.
virtual void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const =0
Get a constant, nonpersisting, globally indexed view of the given row of the matrix.
virtual bool isLocallyIndexed() const =0
Whether matrix indices are locally indexed.
virtual size_t getNodeMaxNumRowEntries() const =0
The maximum number of entries across all rows/columns on this node.
virtual global_size_t getGlobalNumCols() const =0
The global number of columns of this matrix.
virtual GlobalOrdinal getIndexBase() const =0
The index base for global indices in this matrix.
virtual const Teuchos::RCP< const Teuchos::Comm< int > > & getComm() const =0
The communicator over which this matrix is distributed.
Node node_type
The Kokkos Node type.
virtual size_t getNodeNumRows() const =0
The number of rows owned by the calling process.
virtual void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)=0
Scale the RowMatrix on the right with the given Vector x.
virtual size_t getNodeNumCols() const =0
The number of columns needed to apply the forward operator on this node.
virtual void getLocalRowCopy(LocalOrdinal LocalRow, const Teuchos::ArrayView< LocalOrdinal > &Indices, const Teuchos::ArrayView< Scalar > &Values, size_t &NumEntries) const =0
Get a copy of the given local row's entries.
virtual bool isLowerTriangular() const =0
Whether this matrix is lower triangular.
virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const =0
The current number of entries on the calling process in the specified local row.
virtual void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)=0
Scale the RowMatrix on the left with the given Vector x.
Abstract base class for sources of an Import or Export, that also know how to pack themselves...
virtual Teuchos::RCP< const RowGraph< LocalOrdinal, GlobalOrdinal, Node > > getGraph() const =0
The RowGraph associated with this matrix.
LocalOrdinal local_ordinal_type
The type of local indices.
virtual ~RowMatrix()
Destructor (virtual for memory safety of derived classes).
virtual bool isUpperTriangular() const =0
Whether this matrix is upper triangular.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getRowMap() const =0
The Map that describes the distribution of rows over processes.
size_t global_size_t
Global size_t object.
virtual void getGlobalRowCopy(GlobalOrdinal GlobalRow, const Teuchos::ArrayView< GlobalOrdinal > &Indices, const Teuchos::ArrayView< Scalar > &Values, size_t &NumEntries) const =0
Get a copy of the given global row's entries.
virtual size_t getGlobalMaxNumRowEntries() const =0
The maximum number of entries across all rows/columns on all nodes.
Abstract interface for linear operators accepting Tpetra MultiVector objects.
GlobalOrdinal global_ordinal_type
The type of global indices.
Abstract base class for objects that can be the source of an Import or Export operation, and that also know how to pack their data to send to the target object.
virtual ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const =0
The Frobenius norm of the matrix.
virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const =0
The current number of entries on the calling process in the specified global row. ...
Sets up and executes a communication plan for a Tpetra DistObject.
virtual void pack(const Teuchos::ArrayView< const LocalOrdinal > &exportLIDs, Teuchos::Array< char > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets, Distributor &distor) const
Implementation of SrcDistObjectWithPack.
virtual void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const =0
Get a copy of the diagonal entries, distributed by the row Map.
virtual Teuchos::RCP< Node > getNode() const =0
The Kokkos Node instance.
virtual bool isFillComplete() const =0
Whether fillComplete() has been called.
virtual global_size_t getGlobalNumEntries() const =0
The global number of stored (structurally nonzero) entries.
virtual Teuchos::RCP< RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > add(const Scalar &alpha, const RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null) const
Return a new RowMatrix which is the result of beta*this + alpha*A.
Scalar scalar_type
The type of the entries in the sparse matrix.
Describes a parallel distribution of objects over processes.
virtual bool supportsRowViews() const =0
Whether this object implements getLocalRowView() and getGlobalRowView().
A read-only, row-oriented interface to a sparse matrix.
A distributed dense vector.
virtual size_t getNodeNumEntries() const =0
The local number of stored (structurally nonzero) entries.
virtual bool isGloballyIndexed() const =0
Whether matrix indices are globally indexed.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getColMap() const =0
The Map that describes the distribution of columns over processes.
virtual bool hasColMap() const =0
Whether this matrix has a well-defined column map.
virtual size_t getNodeNumDiags() const =0
The number of local diagonal entries, based on global row/column index comparisons.
virtual global_size_t getGlobalNumRows() const =0
The global number of rows of this matrix.