Macros and functions to help memory allocation.
First type used to represent a partition. This is not the one used by Union-Find.
Definition type_partitions.h:36
uint size_par
Size of the partition.
Definition type_partitions.h:38
uint ** cl_elems
Array of classes. For each class c cl_elems[c] contains a point to its firts element in storage.
Definition type_partitions.h:41
uint * storage
Used to the classes contiguously in memory (size size_set).
Definition type_partitions.h:40
uint size_set
Size of the partitioned set (the set itself is {0,...,size_set-1}).
Definition type_partitions.h:37
uint * numcl
Array indexed by the partitioned set. Each element in the set is mapped to its class.
Definition type_partitions.h:39
uint * cl_size
Array indexed by the classes. Each class is mapped to its size.
Definition type_partitions.h:42
Second type used to represent a partition. This is the type used by Union-Find.
Definition type_partitions.h:138
uint size_set
Size of the partitionned set (the set itself is {0,...,size_set-1}).
Definition type_partitions.h:140
uint * rank
Array of ranks (meaningful only for roots).
Definition type_partitions.h:144
uint * sizec
Array of classes sizes (meaningful only for roots).
Definition type_partitions.h:145
uint size_par
Size of the partition.
Definition type_partitions.h:142
uint size_tab
Size of all arrays.
Definition type_partitions.h:139
uint * parent
Array encoding the parent relation.
Definition type_partitions.h:143
Implementation of dequeues of unsigned integers.
uint * parti_compute_inv(parti *P)
Computes the inverse mapping of a partition.
Definition type_partitions.c:197
ufind * create_ufind(uint)
Creation of a trivial union-find partition (all classes are singletons).
Definition type_partitions.c:216
parti * create_parti(uint size_set, uint size_par, uint *numcl)
Creation of a partition.
Definition type_partitions.c:10
void union_ufind(uint, uint, ufind *)
Merging of the classes of two elements in a union-find partition.
Definition type_partitions.c:315
parti * restrict_parti(parti *, uint, bool *, uint *)
Restriction of a partition to a subset of the partitioned set.
Definition type_partitions.c:118
void delete_parti(parti *)
Release of a partition.
Definition type_partitions.c:66
uint find_ufind(uint, ufind *)
Computes the class number of an element in a union-find partition.
Definition type_partitions.c:298
void makeset_ufind(ufind *)
Increments the size of the partionned set in a union-find partition.
Definition type_partitions.c:282
parti * ufind_to_parti(ufind *)
Conversion from the union-find type to the partition type.
Definition type_partitions.c:484
uint sizepar_ufind(ufind *)
Computes the size of the partition in a union-find partition.
Definition type_partitions.c:268
uint sizeset_ufind(ufind *)
Computes the size of the partitioned set in a union-find partition.
Definition type_partitions.c:263
ufind * parti_to_ufind(parti *)
Conversion from the partition type to the union-find type.
Definition type_partitions.c:428
parti * ufind_to_parti_refined(ufind *, parti *)
Conversion from the union-find type to the partition type. In this case, a partition that is coarser ...
Definition type_partitions.c:559
parti * restrict_parti_subset(parti *, uint, bool *, uint *, uint *)
Restriction of a partition to a subset of the partitioned set. Input partition is already a partition...
Definition type_partitions.c:176
void print_ufind(ufind *)
Displays a union-find partition.
Definition type_partitions.c:343
void delete_ufind(ufind *)
Release of a union-find partition.
Definition type_partitions.c:250
uint sizeclass_ufind(uint, ufind *)
Computes the size of the class of an element in a union-find partition.
Definition type_partitions.c:308
bool istrivial_parti(parti *)
Checks whether a partition is trivial (all classes are singletons).
Definition type_partitions.c:79