Go to the source code of this file.
real function scnrm2 |
( |
integer |
N, |
|
|
complex, dimension(*) |
X, |
|
|
integer |
INCX |
|
) |
| |
SCNRM2
- Purpose:
SCNRM2 returns the euclidean norm of a vector via the function
name, so that
SCNRM2 := sqrt( x**H*x )
- Author
- Univ. of Tennessee
-
Univ. of California Berkeley
-
Univ. of Colorado Denver
-
NAG Ltd.
- Date
- November 2011
- Further Details:
-- This version written on 25-October-1982.
Modified on 14-October-1993 to inline the call to CLASSQ.
Sven Hammarling, Nag Ltd.
Definition at line 56 of file scnrm2.f.
73 parameter(one=1.0e+0,zero=0.0e+0)
76 REAL norm,scale,ssq,temp
80 INTRINSIC abs,aimag,
REAL,sqrt
82 IF (n.LT.1 .OR. incx.LT.1)
THEN
91 DO 10 ix = 1,1 + (n-1)*incx,incx
92 IF (
REAL(x(ix)).NE.zero) then
93 temp = abs(
REAL(x(ix)))
94 IF (scale.LT.temp)
THEN
95 ssq = one + ssq* (scale/temp)**2
98 ssq = ssq + (temp/scale)**2
101 IF (aimag(x(ix)).NE.zero)
THEN
102 temp = abs(aimag(x(ix)))
103 IF (scale.LT.temp)
THEN
104 ssq = one + ssq* (scale/temp)**2
107 ssq = ssq + (temp/scale)**2
111 norm = scale*sqrt(ssq)
real function scnrm2(N, X, INCX)
SCNRM2