blas/{gonum,testblas}: zero out elements of c when beta is zero
MODIFY
blas/gonum/level3float32.go
blas/gonum/level3float32.go
@@ -273,7 +273,6 @@ func (Implementation) Ssymm(s blas.Side, ul blas.Uplo, m, n int, alpha float32,
return
}
- if alpha == 0 {
if beta == 0 {
for i := 0; i < m; i++ {
ctmp := c[i*ldc : i*ldc+n]
@@ -281,14 +280,17 @@ func (Implementation) Ssymm(s blas.Side, ul blas.Uplo, m, n int, alpha float32,
ctmp[j] = 0
}
}
- return
}
+
+ if alpha == 0 {
+ if beta != 0 {
for i := 0; i < m; i++ {
ctmp := c[i*ldc : i*ldc+n]
for j := 0; j < n; j++ {
ctmp[j] *= beta
}
}
+ }
return
}
@@ -605,6 +607,18 @@ func (Implementation) Ssyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl
atmp := a[i*lda : i*lda+k]
btmp := b[i*ldb : i*ldb+k]
ctmp := c[i*ldc+i : i*ldc+n]
+ if beta == 0 {
+ for jc := range ctmp {
+ j := i + jc
+ var tmp1, tmp2 float32
+ binner := b[j*ldb : j*ldb+k]
+ for l, v := range a[j*lda : j*lda+k] {
+ tmp1 += v * btmp[l]
+ tmp2 += atmp[l] * binner[l]
+ }
+ ctmp[jc] = alpha * (tmp1 + tmp2)
+ }
+ } else {
for jc := range ctmp {
j := i + jc
var tmp1, tmp2 float32
@@ -617,12 +631,24 @@ func (Implementation) Ssyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl
ctmp[jc] += alpha * (tmp1 + tmp2)
}
}
+ }
return
}
for i := 0; i < n; i++ {
atmp := a[i*lda : i*lda+k]
btmp := b[i*ldb : i*ldb+k]
ctmp := c[i*ldc : i*ldc+i+1]
+ if beta == 0 {
+ for j := 0; j <= i; j++ {
+ var tmp1, tmp2 float32
+ binner := b[j*ldb : j*ldb+k]
+ for l, v := range a[j*lda : j*lda+k] {
+ tmp1 += v * btmp[l]
+ tmp2 += atmp[l] * binner[l]
+ }
+ ctmp[j] = alpha * (tmp1 + tmp2)
+ }
+ } else {
for j := 0; j <= i; j++ {
var tmp1, tmp2 float32
binner := b[j*ldb : j*ldb+k]
@@ -634,12 +660,19 @@ func (Implementation) Ssyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl
ctmp[j] += alpha * (tmp1 + tmp2)
}
}
+ }
return
}
if ul == blas.Upper {
for i := 0; i < n; i++ {
ctmp := c[i*ldc+i : i*ldc+n]
- if beta != 1 {
+ switch beta {
+ case 0:
+ for j := range ctmp {
+ ctmp[j] = 0
+ }
+ case 1:
+ default:
for j := range ctmp {
ctmp[j] *= beta
}
@@ -659,7 +692,13 @@ func (Implementation) Ssyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl
}
for i := 0; i < n; i++ {
ctmp := c[i*ldc : i*ldc+i+1]
- if beta != 1 {
+ switch beta {
+ case 0:
+ for j := range ctmp {
+ ctmp[j] = 0
+ }
+ case 1:
+ default:
for j := range ctmp {
ctmp[j] *= beta
}

MODIFY
blas/gonum/level3float64.go
blas/gonum/level3float64.go
@@ -267,7 +267,6 @@ func (Implementation) Dsymm(s blas.Side, ul blas.Uplo, m, n int, alpha float64,
return
}
- if alpha == 0 {
if beta == 0 {
for i := 0; i < m; i++ {
ctmp := c[i*ldc : i*ldc+n]
@@ -275,14 +274,17 @@ func (Implementation) Dsymm(s blas.Side, ul blas.Uplo, m, n int, alpha float64,
ctmp[j] = 0
}
}
- return
}
+
+ if alpha == 0 {
+ if beta != 0 {
for i := 0; i < m; i++ {
ctmp := c[i*ldc : i*ldc+n]
for j := 0; j < n; j++ {
ctmp[j] *= beta
}
}
+ }
return
}
@@ -595,6 +597,18 @@ func (Implementation) Dsyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl
atmp := a[i*lda : i*lda+k]
btmp := b[i*ldb : i*ldb+k]
ctmp := c[i*ldc+i : i*ldc+n]
+ if beta == 0 {
+ for jc := range ctmp {
+ j := i + jc
+ var tmp1, tmp2 float64
+ binner := b[j*ldb : j*ldb+k]
+ for l, v := range a[j*lda : j*lda+k] {
+ tmp1 += v * btmp[l]
+ tmp2 += atmp[l] * binner[l]
+ }
+ ctmp[jc] = alpha * (tmp1 + tmp2)
+ }
+ } else {
for jc := range ctmp {
j := i + jc
var tmp1, tmp2 float64
@@ -607,12 +621,24 @@ func (Implementation) Dsyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl
ctmp[jc] += alpha * (tmp1 + tmp2)
}
}
+ }
return
}
for i := 0; i < n; i++ {
atmp := a[i*lda : i*lda+k]
btmp := b[i*ldb : i*ldb+k]
ctmp := c[i*ldc : i*ldc+i+1]
+ if beta == 0 {
+ for j := 0; j <= i; j++ {
+ var tmp1, tmp2 float64
+ binner := b[j*ldb : j*ldb+k]
+ for l, v := range a[j*lda : j*lda+k] {
+ tmp1 += v * btmp[l]
+ tmp2 += atmp[l] * binner[l]
+ }
+ ctmp[j] = alpha * (tmp1 + tmp2)
+ }
+ } else {
for j := 0; j <= i; j++ {
var tmp1, tmp2 float64
binner := b[j*ldb : j*ldb+k]
@@ -624,12 +650,19 @@ func (Implementation) Dsyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl
ctmp[j] += alpha * (tmp1 + tmp2)
}
}
+ }
return
}
if ul == blas.Upper {
for i := 0; i < n; i++ {
ctmp := c[i*ldc+i : i*ldc+n]
- if beta != 1 {
+ switch beta {
+ case 0:
+ for j := range ctmp {
+ ctmp[j] = 0
+ }
+ case 1:
+ default:
for j := range ctmp {
ctmp[j] *= beta
}
@@ -649,7 +682,13 @@ func (Implementation) Dsyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha fl
}
for i := 0; i < n; i++ {
ctmp := c[i*ldc : i*ldc+i+1]
- if beta != 1 {
+ switch beta {
+ case 0:
+ for j := range ctmp {
+ ctmp[j] = 0
+ }
+ case 1:
+ default:
for j := range ctmp {
ctmp[j] *= beta
}

MODIFY
blas/testblas/common.go
blas/testblas/common.go
@@ -647,7 +647,10 @@ func zmm(tA, tB blas.Transpose, m, n, k int, alpha complex128, a []complex128, l
}
for i := 0; i < m; i++ {
for j := 0; j < n; j++ {
- r[i*ldc+j] = alpha*r[i*ldc+j] + beta*c[i*ldc+j]
+ r[i*ldc+j] = alpha * r[i*ldc+j]
+ if beta != 0 {
+ r[i*ldc+j] += beta * c[i*ldc+j]
+ }
}
}
return r

MODIFY
blas/testblas/dsymm.go
blas/testblas/dsymm.go
package testblas
import (
+ "math"
"testing"
"gonum.org/v1/gonum/blas"
@@ -268,6 +269,238 @@ func DsymmTest(t *testing.T, blasser Dsymmer) {
{25, 65, 65},
},
},
+
+ {
+ side: blas.Left,
+ ul: blas.Upper,
+ m: 3,
+ n: 4,
+ a: [][]float64{
+ {2, 3, 4},
+ {0, 6, 7},
+ {0, 0, 10},
+ },
+ b: [][]float64{
+ {2, 3, 4, 8},
+ {5, 6, 7, 15},
+ {8, 9, 10, 20},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ },
+ alpha: 2,
+ ans: [][]float64{
+ {102, 120, 138, 282},
+ {184, 216, 248, 508},
+ {246, 288, 330, 674},
+ },
+ },
+ {
+ side: blas.Left,
+ ul: blas.Upper,
+ m: 4,
+ n: 3,
+ a: [][]float64{
+ {2, 3, 4, 8},
+ {0, 6, 7, 9},
+ {0, 0, 10, 10},
+ {0, 0, 0, 11},
+ },
+ b: [][]float64{
+ {2, 3, 4},
+ {5, 6, 7},
+ {8, 9, 10},
+ {2, 1, 1},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ },
+ alpha: 2,
+ ans: [][]float64{
+ {134, 136, 154},
+ {220, 234, 266},
+ {286, 308, 350},
+ {326, 358, 412},
+ },
+ },
+ {
+ side: blas.Left,
+ ul: blas.Lower,
+ m: 3,
+ n: 4,
+ a: [][]float64{
+ {2, 0, 0},
+ {3, 6, 0},
+ {4, 7, 10},
+ },
+ b: [][]float64{
+ {2, 3, 4, 8},
+ {5, 6, 7, 15},
+ {8, 9, 10, 20},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ },
+ alpha: 2,
+ ans: [][]float64{
+ {102, 120, 138, 282},
+ {184, 216, 248, 508},
+ {246, 288, 330, 674},
+ },
+ },
+ {
+ side: blas.Left,
+ ul: blas.Lower,
+ m: 4,
+ n: 3,
+ a: [][]float64{
+ {2, 0, 0, 0},
+ {3, 6, 0, 0},
+ {4, 7, 10, 0},
+ {8, 9, 10, 11},
+ },
+ b: [][]float64{
+ {2, 3, 4},
+ {5, 6, 7},
+ {8, 9, 10},
+ {2, 1, 1},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ },
+ alpha: 2,
+ ans: [][]float64{
+ {134, 136, 154},
+ {220, 234, 266},
+ {286, 308, 350},
+ {326, 358, 412},
+ },
+ },
+ {
+ side: blas.Right,
+ ul: blas.Upper,
+ m: 3,
+ n: 4,
+ a: [][]float64{
+ {2, 0, 0, 0},
+ {3, 6, 0, 0},
+ {4, 7, 10, 0},
+ {3, 4, 5, 6},
+ },
+ b: [][]float64{
+ {2, 3, 4, 9},
+ {5, 6, 7, -3},
+ {8, 9, 10, -2},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ },
+ alpha: 2,
+ ans: [][]float64{
+ {8, 36, 80, 108},
+ {20, 72, 140, -36},
+ {32, 108, 200, -24},
+ },
+ },
+ {
+ side: blas.Right,
+ ul: blas.Upper,
+ m: 4,
+ n: 3,
+ a: [][]float64{
+ {2, 0, 0},
+ {3, 6, 0},
+ {4, 7, 10},
+ },
+ b: [][]float64{
+ {2, 3, 4},
+ {5, 6, 7},
+ {8, 9, 10},
+ {2, 1, 1},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ },
+ alpha: 2,
+ ans: [][]float64{
+ {8, 36, 80, 20},
+ {72, 140, 32, 108},
+ {200, 8, 12, 20},
+ },
+ },
+ {
+ side: blas.Right,
+ ul: blas.Lower,
+ m: 3,
+ n: 4,
+ a: [][]float64{
+ {2, 0, 0, 0},
+ {3, 6, 0, 0},
+ {4, 7, 10, 0},
+ {3, 4, 5, 6},
+ },
+ b: [][]float64{
+ {2, 3, 4, 2},
+ {5, 6, 7, 1},
+ {8, 9, 10, 1},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN(), math.NaN()},
+ },
+ alpha: 2,
+ ans: [][]float64{
+ {70, 120, 158, 100},
+ {118, 208, 274, 160},
+ {172, 304, 400, 232},
+ },
+ },
+ {
+ side: blas.Right,
+ ul: blas.Lower,
+ m: 4,
+ n: 3,
+ a: [][]float64{
+ {2, 0, 0},
+ {3, 6, 0},
+ {4, 7, 10},
+ },
+ b: [][]float64{
+ {2, 3, 4},
+ {5, 6, 7},
+ {8, 9, 10},
+ {2, 1, 1},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.NaN(), math.NaN(), math.NaN()},
+ },
+ alpha: 2,
+ ans: [][]float64{
+ {58, 104, 138},
+ {112, 200, 264},
+ {166, 296, 390},
+ {22, 38, 50},
+ },
+ },
} {
aFlat := flatten(test.a)
bFlat := flatten(test.b)

MODIFY
blas/testblas/dsyr2k.go
blas/testblas/dsyr2k.go
package testblas
import (
+ "math"
"testing"
"gonum.org/v1/gonum/blas"
@@ -192,6 +193,165 @@ func Dsyr2kTest(t *testing.T, blasser Dsyr2ker) {
{360, 568, 774},
},
},
+
+ {
+ ul: blas.Upper,
+ tA: blas.NoTrans,
+ n: 3,
+ k: 2,
+ alpha: 0,
+ a: [][]float64{
+ {1, 2},
+ {3, 4},
+ {5, 6},
+ },
+ b: [][]float64{
+ {7, 8},
+ {9, 10},
+ {11, 12},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.Inf(-1), math.NaN(), math.NaN()},
+ {math.Inf(-1), math.Inf(-1), math.NaN()},
+ },
+ ans: [][]float64{
+ {0, 0, 0},
+ {math.Inf(-1), 0, 0},
+ {math.Inf(-1), math.Inf(-1), 0},
+ },
+ },
+ {
+ ul: blas.Lower,
+ tA: blas.NoTrans,
+ n: 3,
+ k: 2,
+ alpha: 0,
+ a: [][]float64{
+ {1, 2},
+ {3, 4},
+ {5, 6},
+ },
+ b: [][]float64{
+ {7, 8},
+ {9, 10},
+ {11, 12},
+ },
+ c: [][]float64{
+ {math.NaN(), math.Inf(-1), math.Inf(-1)},
+ {math.NaN(), math.NaN(), math.Inf(-1)},
+ {math.NaN(), math.NaN(), math.NaN()},
+ },
+ ans: [][]float64{
+ {0, math.Inf(-1), math.Inf(-1)},
+ {0, 0, math.Inf(-1)},
+ {0, 0, 0},
+ },
+ },
+ {
+ ul: blas.Upper,
+ tA: blas.NoTrans,
+ n: 3,
+ k: 2,
+ alpha: 3,
+ a: [][]float64{
+ {1, 2},
+ {3, 4},
+ {5, 6},
+ },
+ b: [][]float64{
+ {7, 8},
+ {9, 10},
+ {11, 12},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.Inf(-1), math.NaN(), math.NaN()},
+ {math.Inf(-1), math.Inf(-1), math.NaN()},
+ },
+ ans: [][]float64{
+ {138, 246, 354},
+ {math.Inf(-1), 402, 558},
+ {math.Inf(-1), math.Inf(-1), 762},
+ },
+ },
+ {
+ ul: blas.Lower,
+ tA: blas.NoTrans,
+ n: 3,
+ k: 2,
+ alpha: 3,
+ a: [][]float64{
+ {1, 2},
+ {3, 4},
+ {5, 6},
+ },
+ b: [][]float64{
+ {7, 8},
+ {9, 10},
+ {11, 12},
+ },
+ c: [][]float64{
+ {math.NaN(), math.Inf(-1), math.Inf(-1)},
+ {math.NaN(), math.NaN(), math.Inf(-1)},
+ {math.NaN(), math.NaN(), math.NaN()},
+ },
+ ans: [][]float64{
+ {138, math.Inf(-1), math.Inf(-1)},
+ {246, 402, math.Inf(-1)},
+ {354, 558, 762},
+ },
+ },
+ {
+ ul: blas.Upper,
+ tA: blas.Trans,
+ n: 3,
+ k: 2,
+ alpha: 3,
+ a: [][]float64{
+ {1, 3, 5},
+ {2, 4, 6},
+ },
+ b: [][]float64{
+ {7, 9, 11},
+ {8, 10, 12},
+ },
+ c: [][]float64{
+ {math.NaN(), math.NaN(), math.NaN()},
+ {math.Inf(-1), math.NaN(), math.NaN()},
+ {math.Inf(-1), math.Inf(-1), math.NaN()},
+ },
+ ans: [][]float64{
+ {138, 246, 354},
+ {math.Inf(-1), 402, 558},
+ {math.Inf(-1), math.Inf(-1), 762},
+ },
+ },
+ {
+ ul: blas.Lower,
+ tA: blas.Trans,
+ n: 3,
+ k: 2,
+ alpha: 3,
+ a: [][]float64{
+ {1, 3, 5},
+ {2, 4, 6},
+ },
+ b: [][]float64{
+ {7, 9, 11},
+ {8, 10, 12},
+ },
+ c: [][]float64{
+ {math.NaN(), math.Inf(-1), math.Inf(-1)},
+ {math.NaN(), math.NaN(), math.Inf(-1)},
+ {math.NaN(), math.NaN(), math.NaN()},
+ },
+ ans: [][]float64{
+ {138, math.Inf(-1), math.Inf(-1)},
+ {246, 402, math.Inf(-1)},
+ {354, 558, 762},
+ },
+ },
} {
aFlat := flatten(test.a)
bFlat := flatten(test.b)

MODIFY
blas/testblas/zhemm.go
blas/testblas/zhemm.go
@@ -10,6 +10,7 @@ import (
"testing"
"golang.org/x/exp/rand"
+
"gonum.org/v1/gonum/blas"
)
@@ -46,6 +47,13 @@ func zhemmTest(t *testing.T, impl Zhemmer, side blas.Side, uplo blas.Uplo, m, n
for _, ldc := range []int{max(1, n), n + 4} {
for _, alpha := range []complex128{0, 1, complex(0.7, -0.9)} {
for _, beta := range []complex128{0, 1, complex(1.3, -1.1)} {
+ for _, nanC := range []bool{false, true} {
+ if nanC && beta != 0 {
+ // Skip tests with C containing NaN values
+ // unless beta would zero out the NaNs.
+ continue
+ }
+
// Allocate the matrix A and fill it with random numbers.
a := make([]complex128, nA*lda)
for i := range a {
@@ -92,10 +100,13 @@ func zhemmTest(t *testing.T, impl Zhemmer, side blas.Side, uplo blas.Uplo, m, n
for i := range c {
c[i] = rndComplex128(rnd)
}
- // Create a copy of C for checking that
- // Zhemm does not modify C.
- cCopy := make([]complex128, len(c))
- copy(cCopy, c)
+ if nanC {
+ for i := 0; i < n; i++ {
+ for j := 0; j < m; j++ {
+ c[i+j*ldc] = cmplx.NaN()
+ }
+ }
+ }
// Compute the expected result using an internal Zgemm implementation.
var want []complex128
@@ -128,3 +139,4 @@ func zhemmTest(t *testing.T, impl Zhemmer, side blas.Side, uplo blas.Uplo, m, n
}
}
}
+}

MODIFY
blas/testblas/zsymm.go
blas/testblas/zsymm.go
@@ -6,9 +6,11 @@ package testblas
import (
"fmt"
+ "math/cmplx"
"testing"
"golang.org/x/exp/rand"
+
"gonum.org/v1/gonum/blas"
)
@@ -45,6 +47,13 @@ func zsymmTest(t *testing.T, impl Zsymmer, side blas.Side, uplo blas.Uplo, m, n
for _, ldc := range []int{max(1, n), n + 4} {
for _, alpha := range []complex128{0, 1, complex(0.7, -0.9)} {
for _, beta := range []complex128{0, 1, complex(1.3, -1.1)} {
+ for _, nanC := range []bool{false, true} {
+ if nanC && beta != 0 {
+ // Skip tests with C containing NaN values
+ // unless beta would zero out the NaNs.
+ continue
+ }
+
// Allocate the matrix A and fill it with random numbers.
a := make([]complex128, nA*lda)
for i := range a {
@@ -89,10 +98,13 @@ func zsymmTest(t *testing.T, impl Zsymmer, side blas.Side, uplo blas.Uplo, m, n
for i := range c {
c[i] = rndComplex128(rnd)
}
- // Create a copy of C for checking that
- // Zsymm does not modify C.
- cCopy := make([]complex128, len(c))
- copy(cCopy, c)
+ if nanC {
+ for i := 0; i < n; i++ {
+ for j := 0; j < m; j++ {
+ c[i+j*ldc] = cmplx.NaN()
+ }
+ }
+ }
// Compute the expected result using an internal Zgemm implementation.
var want []complex128
@@ -125,3 +137,4 @@ func zsymmTest(t *testing.T, impl Zsymmer, side blas.Side, uplo blas.Uplo, m, n
}
}
}
+}

MODIFY
blas/testblas/zsyrk.go
blas/testblas/zsyrk.go
@@ -6,6 +6,7 @@ package testblas
import (
"fmt"
+ "math/cmplx"
"testing"
"golang.org/x/exp/rand"
@@ -45,6 +46,13 @@ func zsyrkTest(t *testing.T, impl Zsyrker, uplo blas.Uplo, trans blas.Transpose,
for _, ldc := range []int{max(1, n), n + 4} {
for _, alpha := range []complex128{0, 1, complex(0.7, -0.9)} {
for _, beta := range []complex128{0, 1, complex(1.3, -1.1)} {
+ for _, nanC := range []bool{false, true} {
+ if nanC && beta != 0 {
+ // Skip tests with C containing NaN values
+ // unless beta would zero out the NaNs.
+ continue
+ }
+
// Allocate the matrix A and fill it with random numbers.
a := make([]complex128, rowA*lda)
for i := range a {
@@ -60,6 +68,14 @@ func zsyrkTest(t *testing.T, impl Zsyrker, uplo blas.Uplo, trans blas.Transpose,
for i := range c {
c[i] = rndComplex128(rnd)
}
+ if nanC {
+ for i := 0; i < n; i++ {
+ for j := 0; j < n; j++ {
+ c[i+j*ldc] = cmplx.NaN()
+ }
+ }
+ }
+
// Create a copy of C for checking that
// Zsyrk does not modify its triangle
// opposite to uplo.
@@ -133,3 +149,4 @@ func zsyrkTest(t *testing.T, impl Zsyrker, uplo blas.Uplo, trans blas.Transpose,
}
}
}
+}

blas/{gonum,testblas}: zero out elements of c when beta is zero