Definition at line 113 of file lwunionfind.c.
116 uint32_t** cluster_id_ptr_by_elem_id =
lwalloc(uf->
N * sizeof (uint32_t*));
117 uint32_t* ordered_ids =
lwalloc(uf->
N * sizeof (uint32_t));
119 for (i = 0; i < uf->
N; i++)
125 cluster_id_ptr_by_elem_id[i] = &(uf->
clusters[i]);
131 qsort(cluster_id_ptr_by_elem_id, uf->
N, sizeof (uint32_t*), &
cmp_int_ptr);
136 for (i = 0; i < uf-> N; i++)
138 ordered_ids[i] = (cluster_id_ptr_by_elem_id[i] - uf->
clusters);
141 lwfree(cluster_id_ptr_by_elem_id);
void * lwalloc(size_t size)
static int cmp_int_ptr(const void *a, const void *b)
uint32_t UF_find(UNIONFIND *uf, uint32_t i)
References UNIONFIND::clusters, cmp_int_ptr(), lwalloc(), lwfree(), UNIONFIND::N, and UF_find().
Referenced by combine_geometries(), test_unionfind_ordered_by_cluster(), and UF_get_collapsed_cluster_ids().