In native, we use sub-slicing a lot, for example to compute dot products. However, we do not explicitly check the length of input slices. If the input slice itself comes from a larger slice, some of the routines will not panic. See for example the test program:
package main
import (
"github.com/gonum/blas"
"github.com/gonum/blas/native"
)
func main() {
a := make([]float64, 0, 1000)
x := make([]float64, 10)
y := make([]float64, 10)
native.Implementation{}.Dgemv(blas.NoTrans, 10, 10, 1, a, 10, x, 1, 0, y, 1)
}
The length of a is 0, but slicing extends a beyond its original length.
In native, we use sub-slicing a lot, for example to compute dot products. However, we do not explicitly check the length of input slices. If the input slice itself comes from a larger slice, some of the routines will not panic. See for example the test program:
The length of a is 0, but slicing extends a beyond its original length.