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

Base for Akx implementations using only abstract operators. More...

#include <BelosOpAkx.hpp>

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

List of all members.

Public Member Functions

 OpAkx (const Teuchos::RCP< const OP > &A, const Teuchos::RCP< const OP > &M_left, const Teuchos::RCP< const OP > &M_right, const int recommendedBasisLength)
 Constructor.
int maxCandidateBasisLength () const
 Maximum candidate basis length.
int recommendedCandidateBasisLength () const
 (Initial) recommended candidate basis length.

Protected Member Functions

void applyOp (const MV &v_prv, MV &v_cur)
 Apply the "operator" M_left*A*M_right.
void applyFlexibleOp (const MV &v_prv, MV &z_cur, MV &v_cur)
 Apply the "flexible operator.".

Detailed Description

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

Base for Akx implementations using only 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.

It's not always beneficial or desirable to use a matrix powers kernel implementation that expensively reorganizes the sparse matrix and preconditioners. Also, in some cases, we might only have access to the matrix as an abstract operator, or the operator might not even be represented as a matrix. In these cases, subclasses of OpAkx can be useful. They implement the matrix powers kernel straightforwardly, using s applications of the operator (including left and/or right preconditioner(s), if provided) to generate s basis vectors. Subclasses implement specific basis types, like monomial or Newton.

Definition at line 71 of file BelosOpAkx.hpp.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
A[in] The matrix of interest.
M_left[in] If not null, the left preconditioner, or split preconditioner if M_right is also not null.
M_right[in] If not null, the right preconditioner, or split preconditioner if M_left is also not null.
recommendedBasisLength[in] The basis length recommended, at least initially, for good performance, numerical stability, or both.

Definition at line 86 of file BelosOpAkx.hpp.


Member Function Documentation

template<class Scalar , class MV , class OP >
int Belos::OpAkx< Scalar, MV, OP >::maxCandidateBasisLength ( ) const [inline, virtual]

Maximum candidate basis length.

Implements Belos::Akx< Scalar, MV >.

Definition at line 97 of file BelosOpAkx.hpp.

template<class Scalar , class MV , class OP >
int Belos::OpAkx< Scalar, MV, OP >::recommendedCandidateBasisLength ( ) const [inline, virtual]

(Initial) recommended candidate basis length.

Implements Belos::Akx< Scalar, MV >.

Definition at line 106 of file BelosOpAkx.hpp.

template<class Scalar , class MV , class OP >
void Belos::OpAkx< Scalar, MV, OP >::applyOp ( const MV &  v_prv,
MV &  v_cur 
) [inline, protected]

Apply the "operator" M_left*A*M_right.

The operator is suitable for (CA-)GMRES and for unpreconditioned iterative methods (where M_left and M_right are each the identity operator). This method computes v_cur := M_left * (A * (M_right * v_prv)), where "*" indicates the "apply" operation which Belos::OperatorTraits::Apply() performs.

This method has been made available so that subclasses don't have to access A, M_left_, or M_right_ directly, and also to avoid duplicated code.

Parameters:
v_prv[in] Vector to which to apply the operator.
v_cur[out] Result of applying the operator to z_cur.

Definition at line 127 of file BelosOpAkx.hpp.

template<class Scalar , class MV , class OP >
void Belos::OpAkx< Scalar, MV, OP >::applyFlexibleOp ( const MV &  v_prv,
MV &  z_cur,
MV &  v_cur 
) [inline, protected]

Apply the "flexible operator.".

The flexible operator is suitable for (CA-) Flexible GMRES. This method first applies the right preconditioner to v_prv, storing the result in z_cur. If the right preconditioner is the identity operator, v_prv is just copied into z_cur. Then, this method applies the matrix A to z_cur, storing the result in v_cur.

This method has been made available so that subclasses don't have to access A, M_left_, or M_right_ directly, and also to avoid duplicated code.

Parameters:
v_prv[in] Vector to which to apply the right preconditioner.
z_cur[out] Result of applying the right preconditioner to v_cur.
v_cur[out] Result of applying the matrix A to z_cur.

Definition at line 175 of file BelosOpAkx.hpp.


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