43 #ifndef IFPACK2_DENSECONTAINER_DECL_HPP 44 #define IFPACK2_DENSECONTAINER_DECL_HPP 51 #include "Ifpack2_Details_LapackSupportsScalar.hpp" 52 #include "Tpetra_MultiVector.hpp" 53 #include "Tpetra_Map.hpp" 54 #include "Tpetra_RowMatrix.hpp" 55 #include "Teuchos_SerialDenseMatrix.hpp" 104 template<
class MatrixType,
105 class LocalScalarType,
106 const bool supportsLocalScalarType =
112 template<
typename MatrixType,
typename LocalScalarType>
138 static_assert(std::is_same<MatrixType,
139 Tpetra::RowMatrix<
typename MatrixType::scalar_type,
140 typename MatrixType::local_ordinal_type,
141 typename MatrixType::global_ordinal_type,
142 typename MatrixType::node_type> >::value,
143 "Ifpack2::DenseContainer: Please use MatrixType = Tpetra::RowMatrix.");
153 typedef typename Container<MatrixType>::row_matrix_type
row_matrix_type;
172 DenseContainer (
const Teuchos::RCP<const row_matrix_type>& matrix,
173 const Teuchos::ArrayView<const local_ordinal_type>& localRows);
192 return IsInitialized_;
201 virtual void setParameters(
const Teuchos::ParameterList& List);
208 virtual void initialize ();
211 virtual void compute ();
215 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
216 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
217 Teuchos::ETransp mode=Teuchos::NO_TRANS,
218 scalar_type alpha=Teuchos::ScalarTraits<scalar_type>::one(),
219 scalar_type beta=Teuchos::ScalarTraits<scalar_type>::zero())
const;
223 weightedApply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
224 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
225 const Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& D,
226 Teuchos::ETransp mode=Teuchos::NO_TRANS,
227 scalar_type alpha=Teuchos::ScalarTraits<scalar_type>::one(),
228 scalar_type beta=Teuchos::ScalarTraits<scalar_type>::zero())
const;
237 virtual std::ostream& print (std::ostream& os)
const;
244 virtual std::string description ()
const;
248 describe (Teuchos::FancyOStream &out,
249 const Teuchos::EVerbosityLevel verbLevel =
250 Teuchos::Describable::verbLevel_default)
const;
258 void extract (
const Teuchos::RCP<const row_matrix_type>& globalMatrix);
265 typedef Tpetra::MultiVector<local_scalar_type, local_ordinal_type,
266 global_ordinal_type, node_type> local_mv_type;
277 applyImpl (
const local_mv_type& X,
279 Teuchos::ETransp mode,
280 const local_scalar_type alpha,
281 const local_scalar_type beta)
const;
287 Teuchos::SerialDenseMatrix<int, local_scalar_type> diagBlock_;
290 Teuchos::Array<int> ipiv_;
293 Teuchos::RCP<const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> > localMap_;
296 mutable Teuchos::RCP<local_mv_type> Y_;
299 mutable Teuchos::RCP<local_mv_type> X_;
310 template<
class MatrixType,
class LocalScalarType>
336 static_assert(std::is_same<MatrixType,
337 Tpetra::RowMatrix<
typename MatrixType::scalar_type,
338 typename MatrixType::local_ordinal_type,
339 typename MatrixType::global_ordinal_type,
340 typename MatrixType::node_type> >::value,
341 "Ifpack2::DenseContainer: Please use MatrixType = Tpetra::RowMatrix.");
351 typedef typename Container<MatrixType>::row_matrix_type
row_matrix_type;
370 DenseContainer (
const Teuchos::RCP<const row_matrix_type>& matrix,
371 const Teuchos::ArrayView<const local_ordinal_type>& localRows);
390 return IsInitialized_;
399 virtual void setParameters(
const Teuchos::ParameterList& List);
406 virtual void initialize ();
409 virtual void compute ();
413 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
414 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
415 Teuchos::ETransp mode=Teuchos::NO_TRANS,
416 scalar_type alpha=Teuchos::ScalarTraits<scalar_type>::one(),
417 scalar_type beta=Teuchos::ScalarTraits<scalar_type>::zero())
const;
421 weightedApply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
422 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
423 const Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& D,
424 Teuchos::ETransp mode=Teuchos::NO_TRANS,
425 scalar_type alpha=Teuchos::ScalarTraits<scalar_type>::one(),
426 scalar_type beta=Teuchos::ScalarTraits<scalar_type>::zero())
const;
435 virtual std::ostream& print (std::ostream& os)
const;
442 virtual std::string description ()
const;
446 describe (Teuchos::FancyOStream &out,
447 const Teuchos::EVerbosityLevel verbLevel =
448 Teuchos::Describable::verbLevel_default)
const;
456 void extract (
const Teuchos::RCP<const row_matrix_type>& globalMatrix);
463 typedef Tpetra::MultiVector<local_scalar_type, local_ordinal_type,
464 global_ordinal_type, node_type> local_mv_type;
475 applyImpl (
const local_mv_type& X,
477 Teuchos::ETransp mode,
478 const local_scalar_type alpha,
479 const local_scalar_type beta)
const;
485 Teuchos::SerialDenseMatrix<int, local_scalar_type> diagBlock_;
488 Teuchos::Array<int> ipiv_;
491 Teuchos::RCP<const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> > localMap_;
494 mutable Teuchos::RCP<local_mv_type> Y_;
497 mutable Teuchos::RCP<local_mv_type> X_;
508 #endif // IFPACK2_DENSECONTAINER_DECL_HPP virtual bool isComputed() const
Whether the container has been successfully computed.
Definition: Ifpack2_DenseContainer_decl.hpp:394
Ifpack2::Container class declaration.
Container< MatrixType >::row_matrix_type row_matrix_type
The (base class) type of the input matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:341
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:332
virtual bool isInitialized() const
Whether the container has been successfully initialized.
Definition: Ifpack2_DenseContainer_decl.hpp:389
Declaration and definition of the Ifpack2::Details::MultiVectorLocalGatherScatter class...
virtual bool isInitialized() const
Whether the container has been successfully initialized.
Definition: Ifpack2_DenseContainer_decl.hpp:191
Store and solve a local dense linear problem.
Definition: Ifpack2_DenseContainer_decl.hpp:108
LocalScalarType local_scalar_type
The second template parameter of this class.
Definition: Ifpack2_DenseContainer_decl.hpp:325
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:134
Container< MatrixType >::row_matrix_type row_matrix_type
The (base class) type of the input matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:143
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:330
LocalScalarType local_scalar_type
The second template parameter of this class.
Definition: Ifpack2_DenseContainer_decl.hpp:127
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:136
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:328
MatrixType matrix_type
The first template parameter of this class.
Definition: Ifpack2_DenseContainer_decl.hpp:125
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:130
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:132
virtual bool isComputed() const
Whether the container has been successfully computed.
Definition: Ifpack2_DenseContainer_decl.hpp:196
Interface for creating and solving a local linear problem.
Definition: Ifpack2_Container.hpp:103
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition: Ifpack2_DenseContainer_decl.hpp:334
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
MatrixType matrix_type
The first template parameter of this class.
Definition: Ifpack2_DenseContainer_decl.hpp:323
virtual size_t getNumRows() const
The number of rows in the local matrix on the calling process.
Definition: Ifpack2_DenseContainer_decl.hpp:186
virtual size_t getNumRows() const
The number of rows in the local matrix on the calling process.
Definition: Ifpack2_DenseContainer_decl.hpp:384
Type traits class that says whether Teuchos::LAPACK has a valid implementation for the given ScalarTy...
Definition: Ifpack2_Details_LapackSupportsScalar.hpp:17