Belos Version of the Day
Public Types | Public Member Functions | Static 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
typedef
Teuchos::SerialDenseMatrix
< int, Scalar > 
mat_type
typedef Teuchos::RCP< mat_typemat_ptr

Public Member Functions

 TsqrOrthoManager (const Teuchos::RCP< const Teuchos::ParameterList > &params, const std::string &label="Belos")
 Constructor.
virtual ~TsqrOrthoManager ()
 Virtual destructor.
void innerProd (const MV &X, const MV &Y, mat_type &Z) const
 Compute the (block) inner product Z := <X,Y>
void norm (const MV &X, std::vector< magnitude_type > &normVec) const
 Compute the norm(s) of the column(s) of X.
void project (MV &X, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
 Project X against Q and store resulting coefficients in C.
int normalize (MV &X, mat_ptr B) const
 Normalize X in place, and store resulting coefficients in B.
int projectAndNormalize (MV &X, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
 Project X against Q, storing projection coefficients in C; then normalize X in place, and store normalization coefficients in B.
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
 Return $\| <X,X> - I \|$.
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
 Return timers label.

Static Public Member Functions

static Teuchos::RCP< const
Teuchos::ParameterList
getDefaultParameters ()
 Get default parameters for TsqrOrthoManager.
static Teuchos::RCP< const
Teuchos::ParameterList
getFastParameters ()
 Get "fast" parameters for TsqrOrthoManager.

Detailed Description

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

TSQR-based OrthoManager subclass.

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

Definition at line 135 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 139 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 140 of file BelosTsqrOrthoManager.hpp.

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

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

Definition at line 142 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 144 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 145 of file BelosTsqrOrthoManager.hpp.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
params[in] List of configuration parameters. You should get this by calling one of either getDefaultParameters() or getFastParameters(), making a deep copy, modifying what you want to modify, and passing in the resulting list.
label[in] Label for Belos timers (if Belos was build with the corresponding build-time option enabled).

Definition at line 196 of file BelosTsqrOrthoManager.hpp.

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

Virtual destructor.

Definition at line 202 of file BelosTsqrOrthoManager.hpp.


Member Function Documentation

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

Get default parameters for TsqrOrthoManager.

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

Note:
To get nondefault behavior, a good thing to do is to make a deep copy of the returned parameter list, and then modify individual entries as desired.
TSQR implementation configuration options are stored under "TsqrImpl" as an RCP<const ParameterList>. (Don't call sublist() to get them; call get().)
Warning:
This method is not reentrant. It should only be called by one thread at a time.

Definition at line 163 of file BelosTsqrOrthoManager.hpp.

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

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 an RCP<const ParameterList>. (Don't call sublist() to get them; call get().)
Warning:
This method is not reentrant. It should only be called by one thread at a time.

Definition at line 181 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]

Compute the (block) inner product Z := <X,Y>

Definition at line 205 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]

Compute the norm(s) of the column(s) of X.

Parameters:
X[in] Multivector for which to compute column norm(s)
normVec[out] normVec[j] is the norm of column j of X. normVec is resized if it has too few entries to hold all the norms, but it is not resize if it has too many entries.

Definition at line 216 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]

Project X against Q and store resulting coefficients in C.

Definition at line 222 of file BelosTsqrOrthoManager.hpp.

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

Normalize X in place, and store resulting coefficients in B.

Returns:
Rank of X

Definition at line 233 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]

Project X against Q, storing projection coefficients in C; then normalize X in place, and store normalization coefficients in B.

Parameters:
X[in/out] Vector to project and normalize
C[out] Projection coefficients
B[out] Normalization coefficients
Q[in] Orthogonal basis against which to project
Returns:
Rank of X

Definition at line 249 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.

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

Note:
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 276 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 301 of file BelosTsqrOrthoManager.hpp.

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

Return $\| <X,X> - I \|$.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 311 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 315 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 326 of file BelosTsqrOrthoManager.hpp.

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

Return timers label.

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 329 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