Skip to content

Commit 552baf1

Browse files
xUNCSD2BY1: allow workspace query with LRWORK=-1
Previously, xUNCSD2BY1 only allowed workspace queries by passing LWORK=-1 (note the missing "R"). The new commit makes xUNCSD2BY1 behave, e.g., like xHEEVD.
1 parent d7e53d7 commit 552baf1

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

SRC/cuncsd2by1.f

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@
190190
*> The dimension of the array WORK.
191191
*>
192192
*> If LWORK = -1, then a workspace query is assumed; the routine
193-
*> only calculates the optimal size of the WORK array, returns
194-
*> this value as the first entry of the work array, and no error
195-
*> message related to LWORK is issued by XERBLA.
193+
*> only calculates the optimal size of the WORK and RWORK
194+
*> arrays, returns this value as the first entry of the WORK
195+
*> and RWORK array, respectively, and no error message related
196+
*> to LWORK or LRWORK is issued by XERBLA.
196197
*> \endverbatim
197198
*>
198199
*> \param[out] RWORK
@@ -211,10 +212,11 @@
211212
*> LRWORK is INTEGER
212213
*> The dimension of the array RWORK.
213214
*>
214-
*> If LRWORK = -1, then a workspace query is assumed; the routine
215-
*> only calculates the optimal size of the RWORK array, returns
216-
*> this value as the first entry of the work array, and no error
217-
*> message related to LRWORK is issued by XERBLA.
215+
*> If LRWORK=-1, then a workspace query is assumed; the routine
216+
*> only calculates the optimal size of the WORK and RWORK
217+
*> arrays, returns this value as the first entry of the WORK
218+
*> and RWORK array, respectively, and no error message related
219+
*> to LWORK or LRWORK is issued by XERBLA.
218220
*> \endverbatim
219221
*
220222
*> \param[out] IWORK
@@ -313,7 +315,7 @@ SUBROUTINE CUNCSD2BY1( JOBU1, JOBU2, JOBV1T, M, P, Q, X11, LDX11,
313315
WANTU1 = LSAME( JOBU1, 'Y' )
314316
WANTU2 = LSAME( JOBU2, 'Y' )
315317
WANTV1T = LSAME( JOBV1T, 'Y' )
316-
LQUERY = LWORK .EQ. -1
318+
LQUERY = ( LWORK.EQ.-1 ) .OR. ( LRWORK.EQ.-1 )
317319
*
318320
IF( M .LT. 0 ) THEN
319321
INFO = -4

SRC/zuncsd2by1.f

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,10 @@
189189
*> The dimension of the array WORK.
190190
*>
191191
*> If LWORK = -1, then a workspace query is assumed; the routine
192-
*> only calculates the optimal size of the WORK array, returns
193-
*> this value as the first entry of the work array, and no error
194-
*> message related to LWORK is issued by XERBLA.
192+
*> only calculates the optimal size of the WORK and RWORK
193+
*> arrays, returns this value as the first entry of the WORK
194+
*> and RWORK array, respectively, and no error message related
195+
*> to LWORK or LRWORK is issued by XERBLA.
195196
*> \endverbatim
196197
*>
197198
*> \param[out] RWORK
@@ -210,10 +211,11 @@
210211
*> LRWORK is INTEGER
211212
*> The dimension of the array RWORK.
212213
*>
213-
*> If LRWORK = -1, then a workspace query is assumed; the routine
214-
*> only calculates the optimal size of the RWORK array, returns
215-
*> this value as the first entry of the work array, and no error
216-
*> message related to LRWORK is issued by XERBLA.
214+
*> If LRWORK=-1, then a workspace query is assumed; the routine
215+
*> only calculates the optimal size of the WORK and RWORK
216+
*> arrays, returns this value as the first entry of the WORK
217+
*> and RWORK array, respectively, and no error message related
218+
*> to LWORK or LRWORK is issued by XERBLA.
217219
*> \endverbatim
218220
*
219221
*> \param[out] IWORK
@@ -312,7 +314,7 @@ SUBROUTINE ZUNCSD2BY1( JOBU1, JOBU2, JOBV1T, M, P, Q, X11, LDX11,
312314
WANTU1 = LSAME( JOBU1, 'Y' )
313315
WANTU2 = LSAME( JOBU2, 'Y' )
314316
WANTV1T = LSAME( JOBV1T, 'Y' )
315-
LQUERY = LWORK .EQ. -1
317+
LQUERY = ( LWORK.EQ.-1 ) .OR. ( LRWORK.EQ.-1 )
316318
*
317319
IF( M .LT. 0 ) THEN
318320
INFO = -4

0 commit comments

Comments
 (0)