blas/testblas: move test cases for Zher to package-level variable
MODIFY
blas/testblas/zher.go
blas/testblas/zher.go
@@ -11,12 +11,7 @@ import (
"gonum.org/v1/gonum/blas"
)
-type Zherer interface {
- Zher(uplo blas.Uplo, n int, alpha float64, x []complex128, incX int, a []complex128, lda int)
-}
-
-func ZherTest(t *testing.T, impl Zherer) {
- for tc, test := range []struct {
+var zherTestCases = []struct {
alpha float64
x []complex128
a []complex128
@@ -103,7 +98,14 @@ func ZherTest(t *testing.T, impl Zherer) {
10 + 1i, -7 + 5i, 2 + 1i, 18 + 0i,
},
},
- } {
+}
+
+type Zherer interface {
+ Zher(uplo blas.Uplo, n int, alpha float64, x []complex128, incX int, a []complex128, lda int)
+}
+
+func ZherTest(t *testing.T, impl Zherer) {
+ for tc, test := range zherTestCases {
n := len(test.x)
for _, uplo := range []blas.Uplo{blas.Lower, blas.Upper} {
for _, incX := range []int{-11, -2, -1, 1, 2, 7} {

blas/testblas: move test cases for Zher to package-level variable