Debian Codegraph @

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

raw symbols SCIP
1 /* blas/dswap.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 dswap (n,dx,incx,dy,incy) >*/
19 /* Subroutine */ int dswap_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:146:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *n, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *dx, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *incx,
20 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *dy, 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 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! dtemp;
28
29
30 /* interchanges two vectors. */
31 /* uses unrolled loops for increments equal one. */
32 /* jack dongarra, linpack, 3/11/78. */
33 /* modified 12/3/93, array(1) declarations changed to array(*) */
34
35 /*< double precision dx(*),dy(*),dtemp >*/
36 /*< integer i,incx,incy,ix,iy,m,mp1,n >*/
37
38 /*< if(n.le.0)return >*/
39 /* Parameter adjustments */
40 --dy;
41 --dx;
42
43 /* Function Body */
44 if (*n <= 0) {
45 return 0;
46 }
47 /*< if(incx.eq.1.and.incy.eq.1)go to 20 >*/
48 if (*incx == 1 && *incy == 1) {
49 goto L20;
50 }
51
52 /* code for unequal increments or equal increments not equal */
53 /* to 1 */
54
55 /*< ix = 1 >*/
56 ix = 1;
57 /*< iy = 1 >*/
58 iy = 1;
59 /*< if(incx.lt.0)ix = (-n+1)*incx + 1 >*/
60 if (*incx < 0) {
61 ix = (-(*n) + 1) * *incx + 1;
62 }
63 /*< if(incy.lt.0)iy = (-n+1)*incy + 1 >*/
64 if (*incy < 0) {
65 iy = (-(*n) + 1) * *incy + 1;
66 }
67 /*< do 10 i = 1,n >*/
68 i__1 = *n;
69 for (i__ = 1; i__ <= i__1; ++i__) {
70 /*< dtemp = dx(ix) >*/
71 dtemp = dx[ix];
72 /*< dx(ix) = dy(iy) >*/
73 dx[ix] = dy[iy];
74 /*< dy(iy) = dtemp >*/
75 dy[iy] = dtemp;
76 /*< ix = ix + incx >*/
77 ix += *incx;
78 /*< iy = iy + incy >*/
79 iy += *incy;
80 /*< 10 continue >*/
81 /* L10: */
82 }
83 /*< return >*/
84 return 0;
85
86 /* code for both increments equal to 1 */
87
88
89 /* clean-up loop */
90
91 /*< 20 m = mod(n,3) >*/
92 L20:
93 m = *n % 3;
94 /*< if( m .eq. 0 ) go to 40 >*/
95 if (m == 0) {
96 goto L40;
97 }
98 /*< do 30 i = 1,m >*/
99 i__1 = m;
100 for (i__ = 1; i__ <= i__1; ++i__) {
101 /*< dtemp = dx(i) >*/
102 dtemp = dx[i__];
103 /*< dx(i) = dy(i) >*/
104 dx[i__] = dy[i__];
105 /*< dy(i) = dtemp >*/
106 dy[i__] = dtemp;
107 /*< 30 continue >*/
108 /* L30: */
109 }
110 /*< if( n .lt. 3 ) return >*/
111 if (*n < 3) {
112 return 0;
113 }
114 /*< 40 mp1 = m + 1 >*/
115 L40:
116 mp1 = m + 1;
117 /*< do 50 i = mp1,n,3 >*/
118 i__1 = *n;
119 for (i__ = mp1; i__ <= i__1; i__ += 3) {
120 /*< dtemp = dx(i) >*/
121 dtemp = dx[i__];
122 /*< dx(i) = dy(i) >*/
123 dx[i__] = dy[i__];
124 /*< dy(i) = dtemp >*/
125 dy[i__] = dtemp;
126 /*< dtemp = dx(i + 1) >*/
127 dtemp = dx[i__ + 1];
128 /*< dx(i + 1) = dy(i + 1) >*/
129 dx[i__ + 1] = dy[i__ + 1];
130 /*< dy(i + 1) = dtemp >*/
131 dy[i__ + 1] = dtemp;
132 /*< dtemp = dx(i + 2) >*/
133 dtemp = dx[i__ + 2];
134 /*< dx(i + 2) = dy(i + 2) >*/
135 dx[i__ + 2] = dy[i__ + 2];
136 /*< dy(i + 2) = dtemp >*/
137 dy[i__ + 2] = dtemp;
138 /*< 50 continue >*/
139 /* L50: */
140 }
141 /*< return >*/
142 return 0;
143 /*< end >*/
144 } /* dswap_ */
145
146 #ifdef __cplusplus
147 }
148 #endif