This PR allows to also indicate negative cluster identifiers for nodes, which could then be interpreted as indicating that a node is not assigned to a cluster. In principle, a negative cluster could already be set, but this would break a number of operations that assume that cluster numbers are non-negative.
Additionally, three convenience functions are added: clusterWeights and getClusterIsNotEmpty and getNNonEmptyClusters, which are also used internally for some operations.
Finally, the relabeling of empty clusters can now also be done starting from some higher cluster number in removeEmptyClustersLargerThan.
As discussed, I removed the possibility of using negative cluster numbers to identify missing clusters. So this PR now essentially adds a number of convenience functions.
This PR allows to also indicate negative cluster identifiers for nodes, which could then be interpreted as indicating that a node is not assigned to a cluster. In principle, a negative cluster could already be set, but this would break a number of operations that assume that cluster numbers are non-negative.
Additionally, three convenience functions are added:
clusterWeights
andgetClusterIsNotEmpty
andgetNNonEmptyClusters
, which are also used internally for some operations.Finally, the relabeling of empty clusters can now also be done starting from some higher cluster number in
removeEmptyClustersLargerThan
.