blas/gonum: remove badLenX and badLenY panic strings
They were almost unused, badX and badY are used for the same purpose.
MODIFY
blas/gonum/gonum.go
blas/gonum/gonum.go
@@ -14,8 +14,6 @@ type Implementation struct{}
const (
zeroIncX = "blas: zero x index increment"
zeroIncY = "blas: zero y index increment"
- badLenX = "blas: x index out of range"
- badLenY = "blas: y index out of range"
mLT0 = "blas: m < 0"
nLT0 = "blas: n < 0"
@@ -32,8 +30,8 @@ const (
badLdB = "blas: index of b out of range"
badLdC = "blas: index of c out of range"
- badX = "blas: x index out of range"
- badY = "blas: y index out of range"
+ badX = "blas: bad length of x"
+ badY = "blas: bad length of y"
)
// [SD]gemm behavior constants. These are kept here to keep them out of the

MODIFY
blas/gonum/level1double_ddot.go
blas/gonum/level1double_ddot.go
@@ -25,10 +25,10 @@ func (Implementation) Ddot(n int, x []float64, incX int, y []float64, incY int)
}
if incX == 1 && incY == 1 {
if len(x) < n {
- panic(badLenX)
+ panic(badX)
}
if len(y) < n {
- panic(badLenY)
+ panic(badY)
}
return f64.DotUnitary(x[:n], y)
}
@@ -40,10 +40,10 @@ func (Implementation) Ddot(n int, x []float64, incX int, y []float64, incY int)
iy = (-n + 1) * incY
}
if ix >= len(x) || ix+(n-1)*incX >= len(x) {
- panic(badLenX)
+ panic(badX)
}
if iy >= len(y) || iy+(n-1)*incY >= len(y) {
- panic(badLenY)
+ panic(badY)
}
return f64.DotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy))
}

MODIFY
blas/gonum/level1single_dsdot.go
blas/gonum/level1single_dsdot.go
@@ -29,10 +29,10 @@ func (Implementation) Dsdot(n int, x []float32, incX int, y []float32, incY int)
}
if incX == 1 && incY == 1 {
if len(x) < n {
- panic(badLenX)
+ panic(badX)
}
if len(y) < n {
- panic(badLenY)
+ panic(badY)
}
return f32.DdotUnitary(x[:n], y)
}
@@ -44,10 +44,10 @@ func (Implementation) Dsdot(n int, x []float32, incX int, y []float32, incY int)
iy = (-n + 1) * incY
}
if ix >= len(x) || ix+(n-1)*incX >= len(x) {
- panic(badLenX)
+ panic(badX)
}
if iy >= len(y) || iy+(n-1)*incY >= len(y) {
- panic(badLenY)
+ panic(badY)
}
return f32.DdotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy))
}

MODIFY
blas/gonum/level1single_sdot.go
blas/gonum/level1single_sdot.go
@@ -29,10 +29,10 @@ func (Implementation) Sdot(n int, x []float32, incX int, y []float32, incY int)
}
if incX == 1 && incY == 1 {
if len(x) < n {
- panic(badLenX)
+ panic(badX)
}
if len(y) < n {
- panic(badLenY)
+ panic(badY)
}
return f32.DotUnitary(x[:n], y)
}
@@ -44,10 +44,10 @@ func (Implementation) Sdot(n int, x []float32, incX int, y []float32, incY int)
iy = (-n + 1) * incY
}
if ix >= len(x) || ix+(n-1)*incX >= len(x) {
- panic(badLenX)
+ panic(badX)
}
if iy >= len(y) || iy+(n-1)*incY >= len(y) {
- panic(badLenY)
+ panic(badY)
}
return f32.DotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy))
}

MODIFY
blas/gonum/level1single_sdsdot.go
blas/gonum/level1single_sdsdot.go
@@ -29,10 +29,10 @@ func (Implementation) Sdsdot(n int, alpha float32, x []float32, incX int, y []fl
}
if incX == 1 && incY == 1 {
if len(x) < n {
- panic(badLenX)
+ panic(badX)
}
if len(y) < n {
- panic(badLenY)
+ panic(badY)
}
return alpha + float32(f32.DdotUnitary(x[:n], y))
}
@@ -44,10 +44,10 @@ func (Implementation) Sdsdot(n int, alpha float32, x []float32, incX int, y []fl
iy = (-n + 1) * incY
}
if ix >= len(x) || ix+(n-1)*incX >= len(x) {
- panic(badLenX)
+ panic(badX)
}
if iy >= len(y) || iy+(n-1)*incY >= len(y) {
- panic(badLenY)
+ panic(badY)
}
return alpha + float32(f32.DdotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)))
}

blas/gonum: remove badLenX and badLenY panic strings

They were almost unused, badX and badY are used for the same purpose.