21 #ifndef AMESOS2_EPETRAROWMATRIX_ABSTRACTMATRIXADAPTER_DECL_HPP
22 #define AMESOS2_EPETRAROWMATRIX_ABSTRACTMATRIXADAPTER_DECL_HPP
24 #include "Amesos2_config.h"
26 #include <Teuchos_ArrayView.hpp>
28 #include <Epetra_RowMatrix.h>
30 #include "Amesos2_AbstractConcreteMatrixAdapter.hpp"
31 #include "Amesos2_MatrixAdapter_decl.hpp"
32 #include "Amesos2_MatrixTraits.hpp"
54 template <
class DerivedMat >
61 typedef MatrixTraits<Epetra_RowMatrix>::scalar_t scalar_t;
62 typedef MatrixTraits<Epetra_RowMatrix>::local_ordinal_t local_ordinal_t;
63 typedef MatrixTraits<Epetra_RowMatrix>::global_ordinal_t global_ordinal_t;
64 typedef MatrixTraits<Epetra_RowMatrix>::node_t node_t;
66 typedef DerivedMat matrix_t;
72 typedef typename super_t::global_size_t global_size_t;
79 typedef MatrixTraits<Epetra_RowMatrix>::major_access major_access;
86 void getGlobalRowCopy_impl(global_ordinal_t row,
87 const Teuchos::ArrayView<global_ordinal_t>& indices,
88 const Teuchos::ArrayView<scalar_t>& vals,
91 void getGlobalColCopy_impl(global_ordinal_t col,
92 const Teuchos::ArrayView<global_ordinal_t>& indices,
93 const Teuchos::ArrayView<scalar_t>& vals,
96 template<
typename KV_GO,
typename KV_S>
97 void getGlobalRowCopy_kokkos_view_impl(global_ordinal_t row,
102 global_size_t getGlobalNNZ_impl()
const;
104 size_t getLocalNNZ_impl()
const;
106 global_size_t getGlobalNumRows_impl()
const;
108 global_size_t getGlobalNumCols_impl()
const;
110 size_t getMaxRowNNZ_impl()
const;
112 size_t getMaxColNNZ_impl()
const;
114 size_t getGlobalRowNNZ_impl(global_ordinal_t row)
const;
116 size_t getLocalRowNNZ_impl(local_ordinal_t row)
const;
118 size_t getGlobalColNNZ_impl(global_ordinal_t col)
const;
120 size_t getLocalColNNZ_impl(local_ordinal_t col)
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;
150 using spmtx_ptr_t =
typename MatrixTraits<DerivedMat>::sparse_ptr_type;
151 using spmtx_idx_t =
typename MatrixTraits<DerivedMat>::sparse_idx_type;
152 using spmtx_val_t =
typename MatrixTraits<DerivedMat>::sparse_values_type;
154 spmtx_ptr_t getSparseRowPtr()
const;
156 spmtx_idx_t getSparseColInd()
const;
158 spmtx_val_t getSparseValues()
const;
161 void getSparseRowPtr_kokkos_view(KV & view)
const {
162 Kokkos::View<spmtx_ptr_t, Kokkos::HostSpace> src(
163 getSparseRowPtr(), getGlobalNumRows_impl()+1);
164 deep_copy_or_assign_view(view, src);
168 void getSparseColInd_kokkos_view(KV & view)
const {
169 Kokkos::View<spmtx_idx_t, Kokkos::HostSpace> src(
170 getSparseColInd(), getGlobalNNZ_impl());
171 deep_copy_or_assign_view(view, src);
175 void getSparseValues_kokkos_view(KV & view)
const {
176 Kokkos::View<spmtx_val_t, Kokkos::HostSpace> src(
177 getSparseValues(), getGlobalNNZ_impl());
178 deep_copy_or_assign_view(view, src);
185 #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: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