Belos Version of the Day
Public Types | 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 (const Teuchos::RCP< Teuchos::ParameterList > &params, const std::string &label="Belos", Teuchos::RCP< const OP > Op=Teuchos::null)
 Constructor (that sets user-specified parameters).
 TsqrMatOrthoManager (const std::string &label="Belos", Teuchos::RCP< const OP > Op=Teuchos::null)
 Constructor (that sets default parameters).
virtual ~TsqrMatOrthoManager ()
 Destructor (declared virtual for memory safety of derived classes).
Teuchos::RCP< const
Teuchos::ParameterList
getValidParameters () const
 Get default parameters for TsqrMatOrthoManager.
Teuchos::RCP< const
Teuchos::ParameterList
getFastParameters ()
 Get "fast" parameters for TsqrMatOrthoManager.
void setParameterList (const Teuchos::RCP< Teuchos::ParameterList > &params)
const std::string & getLabel () const
 This method returns the label being used by the timers in the orthogonalization manager.
void setOp (Teuchos::RCP< const OP > Op)
 Set operator.
Teuchos::RCP< const OP > getOp () const
 Get operator.
void project (MV &X, Teuchos::RCP< MV > MX, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
void project (MV &X, Teuchos::Array< mat_ptr > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
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.
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.
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.
void setLabel (const std::string &label)
 This method sets the label used by the timers in the orthogonalization manager.

Detailed Description

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

MatOrthoManager subclass using TSQR or DGKS.

Author:
Mark Hoemmen

When the inner product matrix has not been set, this class uses TSQR + Block Gram-Schmidt (via TsqrOrthoManagerImpl). If the inner product matrix has been set, then this class uses classical Gram-Schmidt with reorthogonalization (via DGKSOrthoManager).

TSQR uses multivector scratch space. However, scratch space initialization is "lazy," so scratch space will not be allocated if TSQR is not used.

Definition at line 377 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 383 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 384 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 386 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 388 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 390 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 391 of file BelosTsqrOrthoManager.hpp.


Constructor & Destructor Documentation

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

Constructor (that sets user-specified parameters).

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

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 437 of file BelosTsqrOrthoManager.hpp.

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

Constructor (that sets default parameters).

Parameters:
Op[in] Inner product with respect to which to orthogonalize vectors. If Teuchos::null, use the Euclidean inner product.
label[in] Label for timers. This only matters if the compile-time option for enabling timers is set.

Definition at line 453 of file BelosTsqrOrthoManager.hpp.

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

Destructor (declared virtual for memory safety of derived classes).

Definition at line 461 of file BelosTsqrOrthoManager.hpp.


Member Function Documentation

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

Get default parameters for TsqrMatOrthoManager.

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

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

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 470 of file BelosTsqrOrthoManager.hpp.

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

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 "TSQR implementation" as a sublist.

Definition at line 483 of file BelosTsqrOrthoManager.hpp.

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

Implements Teuchos::ParameterListAcceptor.

Definition at line 487 of file BelosTsqrOrthoManager.hpp.

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

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

Implements Belos::OrthoManager< ScalarType, MV >.

Definition at line 491 of file BelosTsqrOrthoManager.hpp.

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

Set operator.

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

Definition at line 494 of file BelosTsqrOrthoManager.hpp.

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

Get operator.

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

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

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

Definition at line 534 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 542 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 557 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 568 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.

Parameters:
X[in/out] On input: Multivector to normalize. On output: Possibly overwritten with invalid values.
Q[out] On output: Normalized multivector.
B[out] On output: Normalization coefficients.
Returns:
Rank of the input multivector X.

Implements Belos::OutOfPlaceNormalizerMixin< Scalar, MV >.

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

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. X_in may be overwritten with invalid values.

Parameters:
X_in[in/out] On input: The vectors to project against Q and normalize. On output: possibly overwritten with invalid values.
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

Implements Belos::OutOfPlaceNormalizerMixin< Scalar, MV >.

Definition at line 602 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 622 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 632 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 636 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 641 of file BelosTsqrOrthoManager.hpp.

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

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

Implements Belos::OrthoManager< ScalarType, MV >.

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