Skip to content

Commit f566474

Browse files
authored
Apply ROUNDUP_LWORK (Reference-LAPACK PR 904)
1 parent 71fbdd9 commit f566474

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+284
-269
lines changed

lapack-netlib/SRC/sgebrd.f

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
*> \author Univ. of Colorado Denver
148148
*> \author NAG Ltd.
149149
*
150-
*> \ingroup realGEcomputational
150+
*> \ingroup gebrd
151151
*
152152
*> \par Further Details:
153153
* =====================
@@ -230,11 +230,12 @@ SUBROUTINE SGEBRD( M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK,
230230
EXTERNAL SGEBD2, SGEMM, SLABRD, XERBLA
231231
* ..
232232
* .. Intrinsic Functions ..
233-
INTRINSIC MAX, MIN, REAL
233+
INTRINSIC MAX, MIN
234234
* ..
235235
* .. External Functions ..
236236
INTEGER ILAENV
237-
EXTERNAL ILAENV
237+
REAL SROUNDUP_LWORK
238+
EXTERNAL ILAENV, SROUNDUP_LWORK
238239
* ..
239240
* .. Executable Statements ..
240241
*
@@ -243,7 +244,7 @@ SUBROUTINE SGEBRD( M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK,
243244
INFO = 0
244245
NB = MAX( 1, ILAENV( 1, 'SGEBRD', ' ', M, N, -1, -1 ) )
245246
LWKOPT = ( M+N )*NB
246-
WORK( 1 ) = REAL( LWKOPT )
247+
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
247248
LQUERY = ( LWORK.EQ.-1 )
248249
IF( M.LT.0 ) THEN
249250
INFO = -1
@@ -341,7 +342,7 @@ SUBROUTINE SGEBRD( M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK,
341342
*
342343
CALL SGEBD2( M-I+1, N-I+1, A( I, I ), LDA, D( I ), E( I ),
343344
$ TAUQ( I ), TAUP( I ), WORK, IINFO )
344-
WORK( 1 ) = WS
345+
WORK( 1 ) = SROUNDUP_LWORK(WS)
345346
RETURN
346347
*
347348
* End of SGEBRD

lapack-netlib/SRC/sgees.f

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
*> \author Univ. of Colorado Denver
209209
*> \author NAG Ltd.
210210
*
211-
*> \ingroup realGEeigen
211+
*> \ingroup gees
212212
*
213213
* =====================================================================
214214
SUBROUTINE SGEES( JOBVS, SORT, SELECT, N, A, LDA, SDIM, WR, WI,
@@ -250,14 +250,14 @@ SUBROUTINE SGEES( JOBVS, SORT, SELECT, N, A, LDA, SDIM, WR, WI,
250250
REAL DUM( 1 )
251251
* ..
252252
* .. External Subroutines ..
253-
EXTERNAL SCOPY, SGEBAK, SGEBAL, SGEHRD, SHSEQR, SLABAD,
254-
$ SLACPY, SLASCL, SORGHR, SSWAP, STRSEN, XERBLA
253+
EXTERNAL SCOPY, SGEBAK, SGEBAL, SGEHRD, SHSEQR, SLACPY,
254+
$ SLASCL, SORGHR, SSWAP, STRSEN, XERBLA
255255
* ..
256256
* .. External Functions ..
257257
LOGICAL LSAME
258258
INTEGER ILAENV
259-
REAL SLAMCH, SLANGE
260-
EXTERNAL LSAME, ILAENV, SLAMCH, SLANGE
259+
REAL SLAMCH, SLANGE, SROUNDUP_LWORK
260+
EXTERNAL LSAME, ILAENV, SLAMCH, SLANGE, SROUNDUP_LWORK
261261
* ..
262262
* .. Intrinsic Functions ..
263263
INTRINSIC MAX, SQRT
@@ -312,7 +312,7 @@ SUBROUTINE SGEES( JOBVS, SORT, SELECT, N, A, LDA, SDIM, WR, WI,
312312
MAXWRK = MAX( MAXWRK, N + HSWORK )
313313
END IF
314314
END IF
315-
WORK( 1 ) = MAXWRK
315+
WORK( 1 ) = SROUNDUP_LWORK(MAXWRK)
316316
*
317317
IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
318318
INFO = -13
@@ -338,7 +338,6 @@ SUBROUTINE SGEES( JOBVS, SORT, SELECT, N, A, LDA, SDIM, WR, WI,
338338
EPS = SLAMCH( 'P' )
339339
SMLNUM = SLAMCH( 'S' )
340340
BIGNUM = ONE / SMLNUM
341-
CALL SLABAD( SMLNUM, BIGNUM )
342341
SMLNUM = SQRT( SMLNUM ) / EPS
343342
BIGNUM = ONE / SMLNUM
344343
*
@@ -524,7 +523,7 @@ SUBROUTINE SGEES( JOBVS, SORT, SELECT, N, A, LDA, SDIM, WR, WI,
524523
30 CONTINUE
525524
END IF
526525
*
527-
WORK( 1 ) = MAXWRK
526+
WORK( 1 ) = SROUNDUP_LWORK(MAXWRK)
528527
RETURN
529528
*
530529
* End of SGEES

lapack-netlib/SRC/sgeesx.f

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
*> \author Univ. of Colorado Denver
273273
*> \author NAG Ltd.
274274
*
275-
*> \ingroup realGEeigen
275+
*> \ingroup geesx
276276
*
277277
* =====================================================================
278278
SUBROUTINE SGEESX( JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM,
@@ -317,14 +317,14 @@ SUBROUTINE SGEESX( JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM,
317317
REAL DUM( 1 )
318318
* ..
319319
* .. External Subroutines ..
320-
EXTERNAL SCOPY, SGEBAK, SGEBAL, SGEHRD, SHSEQR, SLABAD,
320+
EXTERNAL SCOPY, SGEBAK, SGEBAL, SGEHRD, SHSEQR,
321321
$ SLACPY, SLASCL, SORGHR, SSWAP, STRSEN, XERBLA
322322
* ..
323323
* .. External Functions ..
324324
LOGICAL LSAME
325325
INTEGER ILAENV
326-
REAL SLAMCH, SLANGE
327-
EXTERNAL LSAME, ILAENV, SLAMCH, SLANGE
326+
REAL SLAMCH, SLANGE, SROUNDUP_LWORK
327+
EXTERNAL LSAME, ILAENV, SLAMCH, SLANGE, SROUNDUP_LWORK
328328
* ..
329329
* .. Intrinsic Functions ..
330330
INTRINSIC MAX, SQRT
@@ -398,7 +398,7 @@ SUBROUTINE SGEESX( JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM,
398398
$ LIWRK = ( N*N )/4
399399
END IF
400400
IWORK( 1 ) = LIWRK
401-
WORK( 1 ) = LWRK
401+
WORK( 1 ) = SROUNDUP_LWORK(LWRK)
402402
*
403403
IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
404404
INFO = -16
@@ -426,7 +426,6 @@ SUBROUTINE SGEESX( JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM,
426426
EPS = SLAMCH( 'P' )
427427
SMLNUM = SLAMCH( 'S' )
428428
BIGNUM = ONE / SMLNUM
429-
CALL SLABAD( SMLNUM, BIGNUM )
430429
SMLNUM = SQRT( SMLNUM ) / EPS
431430
BIGNUM = ONE / SMLNUM
432431
*
@@ -634,7 +633,7 @@ SUBROUTINE SGEESX( JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM,
634633
30 CONTINUE
635634
END IF
636635
*
637-
WORK( 1 ) = MAXWRK
636+
WORK( 1 ) = SROUNDUP_LWORK(MAXWRK)
638637
IF( WANTSV .OR. WANTSB ) THEN
639638
IWORK( 1 ) = SDIM*(N-SDIM)
640639
ELSE

lapack-netlib/SRC/sgeev.f

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
*
185185
* @generated from dgeev.f, fortran d -> s, Tue Apr 19 01:47:44 2016
186186
*
187-
*> \ingroup realGEeigen
187+
*> \ingroup geev
188188
*
189189
* =====================================================================
190190
SUBROUTINE SGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR,
@@ -223,16 +223,15 @@ SUBROUTINE SGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR,
223223
REAL DUM( 1 )
224224
* ..
225225
* .. External Subroutines ..
226-
EXTERNAL SGEBAK, SGEBAL, SGEHRD, SHSEQR, SLABAD, SLACPY,
227-
$ SLARTG, SLASCL, SORGHR, SROT, SSCAL, STREVC3,
228-
$ XERBLA
226+
EXTERNAL SGEBAK, SGEBAL, SGEHRD, SHSEQR, SLACPY, SLARTG,
227+
$ SLASCL, SORGHR, SROT, SSCAL, STREVC3, XERBLA
229228
* ..
230229
* .. External Functions ..
231230
LOGICAL LSAME
232231
INTEGER ISAMAX, ILAENV
233-
REAL SLAMCH, SLANGE, SLAPY2, SNRM2
232+
REAL SLAMCH, SLANGE, SLAPY2, SNRM2, SROUNDUP_LWORK
234233
EXTERNAL LSAME, ISAMAX, ILAENV, SLAMCH, SLANGE, SLAPY2,
235-
$ SNRM2
234+
$ SNRM2, SROUNDUP_LWORK
236235
* ..
237236
* .. Intrinsic Functions ..
238237
INTRINSIC MAX, SQRT
@@ -312,7 +311,7 @@ SUBROUTINE SGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR,
312311
END IF
313312
MAXWRK = MAX( MAXWRK, MINWRK )
314313
END IF
315-
WORK( 1 ) = MAXWRK
314+
WORK( 1 ) = SROUNDUP_LWORK(MAXWRK)
316315
*
317316
IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
318317
INFO = -13
@@ -336,7 +335,6 @@ SUBROUTINE SGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR,
336335
EPS = SLAMCH( 'P' )
337336
SMLNUM = SLAMCH( 'S' )
338337
BIGNUM = ONE / SMLNUM
339-
CALL SLABAD( SMLNUM, BIGNUM )
340338
SMLNUM = SQRT( SMLNUM ) / EPS
341339
BIGNUM = ONE / SMLNUM
342340
*
@@ -519,7 +517,7 @@ SUBROUTINE SGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR,
519517
END IF
520518
END IF
521519
*
522-
WORK( 1 ) = MAXWRK
520+
WORK( 1 ) = SROUNDUP_LWORK(MAXWRK)
523521
RETURN
524522
*
525523
* End of SGEEV

lapack-netlib/SRC/sgeevx.f

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297
*
298298
* @generated from dgeevx.f, fortran d -> s, Tue Apr 19 01:47:44 2016
299299
*
300-
*> \ingroup realGEeigen
300+
*> \ingroup geevx
301301
*
302302
* =====================================================================
303303
SUBROUTINE SGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI,
@@ -341,16 +341,16 @@ SUBROUTINE SGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI,
341341
REAL DUM( 1 )
342342
* ..
343343
* .. External Subroutines ..
344-
EXTERNAL SGEBAK, SGEBAL, SGEHRD, SHSEQR, SLABAD, SLACPY,
344+
EXTERNAL SGEBAK, SGEBAL, SGEHRD, SHSEQR, SLACPY,
345345
$ SLARTG, SLASCL, SORGHR, SROT, SSCAL, STREVC3,
346346
$ STRSNA, XERBLA
347347
* ..
348348
* .. External Functions ..
349349
LOGICAL LSAME
350350
INTEGER ISAMAX, ILAENV
351-
REAL SLAMCH, SLANGE, SLAPY2, SNRM2
351+
REAL SLAMCH, SLANGE, SLAPY2, SNRM2, SROUNDUP_LWORK
352352
EXTERNAL LSAME, ISAMAX, ILAENV, SLAMCH, SLANGE, SLAPY2,
353-
$ SNRM2
353+
$ SNRM2, SROUNDUP_LWORK
354354
* ..
355355
* .. Intrinsic Functions ..
356356
INTRINSIC MAX, SQRT
@@ -453,7 +453,7 @@ SUBROUTINE SGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI,
453453
END IF
454454
MAXWRK = MAX( MAXWRK, MINWRK )
455455
END IF
456-
WORK( 1 ) = MAXWRK
456+
WORK( 1 ) = SROUNDUP_LWORK(MAXWRK)
457457
*
458458
IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
459459
INFO = -21
@@ -477,7 +477,6 @@ SUBROUTINE SGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI,
477477
EPS = SLAMCH( 'P' )
478478
SMLNUM = SLAMCH( 'S' )
479479
BIGNUM = ONE / SMLNUM
480-
CALL SLABAD( SMLNUM, BIGNUM )
481480
SMLNUM = SQRT( SMLNUM ) / EPS
482481
BIGNUM = ONE / SMLNUM
483482
*
@@ -684,7 +683,7 @@ SUBROUTINE SGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI,
684683
END IF
685684
END IF
686685
*
687-
WORK( 1 ) = MAXWRK
686+
WORK( 1 ) = SROUNDUP_LWORK(MAXWRK)
688687
RETURN
689688
*
690689
* End of SGEEVX

lapack-netlib/SRC/sgehrd.f

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
*> \author Univ. of Colorado Denver
121121
*> \author NAG Ltd.
122122
*
123-
*> \ingroup realGEcomputational
123+
*> \ingroup gehrd
124124
*
125125
*> \par Further Details:
126126
* =====================
@@ -201,7 +201,8 @@ SUBROUTINE SGEHRD( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO )
201201
* ..
202202
* .. External Functions ..
203203
INTEGER ILAENV
204-
EXTERNAL ILAENV
204+
REAL SROUNDUP_LWORK
205+
EXTERNAL ILAENV, SROUNDUP_LWORK
205206
* ..
206207
* .. Executable Statements ..
207208
*
@@ -227,7 +228,7 @@ SUBROUTINE SGEHRD( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO )
227228
*
228229
NB = MIN( NBMAX, ILAENV( 1, 'SGEHRD', ' ', N, ILO, IHI, -1 ) )
229230
LWKOPT = N*NB + TSIZE
230-
WORK( 1 ) = LWKOPT
231+
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
231232
END IF
232233
*
233234
IF( INFO.NE.0 ) THEN
@@ -344,7 +345,7 @@ SUBROUTINE SGEHRD( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO )
344345
* Use unblocked code to reduce the rest of the matrix
345346
*
346347
CALL SGEHD2( N, I, IHI, A, LDA, TAU, WORK, IINFO )
347-
WORK( 1 ) = LWKOPT
348+
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
348349
*
349350
RETURN
350351
*

lapack-netlib/SRC/sgelq.f

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@
166166
*> the LQ factorization.
167167
*> \endverbatim
168168
*>
169+
*> \ingroup gelq
170+
*>
169171
* =====================================================================
170172
SUBROUTINE SGELQ( M, N, A, LDA, T, TSIZE, WORK, LWORK,
171173
$ INFO )
@@ -190,7 +192,8 @@ SUBROUTINE SGELQ( M, N, A, LDA, T, TSIZE, WORK, LWORK,
190192
* ..
191193
* .. External Functions ..
192194
LOGICAL LSAME
193-
EXTERNAL LSAME
195+
REAL SROUNDUP_LWORK
196+
EXTERNAL LSAME, SROUNDUP_LWORK
194197
* ..
195198
* .. External Subroutines ..
196199
EXTERNAL SGELQT, SLASWLQ, XERBLA
@@ -292,9 +295,9 @@ SUBROUTINE SGELQ( M, N, A, LDA, T, TSIZE, WORK, LWORK,
292295
T( 2 ) = MB
293296
T( 3 ) = NB
294297
IF( MINW ) THEN
295-
WORK( 1 ) = LWMIN
298+
WORK( 1 ) = SROUNDUP_LWORK(LWMIN)
296299
ELSE
297-
WORK( 1 ) = LWREQ
300+
WORK( 1 ) = SROUNDUP_LWORK(LWREQ)
298301
END IF
299302
END IF
300303
IF( INFO.NE.0 ) THEN
@@ -319,7 +322,7 @@ SUBROUTINE SGELQ( M, N, A, LDA, T, TSIZE, WORK, LWORK,
319322
$ LWORK, INFO )
320323
END IF
321324
*
322-
WORK( 1 ) = LWREQ
325+
WORK( 1 ) = SROUNDUP_LWORK(LWREQ)
323326
RETURN
324327
*
325328
* End of SGELQ

lapack-netlib/SRC/sgelqf.f

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
*> \author Univ. of Colorado Denver
119119
*> \author NAG Ltd.
120120
*
121-
*> \ingroup realGEcomputational
121+
*> \ingroup gelqf
122122
*
123123
*> \par Further Details:
124124
* =====================
@@ -167,7 +167,8 @@ SUBROUTINE SGELQF( M, N, A, LDA, TAU, WORK, LWORK, INFO )
167167
* ..
168168
* .. External Functions ..
169169
INTEGER ILAENV
170-
EXTERNAL ILAENV
170+
REAL SROUNDUP_LWORK
171+
EXTERNAL ILAENV, SROUNDUP_LWORK
171172
* ..
172173
* .. Executable Statements ..
173174
*
@@ -176,7 +177,7 @@ SUBROUTINE SGELQF( M, N, A, LDA, TAU, WORK, LWORK, INFO )
176177
INFO = 0
177178
NB = ILAENV( 1, 'SGELQF', ' ', M, N, -1, -1 )
178179
LWKOPT = M*NB
179-
WORK( 1 ) = LWKOPT
180+
WORK( 1 ) = SROUNDUP_LWORK(LWKOPT)
180181
LQUERY = ( LWORK.EQ.-1 )
181182
IF( M.LT.0 ) THEN
182183
INFO = -1
@@ -266,7 +267,7 @@ SUBROUTINE SGELQF( M, N, A, LDA, TAU, WORK, LWORK, INFO )
266267
$ CALL SGELQ2( M-I+1, N-I+1, A( I, I ), LDA, TAU( I ), WORK,
267268
$ IINFO )
268269
*
269-
WORK( 1 ) = IWS
270+
WORK( 1 ) = SROUNDUP_LWORK(IWS)
270271
RETURN
271272
*
272273
* End of SGELQF

0 commit comments

Comments
 (0)