10 #ifndef TPETRA_MIXEDSCALARMULTIPLYOP_HPP
11 #define TPETRA_MIXEDSCALARMULTIPLYOP_HPP
18 #include "Tpetra_Operator.hpp"
39 template <
class Scalar,
77 Teuchos::ETransp mode = Teuchos::NO_TRANS,
78 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
79 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const override {
81 Teuchos::typeName(*
this) <<
"::apply(X,Y): X and Y must have the same number of vectors.");
88 op_->apply(*X_, *Y_, mode, Teuchos::as<OpScalar>(alpha), Teuchos::as<OpScalar>(beta));
103 return op_->getDomainMap();
108 return op_->getRangeMap();
117 const Teuchos::RCP<const op_type>
op_;
118 mutable Teuchos::RCP<MV> X_, Y_;
121 Allocate(
int numVecs)
const {
122 X_ = rcp(
new MV(
op_->getDomainMap(), numVecs));
123 Y_ = rcp(
new MV(
op_->getRangeMap(), numVecs));
134 template <
class Scalar,
140 MixedScalarMultiplyOp<Scalar, OpScalar, LocalOrdinal, GlobalOrdinal, Node> >
146 return Teuchos::rcp(
new op_type(A));
151 #endif // TPETRA_MIXEDSCALARMULTIPLYOP_HPP
const Teuchos::RCP< const op_type > op_
The underlying CrsMatrix object.
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 .
Declaration of Tpetra::Details::Profiling, a scope guard for Kokkos Profiling.
size_t getNumVectors() const
Number of columns in the multivector.
A class for wrapping an Operator of one Scalar type into an Operator of another Scalar type...
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.
~MixedScalarMultiplyOp() override=default
Destructor (virtual for memory safety of derived classes).
Abstract interface for operators (e.g., matrices and preconditioners).
Teuchos::RCP< const map_type > getRangeMap() const override
The range Map of this Operator.
MixedScalarMultiplyOp(const Teuchos::RCP< const op_type > &A)
Constructor.
Teuchos::RCP< const map_type > getDomainMap() const override
The domain Map of this Operator.
A parallel distribution of indices over processes.
Stand-alone utility functions and macros.
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.
bool hasTransposeApply() const override
Whether this Operator's apply() method can apply the transpose or conjugate transpose.
Declaration of Tpetra::Details::Behavior, a class that describes Tpetra's behavior.