blas/{gonum,testblas}: increase coverage cases for alpha and beta zeros
MODIFY
blas/testblas/dgemm.go
blas/testblas/dgemm.go
@@ -187,6 +187,31 @@ var DgemmCases = []DgemmCase{
{248, 132, 149},
},
},
+ {
+ m: 2,
+ n: 3,
+ k: 4,
+ alpha: 2,
+ beta: 0,
+ a: [][]float64{
+ {1, 2, 3, 4},
+ {4, 5, 6, 7},
+ },
+ b: [][]float64{
+ {1, 5, 8},
+ {5, -8, 9},
+ {6, 2, -3},
+ {8, 10, 2},
+ },
+ c: [][]float64{
+ {4, 8, 1},
+ {12, 16, 6},
+ },
+ ans: [][]float64{
+ {122, 70, 50},
+ {242, 124, 146},
+ },
+ },
}
// assumes [][]float64 is actually a matrix

MODIFY
blas/testblas/dsymm.go
blas/testblas/dsymm.go
@@ -57,6 +57,34 @@ func DsymmTest(t *testing.T, blasser Dsymmer) {
{282, 291, 327, 689},
},
},
+ {
+ side: blas.Left,
+ ul: blas.Upper,
+ m: 3,
+ n: 4,
+ a: [][]float64{
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ },
+ b: [][]float64{
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ {0, 0, 0, 0},
+ },
+ c: [][]float64{
+ {8, 12, 2, 1},
+ {9, 12, 9, 9},
+ {12, 1, -1, 5},
+ },
+ alpha: 0,
+ beta: 2,
+ ans: [][]float64{
+ {16, 24, 4, 2},
+ {18, 24, 18, 18},
+ {24, 2, -2, 10},
+ },
+ },
{
side: blas.Left,
ul: blas.Upper,

MODIFY
blas/testblas/dsyrk.go
blas/testblas/dsyrk.go
@@ -96,6 +96,29 @@ func DsyrkTest(t *testing.T, blasser Dsyker) {
{0, 0, 195},
},
},
+ {
+ ul: blas.Upper,
+ tA: blas.NoTrans,
+ n: 3,
+ k: 2,
+ alpha: 3,
+ a: [][]float64{
+ {1, 2},
+ {3, 4},
+ {5, 6},
+ },
+ c: [][]float64{
+ {1, 2, 3},
+ {0, 4, 5},
+ {0, 0, 6},
+ },
+ beta: 0,
+ ans: [][]float64{
+ {15, 33, 51},
+ {0, 75, 117},
+ {0, 0, 183},
+ },
+ },
{
ul: blas.Lower,
tA: blas.NoTrans,
@@ -119,6 +142,29 @@ func DsyrkTest(t *testing.T, blasser Dsyker) {
{57, 127, 195},
},
},
+ {
+ ul: blas.Lower,
+ tA: blas.NoTrans,
+ n: 3,
+ k: 2,
+ alpha: 3,
+ a: [][]float64{
+ {1, 2},
+ {3, 4},
+ {5, 6},
+ },
+ c: [][]float64{
+ {1, 0, 0},
+ {2, 4, 0},
+ {3, 5, 6},
+ },
+ beta: 0,
+ ans: [][]float64{
+ {15, 0, 0},
+ {33, 75, 0},
+ {51, 117, 183},
+ },
+ },
{
ul: blas.Upper,
tA: blas.Trans,
@@ -207,6 +253,50 @@ func DsyrkTest(t *testing.T, blasser Dsyker) {
{51, 117, 183},
},
},
+ {
+ ul: blas.Lower,
+ tA: blas.Trans,
+ n: 3,
+ k: 2,
+ alpha: 0,
+ a: [][]float64{
+ {1, 3, 5},
+ {2, 4, 6},
+ },
+ c: [][]float64{
+ {1, 0, 0},
+ {2, 4, 0},
+ {3, 5, 6},
+ },
+ beta: 0,
+ ans: [][]float64{
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ },
+ },
+ {
+ ul: blas.Upper,
+ tA: blas.Trans,
+ n: 3,
+ k: 2,
+ alpha: 0,
+ a: [][]float64{
+ {1, 3, 5},
+ {2, 4, 6},
+ },
+ c: [][]float64{
+ {1, 2, 3},
+ {0, 4, 5},
+ {0, 0, 6},
+ },
+ beta: 0,
+ ans: [][]float64{
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ },
+ },
} {
aFlat := flatten(test.a)
cFlat := flatten(test.c)

MODIFY
blas/testblas/dtrmm.go
blas/testblas/dtrmm.go
@@ -798,6 +798,28 @@ func DtrmmTest(t *testing.T, blasser Dtrmmer) {
{26, 80, 248},
},
},
+ {
+ s: blas.Right,
+ ul: blas.Lower,
+ tA: blas.Trans,
+ d: blas.Unit,
+ m: 2,
+ n: 3,
+ alpha: 0,
+ a: [][]float64{
+ {1, 0, 0},
+ {2, 4, 0},
+ {3, 5, 6},
+ },
+ b: [][]float64{
+ {10, 11, 12},
+ {13, 14, 15},
+ },
+ ans: [][]float64{
+ {0, 0, 0},
+ {0, 0, 0},
+ },
+ },
} {
aFlat := flatten(test.a)
bFlat := flatten(test.b)

blas/{gonum,testblas}: increase coverage cases for alpha and beta zeros