nauty's CLEANUP of an accumulated refinement code.
Equations
- Hex.GraphIso.Nauty.cleanup l = l % 32767
Instances For
The end position of the cell starting at i in the partition at
level: the least j ≥ i with ptn[j] ≤ level.
Equations
- Hex.GraphIso.Nauty.cellEnd ptn level i = Hex.GraphIso.Nauty.cellEnd.go ptn level (ptn.size - i) i
Instances For
Equations
- Hex.GraphIso.Nauty.cellEnd.go ptn level 0 a✝ = a✝
- Hex.GraphIso.Nauty.cellEnd.go ptn level fuel.succ a✝ = if ptn[a✝]! > level then Hex.GraphIso.Nauty.cellEnd.go ptn level fuel (a✝ + 1) else a✝
Instances For
The cells of the partition at level, as (start, end) position
pairs in order.
Equations
- Hex.GraphIso.Nauty.cells ptn level n = Hex.GraphIso.Nauty.cells.go ptn level n n 0
Instances For
Working state of one refine call on n vertices. lab and
ptn are the partition nest and active the positions of the cells
still to be used as splitters, all three nauty's arrays of those names.
numcells counts the cells. hint is the position pickSplit tries
first on the next iteration. maxpos is the position of the largest
fragment of the last nontrivial split, which is the one left out of the
active set. longcode is the accumulated refinement code.
Instances For
The next active splitting cell: nauty tries hint first, then the
next active position after it, then wraps to the least active position.
Equations
Instances For
The two-pointer partition of lab[c1..c2] by adjacency to the trivial
splitter: adjacent vertices collect on the left in order, non-adjacent
vertices on the right in reversed order, exactly as nauty's swap loop
leaves them. Returns the final (lab, c1, c2).
Equations
Instances For
The position-level bookkeeping after a trivial split with final
pointers c1, c2: record the new cell end, code, count, active entry,
and hint. Touches no labelling data.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One cell's processing in the trivial-splitter pass: two-pointer partition by adjacency, then the split bookkeeping.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One splitting pass of refine for the trivial splitter cell
{lab[split1]}. The splitter row is captured before any cell is
processed, as in nauty.
Equations
- Hex.GraphIso.Nauty.refineTrivial ctx level split1 st = Hex.GraphIso.Nauty.refineTrivial.go level ctx.g[st.lab[split1]!]! (Hex.GraphIso.Nauty.cells st.ptn level n) st
Instances For
Equations
- Hex.GraphIso.Nauty.refineTrivial.go level gRow [] a✝ = a✝
- Hex.GraphIso.Nauty.refineTrivial.go level gRow ((cell1, cell2) :: rest) a✝ = Hex.GraphIso.Nauty.refineTrivial.go level gRow rest (Hex.GraphIso.Nauty.trivialCell level gRow cell1 cell2 a✝)
Instances For
refineTrivial with the cell walk fused: boundaries come from a
snapshot of the partition (ptn0), taken before the pass writes, so
no (start, end) pair list is materialized. Runtime form of
refineTrivial.
Equations
Instances For
The splitter cell's vertex set: the members of lab[lo..hi].
Equations
- Hex.GraphIso.Nauty.worksetOf n lab lo hi = List.foldl (fun (w : Hex.GraphIso.Nauty.VSet n) (o : Nat) => w.insert lab[lo + o]!) Hex.GraphIso.Nauty.VSet.empty (List.range (hi + 1 - lo))
Instances For
The multiplicity of count value v in a count list.
Equations
- Hex.GraphIso.Nauty.multOf counts v = List.countP (fun (x : Nat) => x == v) counts
Instances For
One nonempty count group's bookkeeping in the window scan: code
contribution, maxpos of the largest group so far, the group boundary
with its active-set entry, and the new cell end. Touches no labelling
data.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The position scan over the count window [bmin, bmax]: register each
nonempty group's boundary, code contribution, active-set entry, and the
maxpos of the largest group.
Equations
- One or more equations did not get rendered due to their size.
- Hex.GraphIso.Nauty.windowScan level cell1 cell2 counts [] x✝² x✝¹ x✝ = x✝
Instances For
The stable counting sort of a cell segment: members grouped by count value in ascending value order, keeping cell order within a group.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Write a segment back at cell1.
Equations
- Hex.GraphIso.Nauty.writeSegment lab cell1 [] = lab
- Hex.GraphIso.Nauty.writeSegment lab cell1 (x_1 :: rest) = Hex.GraphIso.Nauty.writeSegment (lab.set! cell1 x_1) (cell1 + 1) rest
Instances For
The active-set fix after a nontrivial split: if the original cell was not active, activate the whole boundary except the largest fragment. Touches no labelling data.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Count multiplicities into a window-sized bucket array.
Equations
Instances For
The window scan driven by the bucket array: replays windowStep
for each nonempty count group in ascending value order.
Equations
- One or more equations did not get rendered due to their size.
- Hex.GraphIso.Nauty.ntcScan level cell1 cell2 bmin bucket 0 x✝³ x✝² x✝¹ x✝ = x✝
Instances For
Exclusive prefix positions of the count groups, offset to the cell start.
Equations
- Hex.GraphIso.Nauty.ntcStarts bucket 0 x✝¹ x✝ = x✝
- Hex.GraphIso.Nauty.ntcStarts bucket fuel.succ x✝¹ x✝ = Hex.GraphIso.Nauty.ntcStarts bucket fuel (x✝¹ + bucket[x✝.size]!) (x✝.push x✝¹)
Instances For
The stable placement: one ascending walk over the members, each written at its group's next position.
Equations
- One or more equations did not get rendered due to their size.
- Hex.GraphIso.Nauty.ntcPlace counts members bmin 0 x✝² x✝¹ x✝ = (x✝¹, x✝)
Instances For
nontrivialCell as the bucket-array counting sort.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The bucket-driven scan replays windowScan over an ascending
value window whenever the bucket entries are the multiplicities.
ntcPass appends the per-member counts and members over its fuel
window and folds the extrema, leaving the accumulator prefixes intact.
ntcBucket accumulates, at slot v, the running bucket count plus
the number of processed positions whose count value is bmin + v. Slots
are only ever touched in range, so out-of-window reads are preserved.
The group base positions tile the cell: the count of members below
value v + 1 is the count below v plus the multiplicity of v. This
is what makes the group intervals [base v, base v + mult v) disjoint
and contiguous, hence the placement injective and size-exact.
The concrete counts pass reconstructs countsOf as its count array.
The concrete counts pass records the cell members in cell order.
The concrete counts pass folds the specification's count minimum.
The concrete counts pass folds the specification's count maximum.
The bucket-array counting sort computes the specification's cell
processing: one counts pass, the multiplicity bucket, the bucket-driven
window scan, and the stable placement replay nontrivialCell exactly.
The @[csimp] makes every compiled call site run the O(cell + window)
fast path in place of the O(cell x window) multOf scan and
segmentOf redistribution.
One splitting pass of refine for a nontrivial splitter cell
lab[split1..split2].
nauty's bucket scratch is reproduced semantically: the multiplicity
window over [bmin, bmax] and the stable counting redistribution give
exactly the array contents nauty's incremental window zeroing and
placement loop produce.
Equations
- One or more equations did not get rendered due to their size.
Instances For
refineNontrivial with the cell walk fused over a partition
snapshot, mirroring refineTrivialFast. Runtime form of
refineNontrivial.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Hex.GraphIso.Nauty.refineNontrivialFast.go ctx level workset ptn0 0 a✝¹ a✝ = a✝
Instances For
One iteration of refine's active-cell loop: remove the chosen
splitter from the active set and perform its splitting pass.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- Hex.GraphIso.Nauty.refineLoop ctx level 0 x✝ = x✝
Instances For
nauty's refine: make the partition at level equitable with respect
to the active cells, producing the refinement code. With the pinned
options (invarproc = NULL) this is also the whole of doref.
Equations
- One or more equations did not get rendered due to their size.
Instances For
nauty's cheapautom: a cheap sufficient condition for the partition
to have automorphisms rearranging only its nontrivial cells.
Equations
Instances For
One v2 round of bestcell's joined-cell count: bump the counts of
v2 and each earlier nonsingleton cell nontrivially joined to it.
Equations
- One or more equations did not get rendered due to their size.
- Hex.GraphIso.Nauty.bestcellRow ctx lab startArr workset v2 [] x✝ = x✝
Instances For
The position of the greatest count, first maximum winning.
Equations
- Hex.GraphIso.Nauty.argmaxLoop bucket [] x✝¹ x✝ = x✝¹
- Hex.GraphIso.Nauty.argmaxLoop bucket (i :: rest) x✝¹ x✝ = if bucket[i]! > x✝ then Hex.GraphIso.Nauty.argmaxLoop bucket rest i bucket[i]! else Hex.GraphIso.Nauty.argmaxLoop bucket rest x✝¹ x✝
Instances For
nauty's targetcell for the pinned undirected configuration: keep
the hinted position when it still starts a nonsingleton cell of the
partition at level, otherwise take bestcell while
level ≤ tcLevel and the first nonsingleton cell deeper than that.
Equations
- One or more equations did not get rendered due to their size.
Instances For
nauty's breakout: split {tv} off the front of the cell starting at
tc, shifting the displaced vertices one place right, and make tc the
only active position.
Equations
- Hex.GraphIso.Nauty.breakout n lab ptn level tc tv = (Hex.GraphIso.Nauty.breakout.go tv (lab.size + 1) lab tc tv, ptn.set! tc level, Hex.GraphIso.Nauty.VSet.empty.insert tc)
Instances For
Equations
Instances For
The inverse of a vertex list: inv[lab[i]] = i.
Equations
- Hex.GraphIso.Nauty.invPerm lab = Hex.GraphIso.Nauty.invPerm.go lab (List.range lab.size) (Array.replicate lab.size 0)
Instances For
nauty's testcanlab: compare g^lab with canong row by row in
nauty's setword order. Returns the comparison and the number of leading
equal rows.
Equations
- One or more equations did not get rendered due to their size.