42 #ifndef THYRA_TPETRA_EUCLIDEAN_SCALAR_PROD_DEF_HPP
43 #define THYRA_TPETRA_EUCLIDEAN_SCALAR_PROD_DEF_HPP
45 #include "Thyra_TpetraEuclideanScalarProd_decl.hpp"
46 #include "Thyra_TpetraMultiVector.hpp"
47 #include "Thyra_TpetraVector.hpp"
53 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
60 typedef Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> TMV;
71 X_tpetra->dot(*Y_tpetra, scalarProds_out);
75 Teuchos::rcp_const_cast<TMV>(X_tpetra)->sync_host ();
77 Teuchos::rcp_const_cast<TMV>(Y_tpetra)->sync_host ();
84 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
89 using Teuchos::rcp_dynamic_cast;
95 return tmv->getConstTpetraMultiVector();
98 RCP<const TV> tv = rcp_dynamic_cast<
const TV>(mv);
100 return tv->getConstTpetraVector();
103 return Teuchos::null;
110 #endif // THYRA_EUCLIDEAN_SCALAR_PROD_DEF_HPP
Concrete implementation of Thyra::MultiVector in terms of Tpetra::MultiVector.
virtual void scalarProdsImpl(const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds) const
Simply calls dots(X,Y,scalar_prods).
Interface for a collection of column vectors called a multi-vector.
Concrete Thyra::SpmdVectorBase using Tpetra::Vector.
bool nonnull(const boost::shared_ptr< T > &p)
virtual void scalarProdsImpl(const MultiVectorBase< Scalar > &X, const MultiVectorBase< Scalar > &Y, const ArrayView< Scalar > &scalarProds) const
If X and Y are both Tpetra wrappers, computes the pair-wise scalar products directly with Tpetra call...
Extends concrete implementation of a Euclidean scalar product for specifically Tpetra vectors/multive...