3.4. Union Find
The uf module includes
- cereeberus.compute.uf.signedDistToLine2Pts(pt, p0, p1)[source]
return a signed distance to a line where line is defined as two points
positive sign refers to “above” the line or “left” of a vertical line to get the expected sign of “right” is positive, the vertical line will be inverted back under the “angle_sign” in _computeNodeHeights() of MergeTree.py
- cereeberus.compute.uf.getSortedNodeHeights(graph, filtration, precision=5)[source]
compute heights of each node given filtration line and return as sorted list of node height tuples, rounded to given precision
- class cereeberus.compute.uf.UnionFind(size, verbose=False)[source]
Array index implementation of UnionFind inspired by William Fiset’s java implementation (github.com/williamfiset/data-structures) with special rerooting function to handle merge tree construction
- __init__(size, verbose=False)[source]
create internal union find structure represented as array with all nodes pointing to themselves (individual components)