Belos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
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]

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 Types inherited from Belos::OutOfPlaceNormalizerMixin< Scalar, MV >
typedef Scalar scalar_type
 
typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
magnitude_type
 
typedef MV multivector_type
 Multivector type with which this class was specialized. More...
 
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. More...
 
Teuchos::RCP< const
Teuchos::ParameterList
getFastParameters () const
 Get "fast" parameters for TsqrOrthoManager. More...
 
 TsqrOrthoManager (const Teuchos::RCP< Teuchos::ParameterList > &params, const std::string &label="Belos")
 Constructor (that sets user-specified parameters). More...
 
 TsqrOrthoManager (const std::string &label)
 Constructor (that sets default parameters). More...
 
virtual ~TsqrOrthoManager ()
 Destructor, declared virtual for safe inheritance. More...
 
void setReorthogonalizationCallback (const Teuchos::RCP< ReorthogonalizationCallback< Scalar > > &callback)
 Set callback to be invoked on reorthogonalization. More...
 
void innerProd (const MV &X, const MV &Y, mat_type &Z) const
 Provides the inner product defining the orthogonality concepts. More...
 
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 normalizeOutOfPlace (MV &X, MV &Q, mat_ptr B) const
 Normalize X into Q*B, overwriting X with invalid values. More...
 
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. More...
 
magnitude_type orthonormError (const MV &X) const
 This method computes the error in orthonormality of a multivector. More...
 
magnitude_type orthogError (const MV &X1, const MV &X2) const
 This method computes the error in orthogonality of two multivectors. More...
 
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. More...
 
const std::string & getLabel () const
 This method returns the label being used by the timers in the orthogonalization manager. More...
 
- Public Member Functions inherited from Belos::OrthoManager< Scalar, MV >
 OrthoManager ()
 Default constructor. More...
 
virtual ~OrthoManager ()
 Destructor. More...
 
virtual void norm (const MV &X, std::vector< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &normvec) const =0
 Compute the norm(s) of the column(s) of X. More...
 
virtual void project (MV &X, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > > C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const =0
 Project X against the (orthogonal) entries of Q. More...
 
virtual int normalize (MV &X, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > B) const =0
 This method takes a multivector X and attempts to compute an orthonormal basis for $colspan(X)$, with respect to innerProd(). More...
 
int projectAndNormalize (MV &X, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > > C, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
 Project X against the Q[i] and normalize X. More...
 
- Public Member Functions inherited from Teuchos::ParameterListAcceptorDefaultBase
RCP< const ParameterListgetParameterList () const
 
- Public Member Functions inherited from Belos::OutOfPlaceNormalizerMixin< Scalar, MV >
virtual ~OutOfPlaceNormalizerMixin ()
 Trivial virtual destructor, to silence compiler warnings. More...
 

Protected Member Functions

virtual int projectAndNormalizeImpl (MV &X, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const
 
- Protected Member Functions inherited from Belos::OrthoManager< Scalar, MV >
virtual int projectAndNormalizeImpl (MV &X, Teuchos::Array< Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > > C, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) const =0
 
- Protected Member Functions inherited from Teuchos::ParameterListAcceptorDefaultBase
void setMyParamList (const RCP< ParameterList > &paramList)
 
RCP< ParameterListgetMyNonconstParamList ()
 
RCP< const ParameterListgetMyParamList () const
 

Private Attributes

TsqrOrthoManagerImpl< Scalar, MV > impl_
 The implementation of TSQR. More...
 
std::string label_
 Label for timers (if timers are enabled at compile time). More...
 

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

Definition at line 142 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 143 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 145 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 147 of file BelosTsqrOrthoManager.hpp.

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

Definition at line 148 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 201 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 210 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
virtual Belos::TsqrOrthoManager< Scalar, MV >::~TsqrOrthoManager ( )
inlinevirtual

Destructor, declared virtual for safe inheritance.

Definition at line 215 of file BelosTsqrOrthoManager.hpp.

Member Function Documentation

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

Implements Teuchos::ParameterListAcceptor.

Definition at line 150 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
Teuchos::RCP<Teuchos::ParameterList> Belos::TsqrOrthoManager< Scalar, MV >::getNonconstParameterList ( )
inlinevirtual

Reimplemented from Teuchos::ParameterListAcceptorDefaultBase.

Definition at line 154 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
Teuchos::RCP<Teuchos::ParameterList> Belos::TsqrOrthoManager< Scalar, MV >::unsetParameterList ( )
inlinevirtual

Reimplemented from Teuchos::ParameterListAcceptorDefaultBase.

Definition at line 158 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
Teuchos::RCP<const Teuchos::ParameterList> Belos::TsqrOrthoManager< Scalar, MV >::getValidParameters ( ) const
inlinevirtual

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 169 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 182 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 239 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
inlinevirtual

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 244 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 248 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 253 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 261 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
virtual int Belos::TsqrOrthoManager< Scalar, MV >::projectAndNormalizeImpl ( MV &  X,
Teuchos::Array< mat_ptr C,
mat_ptr  B,
Teuchos::ArrayView< Teuchos::RCP< const MV > >  Q 
) const
inlineprotectedvirtual

Definition at line 268 of file BelosTsqrOrthoManager.hpp.

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

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
inlinevirtual

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
inlinevirtual

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
inlinevirtual

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)
inlinevirtual

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
inlinevirtual

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.

Member Data Documentation

template<class Scalar , class MV >
TsqrOrthoManagerImpl<Scalar, MV> Belos::TsqrOrthoManager< Scalar, MV >::impl_
mutableprivate

The implementation of TSQR.

The object is delcared "mutable" because it has internal scratch space state, and because the OrthoManager interface requires most of its methods to be declared const.

Definition at line 356 of file BelosTsqrOrthoManager.hpp.

template<class Scalar , class MV >
std::string Belos::TsqrOrthoManager< Scalar, MV >::label_
private

Label for timers (if timers are enabled at compile time).

Definition at line 359 of file BelosTsqrOrthoManager.hpp.


The documentation for this class was generated from the following file: