Debian Codegraph @

debian/external_deps/fetk/punc/src/blas/zscal.c

raw
1 /* ./src_f77/zscal.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 zscal_(integer *n, doublecomplex *za, doublecomplex *zx,
9 integer *incx)
10 {
11 /* System generated locals */
12 integer i__1, i__2, i__3;
13 doublecomplex z__1;
14
15 /* Local variables */
16 static integer i__, ix;
17
18
19 /* scales a vector by a constant. */
20 /* jack dongarra, 3/11/78. */
21 /* modified 3/93 to return if incx .le. 0. */
22 /* modified 12/3/93, array(1) declarations changed to array(*) */
23
24
25 /* Parameter adjustments */
26 --zx;
27
28 /* Function Body */
29 if (*n <= 0 || *incx <= 0) {
30 return 0;
31 }
32 if (*incx == 1) {
33 goto L20;
34 }
35
36 /* code for increment not equal to 1 */
37
38 ix = 1;
39 i__1 = *n;
40 for (i__ = 1; i__ <= i__1; ++i__) {
41 i__2 = ix;
42 i__3 = ix;
43 z__1.r = za->r * zx[i__3].r - za->i * zx[i__3].i, z__1.i = za->r * zx[
44 i__3].i + za->i * zx[i__3].r;
45 zx[i__2].r = z__1.r, zx[i__2].i = z__1.i;
46 ix += *incx;
47 /* L10: */
48 }
49 return 0;
50
51 /* code for increment equal to 1 */
52
53 L20:
54 i__1 = *n;
55 for (i__ = 1; i__ <= i__1; ++i__) {
56 i__2 = i__;
57 i__3 = i__;
58 z__1.r = za->r * zx[i__3].r - za->i * zx[i__3].i, z__1.i = za->r * zx[
59 i__3].i + za->i * zx[i__3].r;
60 zx[i__2].r = z__1.r, zx[i__2].i = z__1.i;
61 /* L30: */
62 }
63 return 0;
64 } /* zscal_ */
65