43 #ifndef IFPACK2_DETAILS_DENSESOLVER_DECL_HPP
44 #define IFPACK2_DETAILS_DENSESOLVER_DECL_HPP
49 #include "Ifpack2_ConfigDefs.hpp"
52 #include "Ifpack2_Details_LapackSupportsScalar.hpp"
53 #include "Teuchos_SerialDenseMatrix.hpp"
54 #include <type_traits>
71 template<
class MatrixType,
72 const bool stub = ! LapackSupportsScalar<typename MatrixType::scalar_type>::value>
75 typename MatrixType::local_ordinal_type,
76 typename MatrixType::global_ordinal_type,
77 typename MatrixType::node_type>,
79 typename MatrixType::local_ordinal_type,
80 typename MatrixType::global_ordinal_type,
81 typename MatrixType::node_type> >
85 template<
class MatrixType>
88 typename MatrixType::local_ordinal_type,
89 typename MatrixType::global_ordinal_type,
90 typename MatrixType::node_type>,
92 typename MatrixType::local_ordinal_type,
93 typename MatrixType::global_ordinal_type,
94 typename MatrixType::node_type> >
118 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
121 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>
row_matrix_type;
123 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
124 "Ifpack2::Details::DenseSolver: Please use MatrixType = Tpetra::RowMatrix.");
127 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
136 DenseSolver (
const Teuchos::RCP<const row_matrix_type>& matrix);
164 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
165 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
166 Teuchos::ETransp mode = Teuchos::NO_TRANS,
167 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
168 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
204 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
207 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
232 std::string description ()
const;
236 describe (Teuchos::FancyOStream &out,
237 const Teuchos::EVerbosityLevel verbLevel =
238 Teuchos::Describable::verbLevel_default)
const;
244 describeLocal (Teuchos::FancyOStream& out,
245 const Teuchos::EVerbosityLevel verbLevel)
const;
258 extract (Teuchos::SerialDenseMatrix<int, scalar_type>& A_local_dense,
271 factor (Teuchos::SerialDenseMatrix<int, scalar_type>& A,
272 const Teuchos::ArrayView<int>& ipiv);
287 typedef Teuchos::ScalarTraits<scalar_type> STS;
298 applyImpl (
const MV& X,
300 const Teuchos::ETransp mode,
305 Teuchos::RCP<const row_matrix_type> A_;
308 Teuchos::RCP<const row_matrix_type> A_local_;
311 Teuchos::SerialDenseMatrix<int, scalar_type> A_local_dense_;
314 Teuchos::Array<int> ipiv_;
317 double initializeTime_;
323 mutable double applyTime_;
332 mutable int numApply_;
343 template<
class MatrixType>
346 typename MatrixType::local_ordinal_type,
347 typename MatrixType::global_ordinal_type,
348 typename MatrixType::node_type>,
350 typename MatrixType::local_ordinal_type,
351 typename MatrixType::global_ordinal_type,
352 typename MatrixType::node_type> >
362 typedef MatrixType matrix_type;
365 typedef typename MatrixType::scalar_type scalar_type;
368 typedef typename MatrixType::local_ordinal_type local_ordinal_type;
371 typedef typename MatrixType::global_ordinal_type global_ordinal_type;
374 typedef typename MatrixType::node_type node_type;
377 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
380 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> row_matrix_type;
383 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
392 DenseSolver (
const Teuchos::RCP<const row_matrix_type>& matrix);
419 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
420 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
421 Teuchos::ETransp mode = Teuchos::NO_TRANS,
422 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
423 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
459 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
462 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
487 std::string description ()
const;
491 describe (Teuchos::FancyOStream &out,
492 const Teuchos::EVerbosityLevel verbLevel =
493 Teuchos::Describable::verbLevel_default)
const;
497 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type,
498 global_ordinal_type, node_type> MV;
504 #endif // IFPACK2_DETAILS_DENSESOLVER_DECL_HPP