Tifpack::Diagonal< MatrixType > Class Template Reference

A class for diagonal preconditioning. More...

#include <Tifpack_Diagonal_decl.hpp>

Inheritance diagram for Tifpack::Diagonal< MatrixType >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Diagonal (const Teuchos::RCP< const MatrixType > &A)
 Constructor to create a Diagonal preconditioner using a Tpetra::CrsMatrix.
 Diagonal (const Teuchos::RCP< const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &diag)
 Constructor to create a Diagonal preconditioner using a Tpetra::Vector.
virtual ~Diagonal ()
 Destructor.
void setParameters (const Teuchos::ParameterList &params)
 Sets parameters on this object.
void initialize ()
 Initialize.
bool isInitialized () const
 Returns true if the preconditioner has been successfully initialized.
void compute ()
 compute the preconditioner
bool isComputed () const
 Return true if compute() has been called.
Methods implementing a Tpetra::Operator interface.

void apply (const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
 Applies the preconditioner to X, returns the result in Y.
const Teuchos::RCP< const
Tpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > & 
getDomainMap () const
 Returns the Tpetra::Map object associated with the domain of this operator.
const Teuchos::RCP< const
Tpetra::Map< LocalOrdinal,
GlobalOrdinal, Node > > & 
getRangeMap () const
 Returns the Tpetra::Map object associated with the range of this operator.
void applyMat (const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS) const
 Applies the matrix to a Tpetra::MultiVector.
Mathematical functions.

magnitudeType computeCondEst (CondestType CT=Cheap, LocalOrdinal MaxIters=1550, magnitudeType Tol=1e-9, const Teuchos::Ptr< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &matrix=Teuchos::null)
 Computes the estimated condition number and returns the value.
Attribute accessor methods

magnitudeType getCondEst () const
 Returns the computed estimated condition number, or -1.0 if no computed.
const Teuchos::RCP< const
Teuchos::Comm< int > > & 
getComm () const
 Returns the Tpetra::BlockMap object associated with the range of this matrix operator.
Teuchos::RCP< const
Tpetra::RowMatrix< Scalar,
LocalOrdinal, GlobalOrdinal,
Node > > 
getMatrix () const
 Returns a reference to the matrix to be preconditioned.
double getComputeFlops () const
 Returns the number of flops in the computation phase.
double getApplyFlops () const
 Returns the number of flops for the application of the preconditioner.
int getNumInitialize () const
 Returns the number of calls to initialize().
int getNumCompute () const
 Returns the number of calls to compute().
int getNumApply () const
 Returns the number of calls to apply().
double getInitializeTime () const
 Returns the time spent in initialize().
double getComputeTime () const
 Returns the time spent in compute().
double getApplyTime () const
 Returns the time spent in apply().
Overridden from Teuchos::Describable

std::string description () const
 Return a simple one-line description of this object.
void describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Print the object with some verbosity level to an FancyOStream object.

Detailed Description

template<class MatrixType>
class Tifpack::Diagonal< MatrixType >

A class for diagonal preconditioning.

Tifpack::Diagonal wraps a vector as a diagonal preconditioner. The preconditioner is simply defined by

\[ z_i = D_i r_i, \]

where $r,z$ are the vector to be preconditioned and the preconditioned vector, and $D_i$ is the i-th element of the scaling vector.

When Tifpack::Diagonal is constructed with a matrix, $D$ contains the inverted diagonal elements from the matrix.

When Tifpack::Diagonal is constructed with a vector, $D$ is the caller-supplied vector.

Author:
Michael Heroux, ETHZ/D-INFK
Date:
Tifpack conversion (from Ifpack code) 31-Mar-2010

Constructor & Destructor Documentation

template<class MatrixType >
Tifpack::Diagonal< MatrixType >::Diagonal ( const Teuchos::RCP< const MatrixType > &  A  )  [inline]

Constructor to create a Diagonal preconditioner using a Tpetra::CrsMatrix.

template<class MatrixType >
Tifpack::Diagonal< MatrixType >::Diagonal ( const Teuchos::RCP< const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  diag  )  [inline]

Constructor to create a Diagonal preconditioner using a Tpetra::Vector.

If your compiler complains about this constructor being ambigous with the other constructor overload, instead call the free-standing function Tifpack::createDiagonalPreconditioner which is located at the bottom of this header file. (This issue arises if this constructor is called with a RCP<Tpetra::Vector> that isn't const-qualified exactly as declared here.)

template<class MatrixType >
Tifpack::Diagonal< MatrixType >::~Diagonal (  )  [inline, virtual]

Destructor.


Member Function Documentation

template<class MatrixType >
void Tifpack::Diagonal< MatrixType >::setParameters ( const Teuchos::ParameterList params  )  [inline, virtual]
template<class MatrixType >
void Tifpack::Diagonal< MatrixType >::initialize (  )  [inline, virtual]
template<class MatrixType >
bool Tifpack::Diagonal< MatrixType >::isInitialized (  )  const [inline, virtual]
template<class MatrixType >
void Tifpack::Diagonal< MatrixType >::compute (  )  [inline, virtual]
template<class MatrixType >
bool Tifpack::Diagonal< MatrixType >::isComputed (  )  const [inline, virtual]
template<class MatrixType >
void Tifpack::Diagonal< MatrixType >::apply ( const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  X,
Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Y,
Teuchos::ETransp  mode = Teuchos::NO_TRANS,
Scalar  alpha = Teuchos::ScalarTraits<Scalar>::one(),
Scalar  beta = Teuchos::ScalarTraits<Scalar>::zero() 
) const [inline, virtual]

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

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

Implements Tifpack::Preconditioner< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type >.

template<class MatrixType >
const Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >& Tifpack::Diagonal< MatrixType >::getDomainMap (  )  const [inline, virtual]
template<class MatrixType >
const Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> >& Tifpack::Diagonal< MatrixType >::getRangeMap (  )  const [inline, virtual]
template<class MatrixType >
void Tifpack::Diagonal< MatrixType >::applyMat ( const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  X,
Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Y,
Teuchos::ETransp  mode = Teuchos::NO_TRANS 
) const

Applies the matrix to a Tpetra::MultiVector.

Parameters:
X - (In) A Tpetra::MultiVector of dimension NumVectors to multiply with matrix.
Y - (Out) A Tpetra::MultiVector of dimension NumVectors containing the result.
template<class MatrixType >
Teuchos::ScalarTraits< typename MatrixType::scalar_type >::magnitudeType Tifpack::Diagonal< MatrixType >::computeCondEst ( CondestType  CT = Cheap,
LocalOrdinal  MaxIters = 1550,
magnitudeType  Tol = 1e-9,
const Teuchos::Ptr< const Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &  matrix = Teuchos::null 
) [inline]

Computes the estimated condition number and returns the value.

template<class MatrixType >
magnitudeType Tifpack::Diagonal< MatrixType >::getCondEst (  )  const [inline, virtual]
template<class MatrixType >
const Teuchos::RCP<const Teuchos::Comm<int> >& Tifpack::Diagonal< MatrixType >::getComm (  )  const

Returns the Tpetra::BlockMap object associated with the range of this matrix operator.

template<class MatrixType >
Teuchos::RCP<const Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > Tifpack::Diagonal< MatrixType >::getMatrix (  )  const [inline, virtual]
template<class MatrixType >
double Tifpack::Diagonal< MatrixType >::getComputeFlops (  )  const

Returns the number of flops in the computation phase.

template<class MatrixType >
double Tifpack::Diagonal< MatrixType >::getApplyFlops (  )  const

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

template<class MatrixType >
int Tifpack::Diagonal< MatrixType >::getNumInitialize (  )  const [inline, virtual]
template<class MatrixType >
int Tifpack::Diagonal< MatrixType >::getNumCompute (  )  const [inline, virtual]
template<class MatrixType >
int Tifpack::Diagonal< MatrixType >::getNumApply (  )  const [inline, virtual]
template<class MatrixType >
double Tifpack::Diagonal< MatrixType >::getInitializeTime (  )  const [inline, virtual]
template<class MatrixType >
double Tifpack::Diagonal< MatrixType >::getComputeTime (  )  const [inline, virtual]
template<class MatrixType >
double Tifpack::Diagonal< MatrixType >::getApplyTime (  )  const [inline, virtual]
template<class MatrixType >
std::string Tifpack::Diagonal< MatrixType >::description (  )  const [inline]

Return a simple one-line description of this object.

template<class MatrixType >
void Tifpack::Diagonal< MatrixType >::describe ( Teuchos::FancyOStream out,
const Teuchos::EVerbosityLevel  verbLevel = Teuchos::Describable::verbLevel_default 
) const [inline]

Print the object with some verbosity level to an FancyOStream object.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Generated on Wed Apr 13 09:56:54 2011 for Tifpack Templated Preconditioning Package by  doxygen 1.6.3