46 #ifndef XPETRA_TPETRAROWMATRIX_HPP 47 #define XPETRA_TPETRAROWMATRIX_HPP 53 #include <Teuchos_Describable.hpp> 62 #include "Tpetra_RowMatrix.hpp" 69 template<class Scalar = RowMatrix<>::scalar_type,
74 :
public RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>
147 void getLocalRowCopy(LocalOrdinal LocalRow,
const Teuchos::ArrayView< LocalOrdinal > &Indices,
const Teuchos::ArrayView< Scalar > &Values,
size_t &NumEntries)
const {
XPETRA_MONITOR(
"TpetraRowMatrix::getLocalRowCopy");
mtx_->getLocalRowCopy(LocalRow, Indices, Values, NumEntries); }
150 void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values)
const {
XPETRA_MONITOR(
"TpetraRowMatrix::getGlobalRowView");
mtx_->getGlobalRowView(GlobalRow, indices, values); }
153 void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values)
const {
XPETRA_MONITOR(
"TpetraRowMatrix::getLocalRowView");
mtx_->getLocalRowView(LocalRow, indices, values); }
179 void apply(
const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X,
MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero())
const { TEUCHOS_TEST_FOR_EXCEPTION(1,
Xpetra::Exceptions::NotImplemented,
"TODO"); }
188 TpetraRowMatrix(
const Teuchos::RCP<Tpetra::RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) :
mtx_(mtx) { }
200 RCP< Tpetra::RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
mtx_;
206 #define XPETRA_TPETRAROWMATRIX_SHORT 207 #endif // XPETRA_TPETRAROWMATRIX_HPP bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
Computes the operator-multivector application.
RCP< Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > mtx_
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
Tpetra::global_size_t getGlobalNumDiags() const
Returns the number of global diagonal entries, based on global row/column index comparisons.
size_t getNodeMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
size_t getNodeNumDiags() const
Returns the number of local diagonal entries, based on global row/column index comparisons.
Tpetra::global_size_t getGlobalNumCols() const
Returns the number of global columns in this matrix.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row indices.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
Tpetra::global_size_t getGlobalNumRows() const
Returns the number of global rows in this matrix.
size_t getNodeNumCols() const
Returns the number of columns needed to apply the forward operator on this node, i.e., the number of elements listed in the column map.
void getLocalRowCopy(LocalOrdinal LocalRow, const Teuchos::ArrayView< LocalOrdinal > &Indices, const Teuchos::ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the graph. Put into storage allocated by callin...
bool isFillComplete() const
Returns true if fillComplete() has been called.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
GlobalOrdinal global_ordinal_type
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator, which must be compatible with X...
RCP< Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_RowMatrixNonConst() const
Get the underlying Tpetra matrix.
Exception throws when you call an unimplemented method of Xpetra.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
size_t global_size_t
Global size_t object.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
LocalOrdinal local_ordinal_type
Tpetra::global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
TpetraRowMatrix(const Teuchos::RCP< Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraCrsMatrix constructor to wrap a Tpetra::CrsMatrix object.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
RCP< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_RowMatrix() const
Get the underlying Tpetra matrix.
#define XPETRA_MONITOR(funcName)
size_t getNodeNumEntries() const
Returns the local number of entries in this matrix.
virtual ~TpetraRowMatrix()
Destructor.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
size_t getNodeNumRows() const
Returns the number of rows owned on the calling node.
const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y...