Belos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
Belos::Operator< ScalarType > Class Template Referenceabstract

Alternative run-time polymorphic interface for operators. More...

#include <BelosOperator.hpp>

Inheritance diagram for Belos::Operator< ScalarType >:
Inheritance graph
[legend]

Public Member Functions

Constructor/Destructor
 Operator ()
 Default constructor (does nothing). More...
 
virtual ~Operator ()
 Virtual destructor, for memory safety of derived classes. More...
 
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. More...
 
virtual bool HasApplyTranspose () const
 Whether this operator implements applying the transpose. More...
 

Detailed Description

template<class ScalarType>
class Belos::Operator< ScalarType >

Alternative run-time polymorphic interface for operators.

Author
Michael Heroux and Heidi Thornquist

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 $AX = B$, any left or right preconditioners. 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 80 of file BelosOperator.hpp.

Constructor & Destructor Documentation

template<class ScalarType>
Belos::Operator< ScalarType >::Operator ( )
inline

Default constructor (does nothing).

Definition at line 86 of file BelosOperator.hpp.

template<class ScalarType>
virtual Belos::Operator< ScalarType >::~Operator ( )
inlinevirtual

Virtual destructor, for memory safety of derived classes.

Definition at line 89 of file BelosOperator.hpp.

Member Function Documentation

template<class ScalarType>
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.

Parameters
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.

Implemented in Belos::GmresPolyOp< ScalarType, MV, OP >.

template<class ScalarType>
virtual bool Belos::Operator< ScalarType >::HasApplyTranspose ( ) const
inlinevirtual

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 141 of file BelosOperator.hpp.


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

Generated on Tue Apr 16 2024 09:25:06 for Belos by doxygen 1.8.5