46 #ifndef XPETRA_TPETRAVECTOR_DECL_HPP
47 #define XPETRA_TPETRAVECTOR_DECL_HPP
55 #include "Xpetra_TpetraMultiVector.hpp"
62 #include "Tpetra_Vector.hpp"
67 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
68 RCP<Tpetra::Vector<Scalar,LocalOrdinal, GlobalOrdinal, Node> >
toTpetra(Vector<Scalar,LocalOrdinal, GlobalOrdinal, Node> &);
70 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
71 RCP<Tpetra::Vector<Scalar,LocalOrdinal, GlobalOrdinal, Node> >
toTpetra(
const Vector<Scalar,LocalOrdinal, GlobalOrdinal, Node> &);
73 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
74 RCP<const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node > >
toXpetra(RCP<
const Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > vec);
76 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
77 RCP<Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node > >
toXpetra(RCP<Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > vec);
82 template <class Scalar = Vector<>::scalar_type,
83 class LocalOrdinal =
typename Vector<Scalar>::local_ordinal_type,
84 class GlobalOrdinal =
typename Vector<Scalar, LocalOrdinal>::global_ordinal_type,
85 class Node =
typename Vector<Scalar, LocalOrdinal, GlobalOrdinal>::node_type>
87 :
public virtual Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node>,
88 public TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>
90 #undef XPETRA_TPETRAMULTIVECTOR_SHORT
95 using TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::dot;
96 using TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm1;
97 using TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm2;
98 using TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::normInf;
99 using TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::meanValue;
100 using TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceGlobalValue;
101 using TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoGlobalValue;
102 using TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::replaceLocalValue;
103 using TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::sumIntoLocalValue;
165 Scalar
dot(
const Vector &a)
const;
178 RCP<Tpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
getTpetra_Vector()
const;
180 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
184 typename dual_view_type::t_host_um getHostLocalView ()
const;
186 typename dual_view_type::t_dev_um getDeviceLocalView()
const;
198 template<
class TargetDeviceType>
199 typename Kokkos::Impl::if_c<
200 Kokkos::Impl::is_same<
201 typename dual_view_type::t_dev_um::execution_space::memory_space,
202 typename TargetDeviceType::memory_space>::value,
203 typename dual_view_type::t_dev_um,
204 typename dual_view_type::t_host_um>::type
205 getLocalView ()
const;
214 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
218 return tX.getTpetra_Vector();
221 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
225 return tX.getTpetra_Vector();
228 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
233 return Teuchos::null;
236 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
239 return toXpetra(Teuchos::rcp_const_cast<Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node > > (vec));
244 #define XPETRA_TPETRAVECTOR_SHORT
245 #endif // XPETRA_TPETRAVECTOR_DECL_HPP
virtual ~TpetraVector()
Destructor.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of this Vector.
void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Adds specified value to existing value at the specified location.
Teuchos::ScalarTraits< Scalar >::magnitudeType normWeighted(const Vector &weights) const
Compute Weighted 2-norm (RMS Norm) of this Vector.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Scalar dot(const Vector &a) const
Computes dot product of this Vector against input Vector x.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Return 1-norm of this Vector.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
static const EVerbosityLevel verbLevel_default
void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)
Replace current value at the specified location with specified values.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
RCP< Tpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_Vector() const
Get the underlying Tpetra multivector.
Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm of this Vector.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)
Adds specified value to existing value at the specified location.
std::string description() const
Return a simple one-line description of this object.
TpetraVector(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
Sets all vector entries to zero.
void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)
Replace current value at the specified location with specified value.
Scalar meanValue() const
Compute mean (average) value of this Vector.