Belos Version of the Day
Public Types | Public Member Functions | Static Public Member Functions
Belos::SimpleOrthoManager< Scalar, MV > Class Template Reference

Simple OrthoManager implementation for benchmarks. More...

#include <BelosSimpleOrthoManager.hpp>

Inheritance diagram for Belos::SimpleOrthoManager< Scalar, MV >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef Scalar scalar_type
typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
magnitude_type
typedef
Teuchos::SerialDenseMatrix
< int, Scalar > 
mat_type
typedef Teuchos::RCP
< Teuchos::SerialDenseMatrix
< int, Scalar > > 
mat_ptr

Public Member Functions

 SimpleOrthoManager (const Teuchos::RCP< OutputManager< Scalar > > &outMan, const std::string &label, const Teuchos::RCP< const Teuchos::ParameterList > &params)
 Constructor.
virtual ~SimpleOrthoManager ()
 Virtual destructor for memory safety of derived classes.
void innerProd (const MV &X, const MV &Y, mat_type &Z) const
void norm (const MV &X, std::vector< magnitude_type > &normVec) const
void project (MV &X, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
 Project X against the (orthogonal) entries of Q.
int normalize (MV &X, mat_ptr B) const
 This method takes a multivector X and attempts to compute an orthonormal basis for $colspan(X)$, with respect to innerProd().
int projectAndNormalize (MV &X, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
 Project X against the Q[i] and normalize X.
magnitude_type orthonormError (const MV &X) const
 This method computes the error in orthonormality of a multivector.
magnitude_type orthogError (const MV &X1, const MV &X2) const
 This method computes the error in orthogonality of two multivectors.
void setLabel (const std::string &label)
 This method sets the label used by the timers in the orthogonalization manager.
const std::string & getLabel () const
 This method returns the label being used by the timers in the orthogonalization manager.

Static Public Member Functions

static Teuchos::RCP< const
Teuchos::ParameterList
getDefaultParameters ()
 Get a default list of parameters.
static Teuchos::RCP< const
Teuchos::ParameterList
getFastParameters ()
 Get a "fast" list of parameters.

Detailed Description

template<class Scalar, class MV>
class Belos::SimpleOrthoManager< Scalar, MV >

Simple OrthoManager implementation for benchmarks.

Author:
Mark Hoemmen

This is a very simple orthogonalization method and should only be used for benchmarks. It performs optional unconditional reorthogonalization (no norm tests), but has no rank-revealing features.

Definition at line 67 of file BelosSimpleOrthoManager.hpp.


Member Typedef Documentation

template<class Scalar , class MV >
typedef Scalar Belos::SimpleOrthoManager< Scalar, MV >::scalar_type

Definition at line 69 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Belos::SimpleOrthoManager< Scalar, MV >::magnitude_type

Definition at line 70 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
typedef Teuchos::SerialDenseMatrix<int, Scalar> Belos::SimpleOrthoManager< Scalar, MV >::mat_type

Definition at line 71 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
typedef Teuchos::RCP<Teuchos::SerialDenseMatrix<int, Scalar> > Belos::SimpleOrthoManager< Scalar, MV >::mat_ptr

Definition at line 72 of file BelosSimpleOrthoManager.hpp.


Constructor & Destructor Documentation

template<class Scalar , class MV >
Belos::SimpleOrthoManager< Scalar, MV >::SimpleOrthoManager ( const Teuchos::RCP< OutputManager< Scalar > > &  outMan,
const std::string &  label,
const Teuchos::RCP< const Teuchos::ParameterList > &  params 
) [inline]

Constructor.

Parameters:
outMan[in/out] Output manager. If not null, use for various kinds of status output (in particular, for debugging).
label[in] Label for Belos timers.
params[in] List of configuration parameters. Call getDefaultParameters() or getFastParameters() for sample valid parameter lists.

Definition at line 188 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
virtual Belos::SimpleOrthoManager< Scalar, MV >::~SimpleOrthoManager ( ) [inline, virtual]

Virtual destructor for memory safety of derived classes.

Definition at line 245 of file BelosSimpleOrthoManager.hpp.


Member Function Documentation

template<class Scalar , class MV >
static Teuchos::RCP<const Teuchos::ParameterList> Belos::SimpleOrthoManager< Scalar, MV >::getDefaultParameters ( ) [inline, static]

Get a default list of parameters.

The "default" parameter list sets reasonably safe options in terms of accuracy of the computed orthogonalization. Call getFastParameters() if you prefer to sacrifice some accuracy for speed.

Warning:
This class method is nonreentrant.

Definition at line 126 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
static Teuchos::RCP<const Teuchos::ParameterList> Belos::SimpleOrthoManager< Scalar, MV >::getFastParameters ( ) [inline, static]

Get a "fast" list of parameters.

The "fast" parameter list favors speed of orthogonalization, but sacrifices some accuracy. Call getDefaultParameters() for safer options in terms of accuracy.

Warning:
This class method is nonreentrant.

Definition at line 158 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
void Belos::SimpleOrthoManager< Scalar, MV >::innerProd ( const MV &  X,
const MV &  Y,
mat_type Z 
) const [inline]

Definition at line 247 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
void Belos::SimpleOrthoManager< Scalar, MV >::norm ( const MV &  X,
std::vector< magnitude_type > &  normVec 
) const [inline]

Definition at line 251 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
void Belos::SimpleOrthoManager< Scalar, MV >::project ( MV &  X,
Teuchos::Array< mat_ptr C,
Teuchos::ArrayView< Teuchos::RCP< const MV > >  Q 
) const [inline, virtual]

Project X against the (orthogonal) entries of Q.

Given a list of (mutually and internally) orthonormal bases Q, this method takes a multivector X and projects it 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, X will be orthogonal to Q[i] with respect to innerProd().
C[out] The coefficients of X in the *Q[i], with respect to innerProd(). 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]. If C[i] is a nnon-null pointer whose size does not match the dimensions of X and *Q[i], then a std::invalid_argument std::exception will be thrown. Otherwise, if C.size() < i or C[i] is a null pointer, then the orthogonalization manager will declare storage for the coefficients and the user will not have access to them.
Q[in] A list of multivector bases specifying the subspaces to be orthogonalized against. Each Q[i] is assumed to have orthonormal columns, and the Q[i] are assumed to be mutually orthogonal.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 261 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
int Belos::SimpleOrthoManager< Scalar, MV >::normalize ( MV &  X,
mat_ptr  B 
) const [inline, virtual]

This method takes a multivector X and attempts to compute an orthonormal basis for $colspan(X)$, 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 the modified. On output, X will have some number of orthonormal columns (with respect to innerProd()).
B[out] The coefficients of the original X with respect to the computed basis. This matrix is not necessarily triangular; see the documentation for specific orthogonalization managers.
Returns:
Rank of the basis computed by this method.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 282 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
int Belos::SimpleOrthoManager< Scalar, MV >::projectAndNormalize ( MV &  X,
Teuchos::Array< mat_ptr C,
mat_ptr  B,
Teuchos::ArrayView< Teuchos::RCP< const MV > >  Q 
) const [inline, virtual]

Project X against the Q[i] and normalize X.

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 doe 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 orthgonality constraints against the Q[i] as well as the orthonormality constraints. 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] The multivector to the modified. On output, the relevant rows of X will be orthogonal to the Q[i] and will have orthonormal columns (with respect to innerProd()).
C[out] The coefficients of the original X in the Q[i], with respect to innerProd(). 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]. If C[i] is a non-null pointer whose size does not match the dimensions of X and *Q[i], then a std::invalid_argument std::exception will be thrown. Otherwise, if C.size() < i or C[i] is a null pointer, then the orthogonalization manager will declare storage for the coefficients and the user will not have access to them.
B[out] The coefficients of the original X with respect to the computed basis. This matrix is not necessarily upper triangular (as it would be for textbook Gram-Schmidt orthogonalization of a full-rank matrix, for example). See the documentation for specific orthogonalization managers.
Q[in] A list of multivector bases specifying the subspaces to be orthogonalized against. Each Q[i] is assumed to have orthonormal columns, and the Q[i] are assumed to be mutually orthogonal.
Returns:
Rank of the basis computed by this method.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 296 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
magnitude_type Belos::SimpleOrthoManager< Scalar, MV >::orthonormError ( const MV &  X) const [inline, virtual]

This method computes the error in orthonormality of a multivector.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 308 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
magnitude_type Belos::SimpleOrthoManager< Scalar, MV >::orthogError ( const MV &  X1,
const MV &  X2 
) const [inline, virtual]

This method computes the error in orthogonality of two multivectors.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 320 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
void Belos::SimpleOrthoManager< Scalar, MV >::setLabel ( const std::string &  label) [inline, virtual]

This method sets the label used by the timers in the orthogonalization manager.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 329 of file BelosSimpleOrthoManager.hpp.

template<class Scalar , class MV >
const std::string& Belos::SimpleOrthoManager< Scalar, MV >::getLabel ( ) const [inline, virtual]

This method returns the label being used by the timers in the orthogonalization manager.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 330 of file BelosSimpleOrthoManager.hpp.


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