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
84 TEUCHOS_TEST_FOR_EXCEPTION
86 Teuchos::typeName (*
this) <<
"::apply(X,Y): X and Y must have the same number of vectors.");
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_;
126 Allocate(
int numVecs)
const {
127 X_ = rcp(
new MV(
op_->getDomainMap(),numVecs));
128 Y_ = rcp(
new MV(
op_->getRangeMap(),numVecs));
140 template <
class Scalar,
146 MixedScalarMultiplyOp<Scalar, OpScalar, LocalOrdinal, GlobalOrdinal, Node> >
151 GlobalOrdinal, Node> op_type;
152 return Teuchos::rcp (
new op_type (A));
157 #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.