19 const Matrix& A,
bool transposeA,
20 const Matrix& P,
bool transposeP,
22 bool call_FillComplete_on_result,
23 bool doOptimizeStorage,
24 const std::string& label,
27 Exceptions::RuntimeError,
"XpetraExt::TripleMatrixMultiply::MultiplyRAP: row map of Ac is not same as row map of R");
29 Exceptions::RuntimeError,
"XpetraExt::TripleMatrixMultiply::MultiplyRAP: row map of Ac is not same as domain map of R");
35 bool haveMultiplyDoFillComplete = call_FillComplete_on_result && doOptimizeStorage;
40#ifdef HAVE_XPETRA_TPETRA
42 if (helpers::isTpetraCrs(R) && helpers::isTpetraCrs(A) && helpers::isTpetraCrs(P)) {
51 Tpetra::TripleMatrixMultiply::MultiplyRAP(tpR, transposeR, tpA, transposeA, tpP, transposeP, tpAc, haveMultiplyDoFillComplete, label, params);
52 }
else if (helpers::isTpetraBlockCrs(R) && helpers::isTpetraBlockCrs(A) && helpers::isTpetraBlockCrs(P)) {
58 std::cout <<
"WARNING: Using inefficient BlockCrs Multiply Placeholder" << std::endl;
65 using CRS = Tpetra::CrsMatrix<SC, LO, GO, NO>;
73 const bool do_fill_complete =
true;
74 Tpetra::TripleMatrixMultiply::MultiplyRAP(*Rcrs, transposeR, *Acrs, transposeA, *Pcrs, transposeP, *Accrs, do_fill_complete, label, params);
83 Ac_w->replaceCrsMatrix(Ac_p);
93 if (call_FillComplete_on_result && !haveMultiplyDoFillComplete) {
95 fillParams->set(
"Optimize Storage", doOptimizeStorage);
105 const std::string stridedViewLabel(
"stridedMaps");
106 const size_t blkSize = 1;
107 std::vector<size_t> stridingInfo(1, blkSize);
108 LocalOrdinal stridedBlockId = -1;
110 if (R.
IsView(stridedViewLabel)) {
111 rangeMap = transposeR ? R.
getColMap(stridedViewLabel) : R.
getRowMap(stridedViewLabel);
117 if (P.
IsView(stridedViewLabel)) {
118 domainMap = transposeP ? P.
getRowMap(stridedViewLabel) : P.
getColMap(stridedViewLabel);
123 Ac.
CreateView(stridedViewLabel, rangeMap, domainMap);
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.
static RCP< Xpetra::StridedMap< LocalOrdinal, GlobalOrdinal, Node > > Build(UnderlyingLib lib, global_size_t numGlobalElements, GlobalOrdinal indexBase, std::vector< size_t > &stridingInfo, const Teuchos::RCP< const Teuchos::Comm< int > > &comm, LocalOrdinal stridedBlockId=-1, GlobalOrdinal offset=0, LocalGlobal lg=Xpetra::GloballyDistributed)
Map constructor with Xpetra-defined contiguous uniform distribution.
static void MultiplyRAP(const Matrix &R, bool transposeR, const Matrix &A, bool transposeA, const Matrix &P, bool transposeP, Matrix &Ac, bool call_FillComplete_on_result=true, bool doOptimizeStorage=true, const std::string &label=std::string(), const RCP< ParameterList > ¶ms=null)