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 "Tpetra_Import_fwd.hpp"
54#include "Tpetra_Export_fwd.hpp"
55#include "Teuchos_SerialDenseMatrix.hpp"
73template<
class MatrixType,
74 const bool stub = ! LapackSupportsScalar<typename MatrixType::scalar_type>::value>
77 typename MatrixType::local_ordinal_type,
78 typename MatrixType::global_ordinal_type,
79 typename MatrixType::node_type>,
81 typename MatrixType::local_ordinal_type,
82 typename MatrixType::global_ordinal_type,
83 typename MatrixType::node_type> >
87template<
class MatrixType>
90 typename MatrixType::local_ordinal_type,
91 typename MatrixType::global_ordinal_type,
92 typename MatrixType::node_type>,
94 typename MatrixType::local_ordinal_type,
95 typename MatrixType::global_ordinal_type,
96 typename MatrixType::node_type> >
120 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
123 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>
row_matrix_type;
125 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
126 "Ifpack2::Details::DenseSolver: Please use MatrixType = Tpetra::RowMatrix.");
128 typedef typename row_matrix_type::nonconst_global_inds_host_view_type nonconst_global_inds_host_view_type;
129 typedef typename row_matrix_type::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
130 typedef typename row_matrix_type::nonconst_values_host_view_type nonconst_values_host_view_type;
135 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
144 DenseSolver (
const Teuchos::RCP<const row_matrix_type>& matrix);
172 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
173 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
174 Teuchos::ETransp mode = Teuchos::NO_TRANS,
175 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
176 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
212 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
215 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
240 std::string description ()
const;
244 describe (Teuchos::FancyOStream &out,
245 const Teuchos::EVerbosityLevel verbLevel =
246 Teuchos::Describable::verbLevel_default)
const;
252 describeLocal (Teuchos::FancyOStream& out,
253 const Teuchos::EVerbosityLevel verbLevel)
const;
266 extract (Teuchos::SerialDenseMatrix<int, scalar_type>& A_local_dense,
279 factor (Teuchos::SerialDenseMatrix<int, scalar_type>& A,
280 const Teuchos::ArrayView<int>& ipiv);
295 typedef Teuchos::ScalarTraits<scalar_type> STS;
306 applyImpl (
const MV& X,
308 const Teuchos::ETransp mode,
313 Teuchos::RCP<const row_matrix_type> A_;
316 Teuchos::RCP<const row_matrix_type> A_local_;
319 Teuchos::SerialDenseMatrix<int, scalar_type> A_local_dense_;
322 Teuchos::Array<int> ipiv_;
325 double initializeTime_;
331 mutable double applyTime_;
340 mutable int numApply_;
351template<
class MatrixType>
354 typename MatrixType::local_ordinal_type,
355 typename MatrixType::global_ordinal_type,
356 typename MatrixType::node_type>,
358 typename MatrixType::local_ordinal_type,
359 typename MatrixType::global_ordinal_type,
360 typename MatrixType::node_type> >
370 typedef MatrixType matrix_type;
373 typedef typename MatrixType::scalar_type scalar_type;
376 typedef typename MatrixType::local_ordinal_type local_ordinal_type;
379 typedef typename MatrixType::global_ordinal_type global_ordinal_type;
382 typedef typename MatrixType::node_type node_type;
385 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
388 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type> row_matrix_type;
391 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> map_type;
400 DenseSolver (
const Teuchos::RCP<const row_matrix_type>& matrix);
427 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
428 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
429 Teuchos::ETransp mode = Teuchos::NO_TRANS,
430 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
431 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
467 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
470 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
495 std::string description ()
const;
499 describe (Teuchos::FancyOStream &out,
500 const Teuchos::EVerbosityLevel verbLevel =
501 Teuchos::Describable::verbLevel_default)
const;
505 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type,
506 global_ordinal_type, node_type> MV;
Declaration of interface for preconditioners that can change their matrix after construction.
Mix-in interface for preconditioners that can change their matrix after construction.
Definition: Ifpack2_Details_CanChangeMatrix.hpp:93
virtual void setMatrix(const Teuchos::RCP< const Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > &A)=0
Set the new matrix.
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition: Ifpack2_Details_DenseSolver_decl.hpp:117
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition: Ifpack2_Details_DenseSolver_decl.hpp:111
MatrixType matrix_type
The first template parameter of this class.
Definition: Ifpack2_Details_DenseSolver_decl.hpp:105
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition: Ifpack2_Details_DenseSolver_decl.hpp:108
Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > map_type
Specialization of Tpetra::Map used by this class.
Definition: Ifpack2_Details_DenseSolver_decl.hpp:135
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition: Ifpack2_Details_DenseSolver_decl.hpp:114
Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > row_matrix_type
Specialization of Tpetra::RowMatrix used by this class.
Definition: Ifpack2_Details_DenseSolver_decl.hpp:123
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the absolute value (magnitude) of a scalar_type.
Definition: Ifpack2_Details_DenseSolver_decl.hpp:120
"Preconditioner" that uses LAPACK's dense LU.
Definition: Ifpack2_Details_DenseSolver_decl.hpp:84
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:108
virtual double getComputeTime() const=0
The time (in seconds) spent in compute().
virtual bool isInitialized() const=0
True if the preconditioner has been successfully initialized, else false.
Teuchos::ScalarTraits< MatrixType::scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_Preconditioner.hpp:111
virtual void compute()=0
Set up the numerical values in this preconditioner.
virtual int getNumCompute() const=0
The number of calls to compute().
virtual Teuchos::RCP< const Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getMatrix() const=0
The input matrix given to the constructor.
virtual int getNumApply() const=0
The number of calls to apply().
virtual double getApplyTime() const=0
The time (in seconds) spent in apply().
virtual void setParameters(const Teuchos::ParameterList &List)=0
Set this preconditioner's parameters.
virtual void apply(const Tpetra::MultiVector< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > &X, Tpetra::MultiVector< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, MatrixType::scalar_type alpha=Teuchos::ScalarTraits< MatrixType::scalar_type >::one(), MatrixType::scalar_type beta=Teuchos::ScalarTraits< MatrixType::scalar_type >::zero()) const=0
Apply the preconditioner to X, putting the result in Y.
virtual Teuchos::RCP< const Tpetra::Map< MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getRangeMap() const=0
The range Map of this operator.
virtual Teuchos::RCP< const Tpetra::Map< MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getDomainMap() const=0
The domain Map of this operator.
virtual bool isComputed() const=0
True if the preconditioner has been successfully computed, else false.
virtual void initialize()=0
Set up the graph structure of this preconditioner.
virtual double getInitializeTime() const=0
The time (in seconds) spent in initialize().
virtual int getNumInitialize() const=0
The number of calls to initialize().
Ifpack2 implementation details.
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:74