136subroutine classq( n, x, incx, scl, sumsq )
148 real(wp) :: scl, sumsq
156 real(wp) :: abig, amed, asml, ax, ymax, ymin
162 if( sumsq == zero ) scl = one
163 if( scl == zero )
then
184 if( incx < 0 ) ix = 1 - (n-1)*incx
186 ax = abs(real(x(ix)))
188 abig = abig + (ax*sbig)**2
190 else if (ax < tsml)
then
191 if (notbig) asml = asml + (ax*ssml)**2
195 ax = abs(aimag(x(ix)))
197 abig = abig + (ax*sbig)**2
199 else if (ax < tsml)
then
200 if (notbig) asml = asml + (ax*ssml)**2
209 if( sumsq > zero )
then
210 ax = scl*sqrt( sumsq )
213 abig = abig + (scl*sbig)**2 * sumsq
214 else if (ax < tsml)
then
216 if (notbig) asml = asml + (scl*ssml)**2 * sumsq
218 amed = amed + scl**2 * sumsq
225 if (abig > zero)
then
229 if (amed > zero .or.
la_isnan(amed))
then
230 abig = abig + (amed*sbig)*sbig
234 else if (asml > zero)
then
238 if (amed > zero .or.
la_isnan(amed))
then
240 asml = sqrt(asml) / ssml
241 if (asml > amed)
then
249 sumsq = ymax**2*( one + (ymin/ymax)**2 )
subroutine classq(n, x, incx, scl, sumsq)
CLASSQ updates a sum of squares represented in scaled form.
real(sp), parameter stbig
real(sp), parameter sssml
real(sp), parameter stsml
real(sp), parameter ssbig
real(sp), parameter szero
LA_CONSTANTS is a module for the scaling constants for the compiled Fortran single and double precisi...