KTH framework for Nek5000 toolboxes; testing version  0.0.1
dzsum1.f
Go to the documentation of this file.
1  DOUBLE PRECISION FUNCTION dzsum1( N, CX, INCX )
2 *
3 * -- LAPACK auxiliary routine (version 3.0) --
4 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5 * Courant Institute, Argonne National Lab, and Rice University
6 * October 31, 1992
7 *
8 * .. Scalar Arguments ..
9  INTEGER incx, n
10 * ..
11 * .. Array Arguments ..
12  COMPLEX*16 cx( * )
13 * ..
14 *
15 * Purpose
16 * =======
17 *
18 * DZSUM1 takes the sum of the absolute values of a complex
19 * vector and returns a double precision result.
20 *
21 * Based on DZASUM from the Level 1 BLAS.
22 * The change is to use the 'genuine' absolute value.
23 *
24 * Contributed by Nick Higham for use with ZLACON.
25 *
26 * Arguments
27 * =========
28 *
29 * N (input) INTEGER
30 * The number of elements in the vector CX.
31 *
32 * CX (input) COMPLEX*16 array, dimension (N)
33 * The vector whose elements will be summed.
34 *
35 * INCX (input) INTEGER
36 * The spacing between successive values of CX. INCX > 0.
37 *
38 * =====================================================================
39 *
40 * .. Local Scalars ..
41  INTEGER i, nincx
42  DOUBLE PRECISION stemp
43 * ..
44 * .. Intrinsic Functions ..
45  INTRINSIC abs
46 * ..
47 * .. Executable Statements ..
48 *
49  dzsum1 = 0.0d0
50  stemp = 0.0d0
51  IF( n.LE.0 )
52  $ RETURN
53  IF( incx.EQ.1 )
54  $ GO TO 20
55 *
56 * CODE FOR INCREMENT NOT EQUAL TO 1
57 *
58  nincx = n*incx
59  DO 10 i = 1, nincx, incx
60 *
61 * NEXT LINE MODIFIED.
62 *
63  stemp = stemp + abs( cx( i ) )
64  10 CONTINUE
65  dzsum1 = stemp
66  RETURN
67 *
68 * CODE FOR INCREMENT EQUAL TO 1
69 *
70  20 CONTINUE
71  DO 30 i = 1, n
72 *
73 * NEXT LINE MODIFIED.
74 *
75  stemp = stemp + abs( cx( i ) )
76  30 CONTINUE
77  dzsum1 = stemp
78  RETURN
79 *
80 * End of DZSUM1
81 *
82  END
double precision function dzsum1(N, CX, INCX)
Definition: dzsum1.f:2