Belos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | List of all members
Belos::OperatorTraits< ScalarType, MV, OP > Class Template Reference

Class which defines basic traits for the operator type. More...

#include <BelosOperatorTraits.hpp>

Static Public Member Functions

static void Apply (const OP &Op, const MV &x, MV &y, ETrans trans=NOTRANS)
 Apply Op to x, putting the result into y. More...
 
static bool HasApplyTranspose (const OP &Op)
 Whether this operator implements applying the transpose. More...
 

Detailed Description

template<class ScalarType, class MV, class OP>
class Belos::OperatorTraits< ScalarType, MV, OP >

Class which defines basic traits for the operator type.

This class defines the interface that Belos' linear solvers use when interacting with operators (e.g., matrices and preconditioners). OperatorTraits is a "traits class," which means that it uses compile-time polymorphism to interface between Belos' solvers and the particular implementation of matrices, preconditioners, and multivectors.

A specialization of this traits class must exist for the ScalarType, MV and OP types. If not, this class will produce a compile-time error. (The UndefinedOperatorTraits class provides an intelligible error message for that case.)

Template Parameters
ScalarTypeThe scalar type: that is, the data type for which scalar multiplication by a (multi)vector is defined, and the data type produced by a dot product of two vectors.
MVThe multivector type. A "multivector" contains one or more vectors. All vectors in a multivector have the same number of entries and belong to the same vector space. (What the latter phrase specifically means depends on the MV class. Informally, it makes sense to add two vectors belonging to the same vector space.)
OPThe operator type. An operator behaves as a function (not in the strict mathematical sense) that takes a multivector X as input, and fills a multivector Y with the result of applying the multivector to X.
Examples:
BlockCG/BlockCGEpetraExFile.cpp, BlockCG/BlockPrecCGEpetraExFile.cpp, BlockCG/PseudoBlockCGEpetraExFile.cpp, BlockCG/PseudoBlockPrecCGEpetraExFile.cpp, BlockGmres/BlockFlexGmresEpetraExFile.cpp, BlockGmres/BlockGmresEpetraExFile.cpp, BlockGmres/BlockGmresPolyEpetraExFile.cpp, BlockGmres/BlockPrecGmresEpetraExFile.cpp, BlockGmres/PseudoBlockGmresEpetraExFile.cpp, BlockGmres/PseudoBlockPrecGmresEpetraExFile.cpp, GCRODR/GCRODREpetraExFile.cpp, GCRODR/PrecGCRODREpetraExFile.cpp, PCPG/PCPGEpetraExFile.cpp, TFQMR/PseudoBlockTFQMREpetraExFile.cpp, and TFQMR/TFQMREpetraExFile.cpp.

Definition at line 109 of file BelosOperatorTraits.hpp.

Member Function Documentation

template<class ScalarType , class MV , class OP >
static void Belos::OperatorTraits< ScalarType, MV, OP >::Apply ( const OP &  Op,
const MV &  x,
MV &  y,
ETrans  trans = NOTRANS 
)
inlinestatic

Apply Op to x, putting the result into y.

If Op, x, and y are real-valued, then applying the conjugate transpose (trans = CONJTRANS) means the same thing as applying the transpose (trans = TRANS).

If Op does not support applying the transpose and you use trans != NOTRANS, or if there is some other error in applying the operator, this method throws a subclass of std::exception.

Definition at line 123 of file BelosOperatorTraits.hpp.

template<class ScalarType , class MV , class OP >
static bool Belos::OperatorTraits< ScalarType, MV, OP >::HasApplyTranspose ( const OP &  Op)
inlinestatic

Whether this operator implements applying the transpose.

The instance of OP which is the first argument of Apply() is not required to support applying the transpose (or Hermitian transpose, if applicable). If it does support applying the transpose, this method should return true. Otherwise, it should return false.

If the operator is complex, "can apply its transpose" means that it can apply both its transpose and its Hermitian transpose.

We provide a default implementation of this method that conservatively returns false. If you want the specialization of OperatorTraits for OP to advertise that operators of type OP may implement applying the transpose, override the default implementation in the specialization.

Definition at line 151 of file BelosOperatorTraits.hpp.


The documentation for this class was generated from the following file:

Generated on Thu Mar 28 2024 09:27:42 for Belos by doxygen 1.8.5