Tpetra parallel linear algebra
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Tpetra_ApplyOp.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Tpetra: Templated Linear Algebra Services Package
4
//
5
// Copyright 2008 NTESS and the Tpetra contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef TPETRA_APPLYOP_HPP
11
#define TPETRA_APPLYOP_HPP
12
13
#include "Tpetra_ConfigDefs.hpp"
14
#include "Tpetra_Operator.hpp"
15
#include "Tpetra_MultiVector.hpp"
16
19
20
namespace
Tpetra
{
21
namespace
details {
22
45
template
<
class
Scalar,
class
OperatorType>
46
class
ApplyOp
:
public
Tpetra::Operator
<Scalar,
47
typename OperatorType::local_ordinal_type,
48
typename OperatorType::global_ordinal_type,
49
typename OperatorType::node_type> {
50
public
:
51
// \name Typedefs
53
55
typedef
typename
OperatorType::scalar_type
scalar_type
;
56
58
typedef
typename
OperatorType::local_ordinal_type
local_ordinal_type
;
59
61
typedef
typename
OperatorType::global_ordinal_type
global_ordinal_type
;
62
64
typedef
typename
OperatorType::node_type
node_type
;
65
67
69
73
ApplyOp
(
const
Teuchos::RCP<const OperatorType>& op)
74
:
operator_
(op) {}
75
77
virtual
~ApplyOp
() {}
78
80
82
88
void
89
apply
(
const
Tpetra::MultiVector<Scalar, local_ordinal_type, global_ordinal_type, node_type>
& X,
90
Tpetra::MultiVector<Scalar, local_ordinal_type, global_ordinal_type, node_type>
& Y,
91
Teuchos::ETransp mode = Teuchos::NO_TRANS,
92
Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
93
Scalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const
{
94
operator_
->template applyTempl<Scalar, Scalar>(X, Y, mode, alpha, beta);
95
}
96
102
bool
hasTransposeApply
()
const
{
103
return
operator_
->hasTransposeApply();
104
}
105
107
Teuchos::RCP<const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> >
108
getDomainMap
()
const
{
109
return
operator_
->getDomainMap();
110
}
111
113
Teuchos::RCP<const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> >
114
getRangeMap
()
const
{
115
return
operator_
->getRangeMap();
116
}
117
118
119
protected
:
121
Teuchos::RCP<const OperatorType>
operator_
;
122
};
123
124
}
// end of namespace details
125
}
// end of namespace Tpetra
126
127
#endif
// TPETRA_APPLYOP_HPP
Tpetra::MultiVector
One or more distributed dense vectors.
Definition
Tpetra_MultiVector_decl.hpp:350
Tpetra::Operator
Abstract interface for operators (e.g., matrices and preconditioners).
Definition
Tpetra_Operator.hpp:55
Tpetra::details::ApplyOp::~ApplyOp
virtual ~ApplyOp()
Destructor.
Definition
Tpetra_ApplyOp.hpp:77
Tpetra::details::ApplyOp::ApplyOp
ApplyOp(const Teuchos::RCP< const OperatorType > &op)
Constructor.
Definition
Tpetra_ApplyOp.hpp:73
Tpetra::details::ApplyOp::global_ordinal_type
OperatorType::global_ordinal_type global_ordinal_type
The type of global indices in the input OperatorType.
Definition
Tpetra_ApplyOp.hpp:61
Tpetra::details::ApplyOp::operator_
Teuchos::RCP< const OperatorType > operator_
The underlying Operator object.
Definition
Tpetra_ApplyOp.hpp:121
Tpetra::details::ApplyOp::scalar_type
OperatorType::scalar_type scalar_type
The type of the entries of the input OperatorType.
Definition
Tpetra_ApplyOp.hpp:55
Tpetra::details::ApplyOp::local_ordinal_type
OperatorType::local_ordinal_type local_ordinal_type
The type of local indices in the input OperatorType.
Definition
Tpetra_ApplyOp.hpp:58
Tpetra::details::ApplyOp::apply
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, , or .
Definition
Tpetra_ApplyOp.hpp:89
Tpetra::details::ApplyOp::getDomainMap
Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getDomainMap() const
The domain Map of this Operator.
Definition
Tpetra_ApplyOp.hpp:108
Tpetra::details::ApplyOp::getRangeMap
Teuchos::RCP< const Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > > getRangeMap() const
The range Map of this Operator.
Definition
Tpetra_ApplyOp.hpp:114
Tpetra::details::ApplyOp::hasTransposeApply
bool hasTransposeApply() const
Whether this Operator's apply() method can apply the transpose or conjugate transpose.
Definition
Tpetra_ApplyOp.hpp:102
Tpetra::details::ApplyOp::node_type
OperatorType::node_type node_type
The type of the Kokkos Node used by the input OperatorType.
Definition
Tpetra_ApplyOp.hpp:64
Tpetra
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Generated by
1.17.0