Go to the documentation of this file.
10 #ifndef vtk_m_worklet_SortAndUniqueIndices_h
11 #define vtk_m_worklet_SortAndUniqueIndices_h
32 template <
typename KeyPortalType>
35 using KeyType =
typename KeyPortalType::ValueType;
45 template <
typename IndexType>
50 const KeyType valueA = this->KeyPortal.Get(a);
51 const KeyType valueB = this->KeyPortal.Get(b);
56 else if (valueB < valueA)
68 template <
typename KeyArrayType>
78 template <
typename Device>
83 auto keyPortal = this->KeyArray.PrepareForInput(Device(), token);
89 template <
typename KeyPortalType>
100 template <
typename IndexType>
103 return this->KeyPortal.Get(a) == this->KeyPortal.Get(b);
108 template <
typename KeyArrayType>
118 template <
typename Device>
123 auto keyPortal = this->KeyArray.PrepareForInput(Device(), token);
139 template <
typename KeyType,
typename Storage>
162 template <
typename KeyType,
typename Storage>
173 template <
typename KeyType,
typename Storage>
193 template <
typename KeyType,
typename Storage>
203 template <
typename KeyType,
typename Storage>
218 template <
typename KeyType,
typename Storage>
228 #endif // vtk_m_worklet_SortAndUniqueIndices_h
static void Unique(vtkm::cont::DeviceAdapterId devId, vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:1078
bool operator()(const IndexType &a, const IndexType &b) const
Definition: StableSortIndices.h:101
const KeyArrayType KeyArray
Definition: StableSortIndices.h:71
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
#define VTKM_ASSERT(condition)
Definition: Assert.h:43
const KeyArrayType KeyArray
Definition: StableSortIndices.h:111
Definition: StableSortIndices.h:109
const KeyPortalType KeyPortal
Definition: StableSortIndices.h:92
vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:468
const KeyPortalType KeyPortal
Definition: StableSortIndices.h:37
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
Definition: StableSortIndices.h:69
static IndexArrayType Sort(vtkm::cont::DeviceAdapterId device, const vtkm::cont::ArrayHandle< KeyType, Storage > &keys)
Returns an index array that maps the keys array into a stable sorted ordering.
Definition: StableSortIndices.h:174
static void Sort(const vtkm::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:163
static void Unique(const vtkm::cont::ArrayHandle< KeyType, Storage > &keys, IndexArrayType &indices)
Reduces the array returned by Sort so that the mapped keys are unique.
Definition: StableSortIndices.h:219
#define VTKM_CONT
Definition: ExportMacros.h:57
Definition: StableSortIndices.h:33
Tag for a device adapter used to specify that any device may be used for an operation.
Definition: DeviceAdapterTag.h:180
static void Sort(vtkm::cont::DeviceAdapterId devId, vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:980
typename KeyPortalType::ValueType KeyType
Definition: StableSortIndices.h:35
static bool Copy(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< U, COut > &output)
Definition: Algorithm.h:411
bool operator()(const IndexType &a, const IndexType &b) const
Definition: StableSortIndices.h:46
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:31
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
IndirectUniquePredicateExecObject(const KeyArrayType &keyArray)
Definition: StableSortIndices.h:113
static IndexArrayType Sort(const vtkm::cont::ArrayHandle< KeyType, Storage > &keys)
Returns an index array that maps the keys array into a stable sorted ordering.
Definition: StableSortIndices.h:194
IndirectUniquePredicate< typename KeyArrayType::ReadPortalType > PrepareForExecution(Device, vtkm::cont::Token &token) const
Definition: StableSortIndices.h:119
Produces an ArrayHandle<vtkm::Id> index array that stable-sorts and optionally uniquifies an input ar...
Definition: StableSortIndices.h:25
IndirectSortPredicate< typename KeyArrayType::ReadPortalType > PrepareForExecution(Device, vtkm::cont::Token &token) const
Definition: StableSortIndices.h:79
static void Sort(vtkm::cont::DeviceAdapterId device, const vtkm::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:140
IndirectSortPredicateExecObject(const KeyArrayType &keyArray)
Definition: StableSortIndices.h:73
IndirectUniquePredicate(const KeyPortalType &keyPortal)
Definition: StableSortIndices.h:95
static void Unique(vtkm::cont::DeviceAdapterId device, const vtkm::cont::ArrayHandle< KeyType, Storage > &keys, IndexArrayType &indices)
Reduces the array returned by Sort so that the mapped keys are unique.
Definition: StableSortIndices.h:204
An implicit array handle containing the its own indices.
Definition: ArrayHandleIndex.h:55
Definition: StableSortIndices.h:90
IndirectSortPredicate(const KeyPortalType &keyPortal)
Definition: StableSortIndices.h:40