Skip to content

Commit 430e8b4

Browse files
authored
Merge pull request #2648 from martin-frbg/lapack411
Break out of potentially infinite rescaling loop in LAPACK xLARGV/xLARTG/xLARTGP
2 parents 88fe85f + 522aaf5 commit 430e8b4

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

lapack-netlib/SRC/clargv.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ SUBROUTINE CLARGV( N, X, INCX, Y, INCY, C, INCC )
200200
FS = FS*SAFMN2
201201
GS = GS*SAFMN2
202202
SCALE = SCALE*SAFMN2
203-
IF( SCALE.GE.SAFMX2 )
203+
IF( SCALE.GE.SAFMX2 .AND. COUNT .LT. 20 )
204204
$ GO TO 10
205205
ELSE IF( SCALE.LE.SAFMN2 ) THEN
206206
IF( G.EQ.CZERO ) THEN

lapack-netlib/SRC/clartg.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ SUBROUTINE CLARTG( F, G, CS, SN, R )
161161
FS = FS*SAFMN2
162162
GS = GS*SAFMN2
163163
SCALE = SCALE*SAFMN2
164-
IF( SCALE.GE.SAFMX2 )
164+
IF( SCALE.GE.SAFMX2 .AND. COUNT .LT. 20)
165165
$ GO TO 10
166166
ELSE IF( SCALE.LE.SAFMN2 ) THEN
167167
IF( G.EQ.CZERO.OR.SISNAN( ABS( G ) ) ) THEN

lapack-netlib/SRC/dlartg.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ SUBROUTINE DLARTG( F, G, CS, SN, R )
163163
F1 = F1*SAFMN2
164164
G1 = G1*SAFMN2
165165
SCALE = MAX( ABS( F1 ), ABS( G1 ) )
166-
IF( SCALE.GE.SAFMX2 )
166+
IF( SCALE.GE.SAFMX2 .AND. COUNT .LT. 20)
167167
$ GO TO 10
168168
R = SQRT( F1**2+G1**2 )
169169
CS = F1 / R

lapack-netlib/SRC/dlartgp.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ SUBROUTINE DLARTGP( F, G, CS, SN, R )
161161
F1 = F1*SAFMN2
162162
G1 = G1*SAFMN2
163163
SCALE = MAX( ABS( F1 ), ABS( G1 ) )
164-
IF( SCALE.GE.SAFMX2 )
164+
IF( SCALE.GE.SAFMX2 .AND. COUNT .LT. 20 )
165165
$ GO TO 10
166166
R = SQRT( F1**2+G1**2 )
167167
CS = F1 / R

lapack-netlib/SRC/slartg.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ SUBROUTINE SLARTG( F, G, CS, SN, R )
163163
F1 = F1*SAFMN2
164164
G1 = G1*SAFMN2
165165
SCALE = MAX( ABS( F1 ), ABS( G1 ) )
166-
IF( SCALE.GE.SAFMX2 )
166+
IF( SCALE.GE.SAFMX2 .AND. COUNT .LT. 20)
167167
$ GO TO 10
168168
R = SQRT( F1**2+G1**2 )
169169
CS = F1 / R

lapack-netlib/SRC/slartgp.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ SUBROUTINE SLARTGP( F, G, CS, SN, R )
161161
F1 = F1*SAFMN2
162162
G1 = G1*SAFMN2
163163
SCALE = MAX( ABS( F1 ), ABS( G1 ) )
164-
IF( SCALE.GE.SAFMX2 )
164+
IF( SCALE.GE.SAFMX2 .AND. COUNT .LT. 20)
165165
$ GO TO 10
166166
R = SQRT( F1**2+G1**2 )
167167
CS = F1 / R

lapack-netlib/SRC/zlargv.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ SUBROUTINE ZLARGV( N, X, INCX, Y, INCY, C, INCC )
201201
FS = FS*SAFMN2
202202
GS = GS*SAFMN2
203203
SCALE = SCALE*SAFMN2
204-
IF( SCALE.GE.SAFMX2 )
204+
IF( SCALE.GE.SAFMX2 .AND. COUNT .LT. 20 )
205205
$ GO TO 10
206206
ELSE IF( SCALE.LE.SAFMN2 ) THEN
207207
IF( G.EQ.CZERO ) THEN

lapack-netlib/SRC/zlartg.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ SUBROUTINE ZLARTG( F, G, CS, SN, R )
161161
FS = FS*SAFMN2
162162
GS = GS*SAFMN2
163163
SCALE = SCALE*SAFMN2
164-
IF( SCALE.GE.SAFMX2 )
164+
IF( SCALE.GE.SAFMX2 .AND. COUNT .LT. 20 )
165165
$ GO TO 10
166166
ELSE IF( SCALE.LE.SAFMN2 ) THEN
167167
IF( G.EQ.CZERO.OR.DISNAN( ABS( G ) ) ) THEN

0 commit comments

Comments
 (0)