### Incorrectly documented workspace in ZGESDD

Posted:

**Mon Mar 15, 2010 9:12 pm**In ZGESDD it is documented that the workspace size required by RWORK is 5*min(M,N)*min(M,N) + 7*min(M,N), if JOBZ is not 'N'. But looking at the code at line 1745:

we see that this is incorrect because RWORK in ZLARCM requires workspace of size 2*M*N and the larger dimension is not put in the formula. Since NRWORK = 2*N*N+N (assuming that N <= M) we get that the required workspace for RWORK is at least 2*N*(M+N) + N which is larger than 5*N*N+7*N for sufficiently large M.

I found out that something was wrong in this subroutine when I consistently was getting segmentation error working with the documented size of RWORK.

Zbigniew

- Code: Select all
`CALL ZLARCM( M, N, RWORK( IRVT ), M, VT, LDVT, A, LDA,`

$ RWORK( NRWORK ) )

we see that this is incorrect because RWORK in ZLARCM requires workspace of size 2*M*N and the larger dimension is not put in the formula. Since NRWORK = 2*N*N+N (assuming that N <= M) we get that the required workspace for RWORK is at least 2*N*(M+N) + N which is larger than 5*N*N+7*N for sufficiently large M.

I found out that something was wrong in this subroutine when I consistently was getting segmentation error working with the documented size of RWORK.

Zbigniew