Go to the documentation of this file.
10 #ifndef vtk_m_VecFromPortal_h
11 #define vtk_m_VecFromPortal_h
28 template <
typename PortalType>
32 using ComponentType =
typename std::remove_const<typename PortalType::ValueType>::type;
46 template <
typename T, vtkm::IdComponent DestSize>
56 template <vtkm::IdComponent N>
72 return vtkm::internal::ArrayPortalValueReference<PortalType>(this->
Portal,
77 template <
typename OtherVecType>
80 vtkm::IdComponent numComponents = vtkm::Min(src.GetNumberOfComponents(), this->NumComponents);
89 template <
typename OtherVecType>
92 vtkm::IdComponent numComponents = vtkm::Min(other.GetNumberOfComponents(), this->NumComponents);
95 (*this)[index] += other[index];
101 template <
typename OtherVecType>
104 vtkm::IdComponent numComponents = vtkm::Min(other.GetNumberOfComponents(), this->NumComponents);
107 (*this)[index] -= other[index];
113 template <
typename OtherVecType>
116 vtkm::IdComponent numComponents = vtkm::Min(other.GetNumberOfComponents(), this->NumComponents);
119 (*this)[index] *= other[index];
123 template <
typename ScalarType>
128 (*this)[index] *= other;
134 template <
typename OtherVecType>
142 template <
typename OtherVecType>
145 vtkm::IdComponent numComponents = vtkm::Min(other.GetNumberOfComponents(), this->NumComponents);
148 (*this)[index] /= other[index];
154 template <
typename OtherVecType>
163 if (this->
Portal.Get(index + this->Offset) != other[index])
172 template <
typename OtherVecType>
175 return !(*
this == other);
187 template <
typename PortalType>
205 template <
typename PortalType>
226 return vector[componentIndex];
235 vector[componentIndex] = value;
239 template <vtkm::IdComponent destSize>
248 #endif //vtk_m_VecFromPortal_h
VecFromPortal(const PortalType &portal, vtkm::IdComponent numComponents=0, vtkm::Id offset=0)
Definition: VecFromPortal.h:36
A tag for vectors that are "true" vectors (i.e.
Definition: VecTraits.h:23
Groups connected points that have the same field value.
Definition: Atomic.h:19
The TypeTraits class provides helpful compile-time information about the basic types used in VTKm (an...
Definition: TypeTraits.h:61
VecFromPortal & operator*=(const OtherVecType &other)
Definition: VecFromPortal.h:135
bool operator==(const OtherVecType &other)
Definition: VecFromPortal.h:155
#define VTKM_EXEC_CONT
Definition: ExportMacros.h:52
static void SetComponent(const VecType &vector, vtkm::IdComponent componentIndex, const ComponentType &value)
Definition: VecFromPortal.h:231
vtkm::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:194
VecFromPortal & operator=(const OtherVecType &src)
Definition: VecFromPortal.h:78
vtkm::Id Offset
Definition: VecFromPortal.h:184
VecFromPortal & operator+=(const OtherVecType &other)
Definition: VecFromPortal.h:90
PortalType Portal
Definition: VecFromPortal.h:182
VecFromPortal & operator/=(const OtherVecType &other)
Definition: VecFromPortal.h:143
void Multiply(const OtherVecType &other, vtkm::TypeTraitsVectorTag)
Definition: VecFromPortal.h:114
static vtkm::VecFromPortal< PortalType > ZeroInitialization()
Definition: VecFromPortal.h:199
static void CopyInto(const VecType &src, vtkm::Vec< ComponentType, destSize > &dest)
Definition: VecFromPortal.h:240
T BaseComponentType
Base component type in the vector.
Definition: VecTraits.h:78
void Multiply(ScalarType other, vtkm::TypeTraitsScalarTag)
Definition: VecFromPortal.h:124
vtkm::IdComponent GetNumberOfComponents() const
Definition: VecFromPortal.h:44
vtkm::Id GetOffset() const
Definition: VecFromPortal.h:179
void CopyInto(vtkm::Vec< T, DestSize > &dest) const
Definition: VecFromPortal.h:47
typename PortalType::ValueType ComponentType
Definition: VecFromPortal.h:191
vtkm::IdComponent NumComponents
Definition: VecFromPortal.h:183
static vtkm::IdComponent GetNumberOfComponents(const VecType &vector)
Definition: VecFromPortal.h:217
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::internal::ArrayPortalValueReference< PortalType > operator[](vtkm::IdComponent index) const
Definition: VecFromPortal.h:70
Tag used to identify types that aren't Real, Integer, Scalar or Vector.
Definition: TypeTraits.h:20
bool operator!=(const OtherVecType &other)
Definition: VecFromPortal.h:173
Tag used to identify 0 dimensional types (scalars).
Definition: TypeTraits.h:44
Tag used to identify 1 dimensional types (vectors).
Definition: TypeTraits.h:51
A short fixed-length array.
Definition: Types.h:357
typename std::remove_const< typename PortalType::ValueType >::type ComponentType
Definition: VecFromPortal.h:32
typename vtkm::VecTraits< ComponentType >::BaseComponentType BaseComponentType
Definition: VecFromPortal.h:211
typename VecType::ComponentType ComponentType
Definition: VecFromPortal.h:210
static T ZeroInitialization()
A static function that returns 0 (or the closest equivalent to it) for the given type.
Definition: TypeTraits.h:77
Traits that can be queried to treat any type as a Vec.
Definition: VecTraits.h:61
static ComponentType GetComponent(const VecType &vector, vtkm::IdComponent componentIndex)
Definition: VecFromPortal.h:224
A short variable-length array from a window in an ArrayPortal.
Definition: VecFromPortal.h:29
VecFromPortal & operator-=(const OtherVecType &other)
Definition: VecFromPortal.h:102
#define VTKM_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:53
const PortalType & GetPortal() const
Definition: VecFromPortal.h:178
typename vtkm::TypeTraits< ComponentType >::NumericTag NumericTag
Definition: VecFromPortal.h:194