BendTensors.MatT.to_rows: def of bend-tensors@0.0.0.2 Import: import bend-tensors@0.0.0.2/bend_tensors.bend as BendTensors Lines 1138-1153 of bend-tensors@0.0.0.2/bend_tensors.bend: https://jend.leeeet.dev/read.txt?path=bend-tensors@0.0.0.2/bend_tensors.bend&start_line=1138&end_line=1153 import Base # the rows of a MatT(r, c), row-major def MatT.to_rows(+r: Nat, +c: Nat, m: MatT(r, c)) -> List<&2, List<&2, F32>>: match r c: case 0n 0n: MatB{b} = m Blk{a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, a30, a31, a32, a33} = b [[a00, a01, a02, a03], [a10, a11, a12, a13], [a20, a21, a22, a23], [a30, a31, a32, a33]] case 1n+p 0n: MatR{t, b} = m List.append(&2, List<&2, F32>, MatT.to_rows(p, 0n, t), MatT.to_rows(p, 0n, b)) case 0n 1n+q: MatC{l, r2} = m MatT.rows_cat(MatT.to_rows(0n, q, l), MatT.to_rows(0n, q, r2)) case 1n+p 1n+q: MatQ{a, b, c2, d} = m List.append(&2, List<&2, F32>, MatT.rows_cat(MatT.to_rows(p, q, a), MatT.to_rows(p, q, b)), MatT.rows_cat(MatT.to_rows(p, q, c2), MatT.to_rows(p, q, d))) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=bend-tensors@0.0.0.2/bend_tensors.bend&name=Blk https://jend.leeeet.dev/definition.txt?path=bend-tensors@0.0.0.2/bend_tensors.bend&name=MatT https://jend.leeeet.dev/definition.txt?path=bend-tensors@0.0.0.2/bend_tensors.bend&name=MatT.Cols https://jend.leeeet.dev/definition.txt?path=bend-tensors@0.0.0.2/bend_tensors.bend&name=MatT.Leaf https://jend.leeeet.dev/definition.txt?path=bend-tensors@0.0.0.2/bend_tensors.bend&name=MatT.Quad https://jend.leeeet.dev/definition.txt?path=bend-tensors@0.0.0.2/bend_tensors.bend&name=MatT.Rows https://jend.leeeet.dev/definition.txt?path=bend-tensors@0.0.0.2/bend_tensors.bend&name=MatT.rows_cat