Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_Vector.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Xpetra: A linear algebra interface package
4//
5// Copyright 2012 NTESS and the Xpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef XPETRA_VECTOR_HPP
11#define XPETRA_VECTOR_HPP
12
13/* this file is automatically generated - do not edit (see script/interfaces.py) */
14
15#include "Xpetra_ConfigDefs.hpp"
16#include "Xpetra_MultiVector.hpp"
17
18namespace Xpetra {
19
20template <class Scalar,
21 class LocalOrdinal,
22 class GlobalOrdinal,
23 class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
24class Vector
25 : public virtual MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
26 public:
27 using scalar_type = Scalar;
28 using local_ordinal_type = LocalOrdinal;
29 using global_ordinal_type = GlobalOrdinal;
30 using node_type = Node;
31
32 using MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::dot; // overloading, not hiding
33 using MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::norm1; // overloading, not hiding
34 using MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::norm2; // overloading, not hiding
35 using MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::normInf; // overloading, not hiding
36 using MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::meanValue; // overloading, not hiding
37 using MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::replaceGlobalValue; // overloading, not hiding
38 using MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::sumIntoGlobalValue; // overloading, not hiding
39 using MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::replaceLocalValue; // overloading, not hiding
40 using MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::sumIntoLocalValue; // overloading, not hiding
41
43
44 template <class TargetDeviceType, class AccessType>
45 typename std::conditional<
46 std::is_same<
47 typename dual_view_type::t_dev_um::execution_space::memory_space,
48 typename TargetDeviceType::memory_space>::value,
49 typename dual_view_type::t_dev_um,
50 typename dual_view_type::t_host_um>::type
51 getLocalView(AccessType access_type) const {
52 return this->MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>::template getLocalView<TargetDeviceType>(access_type);
53 }
54
56
57
59 virtual ~Vector() {}
60
62
64
65
67 virtual void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value) = 0;
68
70 virtual void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value) = 0;
71
73 virtual void replaceLocalValue(LocalOrdinal myRow, const Scalar &value) = 0;
74
76 virtual void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value) = 0;
77
79
81
82
84 virtual Scalar dot(const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &a) const = 0;
85
88
91
94
96 virtual Scalar meanValue() const = 0;
97
99
101
102
104 virtual std::string description() const = 0;
105
108
110
111}; // Vector class
112} // namespace Xpetra
113
114#define XPETRA_VECTOR_SHORT
115#endif // XPETRA_VECTOR_HPP
static const EVerbosityLevel verbLevel_default
Kokkos::DualView< impl_scalar_type **, Kokkos::LayoutStride, typename node_type::device_type, Kokkos::MemoryUnmanaged > dual_view_type
virtual Scalar dot(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &a) const =0
Computes dot product of this Vector against input Vector x.
std::conditional< std::is_same< typenamedual_view_type::t_dev_um::execution_space::memory_space, typenameTargetDeviceType::memory_space >::value, typenamedual_view_type::t_dev_um, typenamedual_view_type::t_host_um >::type getLocalView(AccessType access_type) const
virtual ~Vector()
Destructor.
virtual void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value)=0
Adds specified value to existing value at the specified location.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const =0
Return 1-norm of this Vector.
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node >::dual_view_type dual_view_type
virtual void replaceLocalValue(LocalOrdinal myRow, const Scalar &value)=0
Replace current value at the specified location with specified values.
virtual std::string description() const =0
Return a simple one-line description of this object.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const =0
Print the object with some verbosity level to an FancyOStream object.
virtual Scalar meanValue() const =0
Compute mean (average) value of this Vector.
virtual void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value)=0
Replace current value at the specified location with specified value.
GlobalOrdinal global_ordinal_type
virtual void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value)=0
Adds specified value to existing value at the specified location.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const =0
Compute Inf-norm of this Vector.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const =0
Compute 2-norm of this Vector.
LocalOrdinal local_ordinal_type