If you don’t care about overwriting data, why isn’t it len(data)/Stride?
If you have the matrix
[ 1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16]
and you View it, to say get the middle 2 x 2 region
The data you have is (the dots and extra numbers are the data actually in the slice)
[ 6 7 . 8 9
10 11] . 11 12
. .
13 14 . 15 16
Stride is 4 which matches the column limit, and len(data) / Stride = 12 / 3 which matches the row limit.
Different example where the numbers don’t work as well:
[ 1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20]
Again, slice the same relative portion
[ 7 8 . 9 10 11
12 13] . 14 15 16
. .
17 18 19 20
Again, the column limit is correctly 5, and the Row limit is 14 / 5 = 2, which is correct.
> --
> You received this message because you are subscribed to the Google Groups "gonum-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
gonum-dev+...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.