NonDominatedSort.split_walk.go: def of unified-nsga-iii@0.2.2.0 Import: import unified-nsga-iii@0.2.2.0/non_dominated_sort.bend as NonDominatedSort Lines 209-225 of unified-nsga-iii@0.2.2.0/non_dominated_sort.bend: https://jend.leeeet.dev/read.txt?path=unified-nsga-iii@0.2.2.0/non_dominated_sort.bend&start_line=209&end_line=225 import Base import unified-nsga-iii@0.2.2.0/util.bend as Util # Per-candidate split is independent given `all`. Mid-split then # concatenate fronts / leftovers so order matches the tail-first walk. def split_walk.go(+all: List<&2, Row>, +fuel: Nat, cand: List<&2, Row>) -> Split: match fuel cand: case 0n Nil{}: Split{Nil{}, Nil{}} case 0n +r <> rest: split_put(r, split_walk.go(all, 0n, rest), row_dom(all, r)) case 1n+p Nil{}: Split{Nil{}, Nil{}} case 1n+p +r <> Nil{}: split_put(r, Split{Nil{}, Nil{}}, row_dom(all, r)) case 1n+p h <> t: +xs = {h <> t : List<&2, Row>} +mid = Nat.div(Util.list_len(Row, xs), 2n) lo hi = split_walk.go(all, p, List.take(&2, Row, xs, mid)) split_walk.go(all, p, List.drop(&2, Row, xs, mid)) split_cat(lo, hi) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.drop https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.take https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/non_dominated_sort.bend&name=Row https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/non_dominated_sort.bend&name=Split https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/non_dominated_sort.bend&name=row_dom https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/non_dominated_sort.bend&name=split_cat https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/non_dominated_sort.bend&name=split_put https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/util.bend&name=list_len