Tpetra Matrix/Vector Services Version of the Day
Protected Attributes
Tpetra::details::ApplyOp< Scalar, OperatorType > Class Template Reference

A class for wrapping an Operator apply in a Operator. More...

#include <Tpetra_ApplyOp.hpp>

Inheritance diagram for Tpetra::details::ApplyOp< Scalar, OperatorType >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef OperatorType::scalar_type scalar_type
 The type of the entries of the input OperatorType.
typedef
OperatorType::local_ordinal_type 
local_ordinal_type
 The type of local indices in the input OperatorType.
typedef
OperatorType::global_ordinal_type 
global_ordinal_type
 The type of global indices in the input OperatorType.
typedef OperatorType::node_type node_type
 The type of the Kokkos Node used by the input OperatorType.
typedef Teuchos::ScalarTraits
< scalar_type >::magnitudeType 
magnitude_type
 The type of the magnitude (absolute value) of a matrix entry.

Public Member Functions

Constructor and destructor
 ApplyOp (const Teuchos::RCP< const OperatorType > &op)
 Constructor.
virtual ~ApplyOp ()
 Destructor.
Methods implementing Operator
void apply (const Tpetra::MultiVector< Scalar, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< Scalar, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
 Compute Y = beta*Y + alpha*Op(A)*X, where Op(A) is either A, $A^T$, or $A^H$.
bool hasTransposeApply () const
 Whether this Operator's apply() method can apply the transpose or conjugate transpose.
Teuchos::RCP< const
Tpetra::Map
< local_ordinal_type,
global_ordinal_type, node_type > > 
getDomainMap () const
 The domain Map of this Operator.
Teuchos::RCP< const
Tpetra::Map
< local_ordinal_type,
global_ordinal_type, node_type > > 
getRangeMap () const
 The range Map of this Operator.

Protected Attributes

Teuchos::RCP< const OperatorType > operator_
 The underlying Operator object.

Detailed Description

template<class Scalar, class OperatorType>
class Tpetra::details::ApplyOp< Scalar, OperatorType >

A class for wrapping an Operator apply in a Operator.

Note:
Most Tpetra users do not need to use this class. It will be useful to Tpetra users who want to do mixed-precision operator apply, where the operator's data has a different precision than that of the input and output vectors. If your operator and vectors have the same type of entries, then you don't need to use this class.

This class makes a Operator<OpScalar, ...> "look like" an Operator<Scalar, ...>, where OpScalar and Scalar may be different types. It does so by working around a limitation of C++, namely that template methods of a class can't be virtual.

Template Parameters:
ScalarThe type of the entries of the input and output MultiVector of the apply() method. Same as the first template parameter of Operator.
OperatorTypeThe type of the underlying Operator, whose first template parameter OperatorType::scalar_type may be different than this Operator's Scalar type.

Definition at line 78 of file Tpetra_ApplyOp.hpp.


Member Typedef Documentation

template<class Scalar , class OperatorType >
typedef OperatorType::scalar_type Tpetra::details::ApplyOp< Scalar, OperatorType >::scalar_type

The type of the entries of the input OperatorType.

Reimplemented from Tpetra::Operator< Scalar, OperatorType::local_ordinal_type, OperatorType::global_ordinal_type, OperatorType::node_type >.

Definition at line 88 of file Tpetra_ApplyOp.hpp.

template<class Scalar , class OperatorType >
typedef OperatorType::local_ordinal_type Tpetra::details::ApplyOp< Scalar, OperatorType >::local_ordinal_type

The type of local indices in the input OperatorType.

Reimplemented from Tpetra::Operator< Scalar, OperatorType::local_ordinal_type, OperatorType::global_ordinal_type, OperatorType::node_type >.

Definition at line 91 of file Tpetra_ApplyOp.hpp.

template<class Scalar , class OperatorType >
typedef OperatorType::global_ordinal_type Tpetra::details::ApplyOp< Scalar, OperatorType >::global_ordinal_type

The type of global indices in the input OperatorType.

Reimplemented from Tpetra::Operator< Scalar, OperatorType::local_ordinal_type, OperatorType::global_ordinal_type, OperatorType::node_type >.

Definition at line 94 of file Tpetra_ApplyOp.hpp.

template<class Scalar , class OperatorType >
typedef OperatorType::node_type Tpetra::details::ApplyOp< Scalar, OperatorType >::node_type

The type of the Kokkos Node used by the input OperatorType.

Reimplemented from Tpetra::Operator< Scalar, OperatorType::local_ordinal_type, OperatorType::global_ordinal_type, OperatorType::node_type >.

Definition at line 97 of file Tpetra_ApplyOp.hpp.

template<class Scalar , class OperatorType >
typedef Teuchos::ScalarTraits<scalar_type>::magnitudeType Tpetra::details::ApplyOp< Scalar, OperatorType >::magnitude_type

The type of the magnitude (absolute value) of a matrix entry.

Definition at line 100 of file Tpetra_ApplyOp.hpp.


Constructor & Destructor Documentation

template<class Scalar , class OperatorType >
Tpetra::details::ApplyOp< Scalar, OperatorType >::ApplyOp ( const Teuchos::RCP< const OperatorType > &  op) [inline]

Constructor.

Parameters:
A[in] The Operator to wrap with a different Scalar type.

Definition at line 109 of file Tpetra_ApplyOp.hpp.

template<class Scalar , class OperatorType >
virtual Tpetra::details::ApplyOp< Scalar, OperatorType >::~ApplyOp ( ) [inline, virtual]

Destructor.

Definition at line 113 of file Tpetra_ApplyOp.hpp.


Member Function Documentation

template<class Scalar , class OperatorType >
void Tpetra::details::ApplyOp< Scalar, OperatorType >::apply ( const Tpetra::MultiVector< Scalar, local_ordinal_type, global_ordinal_type, node_type > &  X,
Tpetra::MultiVector< Scalar, local_ordinal_type, global_ordinal_type, node_type > &  Y,
Teuchos::ETransp  mode = Teuchos::NO_TRANS,
Scalar  alpha = Teuchos::ScalarTraits<Scalar>::one(),
Scalar  beta = Teuchos::ScalarTraits<Scalar>::zero() 
) const [inline, virtual]

Compute Y = beta*Y + alpha*Op(A)*X, where Op(A) is either A, $A^T$, or $A^H$.

This method calls the underlying Operator object's applyTempl<Scalar,Scalar>() method.

Implements Tpetra::Operator< Scalar, OperatorType::local_ordinal_type, OperatorType::global_ordinal_type, OperatorType::node_type >.

Definition at line 125 of file Tpetra_ApplyOp.hpp.

template<class Scalar , class OperatorType >
bool Tpetra::details::ApplyOp< Scalar, OperatorType >::hasTransposeApply ( ) const [inline, virtual]

Whether this Operator's apply() method can apply the transpose or conjugate transpose.

This depends on whether it is true for the Operator that this object wraps.

Reimplemented from Tpetra::Operator< Scalar, OperatorType::local_ordinal_type, OperatorType::global_ordinal_type, OperatorType::node_type >.

Definition at line 140 of file Tpetra_ApplyOp.hpp.

template<class Scalar , class OperatorType >
Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> > Tpetra::details::ApplyOp< Scalar, OperatorType >::getDomainMap ( ) const [inline, virtual]
template<class Scalar , class OperatorType >
Teuchos::RCP<const Tpetra::Map<local_ordinal_type,global_ordinal_type,node_type> > Tpetra::details::ApplyOp< Scalar, OperatorType >::getRangeMap ( ) const [inline, virtual]

Member Data Documentation

template<class Scalar , class OperatorType >
Teuchos::RCP<const OperatorType> Tpetra::details::ApplyOp< Scalar, OperatorType >::operator_ [protected]

The underlying Operator object.

Definition at line 159 of file Tpetra_ApplyOp.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines