Line | |
---|
1 | SUBROUTINE CSCAL(N,CA,CX,INCX) |
---|
2 | * .. Scalar Arguments .. |
---|
3 | COMPLEX CA |
---|
4 | INTEGER INCX,N |
---|
5 | * .. |
---|
6 | * .. Array Arguments .. |
---|
7 | COMPLEX CX(*) |
---|
8 | * .. |
---|
9 | * |
---|
10 | * Purpose |
---|
11 | * ======= |
---|
12 | * |
---|
13 | * scales a vector by a constant. |
---|
14 | * jack dongarra, linpack, 3/11/78. |
---|
15 | * modified 3/93 to return if incx .le. 0. |
---|
16 | * modified 12/3/93, array(1) declarations changed to array(*) |
---|
17 | * |
---|
18 | * |
---|
19 | * .. Local Scalars .. |
---|
20 | INTEGER I,NINCX |
---|
21 | * .. |
---|
22 | IF (N.LE.0 .OR. INCX.LE.0) RETURN |
---|
23 | IF (INCX.EQ.1) GO TO 20 |
---|
24 | * |
---|
25 | * code for increment not equal to 1 |
---|
26 | * |
---|
27 | NINCX = N*INCX |
---|
28 | DO 10 I = 1,NINCX,INCX |
---|
29 | CX(I) = CA*CX(I) |
---|
30 | 10 CONTINUE |
---|
31 | RETURN |
---|
32 | * |
---|
33 | * code for increment equal to 1 |
---|
34 | * |
---|
35 | 20 DO 30 I = 1,N |
---|
36 | CX(I) = CA*CX(I) |
---|
37 | 30 CONTINUE |
---|
38 | RETURN |
---|
39 | END |
---|
Note: See
TracBrowser
for help on using the repository browser.