root / src / blas / scopy.f @ 2
Historique | Voir | Annoter | Télécharger (1,36 ko)
| 1 | 1 | pfleura2 | SUBROUTINE SCOPY(N,SX,INCX,SY,INCY) |
|---|---|---|---|
| 2 | 1 | pfleura2 | * .. Scalar Arguments .. |
| 3 | 1 | pfleura2 | INTEGER INCX,INCY,N |
| 4 | 1 | pfleura2 | * .. |
| 5 | 1 | pfleura2 | * .. Array Arguments .. |
| 6 | 1 | pfleura2 | REAL SX(*),SY(*) |
| 7 | 1 | pfleura2 | * .. |
| 8 | 1 | pfleura2 | * |
| 9 | 1 | pfleura2 | * Purpose |
| 10 | 1 | pfleura2 | * ======= |
| 11 | 1 | pfleura2 | * |
| 12 | 1 | pfleura2 | * copies a vector, x, to a vector, y. |
| 13 | 1 | pfleura2 | * uses unrolled loops for increments equal to 1. |
| 14 | 1 | pfleura2 | * jack dongarra, linpack, 3/11/78. |
| 15 | 1 | pfleura2 | * modified 12/3/93, array(1) declarations changed to array(*) |
| 16 | 1 | pfleura2 | * |
| 17 | 1 | pfleura2 | * |
| 18 | 1 | pfleura2 | * .. Local Scalars .. |
| 19 | 1 | pfleura2 | INTEGER I,IX,IY,M,MP1 |
| 20 | 1 | pfleura2 | * .. |
| 21 | 1 | pfleura2 | * .. Intrinsic Functions .. |
| 22 | 1 | pfleura2 | INTRINSIC MOD |
| 23 | 1 | pfleura2 | * .. |
| 24 | 1 | pfleura2 | IF (N.LE.0) RETURN |
| 25 | 1 | pfleura2 | IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20 |
| 26 | 1 | pfleura2 | * |
| 27 | 1 | pfleura2 | * code for unequal increments or equal increments |
| 28 | 1 | pfleura2 | * not equal to 1 |
| 29 | 1 | pfleura2 | * |
| 30 | 1 | pfleura2 | IX = 1 |
| 31 | 1 | pfleura2 | IY = 1 |
| 32 | 1 | pfleura2 | IF (INCX.LT.0) IX = (-N+1)*INCX + 1 |
| 33 | 1 | pfleura2 | IF (INCY.LT.0) IY = (-N+1)*INCY + 1 |
| 34 | 1 | pfleura2 | DO 10 I = 1,N |
| 35 | 1 | pfleura2 | SY(IY) = SX(IX) |
| 36 | 1 | pfleura2 | IX = IX + INCX |
| 37 | 1 | pfleura2 | IY = IY + INCY |
| 38 | 1 | pfleura2 | 10 CONTINUE |
| 39 | 1 | pfleura2 | RETURN |
| 40 | 1 | pfleura2 | * |
| 41 | 1 | pfleura2 | * code for both increments equal to 1 |
| 42 | 1 | pfleura2 | * |
| 43 | 1 | pfleura2 | * |
| 44 | 1 | pfleura2 | * clean-up loop |
| 45 | 1 | pfleura2 | * |
| 46 | 1 | pfleura2 | 20 M = MOD(N,7) |
| 47 | 1 | pfleura2 | IF (M.EQ.0) GO TO 40 |
| 48 | 1 | pfleura2 | DO 30 I = 1,M |
| 49 | 1 | pfleura2 | SY(I) = SX(I) |
| 50 | 1 | pfleura2 | 30 CONTINUE |
| 51 | 1 | pfleura2 | IF (N.LT.7) RETURN |
| 52 | 1 | pfleura2 | 40 MP1 = M + 1 |
| 53 | 1 | pfleura2 | DO 50 I = MP1,N,7 |
| 54 | 1 | pfleura2 | SY(I) = SX(I) |
| 55 | 1 | pfleura2 | SY(I+1) = SX(I+1) |
| 56 | 1 | pfleura2 | SY(I+2) = SX(I+2) |
| 57 | 1 | pfleura2 | SY(I+3) = SX(I+3) |
| 58 | 1 | pfleura2 | SY(I+4) = SX(I+4) |
| 59 | 1 | pfleura2 | SY(I+5) = SX(I+5) |
| 60 | 1 | pfleura2 | SY(I+6) = SX(I+6) |
| 61 | 1 | pfleura2 | 50 CONTINUE |
| 62 | 1 | pfleura2 | RETURN |
| 63 | 1 | pfleura2 | END |