43 #ifndef IFPACK2_DETAILS_TRIDISOLVER_DECL_HPP
44 #define IFPACK2_DETAILS_TRIDISOLVER_DECL_HPP
49 #include "Ifpack2_ConfigDefs.hpp"
52 #include "Ifpack2_Details_LapackSupportsScalar.hpp"
53 #include "Tpetra_RowMatrix.hpp"
54 #include "Teuchos_SerialTriDiMatrix.hpp"
55 #include <type_traits>
72 template<
class MatrixType,
73 const bool stub = ! LapackSupportsScalar<typename MatrixType::scalar_type>::value>
76 typename MatrixType::local_ordinal_type,
77 typename MatrixType::global_ordinal_type,
78 typename MatrixType::node_type>,
80 typename MatrixType::local_ordinal_type,
81 typename MatrixType::global_ordinal_type,
82 typename MatrixType::node_type> >
86 template<
class MatrixType>
89 typename MatrixType::local_ordinal_type,
90 typename MatrixType::global_ordinal_type,
91 typename MatrixType::node_type>,
93 typename MatrixType::local_ordinal_type,
94 typename MatrixType::global_ordinal_type,
95 typename MatrixType::node_type> >
119 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
122 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>
row_matrix_type;
124 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::Details::TriDiSolver: 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.");
127 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
136 TriDiSolver (
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::SerialTriDiMatrix<int, scalar_type>& A_local_tridi,
271 factor (Teuchos::SerialTriDiMatrix<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::SerialTriDiMatrix<int, scalar_type> A_local_tridi_;
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> >
361 typedef MatrixType matrix_type;
364 typedef typename MatrixType::scalar_type scalar_type;
367 typedef typename MatrixType::local_ordinal_type local_ordinal_type;
370 typedef typename MatrixType::global_ordinal_type global_ordinal_type;
373 typedef typename MatrixType::node_type node_type;
376 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
379 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> row_matrix_type;
381 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::Details::TriDiSolver: 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.");
384 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
393 TriDiSolver (
const Teuchos::RCP<const row_matrix_type>& matrix);
420 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
421 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
422 Teuchos::ETransp mode = Teuchos::NO_TRANS,
423 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
424 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
460 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
463 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
488 std::string description ()
const;
492 describe (Teuchos::FancyOStream &out,
493 const Teuchos::EVerbosityLevel verbLevel =
494 Teuchos::Describable::verbLevel_default)
const;
497 describeLocal (Teuchos::FancyOStream& out,
498 const Teuchos::EVerbosityLevel verbLevel)
const;
503 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type,
504 global_ordinal_type, node_type> MV;
510 #endif // IFPACK2_DETAILS_TRIDISOLVER_DECL_HPP