48 #ifndef PACKAGES_XPETRA_SUP_UTILS_XPETRA_ITERATOROPS_HPP_ 49 #define PACKAGES_XPETRA_SUP_UTILS_XPETRA_ITERATOROPS_HPP_ 69 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 bool call_FillComplete_on_result =
true,
77 bool doOptimizeStorage =
true,
78 const std::string & label = std::string()) {
81 std::string msg =
"XpetraExt::MatrixMatrix::Jacobi: row map of C is not same as row map of A";
85 std::string msg =
"XpetraExt::MatrixMatrix::Jacobi: row map of C is not same as row map of B";
94 bool haveMultiplyDoFillComplete = call_FillComplete_on_result && doOptimizeStorage;
97 #ifndef HAVE_XPETRA_EPETRAEXT 103 #ifdef HAVE_XPETRA_TPETRA 114 if(call_FillComplete_on_result && !haveMultiplyDoFillComplete) {
116 params->
set(
"Optimize Storage",doOptimizeStorage);
123 C.
CreateView(
"stridedMaps", rcpA,
false, rcpB,
false);
127 template <
class GlobalOrdinal>
134 bool call_FillComplete_on_result,
135 bool doOptimizeStorage,
136 const std::string & label) {
140 typedef GlobalOrdinal
GO;
144 std::string msg =
"XpetraExt::MatrixMatrix::Jacobi: row map of C is not same as row map of A";
148 std::string msg =
"XpetraExt::MatrixMatrix::Jacobi: row map of C is not same as row map of B";
157 bool haveMultiplyDoFillComplete = call_FillComplete_on_result && doOptimizeStorage;
160 # ifndef HAVE_XPETRA_EPETRAEXT 171 std::ostringstream buf;
173 std::string msg =
"EpetraExt::MatrixMatrix::Jacobi return value of " + buf.str();
178 #ifdef HAVE_XPETRA_TPETRA 189 if(call_FillComplete_on_result && !haveMultiplyDoFillComplete) {
191 params->
set(
"Optimize Storage",doOptimizeStorage);
198 C.
CreateView(
"stridedMaps", rcpA,
false, rcpB,
false);
201 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 208 bool call_FillComplete_on_result,
209 bool doOptimizeStorage,
210 const std::string & label) {
211 JacobiT<int>(omega, Dinv, A, B, C, call_FillComplete_on_result, doOptimizeStorage, label);
215 #ifdef HAVE_XPETRA_INT_LONG_LONG 222 bool call_FillComplete_on_result,
223 bool doOptimizeStorage,
224 const std::string & label) {
225 JacobiT<long long>(omega, Dinv, A, B, C, call_FillComplete_on_result, doOptimizeStorage, label);
227 #endif // HAVE_XPETRA_INT_LONG_LONG 236 template <
class Scalar,
237 class LocalOrdinal = int,
238 class GlobalOrdinal = LocalOrdinal,
243 #undef XPETRA_ITERATOROPS_SHORT 255 const std::string & label) {
264 if (C == Teuchos::null)
268 C->CreateView(
"stridedMaps", rcpFromRef(A),
false, rcpFromRef(B),
false);
278 #define XPETRA_ITERATOROPS_SHORT void Jacobi(double omega, const Xpetra::Vector< double, int, int > &Dinv, const Xpetra::Matrix< double, int, int > &A, const Xpetra::Matrix< double, int, int > &B, Xpetra::Matrix< double, int, int > &C, bool call_FillComplete_on_result, bool doOptimizeStorage, const std::string &label)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Exception throws to report errors in the internal logical of the program.
Xpetra utility class containing iteration operators.
static RCP< Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op2NonConstTpetraCrs(RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op)
virtual void fillComplete(const RCP< const Map > &domainMap, const RCP< const Map > &rangeMap, const RCP< ParameterList > ¶ms=null)=0
Signal that data entry is complete, specifying domain and range maps.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void Jacobi(Scalar omega, const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Dinv, const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &C, bool call_FillComplete_on_result=true, bool doOptimizeStorage=true, const std::string &label=std::string())
virtual bool isFillComplete() const =0
Returns true if fillComplete() has been called and the matrix is in compute mode. ...
void CreateView(viewLabel_t viewLabel, const RCP< const Map > &rowMap, const RCP< const Map > &colMap)
static RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Jacobi(Scalar omega, const Vector &Dinv, const Matrix &A, const Matrix &B, RCP< Matrix > C_in, Teuchos::FancyOStream &fos, const std::string &label)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
void JacobiT(double omega, const Xpetra::Vector< double, int, GlobalOrdinal > &Dinv, const Xpetra::Matrix< double, int, GlobalOrdinal > &A, const Xpetra::Matrix< double, int, GlobalOrdinal > &B, Xpetra::Matrix< double, int, GlobalOrdinal > &C, bool call_FillComplete_on_result, bool doOptimizeStorage, const std::string &label)
static RCP< Epetra_CrsMatrix > Op2NonConstEpetraCrs(RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op)
virtual Teuchos::RCP< const Map > getRangeMap() const =0
The Map associated with the range of this operator, which must be compatible with Y...
static RCP< Matrix > Build(const RCP< const Map > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile)
Constructor specifying the number of non-zeros for all rows.
static RCP< const Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op2TpetraCrs(RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op)
virtual const RCP< const Map > & getRowMap() const
Returns the Map that describes the row distribution in this matrix.
virtual Teuchos::RCP< const Map > getDomainMap() const =0
The Map associated with the domain of this operator, which must be compatible with X...
Xpetra-specific matrix class.