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.
epetra/example/BlockCG/BlockCGEpetraExFile.cpp, epetra/example/BlockCG/BlockPrecCGEpetraExFile.cpp, epetra/example/BlockCG/PseudoBlockCGEpetraExFile.cpp, epetra/example/BlockCG/PseudoBlockPrecCGEpetraExFile.cpp, epetra/example/BlockGmres/BlockFlexGmresEpetraExFile.cpp, epetra/example/BlockGmres/BlockGmresEpetraExFile.cpp, epetra/example/BlockGmres/BlockGmresPolyEpetraExFile.cpp, epetra/example/BlockGmres/BlockPrecGmresEpetraExFile.cpp, epetra/example/BlockGmres/PseudoBlockGmresEpetraExFile.cpp, epetra/example/BlockGmres/PseudoBlockPrecGmresEpetraExFile.cpp, epetra/example/GCRODR/GCRODREpetraExFile.cpp, epetra/example/GCRODR/PrecGCRODREpetraExFile.cpp, epetra/example/PCPG/PCPGEpetraExFile.cpp, epetra/example/RCG/RCGEpetraExFile.cpp, epetra/example/SolverFactory/SolverFactoryEpetraGaleriEx.cpp, epetra/example/TFQMR/PseudoBlockTFQMREpetraExFile.cpp, epetra/example/TFQMR/TFQMREpetraExFile.cpp, tpetra/example/BlockCG/BlockCGTpetraExFile.cpp, tpetra/example/BlockCG/PseudoBlockCGTpetraExFile.cpp, tpetra/example/BlockGmres/BlockGmresTpetraExFile.cpp, tpetra/example/BlockGmres/BlockGmresTpetraGaleriEx.cpp, tpetra/example/BlockGmres/PseudoBlockGmresTpetraExFile.cpp, tpetra/example/GCRODR/GCRODRTpetraExFile.cpp, tpetra/example/PCPG/PCPGTpetraExFile.cpp, tpetra/example/RCG/RCGTpetraExFile.cpp, tpetra/example/SolverFactory/SolverFactoryTpetraGaleriEx.cpp, tpetra/example/TFQMR/PseudoBlockTFQMRTpetraExFile.cpp, and tpetra/example/TFQMR/TFQMRTpetraExFile.cpp.

Definition at line 77 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 

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 91 of file BelosOperatorTraits.hpp.

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

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 119 of file BelosOperatorTraits.hpp.

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

Generated on Mon Jul 15 2024 09:24:25 for Belos by doxygen 1.8.5