43 #ifndef TPETRA_MMHELPERS_DECL_HPP 44 #define TPETRA_MMHELPERS_DECL_HPP 46 #include <Tpetra_CrsMatrix.hpp> 47 #include <Teuchos_Array.hpp> 66 class GlobalOrdinal = Details::DefaultTypes::global_ordinal_type,
77 void deleteContents ();
90 Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
importMatrix;
92 Teuchos::RCP<const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
origMatrix;
97 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
102 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
107 virtual ~CrsWrapper () {}
108 virtual Teuchos::RCP<const map_type> getRowMap ()
const = 0;
109 virtual bool isFillComplete () = 0;
112 insertGlobalValues (GlobalOrdinal globalRow,
113 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
114 const Teuchos::ArrayView<const Scalar> &values) = 0;
116 sumIntoGlobalValues (GlobalOrdinal globalRow,
117 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
118 const Teuchos::ArrayView<const Scalar> &values) = 0;
121 template <class Scalar = CrsMatrix<>::scalar_type,
125 class CrsWrapper_CrsMatrix :
126 public CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
131 CrsWrapper_CrsMatrix (crs_matrix_type& crsmatrix);
132 virtual ~CrsWrapper_CrsMatrix ();
133 Teuchos::RCP<const map_type> getRowMap ()
const;
135 bool isFillComplete ();
138 insertGlobalValues (GlobalOrdinal globalRow,
139 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
140 const Teuchos::ArrayView<const Scalar> &values);
142 sumIntoGlobalValues (GlobalOrdinal globalRow,
143 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
144 const Teuchos::ArrayView<const Scalar> &values);
146 crs_matrix_type& crsmat_;
150 template <class Scalar = CrsMatrix<>::scalar_type,
152 class GlobalOrdinal =
156 class CrsWrapper_GraphBuilder :
157 public CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
161 CrsWrapper_GraphBuilder (
const Teuchos::RCP<const map_type>& map);
162 virtual ~CrsWrapper_GraphBuilder ();
164 Teuchos::RCP<const map_type> getRowMap ()
const {
168 bool isFillComplete ();
170 insertGlobalValues (GlobalOrdinal globalRow,
171 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
172 const Teuchos::ArrayView<const Scalar> &values);
174 sumIntoGlobalValues (GlobalOrdinal globalRow,
175 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
176 const Teuchos::ArrayView<const Scalar> &values);
178 std::map<GlobalOrdinal, std::set<GlobalOrdinal>*>& get_graph ();
180 size_t get_max_row_length () {
181 return max_row_length_;
185 std::map<GlobalOrdinal, std::set<GlobalOrdinal>*> graph_;
186 const Teuchos::RCP<const map_type>& rowmap_;
190 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
192 insert_matrix_locations (CrsWrapper_GraphBuilder<Scalar, LocalOrdinal, GlobalOrdinal, Node>& graphbuilder,
196 #endif // TPETRA_MMHELPERS_DECL_HPP Teuchos::RCP< const map_type > importColMap
Colmap garnered as a result of the import.
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Sparse matrix that presents a row-oriented interface that lets users read or modify entries...
LocalOrdinal local_ordinal_type
This class' second template parameter; the type of local indices.
KokkosClassic::DefaultNode::DefaultNodeType node_type
Default value of Node template parameter.
Teuchos::RCP< const map_type > domainMap
Domain map for original matrix.
GlobalOrdinal global_ordinal_type
This class' third template parameter; the type of global indices.
Teuchos::RCP< const map_type > colMap
Col map for the original version of the matrix.
Node node_type
This class' fourth template parameter; the Kokkos device type.
Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > origMatrix
The original matrix.
int local_ordinal_type
Default value of LocalOrdinal template parameter.
size_t global_size_t
Global size_t object.
Teuchos::RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > importMatrix
The imported matrix.
double scalar_type
Default value of Scalar template parameter.
Describes a parallel distribution of objects over processes.
Teuchos::RCP< const map_type > rowMap
Desired row map for "imported" version of the matrix.
Struct that holds views of the contents of a CrsMatrix.
Teuchos::RCP< const map_type > origRowMap
Original row map of matrix.