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 global_size_t getGlobalNNZ_impl()
const;
132 size_t getLocalNNZ_impl()
const;
134 global_size_t getGlobalNumRows_impl()
const;
136 global_size_t getGlobalNumCols_impl()
const;
138 size_t getMaxRowNNZ_impl()
const;
140 size_t getMaxColNNZ_impl()
const;
142 size_t getGlobalRowNNZ_impl(global_ordinal_t row)
const;
144 size_t getLocalRowNNZ_impl(local_ordinal_t row)
const;
146 size_t getGlobalColNNZ_impl(global_ordinal_t col)
const;
148 size_t getLocalColNNZ_impl(local_ordinal_t col)
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 Kokkos::View<typename super_t::spmtx_ptr_t, Kokkos::HostSpace> src(
187 getSparseRowPtr(), getGlobalNumRows_impl()+1);
188 deep_copy_or_assign_view(view, src);
192 void getSparseColInd_kokkos_view(KV & view)
const {
193 Kokkos::View<typename super_t::spmtx_idx_t, Kokkos::HostSpace> src(
194 getSparseColInd(), getGlobalNNZ_impl());
195 deep_copy_or_assign_view(view, src);
199 void getSparseValues_kokkos_view(KV & view)
const {
200 Kokkos::View<typename super_t::spmtx_vals_t, Kokkos::HostSpace> src(
201 getSparseValues(), getGlobalNNZ_impl());
202 deep_copy_or_assign_view(view, src);
209 #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