Line | |
---|
1 | SUBROUTINE CCOPY(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 | * CCOPY copies a vector x to a vector y. |
---|
13 | * |
---|
14 | * Further Details |
---|
15 | * =============== |
---|
16 | * |
---|
17 | * jack dongarra, linpack, 3/11/78. |
---|
18 | * modified 12/3/93, array(1) declarations changed to array(*) |
---|
19 | * |
---|
20 | * .. Local Scalars .. |
---|
21 | INTEGER I,IX,IY |
---|
22 | * .. |
---|
23 | IF (N.LE.0) RETURN |
---|
24 | IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20 |
---|
25 | * |
---|
26 | * code for unequal increments or equal increments |
---|
27 | * not equal to 1 |
---|
28 | * |
---|
29 | IX = 1 |
---|
30 | IY = 1 |
---|
31 | IF (INCX.LT.0) IX = (-N+1)*INCX + 1 |
---|
32 | IF (INCY.LT.0) IY = (-N+1)*INCY + 1 |
---|
33 | DO 10 I = 1,N |
---|
34 | CY(IY) = CX(IX) |
---|
35 | IX = IX + INCX |
---|
36 | IY = IY + INCY |
---|
37 | 10 CONTINUE |
---|
38 | RETURN |
---|
39 | * |
---|
40 | * code for both increments equal to 1 |
---|
41 | * |
---|
42 | 20 DO 30 I = 1,N |
---|
43 | CY(I) = CX(I) |
---|
44 | 30 CONTINUE |
---|
45 | RETURN |
---|
46 | END |
---|
Note: See
TracBrowser
for help on using the repository browser.