43#ifndef IFPACK_POLYNOMIAL_H
44#define IFPACK_POLYNOMIAL_H
46#if defined(Ifpack_SHOW_DEPRECATED_WARNINGS)
48#warning "The Ifpack package is deprecated"
52#include "Ifpack_ConfigDefs.h"
53#include "Ifpack_Preconditioner.h"
54#include "Teuchos_RefCountPtr.hpp"
55#include "Teuchos_LAPACK.hpp"
56#include "Teuchos_SerialDenseMatrix.hpp"
71#ifdef HAVE_IFPACK_EPETRAEXT
72class EpetraExt_PointToBlockDiagPermute;
139 UseTranspose_ = UseTranspose_in;
180 virtual const char * Label()
const
182 return(Label_.c_str());
188 return(UseTranspose_);
210 return(IsInitialized_);
230 virtual double Condest(
const Ifpack_CondestType CT = Ifpack_Cheap,
231 const int MaxIters = 1550,
232 const double Tol = 1e-9,
245 virtual std::ostream&
Print(std::ostream & os)
const;
254 return(NumInitialize_);
266 return(NumApplyInverse_);
272 return(InitializeTime_);
278 return(ComputeTime_);
284 return(ApplyInverseTime_);
296 return(ComputeFlops_);
302 return(ApplyInverseFlops_);
311 const int MaximumIterations,
317 const int MaximumIterations,
318 double& lambda_min,
double& lambda_max);
320#ifdef HAVE_IFPACK_EPETRAEXT
323 int CG(
const int MaximumIterations,
324 double& lambda_min,
double& lambda_max);
327 int PowerMethod(
const int MaximumIterations,
double& lambda_max);
333 const int MaximumIterations,
334 double& lambda_real_min,
double& lambda_real_max,
335 double& lambda_imag_min,
double& lambda_imag_max);
343 virtual void SetLabel();
369 mutable int NumApplyInverse_;
371 double InitializeTime_;
375 mutable double ApplyInverseTime_;
377 double ComputeFlops_;
379 mutable double ApplyInverseFlops_;
386 int LSPointsReal_, LSPointsImag_;
395 bool ComputeCondest_;
399 double RealEigRatio_, ImagEigRatio_;
405 double LambdaRealMin_, LambdaRealMax_, LambdaImagMin_, LambdaImagMax_;
407 double MinDiagonalValue_;
409 std::vector<double> coeff_;
417 long long NumGlobalRows_;
419 long long NumGlobalNonzeros_;
421 Teuchos::RefCountPtr<const Epetra_Operator> Operator_;
423 Teuchos::RefCountPtr<const Epetra_RowMatrix> Matrix_;
425 mutable Teuchos::RefCountPtr<Epetra_Vector> InvDiagonal_;
428#ifdef HAVE_IFPACK_EPETRAEXT
430 Teuchos::ParameterList BlockList_;
431 Teuchos::RefCountPtr<EpetraExt_PointToBlockDiagPermute> InvBlockDiagonal_;
436 bool SolveNormalEquations_;
441 Teuchos::RefCountPtr<Epetra_Time> Time_;
443 bool ZeroStartingSolution_;
Ifpack_Polynomial: class for preconditioning with least squares polynomials in Ifpack.
virtual bool IsComputed() const
Returns true if the preconditioner has been successfully computed.
virtual bool IsInitialized() const
Returns true if the preconditioner has been successfully initialized, false otherwise.
virtual double NormInf() const
Returns the infinity norm of the global matrix (not implemented)
virtual double ApplyInverseFlops() const
Returns the number of flops for the application of the preconditioner.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the matrix to an Epetra_MultiVector.
virtual const Epetra_RowMatrix & Matrix() const
Returns a pointer to the matrix to be preconditioned.
virtual int SetParameters(Teuchos::ParameterList &List)
Sets all the parameters for the preconditioner.
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
virtual int Compute()
Computes the preconditioners.
virtual double ApplyInverseTime() const
Returns the time spent in ApplyInverse().
virtual double ComputeTime() const
Returns the time spent in Compute().
virtual double InitializeFlops() const
Returns the number of flops in the initialization phase.
virtual double InitializeTime() const
Returns the time spent in Initialize().
static int CG(const Epetra_Operator &Operator, const Epetra_Vector &InvPointDiagonal, const int MaximumIterations, double &lambda_min, double &lambda_max)
Uses AztecOO's CG to estimate lambda_min and lambda_max.
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
virtual int Initialize()
Computes all it is necessary to initialize the preconditioner.
virtual double ComputeFlops() const
Returns the number of flops in the computation phase.
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
int GMRES(const Epetra_Operator &Operator, const Epetra_Vector &InvPointDiagonal, const int MaximumIterations, double &lambda_real_min, double &lambda_real_max, double &lambda_imag_min, double &lambda_imag_max)
Uses AztecOO's GMRES to estimate the height and width of the spectrum.
static int PowerMethod(const Epetra_Operator &Operator, const Epetra_Vector &InvPointDiagonal, const int MaximumIterations, double &LambdaMax)
Simple power method to compute lambda_max.
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
virtual int NumApplyInverse() const
Returns the number of calls to ApplyInverse().
virtual int NumInitialize() const
Returns the number of calls to Initialize().
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual int SetUseTranspose(bool UseTranspose_in)
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Applies the preconditioner to X, returns the result in Y.
virtual std::ostream & Print(std::ostream &os) const
Prints object to an output stream.
virtual double Condest() const
Returns the condition number estimate, or -1.0 if not computed.
virtual int NumCompute() const
Returns the number of calls to Compute().
virtual ~Ifpack_Polynomial()
Destructor.
Ifpack_Preconditioner: basic class for preconditioning in Ifpack.