IFPACK Development
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Ifpack_Polynomial Class Reference

Ifpack_Polynomial: class for preconditioning with least squares polynomials in Ifpack. More...

#include <Ifpack_Polynomial.h>

Inheritance diagram for Ifpack_Polynomial:
Inheritance graph
[legend]
Collaboration diagram for Ifpack_Polynomial:
Collaboration graph
[legend]

Public Member Functions

 Ifpack_Polynomial (const Epetra_Operator *Matrix)
 Ifpack_Polynomial constructor with given Epetra_Operator/Epetra_RowMatrix.
 
 Ifpack_Polynomial (const Epetra_RowMatrix *Matrix)
 Ifpack_Polynomial constructor with given Epetra_Operator/Epetra_RowMatrix.
 
virtual ~Ifpack_Polynomial ()
 Destructor.
 
virtual int SetUseTranspose (bool UseTranspose_in)
 
virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the matrix to an Epetra_MultiVector.
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the preconditioner to X, returns the result in Y.
 
virtual double NormInf () const
 Returns the infinity norm of the global matrix (not implemented)
 
virtual const char * Label () const
 
virtual bool UseTranspose () const
 Returns the current UseTranspose setting.
 
virtual bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise.
 
virtual const Epetra_CommComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator.
 
virtual const Epetra_MapOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator.
 
virtual const Epetra_MapOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator.
 
virtual int Initialize ()
 Computes all it is necessary to initialize the preconditioner.
 
virtual bool IsInitialized () const
 Returns true if the preconditioner has been successfully initialized, false otherwise.
 
virtual bool IsComputed () const
 Returns true if the preconditioner has been successfully computed.
 
virtual int Compute ()
 Computes the preconditioners.
 
virtual const Epetra_RowMatrixMatrix () const
 Returns a pointer to the matrix to be preconditioned.
 
virtual double Condest (const Ifpack_CondestType CT=Ifpack_Cheap, const int MaxIters=1550, const double Tol=1e-9, Epetra_RowMatrix *Matrix_in=0)
 Computes the condition number estimates and returns the value.
 
virtual double Condest () const
 Returns the condition number estimate, or -1.0 if not computed.
 
virtual int SetParameters (Teuchos::ParameterList &List)
 Sets all the parameters for the preconditioner.
 
virtual std::ostream & Print (std::ostream &os) const
 Prints object to an output stream.
 
virtual int NumInitialize () const
 Returns the number of calls to Initialize().
 
virtual int NumCompute () const
 Returns the number of calls to Compute().
 
virtual int NumApplyInverse () const
 Returns the number of calls to ApplyInverse().
 
virtual double InitializeTime () const
 Returns the time spent in Initialize().
 
virtual double ComputeTime () const
 Returns the time spent in Compute().
 
virtual double ApplyInverseTime () const
 Returns the time spent in ApplyInverse().
 
virtual double InitializeFlops () const
 Returns the number of flops in the initialization phase.
 
virtual double ComputeFlops () const
 Returns the number of flops in the computation phase.
 
virtual double ApplyInverseFlops () const
 Returns the number of flops for the application of the preconditioner.
 
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 Public Member Functions

static int PowerMethod (const Epetra_Operator &Operator, const Epetra_Vector &InvPointDiagonal, const int MaximumIterations, double &LambdaMax)
 Simple power method to compute lambda_max.
 
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.
 

Detailed Description

Ifpack_Polynomial: class for preconditioning with least squares polynomials in Ifpack.

The Ifpack_Polynomial class enables the construction of preconditioners based on least squares polynomials for an Epetra_RowMatrix. Similar to Ifpack_Chebyshev, Ifpack_Polynomial is designed for indefinite linear systems.

The list of parameters is

Author
Paul Tsuji, May 2013.

Definition at line 99 of file Ifpack_Polynomial.h.

Constructor & Destructor Documentation

◆ Ifpack_Polynomial() [1/2]

Ifpack_Polynomial::Ifpack_Polynomial ( const Epetra_Operator * Matrix)

Ifpack_Polynomial constructor with given Epetra_Operator/Epetra_RowMatrix.

Creates an instance of Ifpack_Polynomial class.

Parameters
Matrix- (In) Pointer to the operator to precondition.

Definition at line 85 of file Ifpack_Polynomial.cpp.

◆ Ifpack_Polynomial() [2/2]

Ifpack_Polynomial::Ifpack_Polynomial ( const Epetra_RowMatrix * Matrix)

Ifpack_Polynomial constructor with given Epetra_Operator/Epetra_RowMatrix.

Creates an instance of Ifpack_Polynomial class.

Parameters
Matrix- (In) Pointer to the matrix to precondition.

Definition at line 134 of file Ifpack_Polynomial.cpp.

◆ ~Ifpack_Polynomial()

virtual Ifpack_Polynomial::~Ifpack_Polynomial ( )
inlinevirtual

Destructor.

Definition at line 121 of file Ifpack_Polynomial.h.

Member Function Documentation

◆ Apply()

int Ifpack_Polynomial::Apply ( const Epetra_MultiVector & X,
Epetra_MultiVector & Y ) const
virtual

Applies the matrix to an Epetra_MultiVector.

Parameters
X- (In) A Epetra_MultiVector of dimension NumVectors to multiply with matrix.
Y- (Out) A Epetra_MultiVector of dimension NumVectors containing the result.
Returns
Integer error code, set to 0 if successful.

Implements Epetra_Operator.

Definition at line 251 of file Ifpack_Polynomial.cpp.

References IsComputed(), Epetra_MultiVector::NumVectors(), and UseTranspose().

◆ ApplyInverse()

int Ifpack_Polynomial::ApplyInverse ( const Epetra_MultiVector & X,
Epetra_MultiVector & Y ) const
virtual

Applies the preconditioner to X, returns the result in Y.

Parameters
X- (In) A Epetra_MultiVector of dimension NumVectors to be preconditioned.
Y- (InOut) A Epetra_MultiVector of dimension NumVectors containing result.
Returns
Integer error code, set to 0 if successful.
Warning
This routine is NOT AztecOO complaint.

Implements Ifpack_Preconditioner.

Definition at line 627 of file Ifpack_Polynomial.cpp.

References IsComputed(), Epetra_MultiVector::Multiply(), Epetra_MultiVector::NumVectors(), Epetra_MultiVector::PutScalar(), and Epetra_MultiVector::Update().

◆ ApplyInverseFlops()

virtual double Ifpack_Polynomial::ApplyInverseFlops ( ) const
inlinevirtual

Returns the number of flops for the application of the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 294 of file Ifpack_Polynomial.h.

◆ ApplyInverseTime()

virtual double Ifpack_Polynomial::ApplyInverseTime ( ) const
inlinevirtual

Returns the time spent in ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 276 of file Ifpack_Polynomial.h.

◆ CG()

int Ifpack_Polynomial::CG ( const Epetra_Operator & Operator,
const Epetra_Vector & InvPointDiagonal,
const int MaximumIterations,
double & lambda_min,
double & lambda_max )
static

Uses AztecOO's CG to estimate lambda_min and lambda_max.

Definition at line 704 of file Ifpack_Polynomial.cpp.

References Epetra_Operator::OperatorDomainMap(), Epetra_Operator::OperatorRangeMap(), Epetra_MultiVector::PutScalar(), and Epetra_MultiVector::Random().

◆ Comm()

const Epetra_Comm & Ifpack_Polynomial::Comm ( ) const
virtual

Returns a pointer to the Epetra_Comm communicator associated with this operator.

Implements Epetra_Operator.

Definition at line 233 of file Ifpack_Polynomial.cpp.

Referenced by Initialize(), and Print().

◆ Compute()

int Ifpack_Polynomial::Compute ( )
virtual

Computes the preconditioners.

Implements Ifpack_Preconditioner.

Definition at line 307 of file Ifpack_Polynomial.cpp.

References GMRES(), Initialize(), IsInitialized(), and Matrix().

◆ ComputeFlops()

virtual double Ifpack_Polynomial::ComputeFlops ( ) const
inlinevirtual

Returns the number of flops in the computation phase.

Implements Ifpack_Preconditioner.

Definition at line 288 of file Ifpack_Polynomial.h.

◆ ComputeTime()

virtual double Ifpack_Polynomial::ComputeTime ( ) const
inlinevirtual

Returns the time spent in Compute().

Implements Ifpack_Preconditioner.

Definition at line 270 of file Ifpack_Polynomial.h.

◆ Condest() [1/2]

virtual double Ifpack_Polynomial::Condest ( ) const
inlinevirtual

Returns the condition number estimate, or -1.0 if not computed.

Implements Ifpack_Preconditioner.

Definition at line 230 of file Ifpack_Polynomial.h.

Referenced by Print().

◆ Condest() [2/2]

double Ifpack_Polynomial::Condest ( const Ifpack_CondestType CT = Ifpack_Cheap,
const int MaxIters = 1550,
const double Tol = 1e-9,
Epetra_RowMatrix * Matrix_in = 0 )
virtual

Computes the condition number estimates and returns the value.

Implements Ifpack_Preconditioner.

Definition at line 605 of file Ifpack_Polynomial.cpp.

References IsComputed().

◆ GMRES()

int Ifpack_Polynomial::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.

Definition at line 835 of file Ifpack_Polynomial.cpp.

References Epetra_Operator::OperatorDomainMap(), Epetra_Operator::OperatorRangeMap(), Epetra_MultiVector::PutScalar(), and Epetra_MultiVector::Random().

Referenced by Compute().

◆ HasNormInf()

virtual bool Ifpack_Polynomial::HasNormInf ( ) const
inlinevirtual

Returns true if the this object can provide an approximate Inf-norm, false otherwise.

Implements Epetra_Operator.

Definition at line 186 of file Ifpack_Polynomial.h.

◆ Initialize()

int Ifpack_Polynomial::Initialize ( )
virtual

Computes all it is necessary to initialize the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 273 of file Ifpack_Polynomial.cpp.

References Comm(), and Matrix().

Referenced by Compute().

◆ InitializeFlops()

virtual double Ifpack_Polynomial::InitializeFlops ( ) const
inlinevirtual

Returns the number of flops in the initialization phase.

Implements Ifpack_Preconditioner.

Definition at line 282 of file Ifpack_Polynomial.h.

◆ InitializeTime()

virtual double Ifpack_Polynomial::InitializeTime ( ) const
inlinevirtual

Returns the time spent in Initialize().

Implements Ifpack_Preconditioner.

Definition at line 264 of file Ifpack_Polynomial.h.

◆ IsComputed()

virtual bool Ifpack_Polynomial::IsComputed ( ) const
inlinevirtual

Returns true if the preconditioner has been successfully computed.

Implements Ifpack_Preconditioner.

Definition at line 208 of file Ifpack_Polynomial.h.

Referenced by Apply(), ApplyInverse(), and Condest().

◆ IsInitialized()

virtual bool Ifpack_Polynomial::IsInitialized ( ) const
inlinevirtual

Returns true if the preconditioner has been successfully initialized, false otherwise.

Implements Ifpack_Preconditioner.

Definition at line 202 of file Ifpack_Polynomial.h.

Referenced by Compute().

◆ Label()

virtual const char * Ifpack_Polynomial::Label ( ) const
inlinevirtual

Implements Epetra_Operator.

Definition at line 174 of file Ifpack_Polynomial.h.

◆ Matrix()

virtual const Epetra_RowMatrix & Ifpack_Polynomial::Matrix ( ) const
inlinevirtual

Returns a pointer to the matrix to be preconditioned.

Implements Ifpack_Preconditioner.

Definition at line 218 of file Ifpack_Polynomial.h.

Referenced by Compute(), and Initialize().

◆ NormInf()

virtual double Ifpack_Polynomial::NormInf ( ) const
inlinevirtual

Returns the infinity norm of the global matrix (not implemented)

Implements Epetra_Operator.

Definition at line 166 of file Ifpack_Polynomial.h.

◆ NumApplyInverse()

virtual int Ifpack_Polynomial::NumApplyInverse ( ) const
inlinevirtual

Returns the number of calls to ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 258 of file Ifpack_Polynomial.h.

◆ NumCompute()

virtual int Ifpack_Polynomial::NumCompute ( ) const
inlinevirtual

Returns the number of calls to Compute().

Implements Ifpack_Preconditioner.

Definition at line 252 of file Ifpack_Polynomial.h.

◆ NumInitialize()

virtual int Ifpack_Polynomial::NumInitialize ( ) const
inlinevirtual

Returns the number of calls to Initialize().

Implements Ifpack_Preconditioner.

Definition at line 246 of file Ifpack_Polynomial.h.

◆ OperatorDomainMap()

const Epetra_Map & Ifpack_Polynomial::OperatorDomainMap ( ) const
virtual

Returns the Epetra_Map object associated with the domain of this operator.

Implements Epetra_Operator.

Definition at line 239 of file Ifpack_Polynomial.cpp.

◆ OperatorRangeMap()

const Epetra_Map & Ifpack_Polynomial::OperatorRangeMap ( ) const
virtual

Returns the Epetra_Map object associated with the range of this operator.

Implements Epetra_Operator.

Definition at line 245 of file Ifpack_Polynomial.cpp.

◆ PowerMethod()

int Ifpack_Polynomial::PowerMethod ( const Epetra_Operator & Operator,
const Epetra_Vector & InvPointDiagonal,
const int MaximumIterations,
double & LambdaMax )
static

◆ Print()

std::ostream & Ifpack_Polynomial::Print ( std::ostream & os) const
virtual

Prints object to an output stream.

Implements Ifpack_Preconditioner.

Definition at line 548 of file Ifpack_Polynomial.cpp.

References Comm(), Condest(), and Epetra_Comm::MinAll().

◆ SetParameters()

int Ifpack_Polynomial::SetParameters ( Teuchos::ParameterList & List)
virtual

Sets all the parameters for the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 177 of file Ifpack_Polynomial.cpp.

◆ SetUseTranspose()

virtual int Ifpack_Polynomial::SetUseTranspose ( bool UseTranspose_in)
inlinevirtual

This flag can be used to apply the preconditioner to the transpose of the input operator.

Returns
Integer error code, set to 0 if successful. Set to -1 if this implementation does not support transpose.

Implements Epetra_Operator.

Definition at line 131 of file Ifpack_Polynomial.h.

◆ UseTranspose()

virtual bool Ifpack_Polynomial::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 180 of file Ifpack_Polynomial.h.

Referenced by Apply().


The documentation for this class was generated from the following files: