diff options
author | james <james@8a072113-8704-0410-8d35-dd094bca7971> | 2012-10-19 21:45:55 +0000 |
---|---|---|
committer | james <james@8a072113-8704-0410-8d35-dd094bca7971> | 2012-10-19 21:45:55 +0000 |
commit | 04af8255ecace3e1a346cc2ae2157bb2935e80d4 (patch) | |
tree | 01ba69d0a9cf5cffec8e09970b339375d0d4b0d3 /SRC/dhgeqz.f | |
parent | 5dbf71b11b4901dd61b5d820d1c937a2ec4d0fcf (diff) |
patch from Mathworks that fixes convergence problem with some particular pencils in xGGEV
Diffstat (limited to 'SRC/dhgeqz.f')
-rw-r--r-- | SRC/dhgeqz.f | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/SRC/dhgeqz.f b/SRC/dhgeqz.f index f6989aae..9836a29d 100644 --- a/SRC/dhgeqz.f +++ b/SRC/dhgeqz.f @@ -739,9 +739,9 @@ * Exceptional shift. Chosen for no particularly good reason. * (Single shift only.) * - IF( ( DBLE( MAXIT )*SAFMIN )*ABS( H( ILAST-1, ILAST ) ).LT. + IF( ( DBLE( MAXIT )*SAFMIN )*ABS( H( ILAST, ILAST-1 ) ).LT. $ ABS( T( ILAST-1, ILAST-1 ) ) ) THEN - ESHIFT = ESHIFT + H( ILAST, ILAST-1 ) / + ESHIFT = H( ILAST, ILAST-1 ) / $ T( ILAST-1, ILAST-1 ) ELSE ESHIFT = ESHIFT + ONE / ( SAFMIN*DBLE( MAXIT ) ) @@ -759,6 +759,16 @@ $ T( ILAST-1, ILAST-1 ), LDT, SAFMIN*SAFETY, S1, $ S2, WR, WR2, WI ) * + IF ( ABS( (WR/S1)*T( ILAST, ILAST ) - H( ILAST, ILAST ) ) + $ .GT. ABS( (WR2/S2)*T( ILAST, ILAST ) + $ - H( ILAST, ILAST ) ) ) THEN + TEMP = WR + WR = WR2 + WR2 = TEMP + TEMP = S1 + S1 = S2 + S2 = TEMP + END IF TEMP = MAX( S1, SAFMIN*MAX( ONE, ABS( WR ), ABS( WI ) ) ) IF( WI.NE.ZERO ) $ GO TO 200 |