You may try
type
Matrix*[W, H: static int] = array[W, array[H, float]]
func submatrix*[W, H](m: Matrix[W, H]): Matrix[W - 1, H - 1] =
for row in 0 ..< high(m):
for col in 0 ..< high(m[0]):
result[row][col] = m[row][col]
var
m: Matrix[3, 3]
let s = submatrix(m)
echo s.len
echo s[0].len
Run
- Submatrix function and arrays zetashift
- Re: Submatrix function and arrays Stefan_Salewski
- Re: Submatrix function and arrays zetashift
- Re: Submatrix function and arrays zetashift
- Re: Submatrix function and arrays Stefan_Salewski
- Re: Submatrix function and arrays solo989
- Re: Submatrix function and array... zetashift
- Re: Submatrix function and a... Stefan_Salewski
- Re: Submatrix function and a... zetashift
- Re: Submatrix function and a... Stefan_Salewski
- Re: Submatrix function and a... zetashift
- Re: Submatrix function and a... zetashift
