Anasazi  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
List of all members
Anasazi::MatOrthoManager< ScalarType, MV, OP > Class Template Referenceabstract

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 >

Public Member Functions

Constructor/Destructor
 MatOrthoManager (Teuchos::RCP< const OP > Op=Teuchos::null)
 Default constructor. More...
 
virtual ~MatOrthoManager ()
 Destructor. More...
 
Accessor routines
virtual void setOp (Teuchos::RCP< const OP > Op)
 Set operator used for inner product. More...
 
virtual Teuchos::RCP< const OP > getOp () const
 Get operator used for inner product. More...
 
int getOpCounter () const
 Retrieve operator counter. More...
 
void resetOpCounter ()
 Reset the operator counter to zero. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
Methods implementing Anasazi::OrthoManager
void innerProd (const MV &X, const MV &Y, Teuchos::SerialDenseMatrix< int, ScalarType > &Z) const
 Implements the interface OrthoManager::innerProd(). More...
 
void norm (const MV &X, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec) const
 Implements the interface OrthoManager::norm(). More...
 
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(). More...
 
int normalize (MV &X, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B=Teuchos::null) const
 Implements the interface OrthoManager::normalize(). More...
 
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(). More...
 
Teuchos::ScalarTraits
< ScalarType >::magnitudeType 
orthonormError (const MV &X) const
 Implements the interface OrthoManager::orthonormError(). More...
 
Teuchos::ScalarTraits
< ScalarType >::magnitudeType 
orthogError (const MV &X1, const MV &X2) const
 Implements the interface OrthoManager::orthogError(). More...
 
- Public Member Functions inherited from Anasazi::OrthoManager< ScalarType, MV >
 OrthoManager ()
 Default constructor. More...
 
virtual ~OrthoManager ()
 Destructor. More...
 

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 76 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 318 of file AnasaziMatOrthoManager.hpp.

template<class ScalarType, class MV, class OP>
virtual Anasazi::MatOrthoManager< ScalarType, MV, OP >::~MatOrthoManager ( )
inlinevirtual

Destructor.

Definition at line 84 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 322 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 329 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 335 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 341 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 383 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 422 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::TsqrMatOrthoManager< Scalar, MV, OP >, Anasazi::ICGSOrthoManager< ScalarType, MV, OP >, Anasazi::BasicOrthoManager< 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::ICGSOrthoManager< ScalarType, MV, OP >, Anasazi::BasicOrthoManager< 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::TsqrMatOrthoManager< Scalar, MV, OP >, Anasazi::ICGSOrthoManager< ScalarType, MV, OP >, Anasazi::BasicOrthoManager< 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::TsqrMatOrthoManager< Scalar, MV, OP >, Anasazi::ICGSOrthoManager< ScalarType, MV, OP >, Anasazi::BasicOrthoManager< 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 >::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::TsqrMatOrthoManager< Scalar, MV, OP >, Anasazi::ICGSOrthoManager< ScalarType, MV, OP >, Anasazi::BasicOrthoManager< ScalarType, MV, OP >, and Anasazi::SVQBOrthoManager< ScalarType, 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 347 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 415 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 477 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

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 487 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 494 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 506 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

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 513 of file AnasaziMatOrthoManager.hpp.


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