| 1 | /* blas/sswap.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 sswap (n,sx,incx,sy,incy) >*/ |
| 19 | /* Subroutine */ int sswap_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:283: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`! *sx, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *incx, realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! *sy, |
| 20 | 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 | realcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:69:9`! stemp; |
| 28 | |
| 29 | |
| 30 | /* interchanges two vectors. */ |
| 31 | /* uses unrolled loops for increments equal to 1. */ |
| 32 | /* jack dongarra, linpack, 3/11/78. */ |
| 33 | /* modified 12/3/93, array(1) declarations changed to array(*) */ |
| 34 | |
| 35 | /*< real sx(*),sy(*),stemp >*/ |
| 36 | /*< integer i,incx,incy,ix,iy,m,mp1,n >*/ |
| 37 | |
| 38 | /*< if(n.le.0)return >*/ |
| 39 | /* Parameter adjustments */ |
| 40 | --sy; |
| 41 | --sx; |
| 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 | /*< stemp = sx(ix) >*/ |
| 71 | stemp = sx[ix]; |
| 72 | /*< sx(ix) = sy(iy) >*/ |
| 73 | sx[ix] = sy[iy]; |
| 74 | /*< sy(iy) = stemp >*/ |
| 75 | sy[iy] = stemp; |
| 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 | /*< stemp = sx(i) >*/ |
| 102 | stemp = sx[i__]; |
| 103 | /*< sx(i) = sy(i) >*/ |
| 104 | sx[i__] = sy[i__]; |
| 105 | /*< sy(i) = stemp >*/ |
| 106 | sy[i__] = stemp; |
| 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 | /*< stemp = sx(i) >*/ |
| 121 | stemp = sx[i__]; |
| 122 | /*< sx(i) = sy(i) >*/ |
| 123 | sx[i__] = sy[i__]; |
| 124 | /*< sy(i) = stemp >*/ |
| 125 | sy[i__] = stemp; |
| 126 | /*< stemp = sx(i + 1) >*/ |
| 127 | stemp = sx[i__ + 1]; |
| 128 | /*< sx(i + 1) = sy(i + 1) >*/ |
| 129 | sx[i__ + 1] = sy[i__ + 1]; |
| 130 | /*< sy(i + 1) = stemp >*/ |
| 131 | sy[i__ + 1] = stemp; |
| 132 | /*< stemp = sx(i + 2) >*/ |
| 133 | stemp = sx[i__ + 2]; |
| 134 | /*< sx(i + 2) = sy(i + 2) >*/ |
| 135 | sx[i__ + 2] = sy[i__ + 2]; |
| 136 | /*< sy(i + 2) = stemp >*/ |
| 137 | sy[i__ + 2] = stemp; |
| 138 | /*< 50 continue >*/ |
| 139 | /* L50: */ |
| 140 | } |
| 141 | /*< return >*/ |
| 142 | return 0; |
| 143 | /*< end >*/ |
| 144 | } /* sswap_ */ |
| 145 | |
| 146 | #ifdef __cplusplus |
| 147 | } |
| 148 | #endif |