Belos
Version of the Day
|
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... | |
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.)
ScalarType | The 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. |
MV | The 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.) |
OP | The 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. |
Definition at line 77 of file BelosOperatorTraits.hpp.
|
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 91 of file BelosOperatorTraits.hpp.
|
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 119 of file BelosOperatorTraits.hpp.