| 1 |
/* ./src_f77/csscal.f -- translated by f2c (version 20030320). |
| 2 |
You must link the resulting object file with the libraries: |
| 3 |
-lf2c -lm (in that order) |
| 4 |
*/ |
| 5 |
|
| 6 |
#include <punc/vf2c.h> |
| 7 |
|
| 8 |
/* Subroutine */ int csscal_(integer *n, real *sa, realcomplex *cx, integer *incx) |
| 9 |
{ |
| 10 |
/* System generated locals */ |
| 11 |
integer i__1, i__2, i__3, i__4; |
| 12 |
real r__1, r__2; |
| 13 |
realcomplex q__1; |
| 14 |
|
| 15 |
/* Builtin functions */ |
| 16 |
double r_imag(realcomplex *); |
| 17 |
|
| 18 |
/* Local variables */ |
| 19 |
static integer i__, nincx; |
| 20 |
|
| 21 |
|
| 22 |
/* scales a complex vector by a real constant. */ |
| 23 |
/* jack dongarra, linpack, 3/11/78. */ |
| 24 |
/* modified 3/93 to return if incx .le. 0. */ |
| 25 |
/* modified 12/3/93, array(1) declarations changed to array(*) */ |
| 26 |
|
| 27 |
|
| 28 |
/* Parameter adjustments */ |
| 29 |
--cx; |
| 30 |
|
| 31 |
/* Function Body */ |
| 32 |
if (*n <= 0 || *incx <= 0) { |
| 33 |
return 0; |
| 34 |
} |
| 35 |
if (*incx == 1) { |
| 36 |
goto L20; |
| 37 |
} |
| 38 |
|
| 39 |
/* code for increment not equal to 1 */ |
| 40 |
|
| 41 |
nincx = *n * *incx; |
| 42 |
i__1 = nincx; |
| 43 |
i__2 = *incx; |
| 44 |
for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) { |
| 45 |
i__3 = i__; |
| 46 |
i__4 = i__; |
| 47 |
r__1 = *sa * cx[i__4].r; |
| 48 |
r__2 = *sa * r_imag(&cx[i__]); |
| 49 |
q__1.r = r__1, q__1.i = r__2; |
| 50 |
cx[i__3].r = q__1.r, cx[i__3].i = q__1.i; |
| 51 |
/* L10: */ |
| 52 |
} |
| 53 |
return 0; |
| 54 |
|
| 55 |
/* code for increment equal to 1 */ |
| 56 |
|
| 57 |
L20: |
| 58 |
i__2 = *n; |
| 59 |
for (i__ = 1; i__ <= i__2; ++i__) { |
| 60 |
i__1 = i__; |
| 61 |
i__3 = i__; |
| 62 |
r__1 = *sa * cx[i__3].r; |
| 63 |
r__2 = *sa * r_imag(&cx[i__]); |
| 64 |
q__1.r = r__1, q__1.i = r__2; |
| 65 |
cx[i__1].r = q__1.r, cx[i__1].i = q__1.i; |
| 66 |
/* L30: */ |
| 67 |
} |
| 68 |
return 0; |
| 69 |
} /* csscal_ */ |
| 70 |
|