42 #ifndef TPETRA_TRIPLEMATRIXMULTIPLY_DECL_HPP
43 #define TPETRA_TRIPLEMATRIXMULTIPLY_DECL_HPP
46 #include <Teuchos_RCP.hpp>
47 #include <Teuchos_Array.hpp>
48 #include "Tpetra_ConfigDefs.hpp"
49 #include "Tpetra_CrsMatrix.hpp"
50 #include "Tpetra_Vector.hpp"
51 #include "TpetraExt_MMHelpers.hpp"
61 namespace TripleMatrixMultiply {
95 template <
class Scalar,
100 const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& R,
102 const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
104 const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& P,
106 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
107 bool call_FillComplete_on_result =
true,
108 const std::string& label = std::string(),
109 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
116 template<
class Scalar,
120 void mult_R_A_P_newmatrix(
121 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Rview,
122 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
123 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
124 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
125 const std::string& label = std::string(),
126 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
128 template<
class Scalar,
132 void mult_R_A_P_reuse(
133 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Rview,
134 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
135 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
136 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
137 const std::string& label = std::string(),
138 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
140 template<
class Scalar,
144 void mult_PT_A_P_newmatrix(
145 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
146 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
147 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
148 const std::string& label = std::string(),
149 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
151 template<
class Scalar,
155 void mult_PT_A_P_reuse(
156 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
157 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
158 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
159 const std::string& label = std::string(),
160 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
166 template<
class Scalar,
170 struct KernelWrappers3MMM {
172 static inline void mult_PT_A_P_newmatrix_kernel_wrapper_2pass(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
173 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
174 const Teuchos::Array<LocalOrdinal> & Acol2PRow,
175 const Teuchos::Array<LocalOrdinal> & Acol2PRowImport,
176 const Teuchos::Array<LocalOrdinal> & Pcol2Accol,
177 const Teuchos::Array<LocalOrdinal> & PIcol2Accol,
178 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
179 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
180 const std::string& label = std::string(),
181 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
188 #endif // TPETRA_TRIPLEMATRIXMULTIPLY_DECL_HPP
void MultiplyRAP(const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &R, bool transposeR, const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, bool transposeA, const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &P, bool transposeP, CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Ac, bool call_FillComplete_on_result=true, const std::string &label=std::string(), const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Sparse matrix-matrix multiply.