Skip to content

Commit

Permalink
lapack/gonum: relax requirement on work length in Dbdsqr
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-ch committed Feb 26, 2018
1 parent e558b37 commit b704f67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lapack/gonum/dbdsqr.go
Expand Up @@ -43,7 +43,7 @@ import (
// C is a matrix of size n×ncc whose elements are stored in c. The elements
// of c are modified to contain Q^T * C on exit. C is not used if ncc == 0.
//
// work contains temporary storage and must have length at least 4*n. Dbdsqr
// work contains temporary storage and must have length at least 4*(n-1). Dbdsqr
// will panic if there is insufficient working memory.
//
// Dbdsqr returns whether the decomposition was successful.
Expand All @@ -68,7 +68,7 @@ func (impl Implementation) Dbdsqr(uplo blas.Uplo, n, ncvt, nru, ncc int, d, e, v
if len(e) < n-1 {
panic(badE)
}
if len(work) < 4*n {
if len(work) < 4*(n-1) {
panic(badWork)
}
var info int
Expand Down
2 changes: 1 addition & 1 deletion lapack/testlapack/dbdsqr.go
Expand Up @@ -70,7 +70,7 @@ func DbdsqrTest(t *testing.T, impl Dbdsqrer) {
copy(dCopy, d)
eCopy := make([]float64, len(e))
copy(eCopy, e)
work := make([]float64, 4*n)
work := make([]float64, 4*(n-1))
for i := range work {
work[i] = rnd.NormFloat64()
}
Expand Down

0 comments on commit b704f67

Please sign in to comment.