Line | |
---|
1 | DOUBLE COMPLEX FUNCTION ZDOTU(N,ZX,INCX,ZY,INCY) |
---|
2 | * .. Scalar Arguments .. |
---|
3 | INTEGER INCX,INCY,N |
---|
4 | * .. |
---|
5 | * .. Array Arguments .. |
---|
6 | DOUBLE COMPLEX ZX(*),ZY(*) |
---|
7 | * .. |
---|
8 | * |
---|
9 | * Purpose |
---|
10 | * ======= |
---|
11 | * |
---|
12 | * ZDOTU forms the dot product of two vectors. |
---|
13 | * |
---|
14 | * Further Details |
---|
15 | * =============== |
---|
16 | * |
---|
17 | * jack dongarra, 3/11/78. |
---|
18 | * modified 12/3/93, array(1) declarations changed to array(*) |
---|
19 | * |
---|
20 | * .. Local Scalars .. |
---|
21 | DOUBLE COMPLEX ZTEMP |
---|
22 | INTEGER I,IX,IY |
---|
23 | * .. |
---|
24 | ZTEMP = (0.0d0,0.0d0) |
---|
25 | ZDOTU = (0.0d0,0.0d0) |
---|
26 | IF (N.LE.0) RETURN |
---|
27 | IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20 |
---|
28 | * |
---|
29 | * code for unequal increments or equal increments |
---|
30 | * not equal to 1 |
---|
31 | * |
---|
32 | IX = 1 |
---|
33 | IY = 1 |
---|
34 | IF (INCX.LT.0) IX = (-N+1)*INCX + 1 |
---|
35 | IF (INCY.LT.0) IY = (-N+1)*INCY + 1 |
---|
36 | DO 10 I = 1,N |
---|
37 | ZTEMP = ZTEMP + ZX(IX)*ZY(IY) |
---|
38 | IX = IX + INCX |
---|
39 | IY = IY + INCY |
---|
40 | 10 CONTINUE |
---|
41 | ZDOTU = ZTEMP |
---|
42 | RETURN |
---|
43 | * |
---|
44 | * code for both increments equal to 1 |
---|
45 | * |
---|
46 | 20 DO 30 I = 1,N |
---|
47 | ZTEMP = ZTEMP + ZX(I)*ZY(I) |
---|
48 | 30 CONTINUE |
---|
49 | ZDOTU = ZTEMP |
---|
50 | RETURN |
---|
51 | END |
---|
Note: See
TracBrowser
for help on using the repository browser.