Belos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
Belos::ReorthogonalizationCallback< Scalar > Class Template Referenceabstract

Interface of callback invoked by TsqrOrthoManager on reorthogonalization. More...

#include <BelosTsqrOrthoManagerImpl.hpp>

Public Types

typedef Scalar scalar_type
 The template parameter of this class; the type of an inner product result. More...
 
typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
magnitude_type
 The type of a norm result. More...
 

Public Member Functions

virtual ~ReorthogonalizationCallback ()
 Destructor (virtual for memory safety of derived classes) More...
 
virtual void operator() (Teuchos::ArrayView< magnitude_type > normsBeforeFirstPass, Teuchos::ArrayView< magnitude_type > normsAfterFirstPass)=0
 Callback invoked by TsqrOrthoManager on reorthogonalization. More...
 

Detailed Description

template<class Scalar>
class Belos::ReorthogonalizationCallback< Scalar >

Interface of callback invoked by TsqrOrthoManager on reorthogonalization.

Author
Mark Hoemmen
Template Parameters
ScalarThe same type as the template parameter of TsqrOrthoManagerImpl.

This callback's operator() is invoked by TsqrOrthoManagerImpl, and therefore by TsqrOrthoManager. It is invoked right after discovering the need to reorthogonalize (for the first time), but before actually reorthogonalizing. It is only invoked if reorthogonalization is necessary. You can define your own callback by implementing this interface.

This callback lets you collect metrics on reorthogonalization. For example, you might want to measure how often it occurs, or by how much the norms of the vectors drop each time. You can use this information in order to adjust parameters (such as the reorthogonalization parameters) dynamically for your desired balance of accuracy and performance. You might also use it as a numerical debugging aid.

Why a reorthgonalization callback, but not other kinds of callbacks? Reorthogonalization is an event that affects performance, and happens in a data-driven way. Even if you have enabled reorthogonalization, it may not happen at all, or only infrequently. Other kinds of data-driven events (such as a normalization discovering numerical rank deficiency) immediately return to the user with useful diagnostics. Reorthogonalization does not; it happens silently. We could have the orthogonalization method itself gather metrics on reorthogonalization, but the callback lets you define what metrics you want to collect and how you want to display them yourself.

Definition at line 130 of file BelosTsqrOrthoManagerImpl.hpp.

Member Typedef Documentation

template<class Scalar >
typedef Scalar Belos::ReorthogonalizationCallback< Scalar >::scalar_type

The template parameter of this class; the type of an inner product result.

Definition at line 134 of file BelosTsqrOrthoManagerImpl.hpp.

template<class Scalar >
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Belos::ReorthogonalizationCallback< Scalar >::magnitude_type

The type of a norm result.

This may differ from scalar_type. For example, if scalar_type is complex, magnitude_type will be real.

Definition at line 139 of file BelosTsqrOrthoManagerImpl.hpp.

Constructor & Destructor Documentation

template<class Scalar >
Belos::ReorthogonalizationCallback< Scalar >::~ReorthogonalizationCallback ( )
virtual

Destructor (virtual for memory safety of derived classes)

Definition at line 154 of file BelosTsqrOrthoManagerImpl.hpp.

Member Function Documentation

template<class Scalar >
virtual void Belos::ReorthogonalizationCallback< Scalar >::operator() ( Teuchos::ArrayView< magnitude_type normsBeforeFirstPass,
Teuchos::ArrayView< magnitude_type normsAfterFirstPass 
)
pure virtual

Callback invoked by TsqrOrthoManager on reorthogonalization.

Warning
The input views are only valid within the scope of this function. Do not keep them.

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

Generated on Tue Apr 23 2024 09:24:57 for Belos by doxygen 1.8.5