def MatT.max_rows
bend-tensors@0.0.0.2 · bend_tensors.bend:984
import bend-tensors@0.0.0.2/bend_tensors.bend as BendTensors
import Base
984
985def MatT.max_rows(+r: Nat, +c: Nat, m: MatT(r, c)) -> VecT(r):
986 match r c:
987 case 0n 0n:
988 MatB{b} = m
989 VecL{Blk.max_rows(b)}
990 case 1n+p 0n:
991 MatR{t, b} = m
992 x y = MatT.max_rows(p, 0n, t) MatT.max_rows(p, 0n, b)
993 VecN{x, y}
994 case 0n 1n+q:
995 MatC{l, r2} = m
996 x y = MatT.max_rows(0n, q, l) MatT.max_rows(0n, q, r2)
997 VecT.zip(~F32.max.of, 0n, x, y)
998 case 1n+p 1n+q:
999 MatQ{a, b, c2, d} = m
1000 p0 q0 p1 q1 = MatT.max_rows(p, q, a) MatT.max_rows(p, q, b) MatT.max_rows(p, q, c2) MatT.max_rows(p, q, d)
1001 VecT.max2(p, p0, q0, p1, q1)