Belos Version of the Day
Public Types | Public Member Functions | Public Attributes
Belos::NewtonOpAkx< Scalar, MV, OP > Class Template Reference

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

#include <BelosNewtonOpAkx.hpp>

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

List of all members.

Public Types

typedef Teuchos::ScalarTraits
< Scalar >::magnitudeType 
magnitude_type

Public Member Functions

 NewtonOpAkx (const Teuchos::RCP< const OP > &A, const Teuchos::RCP< const OP > &M_left, const Teuchos::RCP< const OP > &M_right, const bool modified)
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.
mults push_back (curMult)
mults push_back (curMult)
 if (B_.is_null()||(B_->numRows()!=s+1||B_->numCols()!=s)||shiftsChanged_) B_
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.

Public Attributes

 numShifts = 2*curMult
ArrayView< const magnitude_typeimagParts = imagParts_.view (0, numUniqueShifts)
return B_

Detailed Description

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

Newton-basis Akx implementation using abstract operators.

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 61 of file BelosNewtonOpAkx.hpp.


Member Typedef Documentation

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

Reimplemented from Belos::Akx< Scalar, MV >.

Definition at line 63 of file BelosNewtonOpAkx.hpp.


Constructor & Destructor Documentation

template<class Scalar , class MV , class OP >
Belos::NewtonOpAkx< Scalar, MV, OP >::NewtonOpAkx ( const Teuchos::RCP< const OP > &  A,
const Teuchos::RCP< const OP > &  M_left,
const Teuchos::RCP< const OP > &  M_right,
const bool  modified 
) [inline]

Definition at line 65 of file BelosNewtonOpAkx.hpp.


Member Function Documentation

template<class Scalar , class MV , class OP >
void Belos::NewtonOpAkx< 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 72 of file BelosNewtonOpAkx.hpp.

template<class Scalar , class MV , class OP >
void Belos::NewtonOpAkx< 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 141 of file BelosNewtonOpAkx.hpp.

template<class Scalar , class MV , class OP >
mults Belos::NewtonOpAkx< Scalar, MV, OP >::push_back ( curMult  )
template<class Scalar , class MV , class OP >
mults Belos::NewtonOpAkx< Scalar, MV, OP >::push_back ( curMult  )
template<class Scalar , class MV , class OP >
Belos::NewtonOpAkx< Scalar, MV, OP >::if ( B_.is_null()||(B_->numRows()!=s+1||B_->numCols()!=s)||  shiftsChanged_)
template<class Scalar , class MV , class OP >
void Belos::NewtonOpAkx< 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 290 of file BelosNewtonOpAkx.hpp.


Member Data Documentation

template<class Scalar , class MV , class OP >
Belos::NewtonOpAkx< Scalar, MV, OP >::numShifts = 2*curMult

Definition at line 260 of file BelosNewtonOpAkx.hpp.

template<class Scalar , class MV , class OP >
ArrayView<const magnitude_type> Belos::NewtonOpAkx< Scalar, MV, OP >::imagParts = imagParts_.view (0, numUniqueShifts)

Definition at line 277 of file BelosNewtonOpAkx.hpp.

template<class Scalar , class MV , class OP >
return Belos::NewtonOpAkx< Scalar, MV, OP >::B_

Definition at line 285 of file BelosNewtonOpAkx.hpp.


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