45 #ifndef AMESOS2_TPETRAROWMATRIX_MATRIXADAPTER_DECL_HPP
46 #define AMESOS2_TPETRAROWMATRIX_MATRIXADAPTER_DECL_HPP
48 #include "Amesos2_config.h"
50 #include <Teuchos_ArrayView.hpp>
51 #include <Tpetra_CrsMatrix.hpp>
53 #include "Amesos2_AbstractConcreteMatrixAdapter.hpp"
59 template <
class Matrix>
class MatrixAdapter;
77 template <
typename Scalar,
78 typename LocalOrdinal,
79 typename GlobalOrdinal,
92 typedef Tpetra::RowMatrix<Scalar,
97 typedef Scalar scalar_t;
98 typedef LocalOrdinal local_ordinal_t;
99 typedef GlobalOrdinal global_ordinal_t;
106 typedef typename super_t::global_size_t global_size_t;
120 void getGlobalRowCopy_impl(global_ordinal_t row,
121 const Teuchos::ArrayView<global_ordinal_t>& indices,
122 const Teuchos::ArrayView<scalar_t>& vals,
125 void getGlobalColCopy_impl(global_ordinal_t col,
126 const Teuchos::ArrayView<global_ordinal_t>& indices,
127 const Teuchos::ArrayView<scalar_t>& vals,
130 global_size_t getGlobalNNZ_impl()
const;
132 size_t getLocalNNZ_impl()
const;
134 size_t getMaxRowNNZ_impl()
const;
136 size_t getMaxColNNZ_impl()
const;
138 size_t getGlobalRowNNZ_impl(global_ordinal_t row)
const;
140 size_t getLocalRowNNZ_impl(local_ordinal_t row)
const;
142 size_t getGlobalColNNZ_impl(global_ordinal_t col)
const;
144 size_t getLocalColNNZ_impl(local_ordinal_t col)
const;
146 global_size_t getGlobalNumRows_impl()
const;
148 global_size_t getGlobalNumCols_impl()
const;
152 const RCP<
const Tpetra::Map<local_ordinal_t,
157 const RCP<
const Tpetra::Map<local_ordinal_t,
160 getRowMap_impl()
const;
162 const RCP<
const Tpetra::Map<local_ordinal_t,
165 getColMap_impl()
const;
167 const RCP<const Teuchos::Comm<int> > getComm_impl()
const;
169 bool isLocallyIndexed_impl()
const;
171 bool isGloballyIndexed_impl()
const;
176 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;
178 typename super_t::spmtx_ptr_t getSparseRowPtr()
const;
180 typename super_t::spmtx_idx_t getSparseColInd()
const;
182 typename super_t::spmtx_vals_t getSparseValues()
const;
185 void getSparseRowPtr_kokkos_view(KV & view)
const {
186 deep_copy_or_assign_view(view, this->mat_->getLocalMatrix().graph.row_map);
190 void getSparseColInd_kokkos_view(KV & view)
const {
191 deep_copy_or_assign_view(view, this->mat_->getLocalMatrix().graph.entries);
195 void getSparseValues_kokkos_view(KV & view)
const {
196 deep_copy_or_assign_view(view, this->mat_->getLocalMatrix().values);
203 #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:100
A Matrix adapter interface for Amesos2.
Definition: Amesos2_MatrixAdapter_decl.hpp:76
Definition: Amesos2_AbstractConcreteMatrixAdapter.hpp:89
Indicates that the concrete class can use the generic getC{c|r}s methods implemented in MatrixAdapter...
Definition: Amesos2_TypeDecl.hpp:91
EDistribution
Definition: Amesos2_TypeDecl.hpp:123