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

MatOrthoManager subclass using TSQR or DGKS. More...

#include <BelosTsqrOrthoManager.hpp>

Inheritance diagram for Belos::TsqrMatOrthoManager< Scalar, MV, OP >:
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 OP operator_type
 Operator type with which this class was specialized.
typedef
Teuchos::SerialDenseMatrix
< int, Scalar > 
mat_type
typedef Teuchos::RCP< mat_typemat_ptr

Public Member Functions

 TsqrMatOrthoManager ()
 Default constructor (sets Op to Teuchos::null)
void setLabel (const std::string &label)
 Set label for timers (if timers enabled)
const std::string & getLabel () const
 Return label for timers (if timers enabled)
 TsqrMatOrthoManager (const Teuchos::RCP< const Teuchos::ParameterList > &params, const std::string &label="Belos", Teuchos::RCP< const OP > Op=Teuchos::null)
 Constructor.
virtual ~TsqrMatOrthoManager ()
 Destructor.
void setOp (Teuchos::RCP< const OP > Op)
 Return the inner product operator.
Teuchos::RCP< const OP > getOp () const
 Return the inner product operator, if any.
void project (MV &X, Teuchos::RCP< MV > MX, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
 Project X against Q with respect to the inner product computed by innerProd().
void project (MV &X, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
 Project X against Q with respect to the inner product computed by innerProd().
int normalize (MV &X, Teuchos::RCP< MV > MX, mat_ptr B) const
int normalize (MV &X, mat_ptr B) const
int projectAndNormalize (MV &X, Teuchos::RCP< MV > MX, 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, Teuchos::RCP< const MV > MX) const
 This method computes the error in orthonormality of a multivector. The method has the option of exploiting a caller-provided MX.
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. This method.
magnitude_type orthogError (const MV &X1, Teuchos::RCP< const MV > MX1, const MV &X2) const
 This method computes the error in orthogonality of two multivectors. The method has the option of exploiting a caller-provided MX.

Static Public Member Functions

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

Detailed Description

template<class Scalar, class MV, class OP>
class Belos::TsqrMatOrthoManager< Scalar, MV, OP >

MatOrthoManager subclass using TSQR or DGKS.

Subclass of MatOrthoManager. When getOp() == null (Euclidean inner product), uses TSQR + Block Gram-Schmidt for orthogonalization. When getOp() != null, uses DGKSOrthoManager (Classical Gram-Schmidt with reorthogonalization) for orthogonalization. Avoids communication only in the TSQR case. Initialization of either orthogonalization manager is "lazy," so you don't have to pay for scratch space if you don't use it.

Definition at line 354 of file BelosTsqrOrthoManager.hpp.


Member Typedef Documentation

template<class Scalar , class MV , class OP >
typedef Scalar Belos::TsqrMatOrthoManager< Scalar, MV, OP >::scalar_type

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

Definition at line 359 of file BelosTsqrOrthoManager.hpp.

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

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

Definition at line 360 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV , class OP >
typedef MV Belos::TsqrMatOrthoManager< Scalar, MV, OP >::multivector_type

Multivector type with which this class was specialized.

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

Definition at line 362 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV , class OP >
typedef OP Belos::TsqrMatOrthoManager< Scalar, MV, OP >::operator_type

Operator type with which this class was specialized.

Definition at line 364 of file BelosTsqrOrthoManager.hpp.

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

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

Definition at line 366 of file BelosTsqrOrthoManager.hpp.

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

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

Definition at line 367 of file BelosTsqrOrthoManager.hpp.


Constructor & Destructor Documentation

template<class Scalar , class MV , class OP >
Belos::TsqrMatOrthoManager< Scalar, MV, OP >::TsqrMatOrthoManager ( ) [inline]

Default constructor (sets Op to Teuchos::null)

Definition at line 432 of file BelosTsqrOrthoManager.hpp.

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

Constructor.

Parameters:
params[in] Parameters used to set up the orthogonalization. Call the getDefaultParameters() class method for default parameters and their documentation.
label[in] Label for timers (if timers are used)
Op[in] Inner product with respect to which to orthogonalize vectors. If Teuchos::null, use the Euclidean inner product.

Definition at line 459 of file BelosTsqrOrthoManager.hpp.

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

Destructor.

Definition at line 470 of file BelosTsqrOrthoManager.hpp.


Member Function Documentation

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

Get default parameters for TsqrMatOrthoManager.

Get a (pointer to a) default list of parameters for configuring a TsqrMatOrthoManager 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 409 of file BelosTsqrOrthoManager.hpp.

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

Get "fast" parameters for TsqrMatOrthoManager.

Get a (pointer to a) list of parameters for configuring a TsqrMatOrthoManager 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 427 of file BelosTsqrOrthoManager.hpp.

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

Set label for timers (if timers enabled)

Note:
Belos::OrthoManager wants this virtual function to be implemented; Anasazi::OrthoManager does not.

Implements Belos::OrthoManager< ScalarType, MV >.

Definition at line 442 of file BelosTsqrOrthoManager.hpp.

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

Return label for timers (if timers enabled)

Implements Belos::OrthoManager< ScalarType, MV >.

Definition at line 446 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV , class OP >
void Belos::TsqrMatOrthoManager< Scalar, MV, OP >::setOp ( Teuchos::RCP< const OP >  Op) [inline]

Return the inner product operator.

Return the inner product operator used for orthogonalization. If it is Teuchos::null, then the vectors are orthogonalized with respect to the Euclidean inner product.

Note:
We override the base class' setOp() so that the DGKSOrthoManager gets the new op.

Reimplemented from Belos::MatOrthoManager< Scalar, MV, OP >.

Definition at line 481 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV , class OP >
Teuchos::RCP<const OP> Belos::TsqrMatOrthoManager< Scalar, MV, OP >::getOp ( ) const [inline]

Return the inner product operator, if any.

Note:
We override only to help C++ do name lookup in the other member functions.

Reimplemented from Belos::MatOrthoManager< Scalar, MV, OP >.

Definition at line 496 of file BelosTsqrOrthoManager.hpp.

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

Project X against Q with respect to the inner product computed by innerProd().

Store the resulting coefficients in C. If MX is not null, assume that MX is the result of applying the operator to X, and exploit this when computing the inner product.

Definition at line 506 of file BelosTsqrOrthoManager.hpp.

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

Project X against Q with respect to the inner product computed by innerProd().

Store the resulting coefficients in C.

Definition at line 529 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV , class OP >
int Belos::TsqrMatOrthoManager< Scalar, MV, OP >::normalize ( MV &  X,
Teuchos::RCP< MV >  MX,
mat_ptr  B 
) const [inline]

Definition at line 536 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 554 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 559 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV , class OP >
int Belos::TsqrMatOrthoManager< Scalar, MV, OP >::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] Vector(s) to normalize
Q[out] Normalized 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 600 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV , class OP >
int Belos::TsqrMatOrthoManager< Scalar, MV, OP >::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 637 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV , class OP >
magnitude_type Belos::TsqrMatOrthoManager< Scalar, MV, OP >::orthonormError ( const MV &  X,
Teuchos::RCP< const MV >  MX 
) const [inline, virtual]

This method computes the error in orthonormality of a multivector. The method has the option of exploiting a caller-provided MX.

Implements Belos::MatOrthoManager< Scalar, MV, OP >.

Definition at line 659 of file BelosTsqrOrthoManager.hpp.

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

This method computes the error in orthonormality of a multivector.

Reimplemented from Belos::MatOrthoManager< Scalar, MV, OP >.

Definition at line 673 of file BelosTsqrOrthoManager.hpp.

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

This method computes the error in orthogonality of two multivectors. This method.

Reimplemented from Belos::MatOrthoManager< Scalar, MV, OP >.

Definition at line 677 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV , class OP >
magnitude_type Belos::TsqrMatOrthoManager< Scalar, MV, OP >::orthogError ( const MV &  X1,
Teuchos::RCP< const MV >  MX1,
const MV &  X2 
) const [inline, virtual]

This method computes the error in orthogonality of two multivectors. The method has the option of exploiting a caller-provided MX.

Implements Belos::MatOrthoManager< Scalar, MV, OP >.

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