Skip to content

Commit

Permalink
Fix initialization of vector of pivoting information in gelsy!
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack authored and skumagai committed Aug 18, 2014
1 parent 5133c46 commit a049db7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/linalg/lapack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ for (gelsd, gelsy, elty) in
newB = [B; zeros($elty, max(0, n - size(B, 1)), size(B, 2))]
lda = max(1, m)
ldb = max(1, m, n)
jpvt = similar(A, BlasInt, n)
jpvt = zeros(BlasInt, n)
rcond = convert($elty, rcond)
rnk = Array(BlasInt, 1)
work = Array($elty, 1)
Expand Down Expand Up @@ -855,7 +855,7 @@ for (gelsd, gelsy, elty, relty) in
newB = [B; zeros($elty, max(0, n - size(B, 1)), size(B, 2))]
lda = max(1, m)
ldb = max(1, m, n)
jpvt = similar(A, BlasInt, n)
jpvt = zeros(BlasInt, n)
rcond = convert($relty, rcond)
rnk = Array(BlasInt, 1)
work = Array($elty, 1)
Expand Down
4 changes: 4 additions & 0 deletions test/linalg4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,7 @@ for newtype in [Diagonal, Bidiagonal, SymTridiagonal, Triangular, Matrix]
@test full(convert(newtype, A)) == full(A)
end

# Issue #7886
x, r = LAPACK.gelsy!([0 1; 0 2; 0 3.], [2, 4, 6.])
@test_approx_eq x [0,2]
@test r == 1

0 comments on commit a049db7

Please sign in to comment.