Debian Codegraph @

Modules/ThirdParty/VNL/src/vxl/v3p/netlib/blas/saxpy.c

raw symbols SCIP
1 /* blas/saxpy.f -- translated by f2c (version 20050501).
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 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 #include "v3p_netlib.h"cxx . . $ `<file>/Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib.h`/
17
18 /*< subroutine saxpy(n,sa,sx,incx,sy,incy) >*/
19 /* Subroutine */ int saxpy_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:221:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *n, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *sa, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *sx, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *incx,
20 realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *sy, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *incy)
21 {
22 /* System generated locals */
23 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__1;
24
25 /* Local variables */
26 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__, m, ix, iy, mp1;
27
28
29 /* constant times a vector plus a vector. */
30 /* uses unrolled loop for increments equal to one. */
31 /* jack dongarra, linpack, 3/11/78. */
32 /* modified 12/3/93, array(1) declarations changed to array(*) */
33
34 /*< real sx(*),sy(*),sa >*/
35 /*< integer i,incx,incy,ix,iy,m,mp1,n >*/
36
37 /*< if(n.le.0)return >*/
38 /* Parameter adjustments */
39 --sy;
40 --sx;
41
42 /* Function Body */
43 if (*n <= 0) {
44 return 0;
45 }
46 /*< if (sa .eq. 0.0) return >*/
47 if (*sa == (float)0.) {
48 return 0;
49 }
50 /*< if(incx.eq.1.and.incy.eq.1)go to 20 >*/
51 if (*incx == 1 && *incy == 1) {
52 goto L20;
53 }
54
55 /* code for unequal increments or equal increments */
56 /* not equal to 1 */
57
58 /*< ix = 1 >*/
59 ix = 1;
60 /*< iy = 1 >*/
61 iy = 1;
62 /*< if(incx.lt.0)ix = (-n+1)*incx + 1 >*/
63 if (*incx < 0) {
64 ix = (-(*n) + 1) * *incx + 1;
65 }
66 /*< if(incy.lt.0)iy = (-n+1)*incy + 1 >*/
67 if (*incy < 0) {
68 iy = (-(*n) + 1) * *incy + 1;
69 }
70 /*< do 10 i = 1,n >*/
71 i__1 = *n;
72 for (i__ = 1; i__ <= i__1; ++i__) {
73 /*< sy(iy) = sy(iy) + sa*sx(ix) >*/
74 sy[iy] += *sa * sx[ix];
75 /*< ix = ix + incx >*/
76 ix += *incx;
77 /*< iy = iy + incy >*/
78 iy += *incy;
79 /*< 10 continue >*/
80 /* L10: */
81 }
82 /*< return >*/
83 return 0;
84
85 /* code for both increments equal to 1 */
86
87
88 /* clean-up loop */
89
90 /*< 20 m = mod(n,4) >*/
91 L20:
92 m = *n % 4;
93 /*< if( m .eq. 0 ) go to 40 >*/
94 if (m == 0) {
95 goto L40;
96 }
97 /*< do 30 i = 1,m >*/
98 i__1 = m;
99 for (i__ = 1; i__ <= i__1; ++i__) {
100 /*< sy(i) = sy(i) + sa*sx(i) >*/
101 sy[i__] += *sa * sx[i__];
102 /*< 30 continue >*/
103 /* L30: */
104 }
105 /*< if( n .lt. 4 ) return >*/
106 if (*n < 4) {
107 return 0;
108 }
109 /*< 40 mp1 = m + 1 >*/
110 L40:
111 mp1 = m + 1;
112 /*< do 50 i = mp1,n,4 >*/
113 i__1 = *n;
114 for (i__ = mp1; i__ <= i__1; i__ += 4) {
115 /*< sy(i) = sy(i) + sa*sx(i) >*/
116 sy[i__] += *sa * sx[i__];
117 /*< sy(i + 1) = sy(i + 1) + sa*sx(i + 1) >*/
118 sy[i__ + 1] += *sa * sx[i__ + 1];
119 /*< sy(i + 2) = sy(i + 2) + sa*sx(i + 2) >*/
120 sy[i__ + 2] += *sa * sx[i__ + 2];
121 /*< sy(i + 3) = sy(i + 3) + sa*sx(i + 3) >*/
122 sy[i__ + 3] += *sa * sx[i__ + 3];
123 /*< 50 continue >*/
124 /* L50: */
125 }
126 /*< return >*/
127 return 0;
128 /*< end >*/
129 } /* saxpy_ */
130
131 #ifdef __cplusplus
132 }
133 #endif