10#ifndef IFPACK2_DETAILS_DENSESOLVER_DECL_HPP
11#define IFPACK2_DETAILS_DENSESOLVER_DECL_HPP
16#include "Ifpack2_ConfigDefs.hpp"
19#include "Ifpack2_Details_LapackSupportsScalar.hpp"
20#include "Tpetra_Import_fwd.hpp"
21#include "Tpetra_Export_fwd.hpp"
22#include "Teuchos_SerialDenseMatrix.hpp"
40template <
class MatrixType,
41 const bool stub = !LapackSupportsScalar<typename MatrixType::scalar_type>::value>
43 typename MatrixType::local_ordinal_type,
44 typename MatrixType::global_ordinal_type,
45 typename MatrixType::node_type>,
47 typename MatrixType::local_ordinal_type,
48 typename MatrixType::global_ordinal_type,
49 typename MatrixType::node_type> > {};
52template <
class MatrixType>
54 typename MatrixType::local_ordinal_type,
55 typename MatrixType::global_ordinal_type,
56 typename MatrixType::node_type>,
58 typename MatrixType::local_ordinal_type,
59 typename MatrixType::global_ordinal_type,
60 typename MatrixType::node_type> > {
83 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
86 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>
row_matrix_type;
88 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
89 "Ifpack2::Details::DenseSolver: Please use MatrixType = Tpetra::RowMatrix.");
91 typedef typename row_matrix_type::nonconst_global_inds_host_view_type nonconst_global_inds_host_view_type;
92 typedef typename row_matrix_type::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
93 typedef typename row_matrix_type::nonconst_values_host_view_type nonconst_values_host_view_type;
96 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
132 apply(
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
133 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
134 Teuchos::ETransp
mode = Teuchos::NO_TRANS,
135 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
136 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
172 Teuchos::RCP<const row_matrix_type>
getMatrix()
const;
175 void setMatrix(
const Teuchos::RCP<const row_matrix_type>& A);
200 std::string description()
const;
204 describe(Teuchos::FancyOStream&
out,
205 const Teuchos::EVerbosityLevel
verbLevel =
206 Teuchos::Describable::verbLevel_default)
const;
211 describeLocal(Teuchos::FancyOStream&
out,
212 const Teuchos::EVerbosityLevel
verbLevel)
const;
225 extract(Teuchos::SerialDenseMatrix<int, scalar_type>&
A_local_dense,
238 factor(Teuchos::SerialDenseMatrix<int, scalar_type>& A,
239 const Teuchos::ArrayView<int>& ipiv);
257 typedef Teuchos::ScalarTraits<scalar_type> STS;
268 applyImpl(
const MV& X,
270 const Teuchos::ETransp
mode,
275 Teuchos::RCP<const row_matrix_type> A_;
278 Teuchos::RCP<const row_matrix_type> A_local_;
281 Teuchos::SerialDenseMatrix<int, scalar_type> A_local_dense_;
284 Teuchos::Array<int> ipiv_;
287 double initializeTime_;
293 mutable double applyTime_;
302 mutable int numApply_;
312template <
class MatrixType>
314 typename MatrixType::local_ordinal_type,
315 typename MatrixType::global_ordinal_type,
316 typename MatrixType::node_type>,
318 typename MatrixType::local_ordinal_type,
319 typename MatrixType::global_ordinal_type,
320 typename MatrixType::node_type> > {
344 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
347 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>
row_matrix_type;
350 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
386 apply(
const Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& X,
387 Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type>& Y,
388 Teuchos::ETransp
mode = Teuchos::NO_TRANS,
389 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
390 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
426 Teuchos::RCP<const row_matrix_type>
getMatrix()
const;
429 void setMatrix(
const Teuchos::RCP<const row_matrix_type>& A);
454 std::string description()
const;
458 describe(Teuchos::FancyOStream&
out,
459 const Teuchos::EVerbosityLevel
verbLevel =
460 Teuchos::Describable::verbLevel_default)
const;
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:60
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:80
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:74
MatrixType matrix_type
The first template parameter of this class.
Definition Ifpack2_Details_DenseSolver_decl.hpp:68
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:71
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:96
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:77
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:86
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the absolute value (magnitude) of a scalar_type.
Definition Ifpack2_Details_DenseSolver_decl.hpp:83
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:341
MatrixType matrix_type
The first template parameter of this class.
Definition Ifpack2_Details_DenseSolver_decl.hpp:329
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:347
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:350
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:335
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the absolute value (magnitude) of a scalar_type.
Definition Ifpack2_Details_DenseSolver_decl.hpp:344
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:332
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:338
"Preconditioner" that uses LAPACK's dense LU.
Definition Ifpack2_Details_DenseSolver_decl.hpp:49
Ifpack2's implementation of Trilinos::Details::LinearSolver interface.
Definition Ifpack2_Details_LinearSolver_decl.hpp:75
Interface for all Ifpack2 preconditioners.
Definition Ifpack2_Preconditioner.hpp:74
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.
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:40