Belos Version of the Day
Public Member Functions
Belos::MonomialOpAkx< Scalar, MV, OP > Class Template Reference

Monomial-basis Akx implementation using abstract operators. More...

#include <BelosMonomialOpAkx.hpp>

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

List of all members.

Public Member Functions

 MonomialOpAkx (const Teuchos::RCP< const OP > &A, const Teuchos::RCP< const OP > &M_left, const Teuchos::RCP< const OP > &M_right, const int recommendedBasisLength)
void computeBasis (const MV &q_last, MV &V_cur, const int s)
 Compute matrix powers kernel with first vector q_last.
void computeFlexibleBasis (const MV &q_last, MV &Z_cur, MV &V_cur, const int s)
 Compute flexible matrix powers kernel.
Teuchos::RCP< const
Teuchos::SerialDenseMatrix
< int, Scalar > > 
changeOfBasisMatrix (const int s)
 Return the s+1 by s change-of-basis matrix.
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.

Detailed Description

template<class Scalar, class MV, class OP>
class Belos::MonomialOpAkx< Scalar, MV, OP >

Monomial-basis Akx implementation using abstract operators.

Author:
Mark Hoemmen

Definition at line 54 of file BelosMonomialOpAkx.hpp.


Constructor & Destructor Documentation

template<class Scalar , class MV , class OP >
Belos::MonomialOpAkx< Scalar, MV, OP >::MonomialOpAkx ( const Teuchos::RCP< const OP > &  A,
const Teuchos::RCP< const OP > &  M_left,
const Teuchos::RCP< const OP > &  M_right,
const int  recommendedBasisLength 
) [inline]

Definition at line 56 of file BelosMonomialOpAkx.hpp.


Member Function Documentation

template<class Scalar , class MV , class OP >
void Belos::MonomialOpAkx< Scalar, MV, OP >::computeBasis ( const MV &  q_last,
MV &  V_cur,
const int  s 
) [inline, 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.

Implements Belos::Akx< Scalar, MV >.

Definition at line 63 of file BelosMonomialOpAkx.hpp.

template<class Scalar , class MV , class OP >
void Belos::MonomialOpAkx< Scalar, MV, OP >::computeFlexibleBasis ( const MV &  q_last,
MV &  Z_cur,
MV &  V_cur,
const int  s 
) [inline, 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.

Implements Belos::Akx< Scalar, MV >.

Definition at line 89 of file BelosMonomialOpAkx.hpp.

template<class Scalar , class MV , class OP >
Teuchos::RCP<const Teuchos::SerialDenseMatrix<int,Scalar> > Belos::MonomialOpAkx< Scalar, MV, OP >::changeOfBasisMatrix ( const int  s) [inline, 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.

Implements Belos::Akx< Scalar, MV >.

Definition at line 123 of file BelosMonomialOpAkx.hpp.

template<class Scalar , class MV , class OP >
void Belos::MonomialOpAkx< Scalar, MV, OP >::updateBasis ( const Teuchos::ArrayView< const magnitude_type > &  realParts,
const Teuchos::ArrayView< const magnitude_type > &  imagParts,
const Teuchos::ArrayView< const int > &  multiplicities,
const int  numValues 
) [inline, 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 from Belos::Akx< Scalar, MV >.

Definition at line 137 of file BelosMonomialOpAkx.hpp.


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