43 #ifndef TPETRA_MMHELPERS_DECL_HPP
44 #define TPETRA_MMHELPERS_DECL_HPP
46 #include <Tpetra_CrsMatrix.hpp>
47 #include <Tpetra_BlockCrsMatrix.hpp>
48 #include <Teuchos_Array.hpp>
65 template <
class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
67 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
68 class Node = ::Tpetra::Details::DefaultTypes::node_type>
78 void deleteContents ();
91 Teuchos::RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
importMatrix;
93 Teuchos::RCP<const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
origMatrix;
102 template <
class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
104 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
105 class Node = ::Tpetra::Details::DefaultTypes::node_type>
115 void deleteContents ();
128 Teuchos::RCP<BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
importMatrix;
130 Teuchos::RCP<const BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
origMatrix;
135 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
140 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
145 virtual ~CrsWrapper () {}
146 virtual Teuchos::RCP<const map_type> getRowMap ()
const = 0;
147 virtual bool isFillComplete () = 0;
150 insertGlobalValues (GlobalOrdinal globalRow,
151 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
152 const Teuchos::ArrayView<const Scalar> &values) = 0;
154 sumIntoGlobalValues (GlobalOrdinal globalRow,
155 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
156 const Teuchos::ArrayView<const Scalar> &values) = 0;
159 template <
class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
161 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
162 class Node = ::Tpetra::Details::DefaultTypes::node_type>
163 class CrsWrapper_CrsMatrix :
164 public CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
166 typedef Map<LocalOrdinal, GlobalOrdinal, Node> map_type;
167 typedef CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> crs_matrix_type;
169 CrsWrapper_CrsMatrix (crs_matrix_type& crsmatrix);
170 virtual ~CrsWrapper_CrsMatrix ();
171 Teuchos::RCP<const map_type> getRowMap ()
const;
173 bool isFillComplete ();
176 insertGlobalValues (GlobalOrdinal globalRow,
177 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
178 const Teuchos::ArrayView<const Scalar> &values);
180 sumIntoGlobalValues (GlobalOrdinal globalRow,
181 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
182 const Teuchos::ArrayView<const Scalar> &values);
184 crs_matrix_type& crsmat_;
187 template <
class Scalar = ::Tpetra::Details::DefaultTypes::scalar_type,
189 class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
190 class Node = ::Tpetra::Details::DefaultTypes::node_type>
191 class CrsWrapper_GraphBuilder :
192 public CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
194 typedef Map<LocalOrdinal, GlobalOrdinal, Node> map_type;
196 CrsWrapper_GraphBuilder (
const Teuchos::RCP<const map_type>& map);
197 virtual ~CrsWrapper_GraphBuilder ();
199 Teuchos::RCP<const map_type> getRowMap ()
const {
203 bool isFillComplete ();
205 insertGlobalValues (GlobalOrdinal globalRow,
206 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
207 const Teuchos::ArrayView<const Scalar> &values);
209 sumIntoGlobalValues (GlobalOrdinal globalRow,
210 const Teuchos::ArrayView<const GlobalOrdinal> &indices,
211 const Teuchos::ArrayView<const Scalar> &values);
213 std::map<GlobalOrdinal, std::set<GlobalOrdinal>*>& get_graph ();
215 size_t get_max_row_length () {
216 return max_row_length_;
220 std::map<GlobalOrdinal, std::set<GlobalOrdinal>*> graph_;
221 const Teuchos::RCP<const map_type>& rowmap_;
225 template<
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
227 insert_matrix_locations (CrsWrapper_GraphBuilder<Scalar, LocalOrdinal, GlobalOrdinal, Node>& graphbuilder,
228 CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C);
231 #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...
Sparse matrix whose entries are small dense square blocks, all of the same dimensions.
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.
Teuchos::RCP< BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > importMatrix
The imported matrix.
int local_ordinal_type
Default value of Scalar template parameter.
Teuchos::RCP< const map_type > importColMap
Colmap garnered as a result of the import.
size_t global_size_t
Global size_t object.
Teuchos::RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > importMatrix
The imported matrix.
Struct that holds views of the contents of a BlockCrsMatrix.
Teuchos::RCP< const map_type > origRowMap
Original row map of matrix.
Teuchos::RCP< const map_type > rowMap
Desired row map for "imported" version of the matrix.
const LocalOrdinal blocksize
The blocksize of all matrices.
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 BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > origMatrix
The original matrix.
Teuchos::RCP< const map_type > colMap
Col map for the original version of the matrix.
Teuchos::RCP< const map_type > origRowMap
Original row map of matrix.
Teuchos::RCP< const map_type > domainMap
Domain map for original matrix.