LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
double precision function dznrm2 ( integer  N,
complex*16, dimension(*)  X,
integer  INCX 
)

DZNRM2

Purpose:
 DZNRM2 returns the euclidean norm of a vector via the function
 name, so that

    DZNRM2 := 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 ZLASSQ.
     Sven Hammarling, Nag Ltd.

Definition at line 56 of file dznrm2.f.

56 *
57 * -- Reference BLAS level1 routine (version 3.4.0) --
58 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
59 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
60 * November 2011
61 *
62 * .. Scalar Arguments ..
63  INTEGER incx,n
64 * ..
65 * .. Array Arguments ..
66  COMPLEX*16 x(*)
67 * ..
68 *
69 * =====================================================================
70 *
71 * .. Parameters ..
72  DOUBLE PRECISION one,zero
73  parameter(one=1.0d+0,zero=0.0d+0)
74 * ..
75 * .. Local Scalars ..
76  DOUBLE PRECISION norm,scale,ssq,temp
77  INTEGER ix
78 * ..
79 * .. Intrinsic Functions ..
80  INTRINSIC abs,dble,dimag,sqrt
81 * ..
82  IF (n.LT.1 .OR. incx.LT.1) THEN
83  norm = zero
84  ELSE
85  scale = zero
86  ssq = one
87 * The following loop is equivalent to this call to the LAPACK
88 * auxiliary routine:
89 * CALL ZLASSQ( N, X, INCX, SCALE, SSQ )
90 *
91  DO 10 ix = 1,1 + (n-1)*incx,incx
92  IF (dble(x(ix)).NE.zero) THEN
93  temp = abs(dble(x(ix)))
94  IF (scale.LT.temp) THEN
95  ssq = one + ssq* (scale/temp)**2
96  scale = temp
97  ELSE
98  ssq = ssq + (temp/scale)**2
99  END IF
100  END IF
101  IF (dimag(x(ix)).NE.zero) THEN
102  temp = abs(dimag(x(ix)))
103  IF (scale.LT.temp) THEN
104  ssq = one + ssq* (scale/temp)**2
105  scale = temp
106  ELSE
107  ssq = ssq + (temp/scale)**2
108  END IF
109  END IF
110  10 CONTINUE
111  norm = scale*sqrt(ssq)
112  END IF
113 *
114  dznrm2 = norm
115  RETURN
116 *
117 * End of DZNRM2.
118 *
double precision function dznrm2(N, X, INCX)
DZNRM2
Definition: dznrm2.f:56

Here is the caller graph for this function: