### DGELSD & DGESDD - bug in optimum workspace computation?

Posted:

**Wed Jun 15, 2005 11:35 am**Hi,

I had already reported this kind of bug (for DGELSD) by mail a few months ago, but it could not be reproduced (by Julien Langou), and I did not have time to follow up.

Since I have run across it again with DGESDD, I have investigated it more closely, and am still able to reproduce it with DGELSD, too:

When an optimum workspace query is requested by passing "-1" as argument for LWORK, both functions return sizes that are often smaller than the minimum workspace size as defined by the formulas in the documentation. I am able to reproduce this on Linux (i686) with the latest LAPACK-rpm for Fedora Core 3 (lapack-3.0-28).

Here is example code for DGELSD:

The above will print 67 as optimum workspace size. But the minimum length according to the documentation should be 739.

Here is example code for DGESDD:

Here it prints 10450 as optimum workspace size. But the formula in the documentation for the minimum demands 17700.

Has anybody else seen these problems? Could one of the developers please investigate it? - Thanks!

Best regards,

Markus

I had already reported this kind of bug (for DGELSD) by mail a few months ago, but it could not be reproduced (by Julien Langou), and I did not have time to follow up.

Since I have run across it again with DGESDD, I have investigated it more closely, and am still able to reproduce it with DGELSD, too:

When an optimum workspace query is requested by passing "-1" as argument for LWORK, both functions return sizes that are often smaller than the minimum workspace size as defined by the formulas in the documentation. I am able to reproduce this on Linux (i686) with the latest LAPACK-rpm for Fedora Core 3 (lapack-3.0-28).

Here is example code for DGELSD:

- Code: Select all
`double precision WORK(1)`

LDA = 100

LDB = 100

M = 100

N = 1

NRHS = 1

LWORK = -1

CALL DGELSD(M, N, NRHS, A, LDA, B, LDB, S, RCOND, RANK, WORK,

& LWORK, IWORK, INFO)

WRITE(*,*) 'M=',M,', N=',N,', NRHS=',NRHS

WRITE(*,*) 'IF LWORK = -1 THEN WORK(1) = ', WORK(1)

end

The above will print 67 as optimum workspace size. But the minimum length according to the documentation should be 739.

Here is example code for DGESDD:

- Code: Select all
`double precision WORK(1)`

LDA = 50

M = 50

N = 100

LDU = 50

LDVT = 100

LWORK = -1

CALL DGESDD('A', M, N, A, LDA, S, U, LDU, VT, LDVT, WORK,

& LWORK, IWORK, INFO)

WRITE(*,*) 'M=',M,', N=',N

WRITE(*,*) 'IF LWORK = -1 THEN WORK(1) = ', WORK(1)

end

Here it prints 10450 as optimum workspace size. But the formula in the documentation for the minimum demands 17700.

Has anybody else seen these problems? Could one of the developers please investigate it? - Thanks!

Best regards,

Markus