00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef XPETRA_TPETRAROWMATRIX_HPP
00047 #define XPETRA_TPETRAROWMATRIX_HPP
00048
00049
00050
00051
00052
00053 #include <Teuchos_Describable.hpp>
00054 #include "Xpetra_ConfigDefs.hpp"
00055 #include "Xpetra_Map.hpp"
00056 #include "Xpetra_RowGraph.hpp"
00057 #include "Xpetra_Vector.hpp"
00058
00059 #include "Xpetra_TpetraConfigDefs.hpp"
00060 #include "Xpetra_TpetraMap.hpp"
00061
00062 #include "Tpetra_RowMatrix.hpp"
00063
00064 #include "Xpetra_RowMatrix.hpp"
00065 #include "Xpetra_Exceptions.hpp"
00066
00067 namespace Xpetra {
00068
00069 template<class Scalar = RowMatrix<>::scalar_type,
00070 class LocalOrdinal = typename RowMatrix<Scalar>::local_ordinal_type,
00071 class GlobalOrdinal = typename RowMatrix<Scalar, LocalOrdinal>::global_ordinal_type,
00072 class Node = typename RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal>::node_type>
00073 class TpetraRowMatrix
00074 : public RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>
00075 {
00076
00077 public:
00078
00080
00081
00083 virtual ~TpetraRowMatrix() { }
00084
00086
00088
00089
00091 const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const { XPETRA_MONITOR("TpetraRowMatrix::getRowMap"); return toXpetra(mtx_->getRowMap()); }
00092
00094 const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const { XPETRA_MONITOR("TpetraRowMatrix::getColMap"); return toXpetra(mtx_->getColMap()); }
00095
00097 Tpetra::global_size_t getGlobalNumRows() const { XPETRA_MONITOR("TpetraRowMatrix::getGlobalNumRows"); return mtx_->getGlobalNumRows(); }
00098
00100 Tpetra::global_size_t getGlobalNumCols() const { XPETRA_MONITOR("TpetraRowMatrix::getGlobalNumCols"); return mtx_->getGlobalNumCols(); }
00101
00103 size_t getNodeNumRows() const { XPETRA_MONITOR("TpetraRowMatrix::getNodeNumRows"); return mtx_->getNodeNumRows(); }
00104
00106 size_t getNodeNumCols() const { XPETRA_MONITOR("TpetraRowMatrix::getNodeNumCols"); return mtx_->getNodeNumCols(); }
00107
00109 Tpetra::global_size_t getGlobalNumEntries() const { XPETRA_MONITOR("TpetraRowMatrix::getGlobalNumEntries"); return mtx_->getGlobalNumEntries(); }
00110
00112 size_t getNodeNumEntries() const { XPETRA_MONITOR("TpetraRowMatrix::getNodeNumEntries"); return mtx_->getNodeNumEntries(); }
00113
00115 size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { XPETRA_MONITOR("TpetraRowMatrix::getNumEntriesInLocalRow"); return mtx_->getNumEntriesInLocalRow(localRow); }
00116
00118 Tpetra::global_size_t getGlobalNumDiags() const { XPETRA_MONITOR("TpetraRowMatrix::getGlobalNumDiags"); return mtx_->getGlobalNumDiags(); }
00119
00121 size_t getNodeNumDiags() const { XPETRA_MONITOR("TpetraRowMatrix::getNodeNumDiags"); return mtx_->getNodeNumDiags(); }
00122
00124 size_t getGlobalMaxNumRowEntries() const { XPETRA_MONITOR("TpetraRowMatrix::getGlobalMaxNumRowEntries"); return mtx_->getGlobalMaxNumRowEntries(); }
00125
00127 size_t getNodeMaxNumRowEntries() const { XPETRA_MONITOR("TpetraRowMatrix::getNodeMaxNumRowEntries"); return mtx_->getNodeMaxNumRowEntries(); }
00128
00130 bool isLocallyIndexed() const { XPETRA_MONITOR("TpetraRowMatrix::isLocallyIndexed"); return mtx_->isLocallyIndexed(); }
00131
00133 bool isGloballyIndexed() const { XPETRA_MONITOR("TpetraRowMatrix::isGloballyIndexed"); return mtx_->isGloballyIndexed(); }
00134
00136 bool isFillComplete() const { XPETRA_MONITOR("TpetraRowMatrix::isFillComplete"); return mtx_->isFillComplete(); }
00137
00139 bool supportsRowViews() const { XPETRA_MONITOR("TpetraRowMatrix::supportsRowViews"); return mtx_->supportsRowViews(); }
00140
00142
00144
00145
00147 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); }
00148
00150 void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const { XPETRA_MONITOR("TpetraRowMatrix::getGlobalRowView"); mtx_->getGlobalRowView(GlobalRow, indices, values); }
00151
00153 void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const { XPETRA_MONITOR("TpetraRowMatrix::getLocalRowView"); mtx_->getLocalRowView(LocalRow, indices, values); }
00154
00156 void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const { TEUCHOS_TEST_FOR_EXCEPTION(1, Xpetra::Exceptions::NotImplemented, "TODO"); }
00157
00158
00160
00162
00163
00165 typename ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const { XPETRA_MONITOR("TpetraRowMatrix::getFrobeniusNorm"); return mtx_->getFrobeniusNorm(); }
00166
00168
00170
00171
00173 const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const { XPETRA_MONITOR("TpetraRowMatrix::getDomainMap"); return toXpetra(mtx_->getDomainMap()); }
00174
00176 const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const { XPETRA_MONITOR("TpetraRowMatrix::getRangeMap"); return toXpetra(mtx_->getRangeMap()); }
00177
00179 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"); }
00180
00181
00183
00185
00186
00188 TpetraRowMatrix(const Teuchos::RCP<Tpetra::RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) : mtx_(mtx) { }
00189
00191 RCP<const Tpetra::RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_RowMatrix() const { return mtx_; }
00192
00194 RCP<Tpetra::RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_RowMatrixNonConst() const { return mtx_; }
00195
00197
00198 private:
00199
00200 RCP< Tpetra::RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > mtx_;
00201
00202 };
00203
00204 }
00205
00206 #define XPETRA_TPETRAROWMATRIX_SHORT
00207 #endif // XPETRA_TPETRAROWMATRIX_HPP