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 Types | Private Member Functions | Private Attributes | List of all members
Belos::SimpleOrthoManager< Scalar, MV > Class Template Reference

Simple OrthoManager implementation for benchmarks. More...

#include <BelosSimpleOrthoManager.hpp>

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

Public Types

typedef Scalar scalar_type
 
typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
magnitude_type
 
typedef
Teuchos::SerialDenseMatrix
< int, Scalar > 
mat_type
 
typedef Teuchos::RCP
< Teuchos::SerialDenseMatrix
< int, Scalar > > 
mat_ptr
 

Public Member Functions

Teuchos::RCP< const
Teuchos::ParameterList
getValidParameters () const
 Get a default list of parameters. More...
 
Teuchos::RCP< const
Teuchos::ParameterList
getFastParameters ()
 Get a "fast" list of parameters. More...
 
void setParameterList (const Teuchos::RCP< Teuchos::ParameterList > &plist)
 
 SimpleOrthoManager (const Teuchos::RCP< OutputManager< Scalar > > &outMan, const std::string &label, const Teuchos::RCP< Teuchos::ParameterList > &params)
 Constructor. More...
 
 SimpleOrthoManager (const std::string &label="Belos")
 Constructor. More...
 
virtual ~SimpleOrthoManager ()
 Virtual destructor for memory safety of derived classes. 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
 
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)
 This method sets the label used by the timers in the orthogonalization manager. 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< ParameterListgetNonconstParameterList ()
 
RCP< ParameterListunsetParameterList ()
 
RCP< const ParameterListgetParameterList () const
 

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 Types

typedef MultiVecTraits< Scalar,
MV > 
MVT
 
typedef Teuchos::ScalarTraits
< Scalar > 
STS
 
typedef Teuchos::ScalarTraits
< magnitude_type
STM
 

Private Member Functions

int normalizeMgs (MV &X, Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > > B) const
 
int normalizeCgs (MV &X, mat_ptr B) const
 
void allocateProjectionCoefficients (Teuchos::Array< mat_ptr > &C, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q, const MV &X, const bool attemptToRecycle=true) const
 
void rawProject (MV &X, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q, Teuchos::ArrayView< mat_ptr > C) const
 

Private Attributes

std::string label_
 Label for Belos timer display. More...
 
Teuchos::RCP< OutputManager
< Scalar > > 
outMan_
 Output manager (used mainly for debugging). More...
 
bool reorthogonalize_
 Whether or not to do (unconditional) reorthogonalization. More...
 
bool useMgs_
 Whether to use MGS or CGS in the normalize() step. More...
 
Teuchos::RCP
< Teuchos::ParameterList
defaultParams_
 Default parameter list. More...
 

Detailed Description

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

Simple OrthoManager implementation for benchmarks.

Author
Mark Hoemmen

This is a very simple orthogonalization method and should only be used for benchmarks. It performs optional unconditional reorthogonalization (no norm tests), but has no rank-revealing features.

Definition at line 67 of file BelosSimpleOrthoManager.hpp.

Member Typedef Documentation

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

Definition at line 71 of file BelosSimpleOrthoManager.hpp.

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

Definition at line 72 of file BelosSimpleOrthoManager.hpp.

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

Definition at line 73 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
typedef Teuchos::RCP<Teuchos::SerialDenseMatrix<int, Scalar> > Belos::SimpleOrthoManager< Scalar, MV >::mat_ptr

Definition at line 74 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
typedef MultiVecTraits<Scalar, MV> Belos::SimpleOrthoManager< Scalar, MV >::MVT
private

Definition at line 77 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
typedef Teuchos::ScalarTraits<Scalar> Belos::SimpleOrthoManager< Scalar, MV >::STS
private

Definition at line 78 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
typedef Teuchos::ScalarTraits<magnitude_type> Belos::SimpleOrthoManager< Scalar, MV >::STM
private

Definition at line 79 of file BelosSimpleOrthoManager.hpp.

Constructor & Destructor Documentation

template<class Scalar, class MV>
Belos::SimpleOrthoManager< Scalar, MV >::SimpleOrthoManager ( const Teuchos::RCP< OutputManager< Scalar > > &  outMan,
const std::string &  label,
const Teuchos::RCP< Teuchos::ParameterList > &  params 
)
inline

Constructor.

Parameters
outMan[in/out] Output manager. If not null, use for various kinds of status output (in particular, for debugging).
label[in] Label for Belos timers.
params[in/out] List of configuration parameters. Call getDefaultParameters() or getFastParameters() for valid parameter lists.

Definition at line 217 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
Belos::SimpleOrthoManager< Scalar, MV >::SimpleOrthoManager ( const std::string &  label = "Belos")
inline

Constructor.

Parameters
label[in] Label for Belos timers.

Definition at line 244 of file BelosSimpleOrthoManager.hpp.

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

Virtual destructor for memory safety of derived classes.

Definition at line 257 of file BelosSimpleOrthoManager.hpp.

Member Function Documentation

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

Get a default list of parameters.

The "default" parameter list sets reasonably safe options in terms of accuracy of the computed orthogonalization. Call getFastParameters() if you prefer to sacrifice some accuracy for speed.

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 127 of file BelosSimpleOrthoManager.hpp.

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

Get a "fast" list of parameters.

The "fast" parameter list favors speed of orthogonalization, but sacrifices some safety and accuracy. Call getDefaultParameters() for safer and more accurate options.

Definition at line 156 of file BelosSimpleOrthoManager.hpp.

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

Implements Teuchos::ParameterListAcceptor.

Definition at line 175 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
void Belos::SimpleOrthoManager< 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 259 of file BelosSimpleOrthoManager.hpp.

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

Definition at line 263 of file BelosSimpleOrthoManager.hpp.

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

Definition at line 274 of file BelosSimpleOrthoManager.hpp.

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

Definition at line 294 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
virtual int Belos::SimpleOrthoManager< 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 310 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
magnitude_type Belos::SimpleOrthoManager< 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 324 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
magnitude_type Belos::SimpleOrthoManager< 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 337 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
void Belos::SimpleOrthoManager< Scalar, MV >::setLabel ( const std::string &  label)
inlinevirtual

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

Implements Belos::OrthoManager< Scalar, MV >.

Definition at line 346 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
const std::string& Belos::SimpleOrthoManager< 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 347 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
int Belos::SimpleOrthoManager< Scalar, MV >::normalizeMgs ( MV &  X,
Teuchos::RCP< Teuchos::SerialDenseMatrix< int, Scalar > >  B 
) const
inlineprivate

Definition at line 352 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
int Belos::SimpleOrthoManager< Scalar, MV >::normalizeCgs ( MV &  X,
mat_ptr  B 
) const
inlineprivate

Definition at line 407 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
void Belos::SimpleOrthoManager< Scalar, MV >::allocateProjectionCoefficients ( Teuchos::Array< mat_ptr > &  C,
Teuchos::ArrayView< Teuchos::RCP< const MV > >  Q,
const MV &  X,
const bool  attemptToRecycle = true 
) const
inlineprivate

Definition at line 482 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
void Belos::SimpleOrthoManager< Scalar, MV >::rawProject ( MV &  X,
Teuchos::ArrayView< Teuchos::RCP< const MV > >  Q,
Teuchos::ArrayView< mat_ptr C 
) const
inlineprivate

Definition at line 533 of file BelosSimpleOrthoManager.hpp.

Member Data Documentation

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

Label for Belos timer display.

Definition at line 82 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
Teuchos::RCP<OutputManager<Scalar> > Belos::SimpleOrthoManager< Scalar, MV >::outMan_
private

Output manager (used mainly for debugging).

Definition at line 84 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
bool Belos::SimpleOrthoManager< Scalar, MV >::reorthogonalize_
private

Whether or not to do (unconditional) reorthogonalization.

Definition at line 86 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
bool Belos::SimpleOrthoManager< Scalar, MV >::useMgs_
private

Whether to use MGS or CGS in the normalize() step.

Definition at line 88 of file BelosSimpleOrthoManager.hpp.

template<class Scalar, class MV>
Teuchos::RCP<Teuchos::ParameterList> Belos::SimpleOrthoManager< Scalar, MV >::defaultParams_
mutableprivate

Default parameter list.

Definition at line 90 of file BelosSimpleOrthoManager.hpp.


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