11 #ifndef AMESOS2_TPETRAROWMATRIX_MATRIXADAPTER_DECL_HPP
12 #define AMESOS2_TPETRAROWMATRIX_MATRIXADAPTER_DECL_HPP
14 #include "Amesos2_config.h"
16 #include <Teuchos_ArrayView.hpp>
17 #include <Tpetra_CrsMatrix.hpp>
19 #include "Amesos2_AbstractConcreteMatrixAdapter.hpp"
25 template <
class Matrix>
class MatrixAdapter;
43 template <
typename Scalar,
44 typename LocalOrdinal,
45 typename GlobalOrdinal,
58 typedef Tpetra::RowMatrix<Scalar,
63 typedef Scalar scalar_t;
64 typedef LocalOrdinal local_ordinal_t;
65 typedef GlobalOrdinal global_ordinal_t;
72 typedef typename super_t::global_size_t global_size_t;
86 template<
typename KV_GO,
typename KV_S>
87 void getGlobalRowCopy_kokkos_view_impl(global_ordinal_t row,
92 void getGlobalRowCopy_impl(global_ordinal_t row,
93 const Teuchos::ArrayView<global_ordinal_t>& indices,
94 const Teuchos::ArrayView<scalar_t>& vals,
97 void getGlobalColCopy_impl(global_ordinal_t col,
98 const Teuchos::ArrayView<global_ordinal_t>& indices,
99 const Teuchos::ArrayView<scalar_t>& vals,
102 global_size_t getGlobalNNZ_impl()
const;
104 size_t getLocalNNZ_impl()
const;
106 size_t getMaxRowNNZ_impl()
const;
108 size_t getMaxColNNZ_impl()
const;
110 size_t getGlobalRowNNZ_impl(global_ordinal_t row)
const;
112 size_t getLocalRowNNZ_impl(local_ordinal_t row)
const;
114 size_t getGlobalColNNZ_impl(global_ordinal_t col)
const;
116 size_t getLocalColNNZ_impl(local_ordinal_t col)
const;
118 global_size_t getGlobalNumRows_impl()
const;
120 global_size_t getGlobalNumCols_impl()
const;
124 const RCP<
const Tpetra::Map<local_ordinal_t,
129 const RCP<
const Tpetra::Map<local_ordinal_t,
132 getRowMap_impl()
const;
134 const RCP<
const Tpetra::Map<local_ordinal_t,
137 getColMap_impl()
const;
139 const RCP<const Teuchos::Comm<int> > getComm_impl()
const;
141 bool isLocallyIndexed_impl()
const;
143 bool isGloballyIndexed_impl()
const;
148 RCP<const super_t> get_impl(
const Teuchos::Ptr<
const Tpetra::Map<local_ordinal_t,global_ordinal_t,node_t> > map,
EDistribution distribution = ROOTED)
const;
151 void getSparseRowPtr_kokkos_view(KV & view)
const {
152 deep_copy_or_assign_view(view, this->mat_->getLocalMatrixDevice().graph.row_map);
156 void getSparseColInd_kokkos_view(KV & view)
const {
157 deep_copy_or_assign_view(view, this->mat_->getLocalMatrixDevice().graph.entries);
161 void getSparseValues_kokkos_view(KV & view)
const {
162 deep_copy_or_assign_view(view, this->mat_->getLocalMatrixDevice().values);
169 #endif // AMESOS2_TPETRAROWMATRIX_MATRIXADAPTER_DECL_HPP
Utility functions for Amesos2.
Copy or assign views based on memory spaces.
Indicates that the object of an adapter provides row access to its data.
Definition: Amesos2_TypeDecl.hpp:66
A Matrix adapter interface for Amesos2.
Definition: Amesos2_MatrixAdapter_decl.hpp:42
Definition: Amesos2_AbstractConcreteMatrixAdapter.hpp:55
Indicates that the concrete class can use the generic getC{c|r}s methods implemented in MatrixAdapter...
Definition: Amesos2_TypeDecl.hpp:57
EDistribution
Definition: Amesos2_TypeDecl.hpp:89