43 #ifndef IFPACK2_CHEBYSHEV_DECL_HPP 44 #define IFPACK2_CHEBYSHEV_DECL_HPP 49 #include "Ifpack2_ConfigDefs.hpp" 50 #include "Ifpack2_Preconditioner.hpp" 51 #include "Ifpack2_Condest.hpp" 52 #include "Ifpack2_Parameters.hpp" 56 #include <Tpetra_CrsMatrix.hpp> 57 #include <Tpetra_Vector.hpp> 59 #include <Teuchos_RCP.hpp> 60 #include <Teuchos_ScalarTraits.hpp> 61 #include <Teuchos_Time.hpp> 196 template<
class MatrixType>
199 typename MatrixType::local_ordinal_type,
200 typename MatrixType::global_ordinal_type,
201 typename MatrixType::node_type>
208 typedef MatrixType matrix_type;
211 typedef typename MatrixType::scalar_type scalar_type;
214 TEUCHOS_DEPRECATED
typedef typename MatrixType::scalar_type Scalar;
218 typedef typename MatrixType::local_ordinal_type local_ordinal_type;
221 TEUCHOS_DEPRECATED
typedef typename MatrixType::local_ordinal_type LocalOrdinal;
225 typedef typename MatrixType::global_ordinal_type global_ordinal_type;
228 TEUCHOS_DEPRECATED
typedef typename MatrixType::global_ordinal_type GlobalOrdinal;
232 typedef typename MatrixType::node_type node_type;
235 TEUCHOS_DEPRECATED
typedef typename MatrixType::node_type Node;
239 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType magnitude_type;
242 TEUCHOS_DEPRECATED
typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType magnitudeType;
251 typedef Tpetra::RowMatrix<scalar_type,local_ordinal_type,global_ordinal_type,node_type> row_matrix_type;
254 typedef Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> map_type;
261 typedef Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type> vector_type;
288 explicit Chebyshev (
const Teuchos::RCP<const row_matrix_type>& A);
291 virtual ~Chebyshev ();
433 void setParameters (
const Teuchos::ParameterList& params);
445 inline bool isInitialized()
const {
446 return IsInitialized_;
490 inline bool isComputed()
const {
527 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
528 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
529 Teuchos::ETransp mode = Teuchos::NO_TRANS,
530 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
531 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
534 const Teuchos::RCP<const map_type>& getDomainMap()
const;
537 const Teuchos::RCP<const map_type>& getRangeMap()
const;
540 bool hasTransposeApply()
const;
563 applyMat (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
564 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
565 Teuchos::ETransp mode = Teuchos::NO_TRANS)
const;
574 local_ordinal_type MaxIters = 1550,
575 magnitude_type Tol = 1e-9,
576 const Teuchos::Ptr<const row_matrix_type>& matrix = Teuchos::null);
583 magnitude_type getCondEst()
const;
586 const Teuchos::RCP<const Teuchos::Comm<int> > & getComm()
const;
589 Teuchos::RCP<const row_matrix_type> getMatrix()
const;
592 double getComputeFlops()
const;
595 double getApplyFlops()
const;
598 int getNumInitialize()
const;
601 int getNumCompute()
const;
604 int getNumApply()
const;
607 double getInitializeTime()
const;
610 double getComputeTime()
const;
613 double getApplyTime()
const;
616 typename MatrixType::scalar_type getLambdaMaxForApply()
const;
623 std::string description()
const;
626 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const;
638 static void TEUCHOS_DEPRECATED
639 PowerMethod (
const Tpetra::Operator<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Operator,
640 const vector_type& InvPointDiagonal,
641 const int MaximumIterations,
642 scalar_type& LambdaMax);
645 static void TEUCHOS_DEPRECATED
646 CG (
const Tpetra::Operator<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Operator,
647 const vector_type& InvPointDiagonal,
648 const int MaximumIterations,
649 scalar_type& lambda_min, scalar_type& lambda_max);
655 typedef Teuchos::ScalarTraits<typename MatrixType::scalar_type> STS;
658 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> MV;
661 Chebyshev (
const Chebyshev<MatrixType>&);
664 Chebyshev<MatrixType>& operator= (
const Chebyshev<MatrixType>&);
674 applyImpl (
const MV& X,
676 Teuchos::ETransp mode,
678 scalar_type beta)
const;
690 mutable Details::Chebyshev<scalar_type, MV, row_matrix_type> impl_;
693 Teuchos::RCP<Teuchos::Time> Time_;
695 magnitude_type Condest_;
708 mutable int NumApply_;
710 double InitializeTime_;
717 mutable double ApplyTime_;
719 double ComputeFlops_;
724 mutable double ApplyFlops_;
731 #endif // IFPACK2_CHEBYSHEV_DECL_HPP CondestType
Ifpack2::CondestType: enum to define the type of condition number estimate.
Definition: Ifpack2_CondestType.hpp:50
Base class for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:130
Definition of Chebyshev implementation.
Declaration of Chebyshev implementation.
Uses AztecOO's CG.
Definition: Ifpack2_CondestType.hpp:52
Ifpack2::Container: a pure virtual class for creating and solving local linear problems.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:67
cheap estimate
Definition: Ifpack2_CondestType.hpp:51