Debian Codegraph @

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

raw
1 /* ./src_f77/sscal.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 sscal_(integer *n, real *sa, real *sx, integer *incx)
9 {
10 /* System generated locals */
11 integer i__1, i__2;
12
13 /* Local variables */
14 static integer i__, m, mp1, nincx;
15
16
17 /* scales a vector by a constant. */
18 /* uses unrolled loops for increment equal to 1. */
19 /* jack dongarra, linpack, 3/11/78. */
20 /* modified 3/93 to return if incx .le. 0. */
21 /* modified 12/3/93, array(1) declarations changed to array(*) */
22
23
24 /* Parameter adjustments */
25 --sx;
26
27 /* Function Body */
28 if (*n <= 0 || *incx <= 0) {
29 return 0;
30 }
31 if (*incx == 1) {
32 goto L20;
33 }
34
35 /* code for increment not equal to 1 */
36
37 nincx = *n * *incx;
38 i__1 = nincx;
39 i__2 = *incx;
40 for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
41 sx[i__] = *sa * sx[i__];
42 /* L10: */
43 }
44 return 0;
45
46 /* code for increment equal to 1 */
47
48
49 /* clean-up loop */
50
51 L20:
52 m = *n % 5;
53 if (m == 0) {
54 goto L40;
55 }
56 i__2 = m;
57 for (i__ = 1; i__ <= i__2; ++i__) {
58 sx[i__] = *sa * sx[i__];
59 /* L30: */
60 }
61 if (*n < 5) {
62 return 0;
63 }
64 L40:
65 mp1 = m + 1;
66 i__2 = *n;
67 for (i__ = mp1; i__ <= i__2; i__ += 5) {
68 sx[i__] = *sa * sx[i__];
69 sx[i__ + 1] = *sa * sx[i__ + 1];
70 sx[i__ + 2] = *sa * sx[i__ + 2];
71 sx[i__ + 3] = *sa * sx[i__ + 3];
72 sx[i__ + 4] = *sa * sx[i__ + 4];
73 /* L50: */
74 }
75 return 0;
76 } /* sscal_ */
77