MCPcopy Create free account
hub / github.com/argumentcomputer/ix / bisect_separates_clusters

Function bisect_separates_clusters

crates/kernel/src/shard.rs:2057–2069  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2055 }
2056}
2057
2058/// Collect the leaf shard ids of an [`AggNode`] in left-to-right DFS order.
2059fn dfs_leaf_order(node: &AggNode, out: &mut Vec<u32>) {
2060 match node {
2061 AggNode::Leaf(id) => out.push(*id),
2062 AggNode::Internal(l, r) => {
2063 dfs_leaf_order(l, out);
2064 dfs_leaf_order(r, out);
2065 },
2066 }
2067}
2068
2069/// A balanced binary [`AggNode`] over the contiguous shard-id range `lo..hi`.
2070fn balanced_agg_tree(lo: u32, hi: u32) -> AggNode {
2071 debug_assert!(hi > lo);
2072 if hi - lo <= 1 {

Callers

nothing calls this directly

Calls 2

two_clustersFunction · 0.85
partitionMethod · 0.80

Tested by

no test coverage detected