def rope_one

bendtorch@1.3.0.0 · main.bend:2302

import bendtorch@1.3.0.0/main.bend as Bendtorch
import Base

2302# pair e of the n x w matrix: row e / hh (hh = h * half pairs a row), head (e mod hh) / half, column c of it
2303def rope_one(+e: U32, +fwd: Bool, +hh: U32, +half: U32, +w: U32, +t: U32, st: RS3) -> RS3:
2304  match st:
2305    case RS3{x, cs, sn}:
2306      +r = U32.div(e, hh)
2307      +c = U32.mod(U32.mod(e, hh), half)
2308      +i1 = (((r * w : U32) + (U32.div(U32.mod(e, hh), half) * (half + half : U32) : U32) : U32) + c : U32)
2309      rope_p2(fwd, i1, (i1 + half : U32), ((U32.mod(r, t) * half : U32) + c : U32), cs, sn, Array.get(F32, x, i1))

Uses (10)

Used by (2)