Go to the documentation of this file.
11 #ifndef vtk_m_worklet_connectivity_union_find_h
12 #define vtk_m_worklet_connectivity_union_find_h
20 namespace connectivity
36 template <
typename Parents>
39 while (parents.Get(index) != index)
40 index = parents.Get(index);
44 template <
typename Parents>
112 while (root_u != root_v)
116 parents.CompareExchange(root_v, &root_v, root_u);
117 else if (root_u > root_v)
118 parents.CompareExchange(root_u, &root_u, root_v);
149 template <
typename Parents>
152 auto root =
findRoot(parents, index);
153 parents.Set(index, root);
164 template <
typename InOutPortalType>
174 #endif // vtk_m_worklet_connectivity_union_find_h
void(WholeArrayInOut comp) ControlSignature
Definition: UnionFind.h:160
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
static VTKM_EXEC void Unite(Parents &parents, vtkm::Id u, vtkm::Id v)
Definition: UnionFind.h:45
Definition: UnionFind.h:26
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
static VTKM_EXEC void Flatten(Parents &parents, vtkm::Id index)
Definition: UnionFind.h:150
void(WorkIndex, _1) ExecutionSignature
Definition: UnionFind.h:161
_1 InputDomain
Definition: UnionFind.h:162
Definition: UnionFind.h:157
static VTKM_EXEC vtkm::Id findRoot(const Parents &parents, vtkm::Id index)
Definition: UnionFind.h:37
VTKM_EXEC void operator()(vtkm::Id index, InOutPortalType &comps) const
Definition: UnionFind.h:165
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38
The ExecutionSignature tag to use to get the work index.
Definition: WorkIndex.h:39