def argmin_dist_rows.go
import unified-nsga-iii@0.2.2.0/survival.bend as Survivalimport Base
157def argmin_dist_rows.go(rows: List<&2, NRow>, +best_i: Nat, +best_d: F32) -> Nat:
158 match rows:
159 case Nil{}:
160 best_i
161 case +row <> rest:
162 +d = nrow_d(row)
163 +lt = F32.is_lt(d, best_d)
164 argmin_dist_rows.go(rest, Bool.pick(Nat, lt, nrow_i(row), best_i), Bool.pick(F32, lt, d, best_d))