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

TSQR-based OrthoManager subclass. More...

#include <BelosTsqrOrthoManager.hpp>

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

List of all members.

Public Types

typedef Scalar scalar_type
typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
magnitude_type
typedef MV multivector_type
 Multivector type with which this class was specialized.
typedef
Teuchos::SerialDenseMatrix
< int, Scalar > 
mat_type
typedef Teuchos::RCP< mat_typemat_ptr

Public Member Functions

void setParameterList (const Teuchos::RCP< Teuchos::ParameterList > &params)
Teuchos::RCP
< Teuchos::ParameterList
getNonconstParameterList ()
Teuchos::RCP
< Teuchos::ParameterList
unsetParameterList ()
Teuchos::RCP< const
Teuchos::ParameterList
getValidParameters () const
 Default valid parameter list.
Teuchos::RCP< const
Teuchos::ParameterList
getFastParameters () const
 Get "fast" parameters for TsqrOrthoManager.
 TsqrOrthoManager (const Teuchos::RCP< Teuchos::ParameterList > &params, const std::string &label="Belos")
 Constructor (that sets user-specified parameters).
 TsqrOrthoManager (const std::string &label)
 Constructor (that sets default parameters).
virtual ~TsqrOrthoManager ()
 Destructor, declared virtual for safe inheritance.
void setReorthogonalizationCallback (const Teuchos::RCP< ReorthogonalizationCallback< Scalar > > &callback)
 Set callback to be invoked on reorthogonalization.
void innerProd (const MV &X, const MV &Y, mat_type &Z) const
 Provides the inner product defining the orthogonality concepts.
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
int normalize (MV &X, mat_ptr B) const
int projectAndNormalize (MV &X, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
int normalizeOutOfPlace (MV &X, MV &Q, mat_ptr B) const
 Normalize X into Q*B, overwriting X with invalid values.
int projectAndNormalizeOutOfPlace (MV &X_in, MV &X_out, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
 Project and normalize X_in into X_out; overwrite X_in.
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)
 Set the label for (the timers for) this orthogonalization manager, and create new timers if the label has changed.
const std::string & getLabel () const
 This method returns the label being used by the timers in the orthogonalization manager.

Detailed Description

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

TSQR-based OrthoManager subclass.

Author:
Mark Hoemmen

Subclass of OrthoManager, implemented using TsqrOrthoManagerImpl (TSQR + Block Gram-Schmidt).

Definition at line 137 of file BelosTsqrOrthoManager.hpp.


Member Typedef Documentation

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

Reimplemented from Belos::OutOfPlaceNormalizerMixin< Scalar, MV >.

Definition at line 143 of file BelosTsqrOrthoManager.hpp.

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

Reimplemented from Belos::OutOfPlaceNormalizerMixin< Scalar, MV >.

Definition at line 144 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
typedef MV Belos::TsqrOrthoManager< Scalar, MV >::multivector_type

Multivector type with which this class was specialized.

Reimplemented from Belos::OutOfPlaceNormalizerMixin< Scalar, MV >.

Definition at line 146 of file BelosTsqrOrthoManager.hpp.

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

Reimplemented from Belos::OutOfPlaceNormalizerMixin< Scalar, MV >.

Definition at line 148 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
typedef Teuchos::RCP<mat_type> Belos::TsqrOrthoManager< Scalar, MV >::mat_ptr

Reimplemented from Belos::OutOfPlaceNormalizerMixin< Scalar, MV >.

Definition at line 149 of file BelosTsqrOrthoManager.hpp.


Constructor & Destructor Documentation

template<class Scalar , class MV >
Belos::TsqrOrthoManager< Scalar, MV >::TsqrOrthoManager ( const Teuchos::RCP< Teuchos::ParameterList > &  params,
const std::string &  label = "Belos" 
) [inline]

Constructor (that sets user-specified parameters).

Parameters:
params[in/out] Configuration parameters, both for this orthogonalization manager, and for TSQR itself (as the "TsqrImpl" sublist). This can be null, in which case default parameters will be set for now; you can always call setParameterList() later to change these.
label[in] Label for timers. This only matters if the compile-time option for enabling timers is set.

Call getValidParameters() for default parameters and their documentation, including TSQR implementation parameters. Call getFastParameters() to get documented parameters for faster computation, possibly at the expense of accuracy and robustness.

Definition at line 203 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
Belos::TsqrOrthoManager< Scalar, MV >::TsqrOrthoManager ( const std::string &  label) [inline]

Constructor (that sets default parameters).

Parameters:
label[in] Label for timers. This only matters if the compile-time option for enabling timers is set.

Definition at line 212 of file BelosTsqrOrthoManager.hpp.

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

Destructor, declared virtual for safe inheritance.

Definition at line 217 of file BelosTsqrOrthoManager.hpp.


Member Function Documentation

template<class Scalar , class MV >
void Belos::TsqrOrthoManager< Scalar, MV >::setParameterList ( const Teuchos::RCP< Teuchos::ParameterList > &  params) [inline, virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 151 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
Teuchos::RCP<Teuchos::ParameterList> Belos::TsqrOrthoManager< Scalar, MV >::getNonconstParameterList ( ) [inline, virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 155 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
Teuchos::RCP<Teuchos::ParameterList> Belos::TsqrOrthoManager< Scalar, MV >::unsetParameterList ( ) [inline, virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 159 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
Teuchos::RCP<const Teuchos::ParameterList> Belos::TsqrOrthoManager< Scalar, MV >::getValidParameters ( ) const [inline, virtual]

Default valid parameter list.

Get a (pointer to a) default list of parameters for configuring a TsqrOrthoManager instance.

Note:
TSQR implementation configuration options are stored under "TsqrImpl" as a sublist.

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 170 of file BelosTsqrOrthoManager.hpp.

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

Get "fast" parameters for TsqrOrthoManager.

Get a (pointer to a) list of parameters for configuring a TsqrOrthoManager instance for maximum speed, at the cost of accuracy (no block reorthogonalization) and robustness to rank deficiency (no randomization of the null space basis).

Note:
TSQR implementation configuration options are stored under "TsqrImpl" as a sublist.

Definition at line 183 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
void Belos::TsqrOrthoManager< Scalar, MV >::setReorthogonalizationCallback ( const Teuchos::RCP< ReorthogonalizationCallback< Scalar > > &  callback) [inline]

Set callback to be invoked on reorthogonalization.

This callback is invoked right after the first projection step, and only if reorthogonalization will be necessary. It is called before actually reorthogonalizing. The first argument gives the norms of the columns of the input multivector before the first projection pass, and the second argument gives their norms after the first projection pass.

The callback is null by default. If the callback is null, no callback will be invoked.

For details and suggested uses, please refer to the documentation of ReorthogonalizationCallback.

Warning:
Please do not rely on the interface to this method. This method may change or go away at any time.
We assume that the input arguments of the callback's operator() are only valid views within the scope of the function. Your callback should not keep the views.

Definition at line 241 of file BelosTsqrOrthoManager.hpp.

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

Provides the inner product defining the orthogonality concepts.

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

Note:
This can be different than the MvTransMv method from the multivector class. For example, if there is a mass matrix M, then this might be the M inner product ( $x^HMx$).

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 246 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 250 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 255 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 263 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 269 of file BelosTsqrOrthoManager.hpp.

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

Normalize X into Q*B, overwriting X with invalid values.

We expose this interface to applications because TSQR is not able to compute an orthogonal basis in place; it needs scratch space. Applications can exploit this interface to avoid excessive copying of vectors when using TSQR for orthogonalization.

Parameters:
X[in/out] Input vector(s) to normalize
Q[out] Normalized output vector(s)
B[out] Normalization coefficients
Returns:
Rank of X.
Note:
Q must have at least as many columns as X. It may have more columns than X; those columns are ignored.

Implements Belos::OutOfPlaceNormalizerMixin< Scalar, MV >.

Definition at line 294 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
int Belos::TsqrOrthoManager< Scalar, MV >::projectAndNormalizeOutOfPlace ( MV &  X_in,
MV &  X_out,
Teuchos::Array< mat_ptr C,
mat_ptr  B,
Teuchos::ArrayView< Teuchos::RCP< const MV > >  Q 
) const [inline, virtual]

Project and normalize X_in into X_out; overwrite X_in.

Project X_in against Q, storing projection coefficients in C, and normalize X_in into X_out, storing normalization coefficients in B. On output, X_out has the resulting orthogonal vectors and X_in is overwritten with invalid values.

Parameters:
X_in[in/out] On input: The vectors to project against Q and normalize. Overwritten with invalid values on output.
X_out[out] The normalized input vectors after projection against Q.
C[out] Projection coefficients
B[out] Normalization coefficients
Q[in] The orthogonal basis against which to project
Returns:
Rank of X_in after projection
Note:
We expose this interface to applications for the same reason that we expose normalizeOutOfPlace().

Implements Belos::OutOfPlaceNormalizerMixin< Scalar, MV >.

Definition at line 320 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
magnitude_type Belos::TsqrOrthoManager< 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 329 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
magnitude_type Belos::TsqrOrthoManager< 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 333 of file BelosTsqrOrthoManager.hpp.

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

Set the label for (the timers for) this orthogonalization manager, and create new timers if the label has changed.

Parameters:
label[in] New label for timers
Note:
Belos::OrthoManager wants this virtual function to be implemented; Anasazi::OrthoManager does not.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 344 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
const std::string& Belos::TsqrOrthoManager< 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 348 of file BelosTsqrOrthoManager.hpp.


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