Debian Codegraph @

debian/external_deps/fetk/punc/src/blas/dzasum.c

raw
1 /* ./src_f77/dzasum.f -- translated by f2c (version 20030320).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include <punc/vf2c.h>
7
8 doublereal dzasum_(integer *n, doublecomplex *zx, integer *incx)
9 {
10 /* System generated locals */
11 integer i__1;
12 doublereal ret_val;
13
14 /* Local variables */
15 static integer i__, ix;
16 static doublereal stemp;
17 extern doublereal dcabs1_(doublecomplex *);
18
19
20 /* takes the sum of the absolute values. */
21 /* jack dongarra, 3/11/78. */
22 /* modified 3/93 to return if incx .le. 0. */
23 /* modified 12/3/93, array(1) declarations changed to array(*) */
24
25
26 /* Parameter adjustments */
27 --zx;
28
29 /* Function Body */
30 ret_val = 0.;
31 stemp = 0.;
32 if (*n <= 0 || *incx <= 0) {
33 return ret_val;
34 }
35 if (*incx == 1) {
36 goto L20;
37 }
38
39 /* code for increment not equal to 1 */
40
41 ix = 1;
42 i__1 = *n;
43 for (i__ = 1; i__ <= i__1; ++i__) {
44 stemp += dcabs1_(&zx[ix]);
45 ix += *incx;
46 /* L10: */
47 }
48 ret_val = stemp;
49 return ret_val;
50
51 /* code for increment equal to 1 */
52
53 L20:
54 i__1 = *n;
55 for (i__ = 1; i__ <= i__1; ++i__) {
56 stemp += dcabs1_(&zx[i__]);
57 /* L30: */
58 }
59 ret_val = stemp;
60 return ret_val;
61 } /* dzasum_ */
62