Ifpack Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Ifpack_Chebyshev Class Reference

Ifpack_Chebyshev: class for preconditioning with Chebyshev polynomials in Ifpack. More...

#include <Ifpack_Chebyshev.h>

Inheritance diagram for Ifpack_Chebyshev:
Inheritance graph
[legend]

Public Member Functions

virtual int SetUseTranspose (bool UseTranspose_in)
 
 Ifpack_Chebyshev (const Epetra_Operator *Matrix)
 Ifpack_Chebyshev constructor with given Epetra_Operator/Epetra_RowMatrix. More...
 
 Ifpack_Chebyshev (const Epetra_RowMatrix *Matrix)
 Ifpack_Chebyshev constructor with given Epetra_Operator/Epetra_RowMatrix. More...
 
virtual ~Ifpack_Chebyshev ()
 Destructor. More...
 
virtual int Apply (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the matrix to an Epetra_MultiVector. More...
 
virtual int ApplyInverse (const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
 Applies the preconditioner to X, returns the result in Y. More...
 
virtual double NormInf () const
 Returns the infinity norm of the global matrix (not implemented) More...
 
virtual const char * Label () const
 
virtual bool UseTranspose () const
 Returns the current UseTranspose setting. More...
 
virtual bool HasNormInf () const
 Returns true if the this object can provide an approximate Inf-norm, false otherwise. More...
 
virtual const Epetra_CommComm () const
 Returns a pointer to the Epetra_Comm communicator associated with this operator. More...
 
virtual const Epetra_MapOperatorDomainMap () const
 Returns the Epetra_Map object associated with the domain of this operator. More...
 
virtual const Epetra_MapOperatorRangeMap () const
 Returns the Epetra_Map object associated with the range of this operator. More...
 
virtual int Initialize ()
 Computes all it is necessary to initialize the preconditioner. More...
 
virtual bool IsInitialized () const
 Returns true if the preconditioner has been successfully initialized, false otherwise. More...
 
virtual bool IsComputed () const
 Returns true if the preconditioner has been successfully computed. More...
 
virtual int Compute ()
 Computes the preconditioners. More...
 
virtual double GetLambdaMax ()
 Returns an approximation to the largest eigenvalue. More...
 
virtual double GetLambdaMin ()
 Contains an approximation to the smallest eigenvalue. More...
 
virtual const Epetra_RowMatrixMatrix () const
 Returns a pointer to the matrix to be preconditioned. More...
 
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. More...
 
virtual double Condest () const
 Returns the condition number estimate, or -1.0 if not computed. More...
 
virtual int SetParameters (Teuchos::ParameterList &List)
 Sets all the parameters for the preconditioner. More...
 
virtual std::ostream & Print (std::ostream &os) const
 Prints object to an output stream. More...
 
virtual int NumInitialize () const
 Returns the number of calls to Initialize(). More...
 
virtual int NumCompute () const
 Returns the number of calls to Compute(). More...
 
virtual int NumApplyInverse () const
 Returns the number of calls to ApplyInverse(). More...
 
virtual double InitializeTime () const
 Returns the time spent in Initialize(). More...
 
virtual double ComputeTime () const
 Returns the time spent in Compute(). More...
 
virtual double ApplyInverseTime () const
 Returns the time spent in ApplyInverse(). More...
 
virtual double InitializeFlops () const
 Returns the number of flops in the initialization phase. More...
 
virtual double ComputeFlops () const
 Returns the number of flops in the computation phase. More...
 
virtual double ApplyInverseFlops () const
 Returns the number of flops for the application of the preconditioner. More...
 
static int PowerMethod (const Epetra_Operator &Operator, const Epetra_Vector &InvPointDiagonal, const int MaximumIterations, double &LambdaMax, const unsigned int *RngSeed=0)
 Simple power method to compute lambda_max. More...
 
static int CG (const Epetra_Operator &Operator, const Epetra_Vector &InvPointDiagonal, const int MaximumIterations, double &lambda_min, double &lambda_max, const unsigned int *RngSeed=0)
 Uses AztecOO's CG to estimate lambda_min and lambda_max. More...
 
bool IsInitialized_
 If true, the preconditioner has been computed successfully. More...
 
bool IsComputed_
 If true, the preconditioner has been computed successfully. More...
 
int NumInitialize_
 Contains the number of successful calls to Initialize(). More...
 
int NumCompute_
 Contains the number of successful call to Compute(). More...
 
int NumApplyInverse_
 Contains the number of successful call to ApplyInverse(). More...
 
double InitializeTime_
 Contains the time for all successful calls to Initialize(). More...
 
double ComputeTime_
 Contains the time for all successful calls to Compute(). More...
 
double ApplyInverseTime_
 Contains the time for all successful calls to ApplyInverse(). More...
 
double ComputeFlops_
 Contains the number of flops for Compute(). More...
 
double ApplyInverseFlops_
 Contain sthe number of flops for ApplyInverse(). More...
 
virtual void SetLabel ()
 Sets the label. More...
 
 Ifpack_Chebyshev (const Ifpack_Chebyshev &)
 Copy constructor (PRIVATE, should not be used) More...
 
Ifpack_Chebyshevoperator= (const Ifpack_Chebyshev &)
 operator = (PRIVATE, should not be used) More...
 
int PolyDegree_
 Contains the degree of Chebyshev polynomial. More...
 
bool UseTranspose_
 If true, use the tranpose of Matrix_. More...
 
double Condest_
 Contains the estimated condition number. More...
 
double EigRatio_
 Contains the ratio such that [LambdaMax_ / EigRatio_, LambdaMax_] is the interval of interest for the Chebyshev polynomial. More...
 
int EigMaxIters_
 Max number of iterations to use in eigenvalue estimation (if automatic). More...
 
std::string Label_
 Contains the label of this object. More...
 
double LambdaMin_
 Contains an approximation to the smallest eigenvalue. More...
 
double LambdaMax_
 Contains an approximation to the largest eigenvalue. More...
 
double MinDiagonalValue_
 Contains the minimum value on the diagonal. More...
 
int NumMyRows_
 Number of local rows. More...
 
int NumMyNonzeros_
 Number of local nonzeros. More...
 
long long NumGlobalRows_
 Number of global rows. More...
 
long long NumGlobalNonzeros_
 Number of global nonzeros. More...
 
Teuchos::RefCountPtr< const
Epetra_Operator
Operator_
 Pointers to the matrix to be preconditioned as an Epetra_Operator. More...
 
Teuchos::RefCountPtr< const
Epetra_RowMatrix
Matrix_
 Pointers to the matrix to be preconditioned as an Epetra_RowMatrix. More...
 
Teuchos::RefCountPtr
< Epetra_Vector
InvDiagonal_
 Contains the inverse of diagonal elements of Matrix. More...
 
bool UseBlockMode_
 Use Block Preconditioning. More...
 
bool SolveNormalEquations_
 Run on the normal equations. More...
 
bool IsRowMatrix_
 If true, the Operator_ is an Epetra_RowMatrix. More...
 
Teuchos::RefCountPtr< Epetra_TimeTime_
 Time object to track timing. More...
 
bool ZeroStartingSolution_
 If true, the starting solution is always the zero vector. More...
 

Detailed Description

Ifpack_Chebyshev: class for preconditioning with Chebyshev polynomials in Ifpack.

The Ifpack_Chebyshev class enables the construction of preconditioners based on Chebyshev polynomials for an Epetra_RowMatrix. Ifpack_Chebyshev 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.

The class is an adaptation of the routine ML_Cheby in Smoother/ml_smoother.h

(04/04/06) Flops are not counted in the routine ApplyInverse()

(04/04/06) The switch to use the transpose matrix is not used in ApplyInverse()

The list of parameters is

Author
Ulrich Hetmaniuk. SNL 1414.
Date
Last modified on 04-Apr-06.

Definition at line 110 of file Ifpack_Chebyshev.h.

Constructor & Destructor Documentation

Ifpack_Chebyshev::Ifpack_Chebyshev ( const Epetra_Operator Matrix)

Ifpack_Chebyshev constructor with given Epetra_Operator/Epetra_RowMatrix.

Creates an instance of Ifpack_Chebyshev class.

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

Definition at line 83 of file Ifpack_Chebyshev.cpp.

Ifpack_Chebyshev::Ifpack_Chebyshev ( const Epetra_RowMatrix Matrix)

Ifpack_Chebyshev constructor with given Epetra_Operator/Epetra_RowMatrix.

Creates an instance of Ifpack_Chebyshev class.

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

Definition at line 125 of file Ifpack_Chebyshev.cpp.

virtual Ifpack_Chebyshev::~Ifpack_Chebyshev ( )
inlinevirtual

Destructor.

Definition at line 132 of file Ifpack_Chebyshev.h.

Ifpack_Chebyshev::Ifpack_Chebyshev ( const Ifpack_Chebyshev )
inlineprivate

Copy constructor (PRIVATE, should not be used)

Definition at line 351 of file Ifpack_Chebyshev.h.

Member Function Documentation

virtual int Ifpack_Chebyshev::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 142 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::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 228 of file Ifpack_Chebyshev.cpp.

int Ifpack_Chebyshev::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 467 of file Ifpack_Chebyshev.cpp.

virtual double Ifpack_Chebyshev::NormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 177 of file Ifpack_Chebyshev.h.

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

Implements Epetra_Operator.

Definition at line 185 of file Ifpack_Chebyshev.h.

virtual bool Ifpack_Chebyshev::UseTranspose ( ) const
inlinevirtual

Returns the current UseTranspose setting.

Implements Epetra_Operator.

Definition at line 191 of file Ifpack_Chebyshev.h.

virtual bool Ifpack_Chebyshev::HasNormInf ( ) const
inlinevirtual

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

Implements Epetra_Operator.

Definition at line 197 of file Ifpack_Chebyshev.h.

const Epetra_Comm & Ifpack_Chebyshev::Comm ( ) const
virtual

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

Implements Epetra_Operator.

Definition at line 209 of file Ifpack_Chebyshev.cpp.

const Epetra_Map & Ifpack_Chebyshev::OperatorDomainMap ( ) const
virtual

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

Implements Epetra_Operator.

Definition at line 215 of file Ifpack_Chebyshev.cpp.

const Epetra_Map & Ifpack_Chebyshev::OperatorRangeMap ( ) const
virtual

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

Implements Epetra_Operator.

Definition at line 221 of file Ifpack_Chebyshev.cpp.

int Ifpack_Chebyshev::Initialize ( )
virtual

Computes all it is necessary to initialize the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 249 of file Ifpack_Chebyshev.cpp.

virtual bool Ifpack_Chebyshev::IsInitialized ( ) const
inlinevirtual

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

Implements Ifpack_Preconditioner.

Definition at line 213 of file Ifpack_Chebyshev.h.

virtual bool Ifpack_Chebyshev::IsComputed ( ) const
inlinevirtual

Returns true if the preconditioner has been successfully computed.

Implements Ifpack_Preconditioner.

Definition at line 219 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::Compute ( )
virtual

Computes the preconditioners.

Implements Ifpack_Preconditioner.

Definition at line 283 of file Ifpack_Chebyshev.cpp.

virtual double Ifpack_Chebyshev::GetLambdaMax ( )
inlinevirtual

Returns an approximation to the largest eigenvalue.

Definition at line 228 of file Ifpack_Chebyshev.h.

virtual double Ifpack_Chebyshev::GetLambdaMin ( )
inlinevirtual

Contains an approximation to the smallest eigenvalue.

Definition at line 231 of file Ifpack_Chebyshev.h.

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

Returns a pointer to the matrix to be preconditioned.

Implements Ifpack_Preconditioner.

Definition at line 237 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::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 436 of file Ifpack_Chebyshev.cpp.

virtual double Ifpack_Chebyshev::Condest ( ) const
inlinevirtual

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

Implements Ifpack_Preconditioner.

Definition at line 249 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::SetParameters ( Teuchos::ParameterList List)
virtual

Sets all the parameters for the preconditioner.

Implements Ifpack_Preconditioner.

Definition at line 160 of file Ifpack_Chebyshev.cpp.

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

Prints object to an output stream.

Implements Ifpack_Preconditioner.

Definition at line 378 of file Ifpack_Chebyshev.cpp.

virtual int Ifpack_Chebyshev::NumInitialize ( ) const
inlinevirtual

Returns the number of calls to Initialize().

Implements Ifpack_Preconditioner.

Definition at line 265 of file Ifpack_Chebyshev.h.

virtual int Ifpack_Chebyshev::NumCompute ( ) const
inlinevirtual

Returns the number of calls to Compute().

Implements Ifpack_Preconditioner.

Definition at line 271 of file Ifpack_Chebyshev.h.

virtual int Ifpack_Chebyshev::NumApplyInverse ( ) const
inlinevirtual

Returns the number of calls to ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 277 of file Ifpack_Chebyshev.h.

virtual double Ifpack_Chebyshev::InitializeTime ( ) const
inlinevirtual

Returns the time spent in Initialize().

Implements Ifpack_Preconditioner.

Definition at line 283 of file Ifpack_Chebyshev.h.

virtual double Ifpack_Chebyshev::ComputeTime ( ) const
inlinevirtual

Returns the time spent in Compute().

Implements Ifpack_Preconditioner.

Definition at line 289 of file Ifpack_Chebyshev.h.

virtual double Ifpack_Chebyshev::ApplyInverseTime ( ) const
inlinevirtual

Returns the time spent in ApplyInverse().

Implements Ifpack_Preconditioner.

Definition at line 295 of file Ifpack_Chebyshev.h.

virtual double Ifpack_Chebyshev::InitializeFlops ( ) const
inlinevirtual

Returns the number of flops in the initialization phase.

Implements Ifpack_Preconditioner.

Definition at line 301 of file Ifpack_Chebyshev.h.

virtual double Ifpack_Chebyshev::ComputeFlops ( ) const
inlinevirtual

Returns the number of flops in the computation phase.

Implements Ifpack_Preconditioner.

Definition at line 307 of file Ifpack_Chebyshev.h.

virtual double Ifpack_Chebyshev::ApplyInverseFlops ( ) const
inlinevirtual

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

Implements Ifpack_Preconditioner.

Definition at line 313 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::PowerMethod ( const Epetra_Operator Operator,
const Epetra_Vector InvPointDiagonal,
const int  MaximumIterations,
double &  LambdaMax,
const unsigned int *  RngSeed = 0 
)
static

Simple power method to compute lambda_max.

Definition at line 729 of file Ifpack_Chebyshev.cpp.

int Ifpack_Chebyshev::CG ( const Epetra_Operator Operator,
const Epetra_Vector InvPointDiagonal,
const int  MaximumIterations,
double &  lambda_min,
double &  lambda_max,
const unsigned int *  RngSeed = 0 
)
static

Uses AztecOO's CG to estimate lambda_min and lambda_max.

Definition at line 763 of file Ifpack_Chebyshev.cpp.

void Ifpack_Chebyshev::SetLabel ( )
privatevirtual

Sets the label.

Definition at line 451 of file Ifpack_Chebyshev.cpp.

Ifpack_Chebyshev& Ifpack_Chebyshev::operator= ( const Ifpack_Chebyshev )
inlineprivate

operator = (PRIVATE, should not be used)

Definition at line 355 of file Ifpack_Chebyshev.h.

Member Data Documentation

bool Ifpack_Chebyshev::IsInitialized_
private

If true, the preconditioner has been computed successfully.

Definition at line 362 of file Ifpack_Chebyshev.h.

bool Ifpack_Chebyshev::IsComputed_
private

If true, the preconditioner has been computed successfully.

Definition at line 364 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::NumInitialize_
private

Contains the number of successful calls to Initialize().

Definition at line 366 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::NumCompute_
private

Contains the number of successful call to Compute().

Definition at line 368 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::NumApplyInverse_
mutableprivate

Contains the number of successful call to ApplyInverse().

Definition at line 370 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::InitializeTime_
private

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

Definition at line 372 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::ComputeTime_
private

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

Definition at line 374 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::ApplyInverseTime_
mutableprivate

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

Definition at line 376 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::ComputeFlops_
private

Contains the number of flops for Compute().

Definition at line 378 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::ApplyInverseFlops_
mutableprivate

Contain sthe number of flops for ApplyInverse().

Definition at line 380 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::PolyDegree_
private

Contains the degree of Chebyshev polynomial.

Definition at line 385 of file Ifpack_Chebyshev.h.

bool Ifpack_Chebyshev::UseTranspose_
private

If true, use the tranpose of Matrix_.

Definition at line 387 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::Condest_
private

Contains the estimated condition number.

Definition at line 389 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::EigRatio_
private

Contains the ratio such that [LambdaMax_ / EigRatio_, LambdaMax_] is the interval of interest for the Chebyshev polynomial.

Definition at line 398 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::EigMaxIters_
private

Max number of iterations to use in eigenvalue estimation (if automatic).

Definition at line 400 of file Ifpack_Chebyshev.h.

std::string Ifpack_Chebyshev::Label_
private

Contains the label of this object.

Definition at line 402 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::LambdaMin_
private

Contains an approximation to the smallest eigenvalue.

Definition at line 404 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::LambdaMax_
private

Contains an approximation to the largest eigenvalue.

Definition at line 406 of file Ifpack_Chebyshev.h.

double Ifpack_Chebyshev::MinDiagonalValue_
private

Contains the minimum value on the diagonal.

Definition at line 408 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::NumMyRows_
private

Number of local rows.

Definition at line 413 of file Ifpack_Chebyshev.h.

int Ifpack_Chebyshev::NumMyNonzeros_
private

Number of local nonzeros.

Definition at line 415 of file Ifpack_Chebyshev.h.

long long Ifpack_Chebyshev::NumGlobalRows_
private

Number of global rows.

Definition at line 417 of file Ifpack_Chebyshev.h.

long long Ifpack_Chebyshev::NumGlobalNonzeros_
private

Number of global nonzeros.

Definition at line 419 of file Ifpack_Chebyshev.h.

Teuchos::RefCountPtr<const Epetra_Operator> Ifpack_Chebyshev::Operator_
private

Pointers to the matrix to be preconditioned as an Epetra_Operator.

Definition at line 421 of file Ifpack_Chebyshev.h.

Teuchos::RefCountPtr<const Epetra_RowMatrix> Ifpack_Chebyshev::Matrix_
private

Pointers to the matrix to be preconditioned as an Epetra_RowMatrix.

Definition at line 423 of file Ifpack_Chebyshev.h.

Teuchos::RefCountPtr<Epetra_Vector> Ifpack_Chebyshev::InvDiagonal_
mutableprivate

Contains the inverse of diagonal elements of Matrix.

Definition at line 425 of file Ifpack_Chebyshev.h.

bool Ifpack_Chebyshev::UseBlockMode_
private

Use Block Preconditioning.

Definition at line 427 of file Ifpack_Chebyshev.h.

bool Ifpack_Chebyshev::SolveNormalEquations_
private

Run on the normal equations.

Definition at line 435 of file Ifpack_Chebyshev.h.

bool Ifpack_Chebyshev::IsRowMatrix_
private

If true, the Operator_ is an Epetra_RowMatrix.

Definition at line 438 of file Ifpack_Chebyshev.h.

Teuchos::RefCountPtr<Epetra_Time> Ifpack_Chebyshev::Time_
private

Time object to track timing.

Definition at line 440 of file Ifpack_Chebyshev.h.

bool Ifpack_Chebyshev::ZeroStartingSolution_
private

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

Definition at line 442 of file Ifpack_Chebyshev.h.


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