Defined in File GenericPartition.hpp
Implements a partition of a set, i.e. a subdivision of the set into disjoint subsets.
Public Functions
Create a new partition data structure for z elements.
z – [in] maximum ValueType
Create a new partition data structure for z elements. Initialize each entry to the default value. WARNING: this circumvents the standard interface and leaves the object in an inconsistent state if defaultValue is neither none nor 0. Use only in exceptional cases.
z – [in] maximum ValueType
defaultValue – [in]
Updates the maximum index of the partition to newZ and sets all its values to defaultValue. WARNING: this leaves the object in an inconsistent state if defaultValue is neither none nor 0. Use only in exceptional cases.
newZ – [in] New maximum index of the partition.
defaultValue – [in] Default value of all the elements in the partition.
Index operator for const instances of this class.
e – [in] an element
Get the set (id) in which the element e is contained.
e – Index of element.
The index of the set in which e is contained.
Extend the data structure and create a slot for one more element. Initializes the entry to noneIndex and returns the index of the entry.
Removes the entry for the given element by setting it to noneIndex.
Add a (previously unassigned) element e to the set s.
s – The index of the subset.
e – The element to add.
Move the (previously assigned) element e to the set s.
s – The index of the subset.
e – The element to move.
Creates a singleton set containing the element e.
e – The index of the element.
Assigns every element to a singleton set. Set id is equal to element id.
Assigns every element to the same subset. Set id is equal to zero.
Assigns the elements from both sets to a new set and returns the id of it.
s – Set to merge.
t – Set to merge.
Id of newly created set.
Sets an upper bound for the subset ids that CAN be assigned.
upper – [in] highest assigned subset ID + 1
Return an upper bound for the subset ids that have been assigned. (This is the maximum id + 1.)
The upper bound.
Get a lower bound for the subset ids that have been assigned.
The lower bound.
Change subset IDs to be consecutive, starting at 0.
useTurbo – Default: false. If set to true, a vector instead of a map to assign new ids which results in a shorter running time but possibly a large space overhead.
Check if partition assigns a valid subset to the element e.
e – The element.
true if the assigned subset is valid, false otherwise.
Check if two elements e1 and e2 belong to the same subset.
e1 – Element.
e2 – Element.
true if e1 and e2 belong to same subset, false otherwise.
Get a list of subset sizes. Indices do not necessarily correspond to subset ids.
A vector of subset sizes.
Get a map from subset id to size of the subset.
A map from subset id to size of the subset.
Get the members of the subset s.
s – The subset.
A set containing the members of s.
Get the current number of sets in this partition.
The current number of sets.
Get the actual vector representing the partition data structure.
vector containing information about partitions.
the subsets of the partition as a set of sets.
Get the ids of nonempty subsets.
A set of ids of nonempty subsets.
Set a human-readable identifier name for the instance.
name – The name.
Get the human-readable identifier.
The name of this partition.