Closed btracey closed 9 years ago
Not LGTM
My counter proposal is to add the following two test cases to testblas.DoubleOneVectorCases and the subsequent three case to testbals.DoubleTwoVectorCases for the reasons outlined in https://github.com/gonum/blas/issues/138#issuecomment-134771415. This fixes our behaviour as is for cgo, but requires a fix for native to push the n == 0 checks down. It has the additional advantage that it regularises the behaviour.
{
Name: "EmptyStationary",
X: []float64{},
Incx: 0,
N: 0,
Panic: true,
Dasum: 0,
Dnrm2: 0,
Idamax: -1,
DscalCases: []DScalCase{
{
Alpha: -2,
Ans: []float64{},
},
{
Alpha: 0,
Ans: []float64{},
},
},
},
{
Name: "EmptyReverse",
X: []float64{},
Incx: -1,
N: 0,
Panic: false,
Dasum: 0,
Dnrm2: 0,
Idamax: -1,
DscalCases: []DScalCase{
{
Alpha: -2,
Ans: []float64{},
},
{
Alpha: 0,
Ans: []float64{},
},
},
},
{
Name: "Empty",
X: []float64{},
Y: []float64{},
Incx: 1,
Incy: 1,
N: 0,
Panic: false,
DaxpyCases: []DaxpyCase{
{
Alpha: 2,
Ans: []float64{},
},
},
DrotCases: []DrotCase{
{
C: math.Cos(25 * math.Pi / 180),
S: math.Sin(25 * math.Pi / 180),
XAns: []float64{},
YAns: []float64{},
},
},
DrotmCases: []DrotmCase{
{
P: blas.DrotmParams{
Flag: blas.Rescaling,
H: [4]float64{0.9, 0.1, -0.1, 0.5},
},
XAns: []float64{},
YAns: []float64{},
},
},
},
{
Name: "EmptyStationary",
X: []float64{},
Y: []float64{},
Incx: 0,
Incy: 0,
N: 0,
Panic: true,
DaxpyCases: []DaxpyCase{
{
Alpha: 2,
Ans: []float64{},
},
},
DrotCases: []DrotCase{
{
C: math.Cos(25 * math.Pi / 180),
S: math.Sin(25 * math.Pi / 180),
XAns: []float64{},
YAns: []float64{},
},
},
DrotmCases: []DrotmCase{
{
P: blas.DrotmParams{
Flag: blas.Rescaling,
H: [4]float64{0.9, 0.1, -0.1, 0.5},
},
XAns: []float64{},
YAns: []float64{},
},
},
},
{
Name: "EmptyReverse",
X: []float64{},
Y: []float64{},
Incx: -1,
Incy: -1,
N: 0,
Panic: false,
DaxpyCases: []DaxpyCase{
{
Alpha: 2,
Ans: []float64{},
},
},
DrotCases: []DrotCase{
{
C: math.Cos(25 * math.Pi / 180),
S: math.Sin(25 * math.Pi / 180),
XAns: []float64{},
YAns: []float64{},
},
},
DrotmCases: []DrotmCase{
{
P: blas.DrotmParams{
Flag: blas.Rescaling,
H: [4]float64{0.9, 0.1, -0.1, 0.5},
},
XAns: []float64{},
YAns: []float64{},
},
},
},
Fixes 137.