123subroutine zlassq( n, x, incx, scale, sumsq )
135 real(wp) :: scale, sumsq
143 real(wp) :: abig, amed, asml, ax, ymax, ymin
149 if( sumsq == zero ) scale = one
150 if( scale == zero )
then
171 if( incx < 0 ) ix = 1 - (n-1)*incx
173 ax = abs(real(x(ix)))
175 abig = abig + (ax*sbig)**2
177 else if (ax < tsml)
then
178 if (notbig) asml = asml + (ax*ssml)**2
182 ax = abs(aimag(x(ix)))
184 abig = abig + (ax*sbig)**2
186 else if (ax < tsml)
then
187 if (notbig) asml = asml + (ax*ssml)**2
196 if( sumsq > zero )
then
197 ax = scale*sqrt( sumsq )
199 if (scale > one)
then
201 abig = abig + scale * (scale * sumsq)
204 abig = abig + scale * (scale * (sbig * (sbig * sumsq)))
206 else if (ax < tsml)
then
208 if (scale < one)
then
210 asml = asml + scale * (scale * sumsq)
213 asml = asml + scale * (scale * (ssml * (ssml * sumsq)))
217 amed = amed + scale * (scale * sumsq)
224 if (abig > zero)
then
228 if (amed > zero .or.
la_isnan(amed))
then
229 abig = abig + (amed*sbig)*sbig
233 else if (asml > zero)
then
237 if (amed > zero .or.
la_isnan(amed))
then
239 asml = sqrt(asml) / ssml
240 if (asml > amed)
then
248 sumsq = ymax**2*( one + (ymin/ymax)**2 )
subroutine zlassq(n, x, incx, scale, sumsq)
ZLASSQ updates a sum of squares represented in scaled form.
real(dp), parameter dtsml
real(dp), parameter dzero
real(dp), parameter dsbig
real(dp), parameter dtbig
real(dp), parameter dssml
LA_CONSTANTS is a module for the scaling constants for the compiled Fortran single and double precisi...