Anasazi Version of the Day
Public Member Functions
Anasazi::TsqrOrthoManager< ScalarType, MV > Class Template Reference

TSQR-based OrthoManager subclass. More...

#include <AnasaziTsqrOrthoManager.hpp>

Inheritance diagram for Anasazi::TsqrOrthoManager< ScalarType, MV >:
Anasazi::OrthoManager< ScalarType, MV >

List of all members.

Public Member Functions

virtual void innerProd (const MV &X, const MV &Y, Teuchos::SerialDenseMatrix< int, ScalarType > &Z) const
 Provides the inner product defining the orthogonality concepts.
virtual void norm (const MV &X, std::vector< typename Teuchos::ScalarTraits< ScalarType >::magnitudeType > &normvec) const
 Provides the norm induced by innerProd().
virtual 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
 Given a list of mutually orthogonal and internally orthonormal bases Q, this method projects a multivector X onto the space orthogonal to the individual Q[i], optionally returning the coefficients of X for the individual Q[i]. All of this is done with respect to the inner product innerProd().
virtual int normalize (MV &X, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, ScalarType > > B=Teuchos::null) const
 This method takes a multivector X and attempts to compute a basis for $colspan(X)$. This basis is orthonormal with respect to innerProd().
virtual 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
 Given a set of bases Q[i] and a multivector X, this method computes an orthonormal basis for $colspan(X) - \sum_i colspan(Q[i])$.
virtual Teuchos::ScalarTraits
< ScalarType >::magnitudeType 
orthonormError (const MV &X) const
 This method computes the error in orthonormality of a multivector.
virtual Teuchos::ScalarTraits
< ScalarType >::magnitudeType 
orthogError (const MV &X1, const MV &X2) const
 This method computes the error in orthogonality of two multivectors.

Detailed Description

template<class ScalarType, class MV>
class Anasazi::TsqrOrthoManager< ScalarType, MV >

TSQR-based OrthoManager subclass.

This is the actual subclass of OrthoManager, implemented using TsqrOrthoManagerImpl (TSQR + Block Gram-Schmidt).

Definition at line 657 of file AnasaziTsqrOrthoManager.hpp.


Member Function Documentation

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

Provides the inner product defining the orthogonality concepts.

All concepts of orthogonality discussed in this class are defined with respect to this inner product.

Note:
This is potentially different from MultiVecTraits::MvTransMv(). For example, it is customary in many eigensolvers to exploit a mass matrix M for the inner product: $x^HMx$.
Parameters:
Z[out] Z(i,j) contains the inner product of X[i] and Y[i]:

\[ Z(i,j) = \langle X[i], Y[i] \rangle \]

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 666 of file AnasaziTsqrOrthoManager.hpp.

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

Provides the norm induced by innerProd().

This computes the norm for each column of a multivector. This is the norm induced by innerProd():

\[ \|x\| = \sqrt{\langle x, x \rangle} \]

Parameters:
normvec[out] Vector of norms, whose i-th entry corresponds to the i-th column of X
Precondition:
  • normvec.size() == GetNumberVecs(X)

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 674 of file AnasaziTsqrOrthoManager.hpp.

template<class ScalarType , class MV >
virtual void Anasazi::TsqrOrthoManager< ScalarType, MV >::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 [inline, virtual]

Given a list of mutually orthogonal and internally orthonormal bases Q, this method projects a multivector X onto the space orthogonal to the individual Q[i], optionally returning the coefficients of X for the individual Q[i]. All of this is done with respect to the inner product innerProd().

After calling this routine, X will be orthogonal to each of the Q[i].

Parameters:
X[in/out] The multivector to be modified.
On output, the columns of X will be orthogonal to each Q[i], satisfying

\[ \langle Q[i], X_{out} \rangle = 0 \]

Also,

\[ X_{out} = X_{in} - \sum_i Q[i] \langle Q[i], X_{in} \rangle \]

Q[in] A list of multivector bases specifying the subspaces to be orthogonalized against, satisfying

\[ \langle Q[i], Q[j] \rangle = I \quad\textrm{if}\quad i=j \]

and

\[ \langle Q[i], Q[j] \rangle = 0 \quad\textrm{if}\quad i \neq j\ . \]

C[out] The coefficients of X in the bases Q[i]. If C[i] is a non-null pointer and C[i] matches the dimensions of X and Q[i], then the coefficients computed during the orthogonalization routine will be stored in the matrix C[i], similar to calling
          innerProd( Q[i], X, C[i] );
If C[i] points to a Teuchos::SerialDenseMatrix with size inconsistent with X and Q[i], then a std::invalid_argument exception will be thrown.
Otherwise, if C.size() < i or C[i] is a null pointer, the caller will not have access to the computed coefficients.

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 681 of file AnasaziTsqrOrthoManager.hpp.

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

This method takes a multivector X and attempts to compute a basis for $colspan(X)$. This basis is orthonormal with respect to innerProd().

This routine returns an integer rank stating the rank of the computed basis. If X does not have full rank and the normalize() routine does not attempt to augment the subspace, then rank may be smaller than the number of columns in X. In this case, only the first rank columns of output X and first rank rows of B will be valid.

Parameters:
X[in/out] The multivector to be modified.
On output, the first rank columns of X satisfy

\[ \langle X[i], X[j] \rangle = \delta_{ij}\ . \]

Also,

\[ X_{in}(1:m,1:n) = X_{out}(1:m,1:rank) B(1:rank,1:n)\ , \]

where m is the number of rows in X and n is the number of columns in X.
B[out] The coefficients of the original X with respect to the computed basis. If B is a non-null pointer and B matches the dimensions of B, then the coefficients computed during the orthogonalization routine will be stored in B, similar to calling
          innerProd( X_{out}, X_{in}, B );
If B points to a Teuchos::SerialDenseMatrix with size inconsistent with X, then a std::invalid_argument exception will be thrown.
Otherwise, if B is null, the caller will not have access to the computed coefficients.
Note:
This matrix is not necessarily triangular (as in a QR factorization); see the documentation of specific orthogonalization managers.
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 rows in the returned B are valid.

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 690 of file AnasaziTsqrOrthoManager.hpp.

template<class ScalarType , class MV >
virtual int Anasazi::TsqrOrthoManager< ScalarType, MV >::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 [inline, virtual]

Given a set of bases Q[i] and a multivector X, this method computes an orthonormal basis for $colspan(X) - \sum_i colspan(Q[i])$.

This routine returns an integer rank stating the rank of the computed basis. If the subspace $colspan(X) - \sum_i colspan(Q[i])$ does not have dimension as large as the number of columns of X and the orthogonalization manager does not attempt to augment the subspace, then rank may be smaller than the number of columns of X. In this case, only the first rank columns of output X and first rank rows of B will be valid.

Note:
This routine guarantees both the orthogonality of the returned basis against the Q[i] as well as the orthonormality of the returned basis. Therefore, this method is not necessarily equivalent to calling project() followed by a call to normalize(); see the documentation for specific orthogonalization managers.
Parameters:
X[in/out] On output, the first rank columns of X satisfy

\[ \langle X[i], X[j] \rangle = \delta_{ij} \quad \textrm{and} \quad \langle X, Q[i] \rangle = 0\ . \]

Also,

\[ X_{in}(1:m,1:n) = X_{out}(1:m,1:rank) B(1:rank,1:n) + \sum_i Q[i] C[i] \]

where m is the number of rows in X and n is the number of columns in X.
Q[in] A list of multivector bases specifying the subspaces to be orthogonalized against, satisfying

\[ \langle Q[i], Q[j] \rangle = I \quad\textrm{if}\quad i=j \]

and

\[ \langle Q[i], Q[j] \rangle = 0 \quad\textrm{if}\quad i \neq j\ . \]

C[out] The coefficients of X in the Q[i]. If C[i] is a non-null pointer and C[i] matches the dimensions of X and Q[i], then the coefficients computed during the orthogonalization routine will be stored in the matrix C[i], similar to calling
          innerProd( Q[i], X, C[i] );
If C[i] points to a Teuchos::SerialDenseMatrix with size inconsistent with X and Q[i], then a std::invalid_argument exception will be thrown.
Otherwise, if C.size() < i or C[i] is a null pointer, the caller will not have access to the computed coefficients.
B[out] The coefficients of the original X with respect to the computed basis. If B is a non-null pointer and B matches the dimensions of B, then the coefficients computed during the orthogonalization routine will be stored in B, similar to calling
          innerProd( Sout, Sin, B );
If B points to a Teuchos::SerialDenseMatrix with size inconsistent with X, then a std::invalid_argument exception will be thrown.
Otherwise, if B is null, the caller will not have access to the computed coefficients.
Note:
This matrix is not necessarily triangular (as in a QR factorization); see the documentation of specific orthogonalization managers.
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 rows in the returned B are valid.

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 697 of file AnasaziTsqrOrthoManager.hpp.

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

This method computes the error in orthonormality of a multivector.

This method return some measure of $\| \langle X, X \rangle - I \| $.
See the documentation of specific orthogonalization managers.

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 707 of file AnasaziTsqrOrthoManager.hpp.

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

This method computes the error in orthogonality of two multivectors.

This method return some measure of $\| \langle X1, X2 \rangle \| $.
See the documentation of specific orthogonalization managers.

Implements Anasazi::OrthoManager< ScalarType, MV >.

Definition at line 713 of file AnasaziTsqrOrthoManager.hpp.


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