42 #ifndef TPETRA_MIXEDSCALARMULTIPLYOP_HPP
43 #define TPETRA_MIXEDSCALARMULTIPLYOP_HPP
50 #include "Tpetra_Operator.hpp"
71 template <
class Scalar,
77 public Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node>
112 Teuchos::ETransp mode = Teuchos::NO_TRANS,
113 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one (),
114 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero ())
const override
116 TEUCHOS_TEST_FOR_EXCEPTION
118 Teuchos::typeName (*
this) <<
"::apply(X,Y): X and Y must have the same number of vectors.");
125 op_->apply (*X_, *Y_, mode, Teuchos::as<OpScalar>(alpha), Teuchos::as<OpScalar>(beta));
140 return op_->getDomainMap ();
145 return op_->getRangeMap ();
154 const Teuchos::RCP<const op_type>
op_;
155 mutable Teuchos::RCP<MV> X_, Y_;
158 Allocate(
int numVecs)
const {
159 X_ = rcp(
new MV(
op_->getDomainMap(),numVecs));
160 Y_ = rcp(
new MV(
op_->getRangeMap(),numVecs));
172 template <
class Scalar,
178 MixedScalarMultiplyOp<Scalar, OpScalar, LocalOrdinal, GlobalOrdinal, Node> >
184 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.
A parallel distribution of indices over processes.
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 .
Teuchos::RCP< const map_type > getRangeMap() const override
The range Map of this Operator.
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.
One or more distributed dense vectors.
size_t getNumVectors() const
Number of columns in the multivector.
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.