Skip to content

Commit 5a8f9aa

Browse files
authored
Remove LABAD (Reference-LAPACK PR 805) and fix infinite loop scaling Inf (PR 1158)
1 parent e5c8361 commit 5a8f9aa

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

lapack-netlib/SRC/csrscl.f

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
* Online html documentation available at
66
* http://www.netlib.org/lapack/explore-html/
77
*
8-
*> \htmlonly
98
*> Download CSRSCL + dependencies
109
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/csrscl.f">
1110
*> [TGZ]</a>
1211
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/csrscl.f">
1312
*> [ZIP]</a>
1413
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csrscl.f">
1514
*> [TXT]</a>
16-
*> \endhtmlonly
1715
*
1816
* Definition:
1917
* ===========
@@ -77,10 +75,11 @@
7775
*> \author Univ. of Colorado Denver
7876
*> \author NAG Ltd.
7977
*
80-
*> \ingroup complexOTHERauxiliary
78+
*> \ingroup rscl
8179
*
8280
* =====================================================================
8381
SUBROUTINE CSRSCL( N, SA, SX, INCX )
82+
IMPLICIT NONE
8483
*
8584
* -- LAPACK auxiliary routine --
8685
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -109,23 +108,28 @@ SUBROUTINE CSRSCL( N, SA, SX, INCX )
109108
EXTERNAL SLAMCH
110109
* ..
111110
* .. External Subroutines ..
112-
EXTERNAL CSSCAL, SLABAD
111+
EXTERNAL CSSCAL
113112
* ..
114113
* .. Intrinsic Functions ..
115114
INTRINSIC ABS
115+
INTRINSIC HUGE
116116
* ..
117117
* .. Executable Statements ..
118118
*
119119
* Quick return if possible
120120
*
121121
IF( N.LE.0 )
122122
$ RETURN
123+
*
124+
IF( SA.GT.HUGE(SA) .OR. SA.LT.-HUGE(SA) ) THEN
125+
CALL CSSCAL( N, SA, SX, INCX )
126+
RETURN
127+
END IF
123128
*
124129
* Get machine parameters
125130
*
126131
SMLNUM = SLAMCH( 'S' )
127132
BIGNUM = ONE / SMLNUM
128-
CALL SLABAD( SMLNUM, BIGNUM )
129133
*
130134
* Initialize the denominator to SA and the numerator to 1.
131135
*

lapack-netlib/SRC/zdrscl.f

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
* Online html documentation available at
66
* http://www.netlib.org/lapack/explore-html/
77
*
8-
*> \htmlonly
98
*> Download ZDRSCL + dependencies
109
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zdrscl.f">
1110
*> [TGZ]</a>
1211
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zdrscl.f">
1312
*> [ZIP]</a>
1413
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zdrscl.f">
1514
*> [TXT]</a>
16-
*> \endhtmlonly
1715
*
1816
* Definition:
1917
* ===========
@@ -77,10 +75,11 @@
7775
*> \author Univ. of Colorado Denver
7876
*> \author NAG Ltd.
7977
*
80-
*> \ingroup complex16OTHERauxiliary
78+
*> \ingroup rscl
8179
*
8280
* =====================================================================
8381
SUBROUTINE ZDRSCL( N, SA, SX, INCX )
82+
IMPLICIT NONE
8483
*
8584
* -- LAPACK auxiliary routine --
8685
* -- LAPACK is a software package provided by Univ. of Tennessee, --
@@ -109,23 +108,28 @@ SUBROUTINE ZDRSCL( N, SA, SX, INCX )
109108
EXTERNAL DLAMCH
110109
* ..
111110
* .. External Subroutines ..
112-
EXTERNAL DLABAD, ZDSCAL
111+
EXTERNAL ZDSCAL
113112
* ..
114113
* .. Intrinsic Functions ..
115114
INTRINSIC ABS
115+
INTRINSIC HUGE
116116
* ..
117117
* .. Executable Statements ..
118118
*
119119
* Quick return if possible
120120
*
121121
IF( N.LE.0 )
122122
$ RETURN
123+
*
124+
IF( SA.GT.HUGE(SA) .OR. SA.LT.-HUGE(SA) ) THEN
125+
CALL ZDSCAL( N, SA, SX, INCX )
126+
RETURN
127+
END IF
123128
*
124129
* Get machine parameters
125130
*
126131
SMLNUM = DLAMCH( 'S' )
127132
BIGNUM = ONE / SMLNUM
128-
CALL DLABAD( SMLNUM, BIGNUM )
129133
*
130134
* Initialize the denominator to SA and the numerator to 1.
131135
*

0 commit comments

Comments
 (0)