Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

fix #3966

the size of the RWORK array in zgesdd was wrong.
  • Loading branch information...
1 parent 24189fc commit 484a9f089200a9cc3cc37b30eb7c73574f719b1e @JeffBezanson JeffBezanson committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  base/linalg/lapack.jl
3  base/linalg/lapack.jl
@@ -858,7 +858,8 @@ for (geev, gesvd, gesdd, ggsvd, elty, relty) in
S = Array($relty, minmn)
cmplx = iseltype(A,Complex)
if cmplx
- rwork = Array($relty, job == 'N' ? 7*minmn : 5*minmn*minmn + 5*minmn)
+ rwork = Array($relty, job == 'N' ? 5*minmn :
+ minmn*max(5*minmn+7, 2*max(m,n)+2*minmn+1))
@ViralBShah Owner

Looking at the zgesdd docs, it seems like this should just be:

  rwork = Array($relty, job == 'N' ? 5*minmn : minmn*(5*minmn+7)
@JeffBezanson Owner

Is 5*minmn+7 always greater than 2*max(m,n)+2*minmn+1? If so, why is the comment in zgesdd written the way it is?

@vtjnash Collaborator
vtjnash added a note

not if max(m,n) >> minmn
(edit: exact formula is 2max > 3min+6)

@ViralBShah Owner

Oops, I was looking at version 3.1 ( This is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
iwork = Array(BlasInt, 8*minmn)
info = Array(BlasInt, 1)

3 comments on commit 484a9f0


This patch makes my tests segfault. Any idea why?


(Just to leave a trail: #4016, 9f60588)

Please sign in to comment.
Something went wrong with that request. Please try again.