Ifpack Package Browser (Single Doxygen Collection) Development
Public Member Functions | Private Member Functions
Ifpack_PointRelaxation Class Reference

Ifpack_PointRelaxation: a class to define point relaxation preconditioners of for Epetra_RowMatrix's. More...

#include <Ifpack_PointRelaxation.h>

Inheritance diagram for Ifpack_PointRelaxation:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual int SetUseTranspose (bool UseTranspose_in)

Private Member Functions

virtual void SetLabel ()
 Sets the label.
 Ifpack_PointRelaxation (const Ifpack_PointRelaxation &rhs)
 Copy constructor (PRIVATE, should not be used)
Ifpack_PointRelaxationoperator= (const Ifpack_PointRelaxation &rhs)
 operator = (PRIVATE, should not be used)
 Ifpack_PointRelaxation (const Epetra_RowMatrix *Matrix)
 Ifpack_PointRelaxation constructor with given Epetra_RowMatrix.
virtual ~Ifpack_PointRelaxation ()
 Destructor.
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=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 ostream & Print (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.
virtual int ApplyInverseJacobi (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the Jacobi preconditioner to X, returns the result in Y.
virtual int ApplyInverseGS (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the Gauss-Seidel preconditioner to X, returns the result in Y.
virtual int ApplyInverseGS_RowMatrix (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual int ApplyInverseGS_CrsMatrix (const Epetra_CrsMatrix *A, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual int ApplyInverseGS_FastCrsMatrix (const Epetra_CrsMatrix *A, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual int ApplyInverseSGS (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the symmetric Gauss-Seidel preconditioner to X, returns the result in Y.
virtual int ApplyInverseSGS_RowMatrix (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual int ApplyInverseSGS_CrsMatrix (const Epetra_CrsMatrix *A, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual int ApplyInverseSGS_FastCrsMatrix (const Epetra_CrsMatrix *A, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
bool IsInitialized_
 If true, the preconditioner has been computed successfully.
bool IsComputed_
 If true, the preconditioner has been computed successfully.
int NumInitialize_
 Contains the number of successful calls to Initialize().
int NumCompute_
 Contains the number of successful call to Compute().
int NumApplyInverse_
 Contains the number of successful call to ApplyInverse().
double InitializeTime_
 Contains the time for all successful calls to Initialize().
double ComputeTime_
 Contains the time for all successful calls to Compute().
double ApplyInverseTime_
 Contains the time for all successful calls to ApplyInverse().
double ComputeFlops_
 Contains the number of flops for Compute().
double ApplyInverseFlops_
 Contain sthe number of flops for ApplyInverse().
int NumSweeps_
 Number of application of the preconditioner (should be greater than 0).
double DampingFactor_
 Damping factor.
bool UseTranspose_
 If true, use the tranpose of Matrix_.
double Condest_
 Contains the estimated condition number.
bool ComputeCondest_
 If true, Compute() also computes the condition number estimate.
string Label_
 Contains the label of this object.
int PrecType_
double MinDiagonalValue_
int NumMyRows_
 Number of local rows.
int NumMyNonzeros_
 Number of local nonzeros.
int NumGlobalRows_
 Number of global rows.
int NumGlobalNonzeros_
 Number of global nonzeros.
Teuchos::RefCountPtr< const
Epetra_RowMatrix
Matrix_
 Pointers to the matrix to be preconditioned.
Teuchos::RefCountPtr
< Epetra_Import
Importer_
 Importer for parallel GS and SGS.
Teuchos::RefCountPtr
< Epetra_Vector
Diagonal_
 Contains the diagonal elements of Matrix.
Teuchos::RefCountPtr< Epetra_TimeTime_
 Time object to track timing.
bool IsParallel_
 If true, more than 1 processor is currently used.
bool ZeroStartingSolution_
 If true, the starting solution is always the zero vector.
bool DoBackwardGS_
 Backward-Mode Gauss Seidel.

Detailed Description

Ifpack_PointRelaxation: a class to define point relaxation preconditioners of for Epetra_RowMatrix's.

The Ifpack_PointRelaxation class enables the construction of point relaxation preconditioners of an Epetra_RowMatrix. Ifpack_PointRelaxation is derived from the Ifpack_Preconditioner class, which is itself derived from Epetra_Operator. Therefore this object can be used as preconditioner everywhere an ApplyInverse() method is required in the preconditioning step.

This class enables the construction of the following simple preconditioners:

We now briefly describe the main features of the above preconditioners. Consider a linear system of type

\[ A x = b, \]

where $A$ is a square, real matrix, and $x, b$ are two real vectors. We begin with the decomposition

\[ A = D - E - F \]

where $D$ is the diagonal of A, $-E$ is the strict lower part, and $-F$ is the strict upper part. It is assumed that the diagonal entries of $A$ are different from zero.

Given an starting solution $x_0$, an iteration of the (damped) Jacobi method can be written in matrix form as follows:

\[ x_{k+1} = \omega D^{-1}(E + F) x_k + D_{-1}b, \]

for $k < k_{max}$, and $\omega $ a damping parameter.

Using Ifpack_Jacobi, the user can apply the specified number of sweeps ( $k_{max}$), and the damping parameter. If only one sweep is used, then the class simply applies the inverse of the diagonal of A to the input vector.

Given an starting solution $x_0$, an iteration of the (damped) GaussSeidel method can be written in matrix form as follows:

\[ (D - E) x_{k+1} = \omega F x_k + b, \]

for $k < k_{max}$, and $\omega $ a damping parameter. Equivalently, the Gauss-Seidel preconditioner can be defined as

\[ P_{GS}^{-1} = (D - E)^{-1}. \]

Clearly, the role of E and F can be interchanged. However, Ifpack_GaussSeidel does not consider backward Gauss-Seidel methods.

For a list of supported parameters, please refer to page ifp_params.

The complete list of supported parameters is reported in page ifp_params. For a presentation of basic relaxation schemes, please refer to page Ifpack_PointRelaxation.

Author:
Marzio Sala, SNL 9214.
Date:
Last modified on 22-Jan-05.

Definition at line 117 of file Ifpack_PointRelaxation.h.


Constructor & Destructor Documentation

Ifpack_PointRelaxation::Ifpack_PointRelaxation ( const Epetra_RowMatrix Matrix)

Ifpack_PointRelaxation constructor with given Epetra_RowMatrix.

Creates an instance of Ifpack_PointRelaxation class.

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

Definition at line 48 of file Ifpack_PointRelaxation.cpp.

virtual Ifpack_PointRelaxation::~Ifpack_PointRelaxation ( ) [inline, virtual]

Destructor.

Definition at line 131 of file Ifpack_PointRelaxation.h.

Ifpack_PointRelaxation::Ifpack_PointRelaxation ( const Ifpack_PointRelaxation rhs) [inline, private]

Copy constructor (PRIVATE, should not be used)

Definition at line 368 of file Ifpack_PointRelaxation.h.


Member Function Documentation

virtual int Ifpack_PointRelaxation::SetUseTranspose ( bool  UseTranspose_in) [inline, virtual]

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 141 of file Ifpack_PointRelaxation.h.

virtual int Ifpack_PointRelaxation::Apply ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [inline, 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 160 of file Ifpack_PointRelaxation.h.

int Ifpack_PointRelaxation::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 339 of file Ifpack_PointRelaxation.cpp.

virtual double Ifpack_PointRelaxation::NormInf ( ) const [inline, virtual]

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

Implements Epetra_Operator.

Definition at line 186 of file Ifpack_PointRelaxation.h.

virtual const char* Ifpack_PointRelaxation::Label ( ) const [inline, virtual]

Implements Epetra_Operator.

Definition at line 194 of file Ifpack_PointRelaxation.h.

virtual bool Ifpack_PointRelaxation::UseTranspose ( ) const [inline, virtual]

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 200 of file Ifpack_PointRelaxation.h.

virtual bool Ifpack_PointRelaxation::HasNormInf ( ) const [inline, virtual]

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

Implements Epetra_Operator.

Definition at line 206 of file Ifpack_PointRelaxation.h.

const Epetra_Comm & Ifpack_PointRelaxation::Comm ( ) const [virtual]

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

Implements Epetra_Operator.

Definition at line 117 of file Ifpack_PointRelaxation.cpp.

const Epetra_Map & Ifpack_PointRelaxation::OperatorDomainMap ( ) const [virtual]

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

Implements Epetra_Operator.

Definition at line 123 of file Ifpack_PointRelaxation.cpp.

const Epetra_Map & Ifpack_PointRelaxation::OperatorRangeMap ( ) const [virtual]

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

Implements Epetra_Operator.

Definition at line 129 of file Ifpack_PointRelaxation.cpp.

int Ifpack_PointRelaxation::Initialize ( ) [virtual]

Computes all it is necessary to initialize the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 135 of file Ifpack_PointRelaxation.cpp.

virtual bool Ifpack_PointRelaxation::IsInitialized ( ) const [inline, virtual]

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

Implements Ifpack_Preconditioner.

Definition at line 222 of file Ifpack_PointRelaxation.h.

virtual bool Ifpack_PointRelaxation::IsComputed ( ) const [inline, virtual]

Returns true if the preconditioner has been successfully computed.

Implements Ifpack_Preconditioner.

Definition at line 228 of file Ifpack_PointRelaxation.h.

int Ifpack_PointRelaxation::Compute ( ) [virtual]

Computes the preconditioners.

Implements Ifpack_Preconditioner.

Definition at line 165 of file Ifpack_PointRelaxation.cpp.

virtual const Epetra_RowMatrix& Ifpack_PointRelaxation::Matrix ( ) const [inline, virtual]

Returns a pointer to the matrix to be preconditioned.

Implements Ifpack_Preconditioner.

Definition at line 240 of file Ifpack_PointRelaxation.h.

double Ifpack_PointRelaxation::Condest ( const Ifpack_CondestType  CT = Ifpack_Cheap,
const int  MaxIters = 1550,
const double  Tol = 1e-9,
Epetra_RowMatrix Matrix = 0 
) [virtual]

Computes the condition number estimates and returns the value.

Implements Ifpack_Preconditioner.

Definition at line 297 of file Ifpack_PointRelaxation.cpp.

virtual double Ifpack_PointRelaxation::Condest ( ) const [inline, virtual]

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

Implements Ifpack_Preconditioner.

Definition at line 252 of file Ifpack_PointRelaxation.h.

int Ifpack_PointRelaxation::SetParameters ( Teuchos::ParameterList List) [virtual]

Sets all the parameters for the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 78 of file Ifpack_PointRelaxation.cpp.

ostream & Ifpack_PointRelaxation::Print ( ostream &  os) const [virtual]

Prints object to an output stream.

Definition at line 231 of file Ifpack_PointRelaxation.cpp.

virtual int Ifpack_PointRelaxation::NumInitialize ( ) const [inline, virtual]

Returns the number of calls to Initialize().

Implements Ifpack_Preconditioner.

Definition at line 268 of file Ifpack_PointRelaxation.h.

virtual int Ifpack_PointRelaxation::NumCompute ( ) const [inline, virtual]

Returns the number of calls to Compute().

Implements Ifpack_Preconditioner.

Definition at line 274 of file Ifpack_PointRelaxation.h.

virtual int Ifpack_PointRelaxation::NumApplyInverse ( ) const [inline, virtual]

Returns the number of calls to ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 280 of file Ifpack_PointRelaxation.h.

virtual double Ifpack_PointRelaxation::InitializeTime ( ) const [inline, virtual]

Returns the time spent in Initialize().

Implements Ifpack_Preconditioner.

Definition at line 286 of file Ifpack_PointRelaxation.h.

virtual double Ifpack_PointRelaxation::ComputeTime ( ) const [inline, virtual]

Returns the time spent in Compute().

Implements Ifpack_Preconditioner.

Definition at line 292 of file Ifpack_PointRelaxation.h.

virtual double Ifpack_PointRelaxation::ApplyInverseTime ( ) const [inline, virtual]

Returns the time spent in ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 298 of file Ifpack_PointRelaxation.h.

virtual double Ifpack_PointRelaxation::InitializeFlops ( ) const [inline, virtual]

Returns the number of flops in the initialization phase.

Implements Ifpack_Preconditioner.

Definition at line 304 of file Ifpack_PointRelaxation.h.

virtual double Ifpack_PointRelaxation::ComputeFlops ( ) const [inline, virtual]

Returns the number of flops in the computation phase.

Implements Ifpack_Preconditioner.

Definition at line 310 of file Ifpack_PointRelaxation.h.

virtual double Ifpack_PointRelaxation::ApplyInverseFlops ( ) const [inline, virtual]

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

Implements Ifpack_Preconditioner.

Definition at line 316 of file Ifpack_PointRelaxation.h.

int Ifpack_PointRelaxation::ApplyInverseJacobi ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [private, virtual]

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

Definition at line 385 of file Ifpack_PointRelaxation.cpp.

int Ifpack_PointRelaxation::ApplyInverseGS ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [private, virtual]

Applies the Gauss-Seidel preconditioner to X, returns the result in Y.

Definition at line 416 of file Ifpack_PointRelaxation.cpp.

int Ifpack_PointRelaxation::ApplyInverseGS_RowMatrix ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [private, virtual]

Definition at line 434 of file Ifpack_PointRelaxation.cpp.

int Ifpack_PointRelaxation::ApplyInverseGS_CrsMatrix ( const Epetra_CrsMatrix A,
const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [private, virtual]

Definition at line 574 of file Ifpack_PointRelaxation.cpp.

int Ifpack_PointRelaxation::ApplyInverseGS_FastCrsMatrix ( const Epetra_CrsMatrix A,
const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [private, virtual]

Definition at line 664 of file Ifpack_PointRelaxation.cpp.

int Ifpack_PointRelaxation::ApplyInverseSGS ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [private, virtual]

Applies the symmetric Gauss-Seidel preconditioner to X, returns the result in Y.

Definition at line 748 of file Ifpack_PointRelaxation.cpp.

int Ifpack_PointRelaxation::ApplyInverseSGS_RowMatrix ( const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [private, virtual]

Definition at line 766 of file Ifpack_PointRelaxation.cpp.

int Ifpack_PointRelaxation::ApplyInverseSGS_CrsMatrix ( const Epetra_CrsMatrix A,
const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [private, virtual]

Definition at line 850 of file Ifpack_PointRelaxation.cpp.

int Ifpack_PointRelaxation::ApplyInverseSGS_FastCrsMatrix ( const Epetra_CrsMatrix A,
const Epetra_MultiVector X,
Epetra_MultiVector Y 
) const [private, virtual]

Definition at line 933 of file Ifpack_PointRelaxation.cpp.

void Ifpack_PointRelaxation::SetLabel ( ) [private, virtual]

Sets the label.

Definition at line 312 of file Ifpack_PointRelaxation.cpp.

Ifpack_PointRelaxation& Ifpack_PointRelaxation::operator= ( const Ifpack_PointRelaxation rhs) [inline, private]

operator = (PRIVATE, should not be used)

Definition at line 372 of file Ifpack_PointRelaxation.h.


Member Data Documentation

If true, the preconditioner has been computed successfully.

Definition at line 379 of file Ifpack_PointRelaxation.h.

If true, the preconditioner has been computed successfully.

Definition at line 381 of file Ifpack_PointRelaxation.h.

Contains the number of successful calls to Initialize().

Definition at line 383 of file Ifpack_PointRelaxation.h.

Contains the number of successful call to Compute().

Definition at line 385 of file Ifpack_PointRelaxation.h.

Contains the number of successful call to ApplyInverse().

Definition at line 387 of file Ifpack_PointRelaxation.h.

Contains the time for all successful calls to Initialize().

Definition at line 389 of file Ifpack_PointRelaxation.h.

Contains the time for all successful calls to Compute().

Definition at line 391 of file Ifpack_PointRelaxation.h.

double Ifpack_PointRelaxation::ApplyInverseTime_ [mutable, private]

Contains the time for all successful calls to ApplyInverse().

Definition at line 393 of file Ifpack_PointRelaxation.h.

Contains the number of flops for Compute().

Definition at line 395 of file Ifpack_PointRelaxation.h.

double Ifpack_PointRelaxation::ApplyInverseFlops_ [mutable, private]

Contain sthe number of flops for ApplyInverse().

Definition at line 397 of file Ifpack_PointRelaxation.h.

Number of application of the preconditioner (should be greater than 0).

Definition at line 402 of file Ifpack_PointRelaxation.h.

Damping factor.

Definition at line 404 of file Ifpack_PointRelaxation.h.

If true, use the tranpose of Matrix_.

Definition at line 406 of file Ifpack_PointRelaxation.h.

Contains the estimated condition number.

Definition at line 408 of file Ifpack_PointRelaxation.h.

If true, Compute() also computes the condition number estimate.

Definition at line 410 of file Ifpack_PointRelaxation.h.

Contains the label of this object.

Definition at line 412 of file Ifpack_PointRelaxation.h.

Definition at line 413 of file Ifpack_PointRelaxation.h.

Definition at line 414 of file Ifpack_PointRelaxation.h.

Number of local rows.

Definition at line 419 of file Ifpack_PointRelaxation.h.

Number of local nonzeros.

Definition at line 421 of file Ifpack_PointRelaxation.h.

Number of global rows.

Definition at line 423 of file Ifpack_PointRelaxation.h.

Number of global nonzeros.

Definition at line 425 of file Ifpack_PointRelaxation.h.

Pointers to the matrix to be preconditioned.

Definition at line 427 of file Ifpack_PointRelaxation.h.

Importer for parallel GS and SGS.

Definition at line 429 of file Ifpack_PointRelaxation.h.

Contains the diagonal elements of Matrix.

Definition at line 431 of file Ifpack_PointRelaxation.h.

Time object to track timing.

Definition at line 433 of file Ifpack_PointRelaxation.h.

If true, more than 1 processor is currently used.

Definition at line 435 of file Ifpack_PointRelaxation.h.

If true, the starting solution is always the zero vector.

Definition at line 437 of file Ifpack_PointRelaxation.h.

Backward-Mode Gauss Seidel.

Definition at line 439 of file Ifpack_PointRelaxation.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines