55 #ifndef AMESOS2_EPETRAROWMATRIX_ABSTRACTMATRIXADAPTER_DECL_HPP 56 #define AMESOS2_EPETRAROWMATRIX_ABSTRACTMATRIXADAPTER_DECL_HPP 58 #include "Amesos2_config.h" 60 #include <Teuchos_ArrayView.hpp> 62 #include <Epetra_RowMatrix.h> 64 #include "Amesos2_AbstractConcreteMatrixAdapter.hpp" 65 #include "Amesos2_MatrixAdapter_decl.hpp" 66 #include "Amesos2_MatrixTraits.hpp" 88 template <
class DerivedMat >
95 typedef MatrixTraits<Epetra_RowMatrix>::scalar_t scalar_t;
96 typedef MatrixTraits<Epetra_RowMatrix>::local_ordinal_t local_ordinal_t;
97 typedef MatrixTraits<Epetra_RowMatrix>::global_ordinal_t global_ordinal_t;
98 typedef MatrixTraits<Epetra_RowMatrix>::node_t node_t;
100 typedef DerivedMat matrix_t;
106 typedef typename super_t::global_size_t global_size_t;
113 typedef MatrixTraits<Epetra_RowMatrix>::major_access major_access;
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 template<
typename KV_GO,
typename KV_S>
131 void getGlobalRowCopy_kokkos_view_impl(global_ordinal_t row,
136 global_size_t getGlobalNNZ_impl()
const;
138 size_t getLocalNNZ_impl()
const;
140 global_size_t getGlobalNumRows_impl()
const;
142 global_size_t getGlobalNumCols_impl()
const;
144 size_t getMaxRowNNZ_impl()
const;
146 size_t getMaxColNNZ_impl()
const;
148 size_t getGlobalRowNNZ_impl(global_ordinal_t row)
const;
150 size_t getLocalRowNNZ_impl(local_ordinal_t row)
const;
152 size_t getGlobalColNNZ_impl(global_ordinal_t col)
const;
154 size_t getLocalColNNZ_impl(local_ordinal_t col)
const;
158 const RCP<
const Tpetra::Map<local_ordinal_t,
163 const RCP<
const Tpetra::Map<local_ordinal_t,
166 getRowMap_impl()
const;
168 const RCP<
const Tpetra::Map<local_ordinal_t,
171 getColMap_impl()
const;
173 const RCP<const Teuchos::Comm<int> > getComm_impl()
const;
175 bool isLocallyIndexed_impl()
const;
177 bool isGloballyIndexed_impl()
const;
182 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;
184 #ifdef TPETRA_ENABLE_DEPRECATED_CODE 185 using spmtx_ptr_t =
typename super_t::spmtx_ptr_t;
186 using spmtx_idx_t =
typename super_t::spmtx_idx_t;
187 using spmtx_val_t =
typename super_t::spmtx_vals_t;
189 using spmtx_ptr_t =
typename MatrixTraits<DerivedMat>::sparse_ptr_type;
190 using spmtx_idx_t =
typename MatrixTraits<DerivedMat>::sparse_idx_type;
191 using spmtx_val_t =
typename MatrixTraits<DerivedMat>::sparse_values_type;
194 spmtx_ptr_t getSparseRowPtr()
const;
196 spmtx_idx_t getSparseColInd()
const;
198 spmtx_val_t getSparseValues()
const;
201 void getSparseRowPtr_kokkos_view(KV & view)
const {
202 Kokkos::View<spmtx_ptr_t, Kokkos::HostSpace> src(
203 getSparseRowPtr(), getGlobalNumRows_impl()+1);
204 deep_copy_or_assign_view(view, src);
208 void getSparseColInd_kokkos_view(KV & view)
const {
209 Kokkos::View<spmtx_idx_t, Kokkos::HostSpace> src(
210 getSparseColInd(), getGlobalNNZ_impl());
211 deep_copy_or_assign_view(view, src);
215 void getSparseValues_kokkos_view(KV & view)
const {
216 Kokkos::View<spmtx_val_t, Kokkos::HostSpace> src(
217 getSparseValues(), getGlobalNNZ_impl());
218 deep_copy_or_assign_view(view, src);
225 #endif // AMESOS2_EPETRAROWMATRIX_ABSTRACTMATRIXADAPTER_DECL_HPP Utility functions for Amesos2.
Copy or assign views based on memory spaces.
Definition: Amesos2_AbstractConcreteMatrixAdapter.hpp:48
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
Definition: Amesos2_TypeDecl.hpp:127
EDistribution
Definition: Amesos2_TypeDecl.hpp:123