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 using spmtx_ptr_t =
typename MatrixTraits<DerivedMat>::sparse_ptr_type;
185 using spmtx_idx_t =
typename MatrixTraits<DerivedMat>::sparse_idx_type;
186 using spmtx_val_t =
typename MatrixTraits<DerivedMat>::sparse_values_type;
188 spmtx_ptr_t getSparseRowPtr()
const;
190 spmtx_idx_t getSparseColInd()
const;
192 spmtx_val_t getSparseValues()
const;
195 void getSparseRowPtr_kokkos_view(KV & view)
const {
196 Kokkos::View<spmtx_ptr_t, Kokkos::HostSpace> src(
197 getSparseRowPtr(), getGlobalNumRows_impl()+1);
198 deep_copy_or_assign_view(view, src);
202 void getSparseColInd_kokkos_view(KV & view)
const {
203 Kokkos::View<spmtx_idx_t, Kokkos::HostSpace> src(
204 getSparseColInd(), getGlobalNNZ_impl());
205 deep_copy_or_assign_view(view, src);
209 void getSparseValues_kokkos_view(KV & view)
const {
210 Kokkos::View<spmtx_val_t, Kokkos::HostSpace> src(
211 getSparseValues(), getGlobalNNZ_impl());
212 deep_copy_or_assign_view(view, src);
219 #endif // AMESOS2_EPETRAROWMATRIX_ABSTRACTMATRIXADAPTER_DECL_HPP
Utility functions for Amesos2.
Copy or assign views based on memory spaces.
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