Debian Codegraph @

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

raw
1 /* ./src_f77/dasum.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 dasum_(integer *n, doublereal *dx, integer *incx)
9 {
10 /* System generated locals */
11 integer i__1, i__2;
12 doublereal ret_val, d__1, d__2, d__3, d__4, d__5, d__6;
13
14 /* Local variables */
15 static integer i__, m, mp1;
16 static doublereal dtemp;
17 static integer nincx;
18
19
20 /* takes the sum of the absolute values. */
21 /* jack dongarra, linpack, 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 --dx;
28
29 /* Function Body */
30 ret_val = 0.;
31 dtemp = 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 nincx = *n * *incx;
42 i__1 = nincx;
43 i__2 = *incx;
44 for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
45 dtemp += (d__1 = dx[i__], abs(d__1));
46 /* L10: */
47 }
48 ret_val = dtemp;
49 return ret_val;
50
51 /* code for increment equal to 1 */
52
53
54 /* clean-up loop */
55
56 L20:
57 m = *n % 6;
58 if (m == 0) {
59 goto L40;
60 }
61 i__2 = m;
62 for (i__ = 1; i__ <= i__2; ++i__) {
63 dtemp += (d__1 = dx[i__], abs(d__1));
64 /* L30: */
65 }
66 if (*n < 6) {
67 goto L60;
68 }
69 L40:
70 mp1 = m + 1;
71 i__2 = *n;
72 for (i__ = mp1; i__ <= i__2; i__ += 6) {
73 dtemp = dtemp + (d__1 = dx[i__], abs(d__1)) + (d__2 = dx[i__ + 1],
74 abs(d__2)) + (d__3 = dx[i__ + 2], abs(d__3)) + (d__4 = dx[i__
75 + 3], abs(d__4)) + (d__5 = dx[i__ + 4], abs(d__5)) + (d__6 =
76 dx[i__ + 5], abs(d__6));
77 /* L50: */
78 }
79 L60:
80 ret_val = dtemp;
81 return ret_val;
82 } /* dasum_ */
83