10 #ifndef IFPACK2_DIAGONAL_DECL_HPP
11 #define IFPACK2_DIAGONAL_DECL_HPP
15 #include "Tpetra_CrsMatrix_decl.hpp"
16 #include <type_traits>
37 template<
class MatrixType>
40 typename MatrixType::local_ordinal_type,
41 typename MatrixType::global_ordinal_type,
42 typename MatrixType::node_type>,
44 typename MatrixType::local_ordinal_type,
45 typename MatrixType::global_ordinal_type,
46 typename MatrixType::node_type> >
49 typedef typename MatrixType::scalar_type scalar_type;
50 typedef typename MatrixType::local_ordinal_type local_ordinal_type;
51 typedef typename MatrixType::global_ordinal_type global_ordinal_type;
52 typedef typename MatrixType::node_type node_type;
56 typedef Tpetra::RowMatrix<scalar_type,
59 node_type> row_matrix_type;
61 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::Diagonal: The template parameter MatrixType must be a Tpetra::RowMatrix specialization. Please don't use Tpetra::CrsMatrix (a subclass of Tpetra::RowMatrix) here anymore. The constructor can take either a RowMatrix or a CrsMatrix just fine.");
64 typedef Tpetra::CrsMatrix<scalar_type,
67 node_type> crs_matrix_type;
69 typedef Tpetra::Vector<scalar_type,
72 node_type> vector_type;
74 typedef Tpetra::Map<local_ordinal_type,
106 virtual ~Diagonal ();
118 bool isInitialized ()
const {
119 return isInitialized_;
126 bool isComputed ()
const {
169 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
170 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
198 double getComputeFlops()
const;
201 double getApplyFlops()
const;
204 int getNumInitialize()
const;
207 int getNumCompute()
const;
210 int getNumApply()
const;
213 double getInitializeTime()
const;
216 double getComputeTime()
const;
219 double getApplyTime()
const;
226 std::string description()
const;
251 typedef Kokkos::View<size_t*, typename node_type::device_type> offsets_type;
252 offsets_type offsets_;
254 double initializeTime_;
256 mutable double applyTime_;
260 mutable int numApply_;
282 template<
class MatrixType,
class VectorType>
283 Teuchos::RCP<Ifpack2::Diagonal<Tpetra::RowMatrix<
typename MatrixType::scalar_type,
284 typename MatrixType::local_ordinal_type,
285 typename MatrixType::global_ordinal_type,
286 typename MatrixType::node_type> > >
289 typedef Tpetra::RowMatrix<
typename MatrixType::scalar_type,
290 typename MatrixType::local_ordinal_type,
291 typename MatrixType::global_ordinal_type,
292 typename MatrixType::node_type> row_matrix_type;
294 return Teuchos::rcp (
new Ifpack2::Diagonal<row_matrix_type> (invdiag));
Mix-in interface for preconditioners that can change their matrix after construction.
Definition: Ifpack2_Details_CanChangeMatrix.hpp:60
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:74
Declaration of interface for preconditioners that can change their matrix after construction.
static const EVerbosityLevel verbLevel_default