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>
44 typename MatrixType::local_ordinal_type,
45 typename MatrixType::global_ordinal_type,
46 typename MatrixType::node_type>,
48 typename MatrixType::local_ordinal_type,
49 typename MatrixType::global_ordinal_type,
50 typename MatrixType::node_type> >
54template<
class MatrixType>
57 typename MatrixType::local_ordinal_type,
58 typename MatrixType::global_ordinal_type,
59 typename MatrixType::node_type>,
61 typename MatrixType::local_ordinal_type,
62 typename MatrixType::global_ordinal_type,
63 typename MatrixType::node_type> >
87 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
90 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>
row_matrix_type;
92 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
93 "Ifpack2::Details::DenseSolver: Please use MatrixType = Tpetra::RowMatrix.");
95 typedef typename row_matrix_type::nonconst_global_inds_host_view_type nonconst_global_inds_host_view_type;
96 typedef typename row_matrix_type::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
97 typedef typename row_matrix_type::nonconst_values_host_view_type nonconst_values_host_view_type;
102 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
111 DenseSolver (
const Teuchos::RCP<const row_matrix_type>& matrix);
139 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
140 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
141 Teuchos::ETransp mode = Teuchos::NO_TRANS,
142 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
143 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
179 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
182 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
211 describe (Teuchos::FancyOStream &out,
212 const Teuchos::EVerbosityLevel verbLevel =
213 Teuchos::Describable::verbLevel_default)
const;
219 describeLocal (Teuchos::FancyOStream& out,
220 const Teuchos::EVerbosityLevel verbLevel)
const;
233 extract (Teuchos::SerialDenseMatrix<int, scalar_type>& A_local_dense,
246 factor (Teuchos::SerialDenseMatrix<int, scalar_type>& A,
247 const Teuchos::ArrayView<int>& ipiv);
262 typedef Teuchos::ScalarTraits<scalar_type> STS;
273 applyImpl (
const MV& X,
275 const Teuchos::ETransp mode,
280 Teuchos::RCP<const row_matrix_type> A_;
283 Teuchos::RCP<const row_matrix_type> A_local_;
286 Teuchos::SerialDenseMatrix<int, scalar_type> A_local_dense_;
289 Teuchos::Array<int> ipiv_;
292 double initializeTime_;
298 mutable double applyTime_;
307 mutable int numApply_;
318template<
class MatrixType>
321 typename MatrixType::local_ordinal_type,
322 typename MatrixType::global_ordinal_type,
323 typename MatrixType::node_type>,
325 typename MatrixType::local_ordinal_type,
326 typename MatrixType::global_ordinal_type,
327 typename MatrixType::node_type> >
352 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
355 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>
row_matrix_type;
358 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
367 DenseSolver (
const Teuchos::RCP<const row_matrix_type>& matrix);
394 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
395 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
396 Teuchos::ETransp mode = Teuchos::NO_TRANS,
397 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
398 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
434 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
437 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
466 describe (Teuchos::FancyOStream &out,
467 const Teuchos::EVerbosityLevel verbLevel =
468 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
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:84
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to the given FancyOStream.
Definition Ifpack2_Details_DenseSolver_def.hpp:543
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:78
DenseSolver(const Teuchos::RCP< const row_matrix_type > &matrix)
Constructor.
Definition Ifpack2_Details_DenseSolver_def.hpp:35
MatrixType matrix_type
The first template parameter of this class.
Definition Ifpack2_Details_DenseSolver_decl.hpp:72
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:75
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:102
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:81
std::string description() const
A one-line description of this object.
Definition Ifpack2_Details_DenseSolver_def.hpp:460
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:90
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the absolute value (magnitude) of a scalar_type.
Definition Ifpack2_Details_DenseSolver_decl.hpp:87
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:349
MatrixType matrix_type
The first template parameter of this class.
Definition Ifpack2_Details_DenseSolver_decl.hpp:337
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:355
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:358
DenseSolver(const Teuchos::RCP< const row_matrix_type > &matrix)
Constructor.
Definition Ifpack2_Details_DenseSolver_def.hpp:650
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to the given FancyOStream.
Definition Ifpack2_Details_DenseSolver_def.hpp:791
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:343
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the absolute value (magnitude) of a scalar_type.
Definition Ifpack2_Details_DenseSolver_decl.hpp:352
std::string description() const
A one-line description of this object.
Definition Ifpack2_Details_DenseSolver_def.hpp:783
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:340
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition Ifpack2_Details_DenseSolver_decl.hpp:346
"Preconditioner" that uses LAPACK's dense LU.
Definition Ifpack2_Details_DenseSolver_decl.hpp:51
Interface for all Ifpack2 preconditioners.
Definition Ifpack2_Preconditioner.hpp:75
virtual double getComputeTime() const=0
virtual bool isInitialized() const=0
virtual int getNumCompute() const=0
virtual Teuchos::RCP< const Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getMatrix() const=0
virtual int getNumApply() const=0
virtual double getApplyTime() const=0
virtual void setParameters(const Teuchos::ParameterList &List)=0
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
virtual Teuchos::RCP< const Tpetra::Map< MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getRangeMap() const=0
virtual Teuchos::RCP< const Tpetra::Map< MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getDomainMap() const=0
virtual bool isComputed() const=0
virtual void initialize()=0
virtual double getInitializeTime() const=0
virtual int getNumInitialize() const=0
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:41