43 #ifndef TPETRA_MMHELPERS_DECL_HPP
44 #define TPETRA_MMHELPERS_DECL_HPP
46 #include <Tpetra_CrsMatrix.hpp>
47 #include <Teuchos_Array.hpp>
64 template <
class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
66 class GlobalOrdinal = ::Tpetra::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 = ::Tpetra::Details::DefaultTypes::scalar_type,
123 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
125 class CrsWrapper_CrsMatrix :
126 public CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
128 typedef Map<LocalOrdinal, GlobalOrdinal, Node> map_type;
129 typedef CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> crs_matrix_type;
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_;
149 template <
class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
151 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
153 class CrsWrapper_GraphBuilder :
154 public CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
156 typedef Map<LocalOrdinal, GlobalOrdinal, Node> map_type;
158 CrsWrapper_GraphBuilder (
const Teuchos::RCP<const map_type>& map);
159 virtual ~CrsWrapper_GraphBuilder ();
161 Teuchos::RCP<const map_type> getRowMap ()
const {
165 bool isFillComplete ();
167 insertGlobalValues (GlobalOrdinal globalRow,
168 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
169 const Teuchos::ArrayView<const Scalar> &values);
171 sumIntoGlobalValues (GlobalOrdinal globalRow,
172 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
173 const Teuchos::ArrayView<const Scalar> &values);
175 std::map<GlobalOrdinal, std::set<GlobalOrdinal>*>& get_graph ();
177 size_t get_max_row_length () {
178 return max_row_length_;
182 std::map<GlobalOrdinal, std::set<GlobalOrdinal>*> graph_;
183 const Teuchos::RCP<const map_type>& rowmap_;
187 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
189 insert_matrix_locations (CrsWrapper_GraphBuilder<Scalar, LocalOrdinal, GlobalOrdinal, Node>& graphbuilder,
190 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C);
193 #endif // TPETRA_MMHELPERS_DECL_HPP
Teuchos::RCP< const map_type > importColMap
Colmap garnered as a result of the import.
Sparse matrix that presents a row-oriented interface that lets users read or modify entries...
Teuchos::RCP< const map_type > domainMap
Domain map for original matrix.
Teuchos::RCP< const map_type > colMap
Col map for the original version of the matrix.
Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > origMatrix
The original matrix.
int local_ordinal_type
Default value of Scalar template parameter.
size_t global_size_t
Global size_t object.
Teuchos::RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > importMatrix
The imported matrix.
::Kokkos::Compat::KokkosDeviceWrapperNode< execution_space > node_type
Default value of Node template parameter.
A parallel distribution of indices 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.