Go to the documentation of this file.
18 #ifndef viskores_worklet_SortAndUniqueIndices_h
19 #define viskores_worklet_SortAndUniqueIndices_h
40 template <
typename KeyPortalType>
43 using KeyType =
typename KeyPortalType::ValueType;
53 template <
typename IndexType>
58 const KeyType valueA = this->KeyPortal.Get(a);
59 const KeyType valueB = this->KeyPortal.Get(b);
64 else if (valueB < valueA)
76 template <
typename KeyArrayType>
86 template <
typename Device>
91 auto keyPortal = this->KeyArray.PrepareForInput(Device(), token);
97 template <
typename KeyPortalType>
108 template <
typename IndexType>
111 return this->KeyPortal.Get(a) == this->KeyPortal.Get(b);
116 template <
typename KeyArrayType>
126 template <
typename Device>
131 auto keyPortal = this->KeyArray.PrepareForInput(Device(), token);
147 template <
typename KeyType,
typename Storage>
170 template <
typename KeyType,
typename Storage>
181 template <
typename KeyType,
typename Storage>
202 template <
typename KeyType,
typename Storage>
213 template <
typename KeyType,
typename Storage>
228 template <
typename KeyType,
typename Storage>
238 #endif // viskores_worklet_SortAndUniqueIndices_h
static void Unique(const viskores::cont::ArrayHandle< KeyType, Storage > &keys, IndexArrayType &indices)
Reduces the array returned by Sort so that the mapped keys are unique.
Definition: StableSortIndices.h:229
const KeyPortalType KeyPortal
Definition: StableSortIndices.h:45
static void Unique(viskores::cont::DeviceAdapterId devId, viskores::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:1098
IndirectUniquePredicate(const KeyPortalType &keyPortal)
Definition: StableSortIndices.h:103
bool operator()(const IndexType &a, const IndexType &b) const
Definition: StableSortIndices.h:109
static void Sort(const viskores::cont::ArrayHandle< KeyType, Storage > &keys, IndexArrayType &indices)
Permutes the indices array so that it will map keys into a stable sorted order.
Definition: StableSortIndices.h:171
static void Sort(viskores::cont::DeviceAdapterId devId, viskores::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:999
Definition: StableSortIndices.h:98
const KeyArrayType KeyArray
Definition: StableSortIndices.h:79
Tag for a device adapter used to specify that any device may be used for an operation.
Definition: DeviceAdapterTag.h:194
typename KeyPortalType::ValueType KeyType
Definition: StableSortIndices.h:43
Definition: StableSortIndices.h:117
static IndexArrayType Sort(const viskores::cont::ArrayHandle< KeyType, Storage > &keys)
Returns an index array that maps the keys array into a stable sorted ordering.
Definition: StableSortIndices.h:203
static IndexArrayType Sort(viskores::cont::DeviceAdapterId device, const viskores::cont::ArrayHandle< KeyType, Storage > &keys)
Returns an index array that maps the keys array into a stable sorted ordering.
Definition: StableSortIndices.h:182
static bool Copy(viskores::cont::DeviceAdapterId devId, const viskores::cont::ArrayHandle< T, CIn > &input, viskores::cont::ArrayHandle< U, COut > &output)
Definition: Algorithm.h:422
#define VISKORES_CONT
Definition: ExportMacros.h:65
Produces an ArrayHandle<viskores::Id> index array that stable-sorts and optionally uniquifies an inpu...
Definition: StableSortIndices.h:33
Groups connected points that have the same field value.
Definition: Atomic.h:27
IndirectSortPredicate< typename KeyArrayType::ReadPortalType > PrepareForExecution(Device, viskores::cont::Token &token) const
Definition: StableSortIndices.h:87
IndirectSortPredicateExecObject(const KeyArrayType &keyArray)
Definition: StableSortIndices.h:81
viskores::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:482
#define VISKORES_ASSERT(condition)
Definition: Assert.h:51
static void Sort(viskores::cont::DeviceAdapterId device, const viskores::cont::ArrayHandle< KeyType, Storage > &keys, IndexArrayType &indices)
Permutes the indices array so that it will map keys into a stable sorted order.
Definition: StableSortIndices.h:148
static void Unique(viskores::cont::DeviceAdapterId device, const viskores::cont::ArrayHandle< KeyType, Storage > &keys, IndexArrayType &indices)
Reduces the array returned by Sort so that the mapped keys are unique.
Definition: StableSortIndices.h:214
An object used to specify a device.
Definition: DeviceAdapterTag.h:66
const KeyPortalType KeyPortal
Definition: StableSortIndices.h:100
bool operator()(const IndexType &a, const IndexType &b) const
Definition: StableSortIndices.h:54
IndirectUniquePredicate< typename KeyArrayType::ReadPortalType > PrepareForExecution(Device, viskores::cont::Token &token) const
Definition: StableSortIndices.h:127
Definition: StableSortIndices.h:77
IndirectUniquePredicateExecObject(const KeyArrayType &keyArray)
Definition: StableSortIndices.h:121
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:43
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:39
Definition: StableSortIndices.h:41
#define VISKORES_EXEC
Definition: ExportMacros.h:59
const KeyArrayType KeyArray
Definition: StableSortIndices.h:119
IndirectSortPredicate(const KeyPortalType &keyPortal)
Definition: StableSortIndices.h:48
An implicit array handle containing the its own indices.
Definition: ArrayHandleIndex.h:64