Anasazi Version of the Day
Anasazi::MatOrthoManager< ScalarType, MV, OP > Class Template Reference

Anasazi's templated virtual class for providing routines for orthogonalization and orthonormalization of multivectors using matrix-based inner products. More...

#include <AnasaziMatOrthoManager.hpp>

Inheritance diagram for Anasazi::MatOrthoManager< ScalarType, MV, OP >:
Anasazi::OrthoManager< ScalarType, MV > Anasazi::BasicOrthoManager< ScalarType, MV, OP > Anasazi::GenOrthoManager< ScalarType, MV, OP > Anasazi::SVQBOrthoManager< ScalarType, MV, OP > Anasazi::ICGSOrthoManager< ScalarType, MV, OP >

List of all members.

Public Member Functions

Constructor/Destructor
 MatOrthoManager (Teuchos::RCP< const OP > Op=Teuchos::null)
 Default constructor.
virtual ~MatOrthoManager ()
 Destructor.
Accessor routines
virtual void setOp (Teuchos::RCP< const OP > Op)
 Set operator used for inner product.
virtual Teuchos::RCP< const OP > getOp () const
 Get operator used for inner product.
int getOpCounter () const
 Retrieve operator counter.
void resetOpCounter ()
 Reset the operator counter to zero.
Matrix-based Orthogonality Methods
void innerProdMat (const MV &X, const MV &Y, Teuchos::SerialDenseMatrix< int, ScalarType > &Z, Teuchos::RCP< const MV > MX=Teuchos::null, Teuchos::RCP< const MV > MY=Teuchos::null) const
 Provides a matrix-based inner product.
void normMat (const MV &X, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec, Teuchos::RCP< const MV > MX=Teuchos::null) const
 Provides the norm induced by the matrix-based inner product.
virtual void projectMat (MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C=Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >(Teuchos::null)), Teuchos::RCP< MV > MX=Teuchos::null, Teuchos::Array< Teuchos::RCP< const MV > > MQ=Teuchos::tuple(Teuchos::RCP< const MV >(Teuchos::null))) const =0
 Provides matrix-based projection method.
virtual int normalizeMat (MV &X, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B=Teuchos::null, Teuchos::RCP< MV > MX=Teuchos::null) const =0
 Provides matrix-based orthonormalization method.
virtual int projectAndNormalizeMat (MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C=Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >(Teuchos::null)), Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B=Teuchos::null, Teuchos::RCP< MV > MX=Teuchos::null, Teuchos::Array< Teuchos::RCP< const MV > > MQ=Teuchos::tuple(Teuchos::RCP< const MV >(Teuchos::null))) const =0
 Provides matrix-based projection/orthonormalization method.
virtual Teuchos::ScalarTraits
< ScalarType >::magnitudeType 
orthonormErrorMat (const MV &X, Teuchos::RCP< const MV > MX=Teuchos::null) const =0
 This method computes the error in orthonormality of a multivector.
virtual Teuchos::ScalarTraits
< ScalarType >::magnitudeType 
orthogErrorMat (const MV &X, const MV &Y, Teuchos::RCP< const MV > MX=Teuchos::null, Teuchos::RCP< const MV > MY=Teuchos::null) const =0
 This method computes the error in orthogonality of two multivectors.
Methods implementing Anasazi::OrthoManager
void innerProd (const MV &X, const MV &Y, Teuchos::SerialDenseMatrix< int, ScalarType > &Z) const
 Implements the interface OrthoManager::innerProd().
void norm (const MV &X, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec) const
 Implements the interface OrthoManager::norm().
void project (MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C=Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >(Teuchos::null))) const
 Implements the interface OrthoManager::project().
int normalize (MV &X, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B=Teuchos::null) const
 Implements the interface OrthoManager::normalize().
int projectAndNormalize (MV &X, Teuchos::Array< Teuchos::RCP< const MV > > Q, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > > C=Teuchos::tuple(Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >(Teuchos::null)), Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B=Teuchos::null) const
 Implements the interface OrthoManager::projectAndNormalize().
Teuchos::ScalarTraits
< ScalarType >::magnitudeType 
orthonormError (const MV &X) const
 Implements the interface OrthoManager::orthonormError().
Teuchos::ScalarTraits
< ScalarType >::magnitudeType 
orthogError (const MV &X1, const MV &X2) const
 Implements the interface OrthoManager::orthogError().

Detailed Description

template<class ScalarType, class MV, class OP>
class Anasazi::MatOrthoManager< ScalarType, MV, OP >

Anasazi's templated virtual class for providing routines for orthogonalization and orthonormalization of multivectors using matrix-based inner products.

This class extends Anasazi::OrthoManager by providing extra calling arguments to orthogonalization routines, to reduce the cost of applying the inner product in cases where the user already has the image of target multivectors under the inner product matrix.

A concrete implementation of this class is necessary. The user can create their own implementation if those supplied are not suitable for their needs.

Author:
Chris Baker, Ulrich Hetmaniuk, Rich Lehoucq, and Heidi Thornquist

Definition at line 63 of file AnasaziMatOrthoManager.hpp.


Constructor & Destructor Documentation

template<class ScalarType , class MV , class OP>
Anasazi::MatOrthoManager< ScalarType, MV, OP >::MatOrthoManager ( Teuchos::RCP< const OP >  Op = Teuchos::null)

Default constructor.

Definition at line 305 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType, class MV, class OP>
virtual Anasazi::MatOrthoManager< ScalarType, MV, OP >::~MatOrthoManager ( ) [inline, virtual]

Destructor.

Definition at line 71 of file AnasaziMatOrthoManager.hpp.


Member Function Documentation

template<class ScalarType , class MV , class OP>
void Anasazi::MatOrthoManager< ScalarType, MV, OP >::setOp ( Teuchos::RCP< const OP >  Op) [virtual]

Set operator used for inner product.

Reimplemented in Anasazi::TsqrMatOrthoManager< Scalar, MV, OP >.

Definition at line 309 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType , class MV , class OP >
Teuchos::RCP< const OP > Anasazi::MatOrthoManager< ScalarType, MV, OP >::getOp ( ) const [virtual]

Get operator used for inner product.

Reimplemented in Anasazi::TsqrMatOrthoManager< Scalar, MV, OP >.

Definition at line 316 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType , class MV , class OP >
int Anasazi::MatOrthoManager< ScalarType, MV, OP >::getOpCounter ( ) const

Retrieve operator counter.

This counter returns the number of applications of the operator specifying the inner product. When the operator is applied to a multivector, the counter is incremented by the number of vectors in the multivector. If the operator is not specified, the counter is never incremented.

Definition at line 322 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType , class MV , class OP >
void Anasazi::MatOrthoManager< ScalarType, MV, OP >::resetOpCounter ( )

Reset the operator counter to zero.

See getOpCounter() for more details.

Definition at line 328 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType, class MV, class OP >
void Anasazi::MatOrthoManager< ScalarType, MV, OP >::innerProdMat ( const MV &  X,
const MV &  Y,
Teuchos::SerialDenseMatrix< int, ScalarType > &  Z,
Teuchos::RCP< const MV >  MX = Teuchos::null,
Teuchos::RCP< const MV >  MY = Teuchos::null 
) const

Provides a matrix-based inner product.

Provides the inner product

\[ \langle x, y \rangle = x^H M y \]

Optionally allows the provision of $M y$ and/or $M x$. See OrthoManager::innerProd() for more details.

Definition at line 370 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType, class MV, class OP >
void Anasazi::MatOrthoManager< ScalarType, MV, OP >::normMat ( const MV &  X,
std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &  normvec,
Teuchos::RCP< const MV >  MX = Teuchos::null 
) const

Provides the norm induced by the matrix-based inner product.

Provides the norm:

\[ \|x\|_M = \sqrt{x^H M y} \]

Optionally allows the provision of $M x$. See OrthoManager::norm() for more details.

Definition at line 409 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType, class MV, class OP>
virtual void Anasazi::MatOrthoManager< ScalarType, MV, OP >::projectMat ( MV &  X,
Teuchos::Array< Teuchos::RCP< const MV > >  Q,
Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > >  C = Teuchos::tuple(Teuchos::RCPTeuchos::SerialDenseMatrix< int, ScalarType > >(Teuchos::null)),
Teuchos::RCP< MV >  MX = Teuchos::null,
Teuchos::Array< Teuchos::RCP< const MV > >  MQ = Teuchos::tuple(Teuchos::RCP< const MV >(Teuchos::null)) 
) const [pure virtual]

Provides matrix-based projection method.

This method optionally allows the provision of $M X$ and/or the $M Q[i]$. See OrthoManager::project() for more details.

Parameters:
X,Q,C[in/out] As in OrthoManager::project()
MX[in/out] If specified by the user, on input MX is required to be the image of X under the operator getOp(). On output, MX will be updated to reflect the changes in X.
MQ[in] If specified by the user, on MQ[i] is required to be the image of Q[i] under the operator getOp().

Implemented in Anasazi::BasicOrthoManager< ScalarType, MV, OP >, Anasazi::ICGSOrthoManager< ScalarType, MV, OP >, and Anasazi::SVQBOrthoManager< ScalarType, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual int Anasazi::MatOrthoManager< ScalarType, MV, OP >::normalizeMat ( MV &  X,
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >  B = Teuchos::null,
Teuchos::RCP< MV >  MX = Teuchos::null 
) const [pure virtual]

Provides matrix-based orthonormalization method.

This method optionally allows the provision of $M X$. See orthoManager::normalize() for more details.

Parameters:
X,B[in/out] As in OrthoManager::normalize()
MX[in/out] If specified by the user, on input MX is required to be the image of X under the operator getOp(). On output, MX will be updated to reflect the changes in X.
Returns:
Rank of the basis computed by this method, less than or equal to the number of columns in X. This specifies how many columns in the returned X and MX and rows in the returned B are valid.

Implemented in Anasazi::BasicOrthoManager< ScalarType, MV, OP >, Anasazi::ICGSOrthoManager< ScalarType, MV, OP >, and Anasazi::SVQBOrthoManager< ScalarType, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual int Anasazi::MatOrthoManager< ScalarType, MV, OP >::projectAndNormalizeMat ( MV &  X,
Teuchos::Array< Teuchos::RCP< const MV > >  Q,
Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > >  C = Teuchos::tuple(Teuchos::RCPTeuchos::SerialDenseMatrix< int, ScalarType > >(Teuchos::null)),
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >  B = Teuchos::null,
Teuchos::RCP< MV >  MX = Teuchos::null,
Teuchos::Array< Teuchos::RCP< const MV > >  MQ = Teuchos::tuple(Teuchos::RCP< const MV >(Teuchos::null)) 
) const [pure virtual]

Provides matrix-based projection/orthonormalization method.

This method optionally allows the provision of $M X$ and/or the $M Q[i]$. See orthoManager::projectAndNormalize() for more details.

Parameters:
X,Q,C,B[in/out] As in OrthoManager::projectAndNormalize()
MX[in/out] If specified by the user, on input MX is required to be the image of X under the operator getOp(). On output, MX will be updated to reflect the changes in X.
MQ[in] If specified by the user, on MQ[i] is required to be the image of Q[i] under the operator getOp().
Returns:
Rank of the basis computed by this method, less than or equal to the number of columns in X. This specifies how many columns in the returned X and MX and rows in the returned B are valid.

Implemented in Anasazi::BasicOrthoManager< ScalarType, MV, OP >, Anasazi::ICGSOrthoManager< ScalarType, MV, OP >, and Anasazi::SVQBOrthoManager< ScalarType, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual Teuchos::ScalarTraits<ScalarType>::magnitudeType Anasazi::MatOrthoManager< ScalarType, MV, OP >::orthonormErrorMat ( const MV &  X,
Teuchos::RCP< const MV >  MX = Teuchos::null 
) const [pure virtual]

This method computes the error in orthonormality of a multivector.

This method optionally allows optionally exploits a caller-provided MX.

Implemented in Anasazi::BasicOrthoManager< ScalarType, MV, OP >, Anasazi::ICGSOrthoManager< ScalarType, MV, OP >, Anasazi::SVQBOrthoManager< ScalarType, MV, OP >, and Anasazi::TsqrMatOrthoManager< Scalar, MV, OP >.

template<class ScalarType, class MV, class OP>
virtual Teuchos::ScalarTraits<ScalarType>::magnitudeType Anasazi::MatOrthoManager< ScalarType, MV, OP >::orthogErrorMat ( const MV &  X,
const MV &  Y,
Teuchos::RCP< const MV >  MX = Teuchos::null,
Teuchos::RCP< const MV >  MY = Teuchos::null 
) const [pure virtual]

This method computes the error in orthogonality of two multivectors.

This method optionally allows optionally exploits a caller-provided MX and/or MY.

Implemented in Anasazi::BasicOrthoManager< ScalarType, MV, OP >, Anasazi::ICGSOrthoManager< ScalarType, MV, OP >, Anasazi::SVQBOrthoManager< ScalarType, MV, OP >, and Anasazi::TsqrMatOrthoManager< Scalar, MV, OP >.

template<class ScalarType, class MV, class OP >
void Anasazi::MatOrthoManager< ScalarType, MV, OP >::innerProd ( const MV &  X,
const MV &  Y,
Teuchos::SerialDenseMatrix< int, ScalarType > &  Z 
) const [virtual]

Implements the interface OrthoManager::innerProd().

This method calls

 innerProdMat(X,Y,Z);

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 334 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType, class MV, class OP >
void Anasazi::MatOrthoManager< ScalarType, MV, OP >::norm ( const MV &  X,
std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &  normvec 
) const [virtual]

Implements the interface OrthoManager::norm().

This method calls

 normMat(X,normvec);

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 402 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType, class MV, class OP >
void Anasazi::MatOrthoManager< ScalarType, MV, OP >::project ( MV &  X,
Teuchos::Array< Teuchos::RCP< const MV > >  Q,
Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > >  C = Teuchos::tuple(Teuchos::RCPTeuchos::SerialDenseMatrix<int,ScalarType> >(Teuchos::null)) 
) const [virtual]

Implements the interface OrthoManager::project().

This method calls

 projectMat(X,Q,C);

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 442 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType, class MV, class OP >
int Anasazi::MatOrthoManager< ScalarType, MV, OP >::normalize ( MV &  X,
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >  B = Teuchos::null 
) const [virtual]

Implements the interface OrthoManager::normalize().

This method calls

 normalizeMat(X,B);

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 452 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType, class MV, class OP >
int Anasazi::MatOrthoManager< ScalarType, MV, OP >::projectAndNormalize ( MV &  X,
Teuchos::Array< Teuchos::RCP< const MV > >  Q,
Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > >  C = Teuchos::tuple(Teuchos::RCPTeuchos::SerialDenseMatrix<int,ScalarType> >(Teuchos::null)),
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > >  B = Teuchos::null 
) const [virtual]

Implements the interface OrthoManager::projectAndNormalize().

This method calls

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 459 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType , class MV, class OP >
Teuchos::ScalarTraits< ScalarType >::magnitudeType Anasazi::MatOrthoManager< ScalarType, MV, OP >::orthonormError ( const MV &  X) const [virtual]

Implements the interface OrthoManager::orthonormError().

This method calls

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 471 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType , class MV, class OP >
Teuchos::ScalarTraits< ScalarType >::magnitudeType Anasazi::MatOrthoManager< ScalarType, MV, OP >::orthogError ( const MV &  X1,
const MV &  X2 
) const [virtual]

Implements the interface OrthoManager::orthogError().

This method calls

 orthogErrorMat(X1,X2);

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 478 of file AnasaziMatOrthoManager.hpp.


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