Go to the documentation of this file.
18 #ifndef viskores_VecFromPortal_h
19 #define viskores_VecFromPortal_h
36 template <
typename PortalType>
40 using ComponentType =
typename std::remove_const<typename PortalType::ValueType>::type;
56 template <
typename T, viskores::IdComponent DestSize>
66 template <viskores::IdComponent N>
80 viskores::internal::ArrayPortalValueReference<PortalType>
operator[](
83 return viskores::internal::ArrayPortalValueReference<PortalType>(this->
Portal,
88 template <
typename OtherVecType>
92 viskores::Min(src.GetNumberOfComponents(), this->NumComponents);
101 template <
typename OtherVecType>
105 viskores::Min(other.GetNumberOfComponents(), this->NumComponents);
108 (*this)[index] += other[index];
114 template <
typename OtherVecType>
118 viskores::Min(other.GetNumberOfComponents(), this->NumComponents);
121 (*this)[index] -= other[index];
127 template <
typename OtherVecType>
131 viskores::Min(other.GetNumberOfComponents(), this->NumComponents);
134 (*this)[index] *= other[index];
138 template <
typename ScalarType>
143 (*this)[index] *= other;
149 template <
typename OtherVecType>
157 template <
typename OtherVecType>
161 viskores::Min(other.GetNumberOfComponents(), this->NumComponents);
164 (*this)[index] /= other[index];
170 template <
typename OtherVecType>
179 if (this->
Portal.Get(index + this->Offset) != other[index])
188 template <
typename OtherVecType>
191 return !(*
this == other);
203 template <
typename PortalType>
221 template <
typename PortalType>
242 return vector[componentIndex];
251 vector[componentIndex] = value;
255 template <viskores::IdComponent destSize>
265 #endif //viskores_VecFromPortal_h
static void SetComponent(const VecType &vector, viskores::IdComponent componentIndex, const ComponentType &value)
Definition: VecFromPortal.h:247
viskores::IdComponent NumComponents
Definition: VecFromPortal.h:199
typename std::remove_const< typename PortalType::ValueType >::type ComponentType
Definition: VecFromPortal.h:40
VecFromPortal(const PortalType &portal, viskores::IdComponent numComponents=0, viskores::Id offset=0)
Definition: VecFromPortal.h:44
viskores::Id Offset
Definition: VecFromPortal.h:200
A short variable-length array from a window in an ArrayPortal.
Definition: VecFromPortal.h:37
static T ZeroInitialization()
A static function that returns 0 (or the closest equivalent to it) for the given type.
Definition: TypeTraits.h:85
typename viskores::VecTraits< ComponentType >::BaseComponentType BaseComponentType
Definition: VecFromPortal.h:227
#define VISKORES_SUPPRESS_EXEC_WARNINGS
Definition: ExportMacros.h:61
A tag for vectors that are "true" vectors (i.e.
Definition: VecTraits.h:31
viskores::IdComponent GetNumberOfComponents() const
Definition: VecFromPortal.h:54
typename viskores::TypeTraits< ComponentType >::NumericTag NumericTag
Definition: VecFromPortal.h:210
viskores::Int32 IdComponent
Base type to use to index small lists.
Definition: Types.h:202
void CopyInto(viskores::Vec< T, DestSize > &dest) const
Definition: VecFromPortal.h:57
#define VISKORES_EXEC_CONT
Definition: ExportMacros.h:60
PortalType Portal
Definition: VecFromPortal.h:198
Tag used to identify 0 dimensional types (scalars).
Definition: TypeTraits.h:52
The TypeTraits class provides helpful compile-time information about the basic types used in Viskores...
Definition: TypeTraits.h:69
static ComponentType GetComponent(const VecType &vector, viskores::IdComponent componentIndex)
Definition: VecFromPortal.h:240
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
const PortalType & GetPortal() const
Definition: VecFromPortal.h:194
Groups connected points that have the same field value.
Definition: Atomic.h:27
typename VecType::ComponentType ComponentType
Definition: VecFromPortal.h:226
VecFromPortal & operator=(const OtherVecType &src)
Definition: VecFromPortal.h:89
Tag used to identify types that aren't Real, Integer, Scalar or Vector.
Definition: TypeTraits.h:28
viskores::Id GetOffset() const
Definition: VecFromPortal.h:195
Traits that can be queried to treat any type as a Vec.
Definition: VecTraits.h:69
typename PortalType::ValueType ComponentType
Definition: VecFromPortal.h:207
VecFromPortal & operator/=(const OtherVecType &other)
Definition: VecFromPortal.h:158
VecFromPortal & operator*=(const OtherVecType &other)
Definition: VecFromPortal.h:150
static void CopyInto(const VecType &src, viskores::Vec< ComponentType, destSize > &dest)
Definition: VecFromPortal.h:256
bool operator!=(const OtherVecType &other)
Definition: VecFromPortal.h:189
bool operator==(const OtherVecType &other)
Definition: VecFromPortal.h:171
viskores::internal::ArrayPortalValueReference< PortalType > operator[](viskores::IdComponent index) const
Definition: VecFromPortal.h:80
void Multiply(const OtherVecType &other, viskores::TypeTraitsVectorTag)
Definition: VecFromPortal.h:128
static viskores::IdComponent GetNumberOfComponents(const VecType &vector)
Definition: VecFromPortal.h:233
VecFromPortal & operator+=(const OtherVecType &other)
Definition: VecFromPortal.h:102
void Multiply(ScalarType other, viskores::TypeTraitsScalarTag)
Definition: VecFromPortal.h:139
T BaseComponentType
Base component type in the vector.
Definition: VecTraits.h:86
static viskores::VecFromPortal< PortalType > ZeroInitialization()
Definition: VecFromPortal.h:215
Tag used to identify 1 dimensional types (vectors).
Definition: TypeTraits.h:59
A short fixed-length array.
Definition: Types.h:365
VecFromPortal & operator-=(const OtherVecType &other)
Definition: VecFromPortal.h:115