LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dznrm2()

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 )
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in]X
          X is COMPLEX*16 array, dimension (N)
         complex vector with N elements
[in]INCX
          INCX is INTEGER
         storage spacing between elements of X
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2017
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 77 of file dznrm2.f.

77 *
78 * -- Reference BLAS level1 routine (version 3.8.0) --
79 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
80 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
81 * November 2017
82 *
83 * .. Scalar Arguments ..
84  INTEGER incx,n
85 * ..
86 * .. Array Arguments ..
87  COMPLEX*16 x(*)
88 * ..
89 *
90 * =====================================================================
91 *
92 * .. Parameters ..
93  DOUBLE PRECISION one,zero
94  parameter(one=1.0d+0,zero=0.0d+0)
95 * ..
96 * .. Local Scalars ..
97  DOUBLE PRECISION norm,scale,ssq,temp
98  INTEGER ix
99 * ..
100 * .. Intrinsic Functions ..
101  INTRINSIC abs,dble,dimag,sqrt
102 * ..
103  IF (n.LT.1 .OR. incx.LT.1) THEN
104  norm = zero
105  ELSE
106  scale = zero
107  ssq = one
108 * The following loop is equivalent to this call to the LAPACK
109 * auxiliary routine:
110 * CALL ZLASSQ( N, X, INCX, SCALE, SSQ )
111 *
112  DO 10 ix = 1,1 + (n-1)*incx,incx
113  IF (dble(x(ix)).NE.zero) THEN
114  temp = abs(dble(x(ix)))
115  IF (scale.LT.temp) THEN
116  ssq = one + ssq* (scale/temp)**2
117  scale = temp
118  ELSE
119  ssq = ssq + (temp/scale)**2
120  END IF
121  END IF
122  IF (dimag(x(ix)).NE.zero) THEN
123  temp = abs(dimag(x(ix)))
124  IF (scale.LT.temp) THEN
125  ssq = one + ssq* (scale/temp)**2
126  scale = temp
127  ELSE
128  ssq = ssq + (temp/scale)**2
129  END IF
130  END IF
131  10 CONTINUE
132  norm = scale*sqrt(ssq)
133  END IF
134 *
135  dznrm2 = norm
136  RETURN
137 *
138 * End of DZNRM2.
139 *
double precision function dznrm2(N, X, INCX)
DZNRM2
Definition: dznrm2.f:77
Here is the caller graph for this function: