Skip to content

Commit bd9bf0b

Browse files
committed
lassq: rename variable scale to match docs
1 parent fd23cd9 commit bd9bf0b

File tree

4 files changed

+112
-112
lines changed

4 files changed

+112
-112
lines changed

SRC/classq.f90

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
!>
3535
!> \verbatim
3636
!>
37-
!> CLASSQ returns the values scl and smsq such that
37+
!> CLASSQ returns the values scale_out and sumsq_out such that
3838
!>
39-
!> ( scl**2 )*smsq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq,
39+
!> (scale_out**2)*sumsq_out = x( 1 )**2 +...+ x( n )**2 + (scale**2)*sumsq,
4040
!>
41-
!> where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is
41+
!> where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is
4242
!> assumed to be non-negative.
4343
!>
4444
!> scale and sumsq must be supplied in SCALE and SUMSQ and
45-
!> scl and smsq are overwritten on SCALE and SUMSQ respectively.
45+
!> scale_out and sumsq_out are overwritten on SCALE and SUMSQ respectively.
4646
!>
4747
!> If scale * sqrt( sumsq ) > tbig then
4848
!> we require: scale >= sqrt( TINY*EPS ) / sbig on entry,
@@ -72,7 +72,7 @@
7272
!> \verbatim
7373
!> X is COMPLEX array, dimension (1+(N-1)*abs(INCX))
7474
!> The vector for which a scaled sum of squares is computed.
75-
!> x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n.
75+
!> x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n.
7676
!> \endverbatim
7777
!>
7878
!> \param[in] INCX
@@ -82,24 +82,24 @@
8282
!> If INCX > 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n
8383
!> If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n
8484
!> If INCX = 0, x isn't a vector so there is no need to call
85-
!> this subroutine. If you call it anyway, it will count x(1)
85+
!> this subroutine. If you call it anyway, it will count x(1)
8686
!> in the vector norm N times.
8787
!> \endverbatim
8888
!>
8989
!> \param[in,out] SCALE
9090
!> \verbatim
9191
!> SCALE is REAL
92-
!> On entry, the value scale in the equation above.
93-
!> On exit, SCALE is overwritten with scl , the scaling factor
92+
!> On entry, the value scale in the equation above.
93+
!> On exit, SCALE is overwritten by scale_out, the scaling factor
9494
!> for the sum of squares.
9595
!> \endverbatim
9696
!>
9797
!> \param[in,out] SUMSQ
9898
!> \verbatim
9999
!> SUMSQ is REAL
100-
!> On entry, the value sumsq in the equation above.
101-
!> On exit, SUMSQ is overwritten with smsq , the basic sum of
102-
!> squares from which scl has been factored out.
100+
!> On entry, the value sumsq in the equation above.
101+
!> On exit, SUMSQ is overwritten by sumsq_out, the basic sum of
102+
!> squares from which scale_out has been factored out.
103103
!> \endverbatim
104104
!
105105
! Authors:
@@ -130,10 +130,10 @@
130130
!>
131131
!> \endverbatim
132132
!
133-
!> \ingroup OTHERauxiliary
133+
!> \ingroup lassq
134134
!
135135
! =====================================================================
136-
subroutine CLASSQ( n, x, incx, scl, sumsq )
136+
subroutine CLASSQ( n, x, incx, scale, sumsq )
137137
use LA_CONSTANTS, &
138138
only: wp=>sp, zero=>szero, one=>sone, &
139139
sbig=>ssbig, ssml=>sssml, tbig=>stbig, tsml=>stsml
@@ -145,7 +145,7 @@ subroutine CLASSQ( n, x, incx, scl, sumsq )
145145
!
146146
! .. Scalar Arguments ..
147147
integer :: incx, n
148-
real(wp) :: scl, sumsq
148+
real(wp) :: scale, sumsq
149149
! ..
150150
! .. Array Arguments ..
151151
complex(wp) :: x(*)
@@ -158,10 +158,10 @@ subroutine CLASSQ( n, x, incx, scl, sumsq )
158158
!
159159
! Quick return if possible
160160
!
161-
if( LA_ISNAN(scl) .or. LA_ISNAN(sumsq) ) return
162-
if( sumsq == zero ) scl = one
163-
if( scl == zero ) then
164-
scl = one
161+
if( LA_ISNAN(scale) .or. LA_ISNAN(sumsq) ) return
162+
if( sumsq == zero ) scale = one
163+
if( scale == zero ) then
164+
scale = one
165165
sumsq = zero
166166
end if
167167
if (n <= 0) then
@@ -207,15 +207,15 @@ subroutine CLASSQ( n, x, incx, scl, sumsq )
207207
! Put the existing sum of squares into one of the accumulators
208208
!
209209
if( sumsq > zero ) then
210-
ax = scl*sqrt( sumsq )
210+
ax = scale*sqrt( sumsq )
211211
if (ax > tbig) then
212-
! We assume scl >= sqrt( TINY*EPS ) / sbig
213-
abig = abig + (scl*sbig)**2 * sumsq
212+
! We assume scale >= sqrt( TINY*EPS ) / sbig
213+
abig = abig + (scale*sbig)**2 * sumsq
214214
else if (ax < tsml) then
215-
! We assume scl <= sqrt( HUGE ) / ssml
216-
if (notbig) asml = asml + (scl*ssml)**2 * sumsq
215+
! We assume scale <= sqrt( HUGE ) / ssml
216+
if (notbig) asml = asml + (scale*ssml)**2 * sumsq
217217
else
218-
amed = amed + scl**2 * sumsq
218+
amed = amed + scale**2 * sumsq
219219
end if
220220
end if
221221
!
@@ -229,7 +229,7 @@ subroutine CLASSQ( n, x, incx, scl, sumsq )
229229
if (amed > zero .or. LA_ISNAN(amed)) then
230230
abig = abig + (amed*sbig)*sbig
231231
end if
232-
scl = one / sbig
232+
scale = one / sbig
233233
sumsq = abig
234234
else if (asml > zero) then
235235
!
@@ -245,17 +245,17 @@ subroutine CLASSQ( n, x, incx, scl, sumsq )
245245
ymin = asml
246246
ymax = amed
247247
end if
248-
scl = one
248+
scale = one
249249
sumsq = ymax**2*( one + (ymin/ymax)**2 )
250250
else
251-
scl = one / ssml
251+
scale = one / ssml
252252
sumsq = asml
253253
end if
254254
else
255255
!
256256
! Otherwise all values are mid-range or zero
257257
!
258-
scl = one
258+
scale = one
259259
sumsq = amed
260260
end if
261261
return

SRC/dlassq.f90

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
!>
3535
!> \verbatim
3636
!>
37-
!> DLASSQ returns the values scl and smsq such that
37+
!> DLASSQ returns the values scale_out and sumsq_out such that
3838
!>
39-
!> ( scl**2 )*smsq = x( 1 )**2 +...+ x( n )**2 + ( scale**2 )*sumsq,
39+
!> (scale_out**2)*sumsq_out = x( 1 )**2 +...+ x( n )**2 + (scale**2)*sumsq,
4040
!>
41-
!> where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is
41+
!> where x( i ) = X( 1 + ( i - 1 )*INCX ). The value of sumsq is
4242
!> assumed to be non-negative.
4343
!>
4444
!> scale and sumsq must be supplied in SCALE and SUMSQ and
45-
!> scl and smsq are overwritten on SCALE and SUMSQ respectively.
45+
!> scale_out and sumsq_out are overwritten on SCALE and SUMSQ respectively.
4646
!>
4747
!> If scale * sqrt( sumsq ) > tbig then
4848
!> we require: scale >= sqrt( TINY*EPS ) / sbig on entry,
@@ -72,7 +72,7 @@
7272
!> \verbatim
7373
!> X is DOUBLE PRECISION array, dimension (1+(N-1)*abs(INCX))
7474
!> The vector for which a scaled sum of squares is computed.
75-
!> x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n.
75+
!> x( i ) = X( 1 + ( i - 1 )*INCX ), 1 <= i <= n.
7676
!> \endverbatim
7777
!>
7878
!> \param[in] INCX
@@ -82,24 +82,24 @@
8282
!> If INCX > 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n
8383
!> If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n
8484
!> If INCX = 0, x isn't a vector so there is no need to call
85-
!> this subroutine. If you call it anyway, it will count x(1)
85+
!> this subroutine. If you call it anyway, it will count x(1)
8686
!> in the vector norm N times.
8787
!> \endverbatim
8888
!>
8989
!> \param[in,out] SCALE
9090
!> \verbatim
9191
!> SCALE is DOUBLE PRECISION
92-
!> On entry, the value scale in the equation above.
93-
!> On exit, SCALE is overwritten with scl , the scaling factor
92+
!> On entry, the value scale in the equation above.
93+
!> On exit, SCALE is overwritten by scale_out, the scaling factor
9494
!> for the sum of squares.
9595
!> \endverbatim
9696
!>
9797
!> \param[in,out] SUMSQ
9898
!> \verbatim
9999
!> SUMSQ is DOUBLE PRECISION
100-
!> On entry, the value sumsq in the equation above.
101-
!> On exit, SUMSQ is overwritten with smsq , the basic sum of
102-
!> squares from which scl has been factored out.
100+
!> On entry, the value sumsq in the equation above.
101+
!> On exit, SUMSQ is overwritten by sumsq_out, the basic sum of
102+
!> squares from which scale_out has been factored out.
103103
!> \endverbatim
104104
!
105105
! Authors:
@@ -130,10 +130,10 @@
130130
!>
131131
!> \endverbatim
132132
!
133-
!> \ingroup OTHERauxiliary
133+
!> \ingroup lassq
134134
!
135135
! =====================================================================
136-
subroutine DLASSQ( n, x, incx, scl, sumsq )
136+
subroutine DLASSQ( n, x, incx, scale, sumsq )
137137
use LA_CONSTANTS, &
138138
only: wp=>dp, zero=>dzero, one=>done, &
139139
sbig=>dsbig, ssml=>dssml, tbig=>dtbig, tsml=>dtsml
@@ -145,7 +145,7 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
145145
!
146146
! .. Scalar Arguments ..
147147
integer :: incx, n
148-
real(wp) :: scl, sumsq
148+
real(wp) :: scale, sumsq
149149
! ..
150150
! .. Array Arguments ..
151151
real(wp) :: x(*)
@@ -158,10 +158,10 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
158158
!
159159
! Quick return if possible
160160
!
161-
if( LA_ISNAN(scl) .or. LA_ISNAN(sumsq) ) return
162-
if( sumsq == zero ) scl = one
163-
if( scl == zero ) then
164-
scl = one
161+
if( LA_ISNAN(scale) .or. LA_ISNAN(sumsq) ) return
162+
if( sumsq == zero ) scale = one
163+
if( scale == zero ) then
164+
scale = one
165165
sumsq = zero
166166
end if
167167
if (n <= 0) then
@@ -198,15 +198,15 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
198198
! Put the existing sum of squares into one of the accumulators
199199
!
200200
if( sumsq > zero ) then
201-
ax = scl*sqrt( sumsq )
201+
ax = scale*sqrt( sumsq )
202202
if (ax > tbig) then
203-
! We assume scl >= sqrt( TINY*EPS ) / sbig
204-
abig = abig + (scl*sbig)**2 * sumsq
203+
! We assume scale >= sqrt( TINY*EPS ) / sbig
204+
abig = abig + (scale*sbig)**2 * sumsq
205205
else if (ax < tsml) then
206-
! We assume scl <= sqrt( HUGE ) / ssml
207-
if (notbig) asml = asml + (scl*ssml)**2 * sumsq
206+
! We assume scale <= sqrt( HUGE ) / ssml
207+
if (notbig) asml = asml + (scale*ssml)**2 * sumsq
208208
else
209-
amed = amed + scl**2 * sumsq
209+
amed = amed + scale**2 * sumsq
210210
end if
211211
end if
212212
!
@@ -220,7 +220,7 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
220220
if (amed > zero .or. LA_ISNAN(amed)) then
221221
abig = abig + (amed*sbig)*sbig
222222
end if
223-
scl = one / sbig
223+
scale = one / sbig
224224
sumsq = abig
225225
else if (asml > zero) then
226226
!
@@ -236,17 +236,17 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
236236
ymin = asml
237237
ymax = amed
238238
end if
239-
scl = one
239+
scale = one
240240
sumsq = ymax**2*( one + (ymin/ymax)**2 )
241241
else
242-
scl = one / ssml
242+
scale = one / ssml
243243
sumsq = asml
244244
end if
245245
else
246246
!
247247
! Otherwise all values are mid-range or zero
248248
!
249-
scl = one
249+
scale = one
250250
sumsq = amed
251251
end if
252252
return

0 commit comments

Comments
 (0)