Skip to content

Commit c55a399

Browse files
xCOMBSSQ does nothing when the second scaled sum is zero
1 parent 6ace55e commit c55a399

File tree

6 files changed

+10
-4
lines changed

6 files changed

+10
-4
lines changed

SRC/classq.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ subroutine CLASSQ( n, x, incx, scl, sumsq )
241241
end if
242242
else
243243
!
244-
! Otherwise all values are mid-range
244+
! Otherwise all values are mid-range or zero
245245
!
246246
scl = one
247247
sumsq = amed

SRC/dcombssq.f

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ SUBROUTINE DCOMBSSQ( V1, V2 )
7474
PARAMETER ( ZERO = 0.0D+0 )
7575
* ..
7676
* .. Executable Statements ..
77+
*
78+
* A zero sum V2 shall not modify the scaling factor of V1
79+
IF( V2( 2 ).EQ.ZERO ) RETURN
7780
*
7881
IF( V1( 1 ).GE.V2( 1 ) ) THEN
7982
IF( V1( 1 ).NE.ZERO ) THEN

SRC/dlassq.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
232232
end if
233233
else
234234
!
235-
! Otherwise all values are mid-range
235+
! Otherwise all values are mid-range or zero
236236
!
237237
scl = one
238238
sumsq = amed

SRC/scombssq.f

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ SUBROUTINE SCOMBSSQ( V1, V2 )
7474
PARAMETER ( ZERO = 0.0D+0 )
7575
* ..
7676
* .. Executable Statements ..
77+
*
78+
* A zero sum V2 shall not modify the scaling factor of V1
79+
IF( V2( 2 ).EQ.ZERO ) RETURN
7780
*
7881
IF( V1( 1 ).GE.V2( 1 ) ) THEN
7982
IF( V1( 1 ).NE.ZERO ) THEN

SRC/slassq.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ subroutine SLASSQ( n, x, incx, scl, sumsq )
232232
end if
233233
else
234234
!
235-
! Otherwise all values are mid-range
235+
! Otherwise all values are mid-range or zero
236236
!
237237
scl = one
238238
sumsq = amed

SRC/zlassq.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ subroutine ZLASSQ( n, x, incx, scl, sumsq )
241241
end if
242242
else
243243
!
244-
! Otherwise all values are mid-range
244+
! Otherwise all values are mid-range or zero
245245
!
246246
scl = one
247247
sumsq = amed

0 commit comments

Comments
 (0)