Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members
Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > Class Template Referenceabstract

Abstract interface for operators (e.g., matrices and preconditioners). More...

#include <Tpetra_Operator.hpp>

Inheritance diagram for Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >:
Inheritance graph
[legend]

Public Types

Typedefs that give access to the template parameters.
typedef Scalar scalar_type
 The type of the entries of the input and output multivectors. More...
 
typedef LocalOrdinal local_ordinal_type
 The local index type. More...
 
typedef GlobalOrdinal global_ordinal_type
 The global index type. More...
 
typedef Node node_type
 The Kokkos Node type. More...
 

Public Member Functions

Pure virtual functions to be overridden by subclasses.
virtual Teuchos::RCP< const
Map< LocalOrdinal,
GlobalOrdinal, Node > > 
getDomainMap () const =0
 The Map associated with the domain of this operator, which must be compatible with X.getMap(). More...
 
virtual Teuchos::RCP< const
Map< LocalOrdinal,
GlobalOrdinal, Node > > 
getRangeMap () const =0
 The Map associated with the range of this operator, which must be compatible with Y.getMap(). More...
 
virtual void apply (const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const =0
 Computes the operator-multivector application. More...
 
virtual bool hasTransposeApply () const
 Whether this operator supports applying the transpose or conjugate transpose. More...
 
virtual bool hasDiagonal () const
 Whether this operator can return its diagonal. More...
 
virtual void getLocalDiagCopy (Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
 Get the diagonal of the operator. More...
 

Detailed Description

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
class Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >

Abstract interface for operators (e.g., matrices and preconditioners).

Template Parameters
ScalarThe type of the entries of the input and output MultiVector objects. See the documentation of MultiVector for details and requirements.
LocalOrdinalThe type of local indices. See the documentation of Map for requirements.
GlobalOrdinalThe type of global indices. See the documentation of Map for requirements.
NodeThe Kokkos Node type. See the documentation of Map for requirements.

An Operator takes a MultiVector as input, and fills a given output MultiVector with the result. The input and output MultiVector objects must have the same number of columns (vectors). However, they need not have the same numbers of rows or the same parallel distributions. The domain of the Operator describes the parallel distribution of valid input MultiVector objects, and the range of the Operator describes the parallel distribution of valid output MultiVector objects.

Operator is just an interface, not an implementation. Many different classes implement this interface, including sparse matrices, direct solvers, iterative solvers, and preconditioners.

Definition at line 87 of file Tpetra_Operator.hpp.

Member Typedef Documentation

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Scalar Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::scalar_type

The type of the entries of the input and output multivectors.

Definition at line 93 of file Tpetra_Operator.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef LocalOrdinal Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_ordinal_type

The local index type.

Definition at line 96 of file Tpetra_Operator.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef GlobalOrdinal Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::global_ordinal_type

The global index type.

Definition at line 99 of file Tpetra_Operator.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
typedef Node Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::node_type

The Kokkos Node type.

Definition at line 102 of file Tpetra_Operator.hpp.

Member Function Documentation

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getDomainMap ( ) const
pure virtual
template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getRangeMap ( ) const
pure virtual
template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
virtual void Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::apply ( const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  X,
MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  Y,
Teuchos::ETransp  mode = Teuchos::NO_TRANS,
Scalar  alpha = Teuchos::ScalarTraits< Scalar >::one(),
Scalar  beta = Teuchos::ScalarTraits< Scalar >::zero() 
) const
pure virtual

Computes the operator-multivector application.

Loosely, performs $Y = \alpha \cdot A^{\textrm{mode}} \cdot X + \beta \cdot Y$. However, the details of operation vary according to the values of alpha and beta. Specifically

  • if beta == 0, apply() must overwrite Y, so that any values in Y (including NaNs) are ignored.
  • if alpha == 0, apply() may short-circuit the operator, so that any values in X (including NaNs) are ignored.

Implemented in Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >, Tpetra::CrsMatrixMultiplyOp< Scalar, MatScalar, LocalOrdinal, GlobalOrdinal, Node >, Tpetra::details::ApplyOp< Scalar, OperatorType >, and Tpetra::MixedScalarMultiplyOp< Scalar, OpScalar, LocalOrdinal, GlobalOrdinal, Node >.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
bool Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::hasTransposeApply ( ) const
virtual

Whether this operator supports applying the transpose or conjugate transpose.

By default, this returns false. Subclasses must override this method if they can support apply() with mode=Teuchos::TRANS or mode=Teuchos::CONJ_TRANS.

Reimplemented in Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >, Tpetra::BlockCrsMatrix< Scalar, LO, GO, Node >, Tpetra::CrsMatrixMultiplyOp< Scalar, MatScalar, LocalOrdinal, GlobalOrdinal, Node >, Tpetra::details::ApplyOp< Scalar, OperatorType >, and Tpetra::MixedScalarMultiplyOp< Scalar, OpScalar, LocalOrdinal, GlobalOrdinal, Node >.

Definition at line 151 of file Tpetra_Operator.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
bool Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::hasDiagonal ( ) const
virtual

Whether this operator can return its diagonal.

By default, this returns false. Subclasses must override this method if they can supply a diagonal.

Definition at line 156 of file Tpetra_Operator.hpp.

template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
void Tpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node >::getLocalDiagCopy ( Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &  diag) const
virtual

Get the diagonal of the operator.

By default, this throws. Subclasses must override this method if they can supply a diagonal.

Reimplemented in Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >, Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >, and Tpetra::RowMatrix< Scalar, LO, GO, Node >.

Definition at line 161 of file Tpetra_Operator.hpp.


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