Belos Package Browser (Single Doxygen Collection)
Development
|
Simple OrthoManager implementation for benchmarks. More...
#include <BelosSimpleOrthoManager.hpp>
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 > ¶ms) | |
Constructor. More... | |
SimpleOrthoManager (const std::string &label) | |
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 |
Project X against the (orthogonal) entries of Q. More... | |
int | normalize (MV &X, mat_ptr B) const |
This method takes a multivector X and attempts to compute an orthonormal basis for ![]() | |
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... | |
![]() | |
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... | |
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... | |
Protected Member Functions | |
virtual int | projectAndNormalizeImpl (MV &X, Teuchos::Array< mat_ptr > C, mat_ptr B, Teuchos::ArrayView< Teuchos::RCP< const MV > > Q) 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... | |
Simple OrthoManager implementation for benchmarks.
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 68 of file BelosSimpleOrthoManager.hpp.
typedef Scalar Belos::SimpleOrthoManager< Scalar, MV >::scalar_type |
Definition at line 73 of file BelosSimpleOrthoManager.hpp.
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Belos::SimpleOrthoManager< Scalar, MV >::magnitude_type |
Definition at line 74 of file BelosSimpleOrthoManager.hpp.
typedef Teuchos::SerialDenseMatrix<int, Scalar> Belos::SimpleOrthoManager< Scalar, MV >::mat_type |
Definition at line 75 of file BelosSimpleOrthoManager.hpp.
typedef Teuchos::RCP<Teuchos::SerialDenseMatrix<int, Scalar> > Belos::SimpleOrthoManager< Scalar, MV >::mat_ptr |
Definition at line 76 of file BelosSimpleOrthoManager.hpp.
|
private |
Definition at line 79 of file BelosSimpleOrthoManager.hpp.
|
private |
Definition at line 80 of file BelosSimpleOrthoManager.hpp.
|
private |
Definition at line 81 of file BelosSimpleOrthoManager.hpp.
|
inline |
Constructor.
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 219 of file BelosSimpleOrthoManager.hpp.
|
inline |
Constructor.
label | [in] Label for Belos timers. |
Definition at line 246 of file BelosSimpleOrthoManager.hpp.
|
inlinevirtual |
Virtual destructor for memory safety of derived classes.
Definition at line 259 of file BelosSimpleOrthoManager.hpp.
|
inline |
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.
Definition at line 129 of file BelosSimpleOrthoManager.hpp.
|
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 158 of file BelosSimpleOrthoManager.hpp.
|
inline |
Definition at line 177 of file BelosSimpleOrthoManager.hpp.
|
inlinevirtual |
Provides the inner product defining the orthogonality concepts.
All concepts of orthogonality discussed in this class are with respect to this inner product.
M
, then this might be the M
inner product ( Implements Belos::OrthoManager< Scalar, MV >.
Definition at line 261 of file BelosSimpleOrthoManager.hpp.
|
inline |
Definition at line 265 of file BelosSimpleOrthoManager.hpp.
|
inlinevirtual |
Project X against the (orthogonal) entries of Q.
Given a list of (mutually and internally) orthonormal bases Q
, this method takes a multivector X
and projects it onto the space orthogonal to the individual Q[i]
, optionally returning the coefficients of X
for the individual Q[i]
. All of this is done with respect to the inner product innerProd().
After calling this routine, X
will be orthogonal to each of the Q[i]
.
X | [in/out] The multivector to be modified. On output, X will be orthogonal to Q[i] with respect to innerProd(). |
C | [out] The coefficients of X in the *Q [i], with respect to innerProd(). If C[i] is a non-null pointer and *C [i] matches the dimensions of X and *Q [i], then the coefficients computed during the orthogonalization routine will be stored in the matrix *C [i]. If C[i] is a nnon-null pointer whose size does not match the dimensions of X and *Q [i], then a std::invalid_argument std::exception will be thrown. Otherwise, if C.size() < i or C[i] is a null pointer, then the orthogonalization manager will declare storage for the coefficients and the user will not have access to them. |
Q | [in] A list of multivector bases specifying the subspaces to be orthogonalized against. Each Q[i] is assumed to have orthonormal columns, and the Q[i] are assumed to be mutually orthogonal. |
Implements Belos::OrthoManager< Scalar, MV >.
Definition at line 276 of file BelosSimpleOrthoManager.hpp.
|
inlinevirtual |
This method takes a multivector X
and attempts to compute an orthonormal basis for , with respect to innerProd().
This routine returns an integer rank
stating the rank of the computed basis. If X
does not have full rank and the normalize() routine does not attempt to augment the subspace, then rank
may be smaller than the number of columns in X
. In this case, only the first rank
columns of output X
and first rank
rows of B
will be valid.
X | [in/out] The multivector to the modified. On output, X will have some number of orthonormal columns (with respect to innerProd()). |
B | [out] The coefficients of the original X with respect to the computed basis. This matrix is not necessarily triangular; see the documentation for specific orthogonalization managers. |
Implements Belos::OrthoManager< Scalar, MV >.
Definition at line 296 of file BelosSimpleOrthoManager.hpp.
|
inlineprotectedvirtual |
Implements Belos::OrthoManager< Scalar, MV >.
Definition at line 312 of file BelosSimpleOrthoManager.hpp.
|
inlinevirtual |
This method computes the error in orthonormality of a multivector.
Implements Belos::OrthoManager< Scalar, MV >.
Definition at line 326 of file BelosSimpleOrthoManager.hpp.
|
inlinevirtual |
This method computes the error in orthogonality of two multivectors.
Implements Belos::OrthoManager< Scalar, MV >.
Definition at line 339 of file BelosSimpleOrthoManager.hpp.
|
inlinevirtual |
This method sets the label used by the timers in the orthogonalization manager.
Implements Belos::OrthoManager< Scalar, MV >.
Definition at line 348 of file BelosSimpleOrthoManager.hpp.
|
inlinevirtual |
This method returns the label being used by the timers in the orthogonalization manager.
Implements Belos::OrthoManager< Scalar, MV >.
Definition at line 349 of file BelosSimpleOrthoManager.hpp.
|
inlineprivate |
Definition at line 354 of file BelosSimpleOrthoManager.hpp.
|
inlineprivate |
Definition at line 409 of file BelosSimpleOrthoManager.hpp.
|
inlineprivate |
Definition at line 484 of file BelosSimpleOrthoManager.hpp.
|
inlineprivate |
Definition at line 535 of file BelosSimpleOrthoManager.hpp.
|
private |
Label for Belos timer display.
Definition at line 84 of file BelosSimpleOrthoManager.hpp.
|
private |
Output manager (used mainly for debugging).
Definition at line 86 of file BelosSimpleOrthoManager.hpp.
|
private |
Whether or not to do (unconditional) reorthogonalization.
Definition at line 88 of file BelosSimpleOrthoManager.hpp.
|
private |
Whether to use MGS or CGS in the normalize() step.
Definition at line 90 of file BelosSimpleOrthoManager.hpp.
|
mutableprivate |
Default parameter list.
Definition at line 92 of file BelosSimpleOrthoManager.hpp.