10#ifndef TPETRA_MIXEDSCALARMULTIPLYOP_HPP
11#define TPETRA_MIXEDSCALARMULTIPLYOP_HPP
18#include "Tpetra_Operator.hpp"
39 template <
class Scalar,
45 public Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node>
80 Teuchos::ETransp
mode = Teuchos::NO_TRANS,
81 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one (),
82 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero ())
const override
85 (
X.getNumVectors () !=
Y.getNumVectors (), std::runtime_error,
86 Teuchos::typeName (*
this) <<
"::apply(X,Y): X and Y must have the same number of vectors.");
88 if (
X.getNumVectors() != X_->getNumVectors()) {
89 Allocate(
X.getNumVectors());
93 op_->apply (*X_, *Y_,
mode, Teuchos::as<OpScalar>(
alpha), Teuchos::as<OpScalar>(
beta));
108 return op_->getDomainMap ();
113 return op_->getRangeMap ();
122 const Teuchos::RCP<const op_type>
op_;
123 mutable Teuchos::RCP<MV> X_, Y_;
140 template <
class Scalar,
146 MixedScalarMultiplyOp<Scalar, OpScalar, LocalOrdinal, GlobalOrdinal, Node> >
152 return Teuchos::rcp (
new op_type (
A));
Declaration of Tpetra::Details::Behavior, a class that describes Tpetra's behavior.
Declaration of Tpetra::Details::Profiling, a scope guard for Kokkos Profiling.
Stand-alone utility functions and macros.
Struct that holds views of the contents of a CrsMatrix.
A class for wrapping an Operator of one Scalar type into an Operator of another Scalar type.
Teuchos::RCP< const map_type > getDomainMap() const override
The domain Map of this Operator.
const Teuchos::RCP< const op_type > op_
The underlying CrsMatrix object.
Teuchos::RCP< MixedScalarMultiplyOp< Scalar, OpScalar, LocalOrdinal, GlobalOrdinal, Node > > createMixedScalarMultiplyOp(const Teuchos::RCP< const Operator< OpScalar, LocalOrdinal, GlobalOrdinal, Node > > &A)
Non-member function to create a MixedScalarMultiplyOp.
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 override
Compute Y = beta*Y + alpha*Op(A)*X, where Op(A) is either A, , or .
MixedScalarMultiplyOp(const Teuchos::RCP< const op_type > &A)
Constructor.
~MixedScalarMultiplyOp() override=default
Destructor (virtual for memory safety of derived classes).
bool hasTransposeApply() const override
Whether this Operator's apply() method can apply the transpose or conjugate transpose.
Teuchos::RCP< const map_type > getRangeMap() const override
The range Map of this Operator.
Abstract interface for operators (e.g., matrices and preconditioners).
Namespace Tpetra contains the class and methods constituting the Tpetra library.
void deep_copy(MultiVector< DS, DL, DG, DN > &dst, const MultiVector< SS, SL, SG, SN > &src)
Copy the contents of the MultiVector src into dst.