34
34
! >
35
35
! > \verbatim
36
36
! >
37
- ! > DLASSQ returns the values scl and smsq such that
37
+ ! > DLASSQ returns the values scale_out and sumsq_out such that
38
38
! >
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,
40
40
! >
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
42
42
! > assumed to be non-negative.
43
43
! >
44
44
! > 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.
46
46
! >
47
47
! > If scale * sqrt( sumsq ) > tbig then
48
48
! > we require: scale >= sqrt( TINY*EPS ) / sbig on entry,
72
72
! > \verbatim
73
73
! > X is DOUBLE PRECISION array, dimension (1+(N-1)*abs(INCX))
74
74
! > 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.
76
76
! > \endverbatim
77
77
! >
78
78
! > \param[in] INCX
82
82
! > If INCX > 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n
83
83
! > If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n
84
84
! > 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)
86
86
! > in the vector norm N times.
87
87
! > \endverbatim
88
88
! >
89
89
! > \param[in,out] SCALE
90
90
! > \verbatim
91
91
! > 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
94
94
! > for the sum of squares.
95
95
! > \endverbatim
96
96
! >
97
97
! > \param[in,out] SUMSQ
98
98
! > \verbatim
99
99
! > 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.
103
103
! > \endverbatim
104
104
!
105
105
! Authors:
130
130
! >
131
131
! > \endverbatim
132
132
!
133
- ! > \ingroup OTHERauxiliary
133
+ ! > \ingroup lassq
134
134
!
135
135
! =====================================================================
136
- subroutine DLASSQ ( n , x , incx , scl , sumsq )
136
+ subroutine DLASSQ ( n , x , incx , scale , sumsq )
137
137
use LA_CONSTANTS, &
138
138
only: wp= >dp, zero= >dzero, one= >done, &
139
139
sbig= >dsbig, ssml= >dssml, tbig= >dtbig, tsml= >dtsml
@@ -145,7 +145,7 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
145
145
!
146
146
! .. Scalar Arguments ..
147
147
integer :: incx, n
148
- real (wp) :: scl , sumsq
148
+ real (wp) :: scale , sumsq
149
149
! ..
150
150
! .. Array Arguments ..
151
151
real (wp) :: x(* )
@@ -158,10 +158,10 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
158
158
!
159
159
! Quick return if possible
160
160
!
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
165
165
sumsq = zero
166
166
end if
167
167
if (n <= 0 ) then
@@ -198,15 +198,15 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
198
198
! Put the existing sum of squares into one of the accumulators
199
199
!
200
200
if ( sumsq > zero ) then
201
- ax = scl * sqrt ( sumsq )
201
+ ax = scale * sqrt ( sumsq )
202
202
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
205
205
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
208
208
else
209
- amed = amed + scl ** 2 * sumsq
209
+ amed = amed + scale ** 2 * sumsq
210
210
end if
211
211
end if
212
212
!
@@ -220,7 +220,7 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
220
220
if (amed > zero .or. LA_ISNAN(amed)) then
221
221
abig = abig + (amed* sbig)* sbig
222
222
end if
223
- scl = one / sbig
223
+ scale = one / sbig
224
224
sumsq = abig
225
225
else if (asml > zero) then
226
226
!
@@ -236,17 +236,17 @@ subroutine DLASSQ( n, x, incx, scl, sumsq )
236
236
ymin = asml
237
237
ymax = amed
238
238
end if
239
- scl = one
239
+ scale = one
240
240
sumsq = ymax** 2 * ( one + (ymin/ ymax)** 2 )
241
241
else
242
- scl = one / ssml
242
+ scale = one / ssml
243
243
sumsq = asml
244
244
end if
245
245
else
246
246
!
247
247
! Otherwise all values are mid-range or zero
248
248
!
249
- scl = one
249
+ scale = one
250
250
sumsq = amed
251
251
end if
252
252
return
0 commit comments