Skip to content

Commit

Permalink
fix #3966
Browse files Browse the repository at this point in the history
the size of the RWORK array in zgesdd was wrong.
  • Loading branch information
JeffBezanson committed Aug 7, 2013
1 parent 24189fc commit 484a9f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/linalg/lapack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

This comment has been minimized.

Copy link
@ViralBShah

ViralBShah Aug 7, 2013

Member

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

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

This comment has been minimized.

Copy link
@JeffBezanson

JeffBezanson Aug 7, 2013

Author Member

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?

This comment has been minimized.

Copy link
@vtjnash

vtjnash Aug 7, 2013

Member

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

This comment has been minimized.

Copy link
@ViralBShah

ViralBShah Aug 7, 2013

Member

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

end
iwork = Array(BlasInt, 8*minmn)
info = Array(BlasInt, 1)
Expand Down

3 comments on commit 484a9f0

@ViralBShah
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Keno
Copy link
Member

@Keno Keno commented on 484a9f0 Aug 12, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch makes my tests segfault. Any idea why?

@kmsquire
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.