Fixed reference behavior for Drotm with flag -2 and updated tests

This commit is contained in:
btracey
2014-01-06 15:05:06 -08:00
parent db35dc7d3a
commit 4f28f4f373
2 changed files with 4 additions and 2 deletions

View File

@@ -431,7 +431,7 @@ func (Blas) Drotm(n int, x []float64, incX int, y []float64, incY int, p blas.Dr
} }
flag := p.Flag flag := p.Flag
if flag == -2 { if flag == -2 {
panic("flag is negative 2") return
} }
if incX == incY && incX > 0 { if incX == incY && incX > 0 {
nsteps := n * incX nsteps := n * incX

View File

@@ -473,6 +473,8 @@ var DoubleTwoVectorCases []DoubleTwoVectorCase = []DoubleTwoVectorCase{
Flag: -2, Flag: -2,
H: [4]float64{0.9, 0.1, -0.1, 0.5}, H: [4]float64{0.9, 0.1, -0.1, 0.5},
}, },
XAns: []float64{10, 15, -6, 3, 14, 7},
YAns: []float64{8, -2, 4, 7, 6, -3},
Name: "Neg2Flag", Name: "Neg2Flag",
}, },
{ {
@@ -1607,7 +1609,7 @@ func DrotmTest(t *testing.T, d Drotmer) {
for _, c := range DoubleTwoVectorCases { for _, c := range DoubleTwoVectorCases {
for _, kind := range c.DrotmCases { for _, kind := range c.DrotmCases {
dCopyTwoTmp(c.X, c.XTmp, c.Y, c.YTmp) dCopyTwoTmp(c.X, c.XTmp, c.Y, c.YTmp)
if c.Panic || kind.P.Flag == -2 { if c.Panic {
f := func() { drotm(c.N, c.XTmp, c.Incx, c.YTmp, c.Incy, kind.P) } f := func() { drotm(c.N, c.XTmp, c.Incx, c.YTmp, c.Incy, kind.P) }
testpanics(f, c.Name+", "+kind.Name, t) testpanics(f, c.Name+", "+kind.Name, t)
continue continue