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
VTKM_CONT vtkm::Id GetNumberOfValues() const
Returns the number of entries in the array.
Definition: ArrayHandle.h:448
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
static VTKM_CONT void Sort(vtkm::cont::DeviceAdapterId devId, vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:965
static VTKM_CONT bool Copy(vtkm::cont::DeviceAdapterId devId, const vtkm::cont::ArrayHandle< T, CIn > &input, vtkm::cont::ArrayHandle< U, COut > &output)
Definition: Algorithm.h:410
static VTKM_CONT 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 VTKM_CONT 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
VTKM_CONT IndirectUniquePredicateExecObject(const KeyArrayType &keyArray)
Definition: StableSortIndices.h:113
const KeyPortalType KeyPortal
Definition: StableSortIndices.h:37
static VTKM_CONT 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
VTKM_EXEC bool operator()(const IndexType &a, const IndexType &b) const
Definition: StableSortIndices.h:101
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
static VTKM_CONT void Unique(vtkm::cont::DeviceAdapterId devId, vtkm::cont::ArrayHandle< T, Storage > &values)
Definition: Algorithm.h:1063
Definition: StableSortIndices.h:69
VTKM_CONT IndirectSortPredicateExecObject(const KeyArrayType &keyArray)
Definition: StableSortIndices.h:73
VTKM_EXEC bool operator()(const IndexType &a, const IndexType &b) const
Definition: StableSortIndices.h:46
static VTKM_CONT 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
#define VTKM_CONT
Definition: ExportMacros.h:57
Definition: StableSortIndices.h:33
typename KeyPortalType::ValueType KeyType
Definition: StableSortIndices.h:35
static VTKM_CONT 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
Base ExecutionObjectBase for execution objects to inherit from so that you can use an arbitrary objec...
Definition: ExecutionObjectBase.h:31
Definition: DeviceAdapterTag.h:52
static VTKM_CONT 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
IndirectUniquePredicate< typename KeyArrayType::ReadPortalType > PrepareForExecution(Device, vtkm::cont::Token &token) const
Definition: StableSortIndices.h:119
VTKM_CONT IndirectUniquePredicate(const KeyPortalType &keyPortal)
Definition: StableSortIndices.h:95
VTKM_CONT IndirectSortPredicate(const KeyPortalType &keyPortal)
Definition: StableSortIndices.h:40
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
An implicit array handle containing the its own indices.
Definition: ArrayHandleIndex.h:54
Definition: StableSortIndices.h:90