Skip to content

Commit d272841

Browse files
committed
fix workspace and scratch in multishift qr code
1 parent deb8643 commit d272841

File tree

12 files changed

+54
-54
lines changed

12 files changed

+54
-54
lines changed

SRC/chseqr.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,10 @@ SUBROUTINE CHSEQR( JOB, COMPZ, N, ILO, IHI, H, LDH, W, Z, LDZ,
320320
* . CLAHQR because of insufficient subdiagonal scratch space.
321321
* . (This is a hard limit.) ====
322322
INTEGER NTINY
323-
PARAMETER ( NTINY = 13 )
323+
PARAMETER ( NTINY = 15 )
324324
*
325325
* ==== NL allocates some local workspace to help small matrices
326-
* . through a rare CLAHQR failure. NL > NTINY = 13 is
326+
* . through a rare CLAHQR failure. NL > NTINY = 15 is
327327
* . required and NL <= NMIN = ILAENV(ISPEC=12,...) is recom-
328328
* . mended. (The default value of NMIN is 75.) Using NL = 49
329329
* . allows up to six simultaneous shifts and a 16-by-16

SRC/claqr0.f

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ SUBROUTINE CLAQR0( WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ,
260260
* . CLAHQR because of insufficient subdiagonal scratch space.
261261
* . (This is a hard limit.) ====
262262
INTEGER NTINY
263-
PARAMETER ( NTINY = 13 )
263+
PARAMETER ( NTINY = 15 )
264264
*
265265
* ==== Exceptional deflation windows: try to cure rare
266266
* . slow convergence by varying the size of the
@@ -355,22 +355,22 @@ SUBROUTINE CLAQR0( WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ,
355355
END IF
356356
*
357357
* ==== NWR = recommended deflation window size. At this
358-
* . point, N .GT. NTINY = 13, so there is enough
358+
* . point, N .GT. NTINY = 15, so there is enough
359359
* . subdiagonal workspace for NWR.GE.2 as required.
360360
* . (In fact, there is enough subdiagonal space for
361-
* . NWR.GE.3.) ====
361+
* . NWR.GE.4.) ====
362362
*
363363
NWR = ILAENV( 13, 'CLAQR0', JBCMPZ, N, ILO, IHI, LWORK )
364364
NWR = MAX( 2, NWR )
365365
NWR = MIN( IHI-ILO+1, ( N-1 ) / 3, NWR )
366366
*
367367
* ==== NSR = recommended number of simultaneous shifts.
368-
* . At this point N .GT. NTINY = 13, so there is at
368+
* . At this point N .GT. NTINY = 15, so there is at
369369
* . enough subdiagonal workspace for NSR to be even
370370
* . and greater than or equal to two as required. ====
371371
*
372372
NSR = ILAENV( 15, 'CLAQR0', JBCMPZ, N, ILO, IHI, LWORK )
373-
NSR = MIN( NSR, ( N+6 ) / 9, IHI-ILO )
373+
NSR = MIN( NSR, ( N-3 ) / 6, IHI-ILO )
374374
NSR = MAX( 2, NSR-MOD( NSR, 2 ) )
375375
*
376376
* ==== Estimate optimal workspace ====
@@ -418,7 +418,7 @@ SUBROUTINE CLAQR0( WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ,
418418
* ==== NSMAX = the Largest number of simultaneous shifts
419419
* . for which there is sufficient workspace. ====
420420
*
421-
NSMAX = MIN( ( N+6 ) / 9, 2*LWORK / 3 )
421+
NSMAX = MIN( ( N-3 ) / 6, 2*LWORK / 3 )
422422
NSMAX = NSMAX - MOD( NSMAX, 2 )
423423
*
424424
* ==== NDFL: an iteration count restarted at deflation. ====

SRC/claqr4.f

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ SUBROUTINE CLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ,
270270
* . CLAHQR because of insufficient subdiagonal scratch space.
271271
* . (This is a hard limit.) ====
272272
INTEGER NTINY
273-
PARAMETER ( NTINY = 13 )
273+
PARAMETER ( NTINY = 15 )
274274
*
275275
* ==== Exceptional deflation windows: try to cure rare
276276
* . slow convergence by varying the size of the
@@ -365,17 +365,17 @@ SUBROUTINE CLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, W, ILOZ,
365365
END IF
366366
*
367367
* ==== NWR = recommended deflation window size. At this
368-
* . point, N .GT. NTINY = 13, so there is enough
368+
* . point, N .GT. NTINY = 15, so there is enough
369369
* . subdiagonal workspace for NWR.GE.2 as required.
370370
* . (In fact, there is enough subdiagonal space for
371-
* . NWR.GE.3.) ====
371+
* . NWR.GE.4.) ====
372372
*
373373
NWR = ILAENV( 13, 'CLAQR4', JBCMPZ, N, ILO, IHI, LWORK )
374374
NWR = MAX( 2, NWR )
375375
NWR = MIN( IHI-ILO+1, ( N-1 ) / 3, NWR )
376376
*
377377
* ==== NSR = recommended number of simultaneous shifts.
378-
* . At this point N .GT. NTINY = 13, so there is at
378+
* . At this point N .GT. NTINY = 15, so there is at
379379
* . enough subdiagonal workspace for NSR to be even
380380
* . and greater than or equal to two as required. ====
381381
*

SRC/dhseqr.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,10 @@ SUBROUTINE DHSEQR( JOB, COMPZ, N, ILO, IHI, H, LDH, WR, WI, Z,
338338
* . DLAHQR because of insufficient subdiagonal scratch space.
339339
* . (This is a hard limit.) ====
340340
INTEGER NTINY
341-
PARAMETER ( NTINY = 13 )
341+
PARAMETER ( NTINY = 15 )
342342
*
343343
* ==== NL allocates some local workspace to help small matrices
344-
* . through a rare DLAHQR failure. NL > NTINY = 13 is
344+
* . through a rare DLAHQR failure. NL > NTINY = 15 is
345345
* . required and NL <= NMIN = ILAENV(ISPEC=12,...) is recom-
346346
* . mended. (The default value of NMIN is 75.) Using NL = 49
347347
* . allows up to six simultaneous shifts and a 16-by-16

SRC/dlaqr0.f

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ SUBROUTINE DLAQR0( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
278278
* . DLAHQR because of insufficient subdiagonal scratch space.
279279
* . (This is a hard limit.) ====
280280
INTEGER NTINY
281-
PARAMETER ( NTINY = 13 )
281+
PARAMETER ( NTINY = 15 )
282282
*
283283
* ==== Exceptional deflation windows: try to cure rare
284284
* . slow convergence by varying the size of the
@@ -362,22 +362,22 @@ SUBROUTINE DLAQR0( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
362362
END IF
363363
*
364364
* ==== NWR = recommended deflation window size. At this
365-
* . point, N .GT. NTINY = 13, so there is enough
365+
* . point, N .GT. NTINY = 14, so there is enough
366366
* . subdiagonal workspace for NWR.GE.2 as required.
367367
* . (In fact, there is enough subdiagonal space for
368-
* . NWR.GE.3.) ====
368+
* . NWR.GE.4.) ====
369369
*
370370
NWR = ILAENV( 13, 'DLAQR0', JBCMPZ, N, ILO, IHI, LWORK )
371371
NWR = MAX( 2, NWR )
372372
NWR = MIN( IHI-ILO+1, ( N-1 ) / 3, NWR )
373373
*
374374
* ==== NSR = recommended number of simultaneous shifts.
375-
* . At this point N .GT. NTINY = 13, so there is at
375+
* . At this point N .GT. NTINY = 15, so there is at
376376
* . enough subdiagonal workspace for NSR to be even
377377
* . and greater than or equal to two as required. ====
378378
*
379379
NSR = ILAENV( 15, 'DLAQR0', JBCMPZ, N, ILO, IHI, LWORK )
380-
NSR = MIN( NSR, ( N+6 ) / 9, IHI-ILO )
380+
NSR = MIN( NSR, ( N-3 ) / 6, IHI-ILO )
381381
NSR = MAX( 2, NSR-MOD( NSR, 2 ) )
382382
*
383383
* ==== Estimate optimal workspace ====
@@ -425,7 +425,7 @@ SUBROUTINE DLAQR0( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
425425
* ==== NSMAX = the Largest number of simultaneous shifts
426426
* . for which there is sufficient workspace. ====
427427
*
428-
NSMAX = MIN( ( N+6 ) / 9, 2*LWORK / 3 )
428+
NSMAX = MIN( ( N-3 ) / 6, 2*LWORK / 3 )
429429
NSMAX = NSMAX - MOD( NSMAX, 2 )
430430
*
431431
* ==== NDFL: an iteration count restarted at deflation. ====

SRC/dlaqr4.f

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ SUBROUTINE DLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
284284
* . DLAHQR because of insufficient subdiagonal scratch space.
285285
* . (This is a hard limit.) ====
286286
INTEGER NTINY
287-
PARAMETER ( NTINY = 13 )
287+
PARAMETER ( NTINY = 15 )
288288
*
289289
* ==== Exceptional deflation windows: try to cure rare
290290
* . slow convergence by varying the size of the
@@ -368,22 +368,22 @@ SUBROUTINE DLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
368368
END IF
369369
*
370370
* ==== NWR = recommended deflation window size. At this
371-
* . point, N .GT. NTINY = 13, so there is enough
371+
* . point, N .GT. NTINY = 15, so there is enough
372372
* . subdiagonal workspace for NWR.GE.2 as required.
373373
* . (In fact, there is enough subdiagonal space for
374-
* . NWR.GE.3.) ====
374+
* . NWR.GE.4.) ====
375375
*
376376
NWR = ILAENV( 13, 'DLAQR4', JBCMPZ, N, ILO, IHI, LWORK )
377377
NWR = MAX( 2, NWR )
378378
NWR = MIN( IHI-ILO+1, ( N-1 ) / 3, NWR )
379379
*
380380
* ==== NSR = recommended number of simultaneous shifts.
381-
* . At this point N .GT. NTINY = 13, so there is at
381+
* . At this point N .GT. NTINY = 15, so there is at
382382
* . enough subdiagonal workspace for NSR to be even
383383
* . and greater than or equal to two as required. ====
384384
*
385385
NSR = ILAENV( 15, 'DLAQR4', JBCMPZ, N, ILO, IHI, LWORK )
386-
NSR = MIN( NSR, ( N+6 ) / 9, IHI-ILO )
386+
NSR = MIN( NSR, ( N-3 ) / 6, IHI-ILO )
387387
NSR = MAX( 2, NSR-MOD( NSR, 2 ) )
388388
*
389389
* ==== Estimate optimal workspace ====
@@ -431,7 +431,7 @@ SUBROUTINE DLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
431431
* ==== NSMAX = the Largest number of simultaneous shifts
432432
* . for which there is sufficient workspace. ====
433433
*
434-
NSMAX = MIN( ( N+6 ) / 9, 2*LWORK / 3 )
434+
NSMAX = MIN( ( N-3 ) / 6, 2*LWORK / 3 )
435435
NSMAX = NSMAX - MOD( NSMAX, 2 )
436436
*
437437
* ==== NDFL: an iteration count restarted at deflation. ====

SRC/shseqr.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,10 @@ SUBROUTINE SHSEQR( JOB, COMPZ, N, ILO, IHI, H, LDH, WR, WI, Z,
338338
* . SLAHQR because of insufficient subdiagonal scratch space.
339339
* . (This is a hard limit.) ====
340340
INTEGER NTINY
341-
PARAMETER ( NTINY = 13 )
341+
PARAMETER ( NTINY = 15 )
342342
*
343343
* ==== NL allocates some local workspace to help small matrices
344-
* . through a rare SLAHQR failure. NL > NTINY = 13 is
344+
* . through a rare SLAHQR failure. NL > NTINY = 15 is
345345
* . required and NL <= NMIN = ILAENV(ISPEC=12,...) is recom-
346346
* . mended. (The default value of NMIN is 75.) Using NL = 49
347347
* . allows up to six simultaneous shifts and a 16-by-16

SRC/slaqr0.f

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ SUBROUTINE SLAQR0( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
277277
* . SLAHQR because of insufficient subdiagonal scratch space.
278278
* . (This is a hard limit.) ====
279279
INTEGER NTINY
280-
PARAMETER ( NTINY = 13 )
280+
PARAMETER ( NTINY = 15 )
281281
*
282282
* ==== Exceptional deflation windows: try to cure rare
283283
* . slow convergence by varying the size of the
@@ -361,22 +361,22 @@ SUBROUTINE SLAQR0( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
361361
END IF
362362
*
363363
* ==== NWR = recommended deflation window size. At this
364-
* . point, N .GT. NTINY = 13, so there is enough
364+
* . point, N .GT. NTINY = 15, so there is enough
365365
* . subdiagonal workspace for NWR.GE.2 as required.
366366
* . (In fact, there is enough subdiagonal space for
367-
* . NWR.GE.3.) ====
367+
* . NWR.GE.4.) ====
368368
*
369369
NWR = ILAENV( 13, 'SLAQR0', JBCMPZ, N, ILO, IHI, LWORK )
370370
NWR = MAX( 2, NWR )
371371
NWR = MIN( IHI-ILO+1, ( N-1 ) / 3, NWR )
372372
*
373373
* ==== NSR = recommended number of simultaneous shifts.
374-
* . At this point N .GT. NTINY = 13, so there is at
374+
* . At this point N .GT. NTINY = 15, so there is at
375375
* . enough subdiagonal workspace for NSR to be even
376376
* . and greater than or equal to two as required. ====
377377
*
378378
NSR = ILAENV( 15, 'SLAQR0', JBCMPZ, N, ILO, IHI, LWORK )
379-
NSR = MIN( NSR, ( N+6 ) / 9, IHI-ILO )
379+
NSR = MIN( NSR, ( N-3 ) / 6, IHI-ILO )
380380
NSR = MAX( 2, NSR-MOD( NSR, 2 ) )
381381
*
382382
* ==== Estimate optimal workspace ====
@@ -424,7 +424,7 @@ SUBROUTINE SLAQR0( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
424424
* ==== NSMAX = the Largest number of simultaneous shifts
425425
* . for which there is sufficient workspace. ====
426426
*
427-
NSMAX = MIN( ( N+6 ) / 9, 2*LWORK / 3 )
427+
NSMAX = MIN( ( N-3 ) / 6, 2*LWORK / 3 )
428428
NSMAX = NSMAX - MOD( NSMAX, 2 )
429429
*
430430
* ==== NDFL: an iteration count restarted at deflation. ====

SRC/slaqr4.f

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ SUBROUTINE SLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
287287
* . SLAHQR because of insufficient subdiagonal scratch space.
288288
* . (This is a hard limit.) ====
289289
INTEGER NTINY
290-
PARAMETER ( NTINY = 13 )
290+
PARAMETER ( NTINY = 15 )
291291
*
292292
* ==== Exceptional deflation windows: try to cure rare
293293
* . slow convergence by varying the size of the
@@ -371,22 +371,22 @@ SUBROUTINE SLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
371371
END IF
372372
*
373373
* ==== NWR = recommended deflation window size. At this
374-
* . point, N .GT. NTINY = 13, so there is enough
374+
* . point, N .GT. NTINY = 15, so there is enough
375375
* . subdiagonal workspace for NWR.GE.2 as required.
376376
* . (In fact, there is enough subdiagonal space for
377-
* . NWR.GE.3.) ====
377+
* . NWR.GE.4.) ====
378378
*
379379
NWR = ILAENV( 13, 'SLAQR4', JBCMPZ, N, ILO, IHI, LWORK )
380380
NWR = MAX( 2, NWR )
381381
NWR = MIN( IHI-ILO+1, ( N-1 ) / 3, NWR )
382382
*
383383
* ==== NSR = recommended number of simultaneous shifts.
384-
* . At this point N .GT. NTINY = 13, so there is at
384+
* . At this point N .GT. NTINY = 15, so there is at
385385
* . enough subdiagonal workspace for NSR to be even
386386
* . and greater than or equal to two as required. ====
387387
*
388388
NSR = ILAENV( 15, 'SLAQR4', JBCMPZ, N, ILO, IHI, LWORK )
389-
NSR = MIN( NSR, ( N+6 ) / 9, IHI-ILO )
389+
NSR = MIN( NSR, ( N-3 ) / 6, IHI-ILO )
390390
NSR = MAX( 2, NSR-MOD( NSR, 2 ) )
391391
*
392392
* ==== Estimate optimal workspace ====
@@ -434,7 +434,7 @@ SUBROUTINE SLAQR4( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
434434
* ==== NSMAX = the Largest number of simultaneous shifts
435435
* . for which there is sufficient workspace. ====
436436
*
437-
NSMAX = MIN( ( N+6 ) / 9, 2*LWORK / 3 )
437+
NSMAX = MIN( ( N-3 ) / 6, 2*LWORK / 3 )
438438
NSMAX = NSMAX - MOD( NSMAX, 2 )
439439
*
440440
* ==== NDFL: an iteration count restarted at deflation. ====

SRC/zhseqr.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,10 @@ SUBROUTINE ZHSEQR( JOB, COMPZ, N, ILO, IHI, H, LDH, W, Z, LDZ,
320320
* . ZLAHQR because of insufficient subdiagonal scratch space.
321321
* . (This is a hard limit.) ====
322322
INTEGER NTINY
323-
PARAMETER ( NTINY = 13 )
323+
PARAMETER ( NTINY = 15 )
324324
*
325325
* ==== NL allocates some local workspace to help small matrices
326-
* . through a rare ZLAHQR failure. NL > NTINY = 13 is
326+
* . through a rare ZLAHQR failure. NL > NTINY = 15 is
327327
* . required and NL <= NMIN = ILAENV(ISPEC=12,...) is recom-
328328
* . mended. (The default value of NMIN is 75.) Using NL = 49
329329
* . allows up to six simultaneous shifts and a 16-by-16

0 commit comments

Comments
 (0)