Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix #3966

the size of the RWORK array in zgesdd was wrong.
  • Loading branch information...
commit 484a9f089200a9cc3cc37b30eb7c73574f719b1e 1 parent 24189fc
Jeff Bezanson JeffBezanson authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  base/linalg/lapack.jl
3  base/linalg/lapack.jl
View
@@ -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))
Viral B. Shah Owner

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

  rwork = Array($relty, job == 'N' ? 5*minmn : minmn*(5*minmn+7)
Jeff Bezanson 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?

Jameson Nash Collaborator
vtjnash added a note

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

Viral B. Shah Owner

Oops, I was looking at version 3.1 (http://www.netlib.no/netlib/lapack/complex16/zgesdd.f). This is correct.

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

2 comments on commit 484a9f0

Viral B. Shah

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

  rwork = Array($relty, job == 'N' ? 5*minmn : minmn*(5*minmn+7)
Jeff Bezanson

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?

Jameson Nash
Collaborator

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

Viral B. Shah

Oops, I was looking at version 3.1 (http://www.netlib.no/netlib/lapack/complex16/zgesdd.f). This is correct.

Keno Fischer
Owner

This patch makes my tests segfault. Any idea why?

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