Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2789_MathNetNumerics-Exploration/HeuristicLab.Algorithms.DataAnalysis.Experimental/sbart/dzasum.f @ 17328

Last change on this file since 17328 was 15457, checked in by gkronber, 7 years ago

#2789 added Finbarr O'Sullivan smoothing spline code

File size: 1.0 KB
Line 
1      DOUBLE PRECISION FUNCTION DZASUM(N,ZX,INCX)
2*     .. Scalar Arguments ..
3      INTEGER INCX,N
4*     ..
5*     .. Array Arguments ..
6      DOUBLE COMPLEX ZX(*)
7*     ..
8*
9*  Purpose
10*  =======
11*
12*     takes the sum of the absolute values.
13*     jack dongarra, 3/11/78.
14*     modified 3/93 to return if incx .le. 0.
15*     modified 12/3/93, array(1) declarations changed to array(*)
16*
17*
18*     .. Local Scalars ..
19      DOUBLE PRECISION STEMP
20      INTEGER I,IX
21*     ..
22*     .. External Functions ..
23      DOUBLE PRECISION DCABS1
24      EXTERNAL DCABS1
25*     ..
26      DZASUM = 0.0d0
27      STEMP = 0.0d0
28      IF (N.LE.0 .OR. INCX.LE.0) RETURN
29      IF (INCX.EQ.1) GO TO 20
30*
31*        code for increment not equal to 1
32*
33      IX = 1
34      DO 10 I = 1,N
35          STEMP = STEMP + DCABS1(ZX(IX))
36          IX = IX + INCX
37   10 CONTINUE
38      DZASUM = STEMP
39      RETURN
40*
41*        code for increment equal to 1
42*
43   20 DO 30 I = 1,N
44          STEMP = STEMP + DCABS1(ZX(I))
45   30 CONTINUE
46      DZASUM = STEMP
47      RETURN
48      END
Note: See TracBrowser for help on using the repository browser.