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