10 #ifndef TPETRA_TRIPLEMATRIXMULTIPLY_DECL_HPP
11 #define TPETRA_TRIPLEMATRIXMULTIPLY_DECL_HPP
14 #include <Teuchos_RCP.hpp>
15 #include <Teuchos_Array.hpp>
16 #include "Tpetra_ConfigDefs.hpp"
17 #include "Tpetra_CrsMatrix.hpp"
18 #include "Tpetra_Vector.hpp"
19 #include "TpetraExt_MMHelpers.hpp"
29 namespace TripleMatrixMultiply {
63 template <
class Scalar,
68 const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& R,
70 const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& A,
72 const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& P,
74 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
75 bool call_FillComplete_on_result =
true,
76 const std::string& label = std::string(),
77 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
84 template<
class Scalar,
88 void mult_R_A_P_newmatrix(
89 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Rview,
90 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
91 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
92 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
93 const std::string& label = std::string(),
94 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
96 template<
class Scalar,
100 void mult_R_A_P_reuse(
101 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Rview,
102 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
103 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
104 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
105 const std::string& label = std::string(),
106 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
108 template<
class Scalar,
112 void mult_PT_A_P_newmatrix(
113 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
114 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
115 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
116 const std::string& label = std::string(),
117 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
119 template<
class Scalar,
123 void mult_PT_A_P_reuse(
124 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
125 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
126 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
127 const std::string& label = std::string(),
128 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
134 template<
class Scalar,
138 struct KernelWrappers3MMM {
140 static inline void mult_PT_A_P_newmatrix_kernel_wrapper_2pass(CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Aview,
141 CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Pview,
142 const Teuchos::Array<LocalOrdinal> & Acol2PRow,
143 const Teuchos::Array<LocalOrdinal> & Acol2PRowImport,
144 const Teuchos::Array<LocalOrdinal> & Pcol2Accol,
145 const Teuchos::Array<LocalOrdinal> & PIcol2Accol,
146 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& Ac,
147 Teuchos::RCP<
const Import<LocalOrdinal,GlobalOrdinal,Node> > Acimport,
148 const std::string& label = std::string(),
149 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null);
156 #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.