Belos Version of the Day

Alternative runtime polymorphic interface for operators. More...
#include <BelosOperator.hpp>
Public Member Functions  
Constructor/Destructor  
Operator ()  
Default constructor (does nothing).  
virtual  ~Operator () 
Virtual destructor, for memory safety of derived classes.  
Methods relating to applying the operator  
virtual void  Apply (const MultiVec< ScalarType > &x, MultiVec< ScalarType > &y, ETrans trans=NOTRANS) const =0 
Apply the operator to x, putting the result in y.  
virtual bool  HasApplyTranspose () const 
Whether this operator implements applying the transpose. 
Alternative runtime polymorphic interface for operators.
Belos' linear solvers are templated on the scalar (Scalar), multivector (MV), and operator (OP) types. The term "operator" includes the matrix A in the linear system , any left or right preconditioners, and any left or right scaling operators. If you have enabled the corresponding Trilinos packages, you can use Belos' solvers directly with OP = Epetra_Operator, Tpetra::Operator, or Thyra::LinearOpBase. Alternately, you may wish to use some other object as an operator. If so, you can make that object inherit from Belos::Operator<Scalar>, and make its corresponding multivector objects inherit from Belos::MultiVec<Scalar>. Belos' solvers may also be instantiated with MV = Belos::MultiVec<Scalar> and OP = Belos::Operator<Scalar>.
A concrete implementation of this class is necessary. Users may create their own implementation if the supplied implementations are not suitable for their needs.
Definition at line 81 of file BelosOperator.hpp.
Belos::Operator< ScalarType >::Operator  (  )  [inline] 
Default constructor (does nothing).
Definition at line 87 of file BelosOperator.hpp.
virtual Belos::Operator< ScalarType >::~Operator  (  )  [inline, virtual] 
Virtual destructor, for memory safety of derived classes.
Definition at line 90 of file BelosOperator.hpp.
virtual void Belos::Operator< ScalarType >::Apply  (  const MultiVec< ScalarType > &  x, 
MultiVec< ScalarType > &  y,  
ETrans  trans = NOTRANS 

)  const [pure virtual] 
Apply the operator to x, putting the result in y.
Take the Belos::MultiVec x
and apply the operator (or its transpose or Hermitian transpose) to it, writing the result into the Belos::MultiVec y
.
x  [in] The input multivector. 
y  [out] The output multivector. x and y may not alias (i.e., be views of) one another. 
trans  [in] Whether to apply the operator (NOTRANS), its transpose (TRANS), or its Hermitian transpose (CONJTRANS). The default is NOTRANS. 
Your Operator subclass' implementation of Apply() is not required to support applying the transpose (or Hermitian transpose, if applicable). If the caller passes in a value of trans
which your Apply() implementation does not support, it should throw a subclass of std::exception. In general, subclasses' implementations should signal any problems applying the operator by throwing a subclass of std::exception.
virtual bool Belos::Operator< ScalarType >::HasApplyTranspose  (  )  const [inline, virtual] 
Whether this operator implements applying the transpose.
Your Operator subclass' implementation 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.
We assume that if an operator can apply its transpose, it can also apply its Hermitian transpose, if the operator is complex (otherwise the transpose and Hermitian transpose are the same operation).
We provide a default implementation of this method that conservatively returns false. If you want your Operator subclass to advertise that it implements applying the transpose, override the default implementation in your subclass.
Definition at line 142 of file BelosOperator.hpp.