def g12_vec.go

unified-nsga-iii@0.2.2.0 · util.bend:333

import unified-nsga-iii@0.2.2.0/util.bend as Util
import Base

333# Sequential cons walk (guide: the list is the shape a flat loop walks).
334# n_var is 12–30 on the oracles; mid-split take/drop of that spine is
335# more expensive than a tail walk. Same rounding as the old map_halves.
336def g12_vec.go(xs: List<&2, F32>, acc: List<&2, F32>) -> List<&2, F32>:
337  match xs:
338    case Nil{}:
339      List.reverse(&2, F32, acc)
340    case +x <> rest:
341      g12_vec.go(rest, g12_one(x) <> acc)

Uses (4)

Used by (1)