Skip to content

Commit 9f60588

Browse files
committed
Match Octave/Numpy's minimum RWORK size for gesdd. Fixes #4016
gesdd's RWORK size was recently changed to match the netlib header. However, the minimum size calculated results in a segfault. Both Octave and Numpy use a different minimum size, and testing verified that anything smaller than this leads to a segfault. Numpy: https://github.com/numpy/numpy/blob/master/numpy/linalg/umath_linalg.c.src#L2922 Octave: http://hg.savannah.gnu.org/hgweb/octave/file/2f1729cae08f/liboctave/numeric/CmplxSVD.cc#l184
1 parent 3134f78 commit 9f60588

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/linalg/lapack.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in
858858
S = Array($relty, minmn)
859859
cmplx = iseltype(A,Complex)
860860
if cmplx
861-
rwork = Array($relty, job == 'N' ? 5*minmn :
861+
rwork = Array($relty, job == 'N' ? 7*minmn :
862862
minmn*max(5*minmn+7, 2*max(m,n)+2*minmn+1))
863863
end
864864
iwork = Array(BlasInt, 8*minmn)

0 commit comments

Comments
 (0)