Belos Package Browser (Single Doxygen Collection) Development
Public Types | Public Member Functions
Belos::Akx< Scalar, MV > Class Template Reference

Matrix powers kernel interface. More...

#include <BelosAkx.hpp>

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

List of all members.

Public Types

typedef Scalar scalar_type
typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
magnitude_type
typedef MV multivector_type

Public Member Functions

virtual int maxCandidateBasisLength () const =0
 The maximum length of the candidate basis.
virtual int recommendedCandidateBasisLength () const =0
 Recommended initial candidate basis length.
virtual void computeFlexibleBasis (const MV &q_last, MV &Z_cur, MV &V_cur, const int s)=0
 Compute flexible matrix powers kernel.
virtual void computeBasis (const MV &q_last, MV &V_cur, const int s)=0
 Compute matrix powers kernel with first vector q_last.
virtual void updateBasis (const Teuchos::ArrayView< const magnitude_type > &realParts, const Teuchos::ArrayView< const magnitude_type > &imagParts, const Teuchos::ArrayView< const int > &multiplicities, const int numValues)
 Improve the basis by updating eigenvalue information.
virtual Teuchos::RCP< const
Teuchos::SerialDenseMatrix
< int, Scalar > > 
changeOfBasisMatrix (const int s)=0
 Return the s+1 by s change-of-basis matrix.

Detailed Description

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

Matrix powers kernel interface.

Author:
Mark Hoemmen
Warning:
This is EXPERIMENTAL CODE. DO NOT RELY ON THIS CODE. The interface or implementation may change at any time.

Definition at line 57 of file BelosAkx.hpp.


Member Typedef Documentation

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

Definition at line 59 of file BelosAkx.hpp.

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

Reimplemented in Belos::NewtonOpAkx< Scalar, MV, OP >.

Definition at line 60 of file BelosAkx.hpp.

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

Definition at line 61 of file BelosAkx.hpp.


Member Function Documentation

template<class Scalar , class MV >
virtual int Belos::Akx< Scalar, MV >::maxCandidateBasisLength ( ) const [pure virtual]

The maximum length of the candidate basis.

Some implementations of the matrix powers kernel may set an upper bound on the candidate basis length. This may be because initial set up of the matrix powers kernel requires expensive reorganization of the sparse matrix data structures.

Implemented in Belos::OpAkx< Scalar, MV, OP >.

template<class Scalar , class MV >
virtual int Belos::Akx< Scalar, MV >::recommendedCandidateBasisLength ( ) const [pure virtual]

Recommended initial candidate basis length.

Some implementations of the matrix powers kernel may recommend a particular candidate basis length, at least initially, for reasons of performance, numerical stability, or both. Solvers should revise this dynamically for numerical stability, since the matrix powers kernel implementation does not promise to do the extensive analysis necessary to guarantee numerical stability at this candidate basis length.

Implemented in Belos::OpAkx< Scalar, MV, OP >.

template<class Scalar , class MV >
virtual void Belos::Akx< Scalar, MV >::computeFlexibleBasis ( const MV &  q_last,
MV &  Z_cur,
MV &  V_cur,
const int  s 
) [pure virtual]

Compute flexible matrix powers kernel.

For Flexible GMRES only. Given the first vector q = q_last: Fill in the first s columns of V_cur with a candidate basis for the span of the vectors $A M^{-1} q, (A M^{-1})^2 q, \dots, (A M^{-1})^s q$, and fill in the first s columns of Z_cur with a candidate basis for the span of the vectors $M^{-1} q, M^{-1} (A M^{-1}) q, \dots, M^{-1} (A M^{-1})^{s-1} q$. "Candidate basis" means that the vectors will be linearly independent in exact arithmetic, as long as the corresponding Krylov subspace has at least that dimension. Any remaining columns of V_cur or Z_cur will not be modified.

We call V_cur the "right basis" because the preconditioner is applied on the right side of the operator, and Z_cur the "left basis" because the preconditioner is applied to the left side. If the preconditioner is the identity matrix (a "trivial preconditioner"), then the first s-1 columns of the left basis coincide with the last s-1 columns of the right basis.

Parameters:
q_last[in] First vector of the matrix powers kernel.
Z_cur[out] The first s columns will be filled in with the right basis.
V_cur[out] The first s columns will be filled in with the left basis.
s[in] Number of vectors to compute. s >= 0. If s == 0, no vectors will be computed.

Implemented in Belos::MonomialOpAkx< Scalar, MV, OP >, and Belos::NewtonOpAkx< Scalar, MV, OP >.

template<class Scalar , class MV >
virtual void Belos::Akx< Scalar, MV >::computeBasis ( const MV &  q_last,
MV &  V_cur,
const int  s 
) [pure virtual]

Compute matrix powers kernel with first vector q_last.

Fill in the first s columns of V_cur with the results of the matrix powers kernel (not including the first vector). Any remaining columns of V_cur will not be modified.

Parameters:
q_last[in] First vector of the matrix powers kernel.
V_cur[out] The first s columns will be filled in with the results of the matrix powers kernel.
s[in] Number of vectors to compute. s >= 0. If s == 0, no vectors will be computed.

Implemented in Belos::MonomialOpAkx< Scalar, MV, OP >, and Belos::NewtonOpAkx< Scalar, MV, OP >.

template<class Scalar , class MV >
virtual void Belos::Akx< Scalar, MV >::updateBasis ( const Teuchos::ArrayView< const magnitude_type > &  realParts,
const Teuchos::ArrayView< const magnitude_type > &  imagParts,
const Teuchos::ArrayView< const int > &  multiplicities,
const int  numValues 
) [virtual]

Improve the basis by updating eigenvalue information.

Some matrix powers kernel implementations may benefit (in terms of numerical stability) from (improvements to) approximations to the eigenvalues of the operator. Many Krylov subspace methods (both for linear systems and for eigenvalue problems) naturally produce such approximations, which may improve as the iteration progresses.

Use the given numValues eigenvalue approximations possibly to improve the numerical properties (e.g., condition number) of the matrix powers kernel basis. This call assumes that eigenvalues may be complex. Real parts are stored in the first array, and their corresponding imaginary parts in the second array.

Parameters:
realParts[in] Real parts of the eigenvalue approximations. realParts[k] + i*imagParts[k] is the k-th approximate eigenvalue, of multiplicity multiplicities[k]. Only the first numValues entries are read.
imagParts[in] Imaginary parts of the eigenvalue approximations. realParts[k] + i*imagParts[k] is the k-th approximate eigenvalue, of multiplicity multiplicities[k]. If no eigenvalues are complex, all of the entries of imagParts must be zero. Only the first numValues entries are read.
multiplicities[in] Multiplicity of the k-th eigenvalue approximation. Only the first numValues entries are read.
numValues[in] The number of eigenvalue approximations, not counting multiplicities.

Reimplemented in Belos::MonomialOpAkx< Scalar, MV, OP >, and Belos::NewtonOpAkx< Scalar, MV, OP >.

template<class Scalar , class MV >
virtual Teuchos::RCP<const Teuchos::SerialDenseMatrix<int,Scalar> > Belos::Akx< Scalar, MV >::changeOfBasisMatrix ( const int  s) [pure virtual]

Return the s+1 by s change-of-basis matrix.

For details on the meaning and entries of this matrix, see M. Hoemmen, "Communication-avoiding Krylov subspace methods" (PhD thesis, UC Berkeley EECS), 2010. If s is bigger than the max candidate basis length, this method will throw an exception.

Note:
Implementations of the Newton basis should by default set all the shifts to zero, so the change-of-basis matrix is always valid even if the implementation has not yet received approximate eigenvalue information from the iterative method. The change-of-basis matrix should also be valid for any s up to the maximum candidate basis length, even if updateBasis() has not yet been called with numValues >= that s value.
Parameters:
s[in] The change-of-basis matrix returned by this method will be s+1 by s.
Returns:
s+1 by s change-of-basis matrix.

Implemented in Belos::MonomialOpAkx< Scalar, MV, OP >.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines