I'm trying out the new Jacobi solver, but having a hard time figuring out

the workspace requirements. As a general comment, it would be very

helpful if this routine had the apparatus offered by many others, where

you can give LWORK = -1 and get a response indicating a suitable workspace

size.

But anyway, take a 3x3 input matrix (M = N = 3), and say we want the left or

right singular vectors but not both. By my reading of dgejsv.f, the minimal

LWORK is supposed to be max(2*N+M,7) = 9. But if I give LWORK = 9, my

program aborts with

** On entry to DGEQP3 parameter number 8 had an illegal value

Param 8 is dgeqp3's LWORK, passed by dgejsv; and looking inside

dgejsv, the first such call is

CALL DGEQP3( M,N,A,LDA, IWORK,WORK, WORK(N+1),LWORK-N, IERR )

With N = 3 and LWORK = 9 on input, this sends dgeqp3 an LWORK of 6

= 2*N. Yet inside dgeqp3 we find the requirement that LWORK >= 3*N+1.

So the abort is not surprising: dgejsv is making an illegal call to

dgeqp3. It seems to me that dgejsv has to specify a bigger minimal

LWORK.