comparison ext/cblas/src/dscal.c @ 427:905e45637745

Add the CLAPACK and CBLAS/F2C-BLAS files we use
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 30 Sep 2016 15:51:22 +0100
parents
children
comparison
equal deleted inserted replaced
426:a23b9f8b4a59 427:905e45637745
1 /* dscal.f -- translated by f2c (version 20061008).
2 You must link the resulting object file with libf2c:
3 on Microsoft Windows system, link with libf2c.lib;
4 on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5 or, if you install libf2c.a in a standard place, with -lf2c -lm
6 -- in that order, at the end of the command line, as in
7 cc *.o -lf2c -lm
8 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9
10 http://www.netlib.org/f2c/libf2c.zip
11 */
12
13 #include "f2c.h"
14 #include "blaswrap.h"
15
16 /* Subroutine */ int dscal_(integer *n, doublereal *da, doublereal *dx,
17 integer *incx)
18 {
19 /* System generated locals */
20 integer i__1, i__2;
21
22 /* Local variables */
23 integer i__, m, mp1, nincx;
24
25 /* .. Scalar Arguments .. */
26 /* .. */
27 /* .. Array Arguments .. */
28 /* .. */
29
30 /* Purpose */
31 /* ======= */
32 /* * */
33 /* scales a vector by a constant. */
34 /* uses unrolled loops for increment equal to one. */
35 /* jack dongarra, linpack, 3/11/78. */
36 /* modified 3/93 to return if incx .le. 0. */
37 /* modified 12/3/93, array(1) declarations changed to array(*) */
38
39
40 /* .. Local Scalars .. */
41 /* .. */
42 /* .. Intrinsic Functions .. */
43 /* .. */
44 /* Parameter adjustments */
45 --dx;
46
47 /* Function Body */
48 if (*n <= 0 || *incx <= 0) {
49 return 0;
50 }
51 if (*incx == 1) {
52 goto L20;
53 }
54
55 /* code for increment not equal to 1 */
56
57 nincx = *n * *incx;
58 i__1 = nincx;
59 i__2 = *incx;
60 for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
61 dx[i__] = *da * dx[i__];
62 /* L10: */
63 }
64 return 0;
65
66 /* code for increment equal to 1 */
67
68
69 /* clean-up loop */
70
71 L20:
72 m = *n % 5;
73 if (m == 0) {
74 goto L40;
75 }
76 i__2 = m;
77 for (i__ = 1; i__ <= i__2; ++i__) {
78 dx[i__] = *da * dx[i__];
79 /* L30: */
80 }
81 if (*n < 5) {
82 return 0;
83 }
84 L40:
85 mp1 = m + 1;
86 i__2 = *n;
87 for (i__ = mp1; i__ <= i__2; i__ += 5) {
88 dx[i__] = *da * dx[i__];
89 dx[i__ + 1] = *da * dx[i__ + 1];
90 dx[i__ + 2] = *da * dx[i__ + 2];
91 dx[i__ + 3] = *da * dx[i__ + 3];
92 dx[i__ + 4] = *da * dx[i__ + 4];
93 /* L50: */
94 }
95 return 0;
96 } /* dscal_ */