42#ifndef TPETRA_CRSMATRIX_UQ_PCE_DEF_HPP
43#define TPETRA_CRSMATRIX_UQ_PCE_DEF_HPP
47#include "Tpetra_CrsMatrix_def.hpp"
53#define TPETRA_CRSMATRIX_UQ_PCE_SPEC(Scalar,LocalOrdinal,GlobalOrdinal,Node) \
55 Teuchos::RCP<MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > \
56 CrsMatrix<Scalar , LocalOrdinal, GlobalOrdinal, Node>:: \
57 getColumnMapMultiVector (const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& X_domainMap, \
58 const bool force) const \
60 using Teuchos::null; \
64 TEUCHOS_TEST_FOR_EXCEPTION( \
65 ! this->hasColMap (), std::runtime_error, "Tpetra::CrsMatrix::getColumn" \
66 "MapMultiVector: You may only call this method if the matrix has a " \
67 "column Map. If the matrix does not yet have a column Map, you should " \
68 "first call fillComplete (with domain and range Map if necessary)."); \
70 TEUCHOS_TEST_FOR_EXCEPTION( \
71 ! this->getGraph ()->isFillComplete (), std::runtime_error, "Tpetra::" \
72 "CrsMatrix::getColumnMapMultiVector: You may only call this method if " \
73 "this matrix's graph is fill complete."); \
75 const size_t numVecs = X_domainMap.getNumVectors (); \
76 RCP<const import_type> importer = this->getGraph ()->getImporter (); \
77 RCP<const map_type> colMap = this->getColMap (); \
81 if (! importer.is_null () || force) { \
82 if (importMV_.is_null () || \
83 importMV_->getNumVectors () != numVecs || \
84 (Kokkos::dimension_scalar(*importMV_) != \
85 Kokkos::dimension_scalar(X_domainMap))) { \
86 X_colMap = rcp (new MV (colMap, numVecs)); \
87 importMV_ = X_colMap; \
90 X_colMap = importMV_; \
97 Teuchos::RCP<MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > \
98 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>:: \
99 getRowMapMultiVector (const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Y_rangeMap, \
100 const bool force) const \
102 using Teuchos::null; \
103 using Teuchos::RCP; \
104 using Teuchos::rcp; \
106 TEUCHOS_TEST_FOR_EXCEPTION( \
107 ! this->getGraph ()->isFillComplete (), std::runtime_error, "Tpetra::" \
108 "CrsMatrix::getRowMapMultiVector: You may only call this method if this " \
109 "matrix's graph is fill complete."); \
111 const size_t numVecs = Y_rangeMap.getNumVectors (); \
112 RCP<const export_type> exporter = this->getGraph ()->getExporter (); \
113 RCP<const map_type> rowMap = this->getRowMap (); \
117 if (! exporter.is_null () || force) { \
118 if (exportMV_.is_null () || \
119 exportMV_->getNumVectors () != numVecs || \
120 (Kokkos::dimension_scalar(*exportMV_) != \
121 Kokkos::dimension_scalar(Y_rangeMap))) { \
122 Y_rowMap = rcp (new MV (rowMap, numVecs)); \
123 exportMV_ = Y_rowMap; \
126 Y_rowMap = exportMV_; \