|
|
1.1 ! root 1: subroutine scopy(n,sx,incx,sy,incy) ! 2: c ! 3: c copies a vector, x, to a vector, y. ! 4: c uses unrolled loops for increments equal to 1. ! 5: c jack dongarra, linpack, 3/11/78. ! 6: c ! 7: real sx(1),sy(1) ! 8: integer i,incx,incy,ix,iy,m,mp1,n ! 9: c ! 10: if(n.le.0)return ! 11: if(incx.eq.1.and.incy.eq.1)go to 20 ! 12: c ! 13: c code for unequal increments or equal increments ! 14: c not equal to 1 ! 15: c ! 16: ix = 1 ! 17: iy = 1 ! 18: if(incx.lt.0)ix = (-n+1)*incx + 1 ! 19: if(incy.lt.0)iy = (-n+1)*incy + 1 ! 20: do 10 i = 1,n ! 21: sy(iy) = sx(ix) ! 22: ix = ix + incx ! 23: iy = iy + incy ! 24: 10 continue ! 25: return ! 26: c ! 27: c code for both increments equal to 1 ! 28: c ! 29: c ! 30: c clean-up loop ! 31: c ! 32: 20 m = mod(n,7) ! 33: if( m .eq. 0 ) go to 40 ! 34: do 30 i = 1,m ! 35: sy(i) = sx(i) ! 36: 30 continue ! 37: if( n .lt. 7 ) return ! 38: 40 mp1 = m + 1 ! 39: do 50 i = mp1,n,7 ! 40: sy(i) = sx(i) ! 41: sy(i + 1) = sx(i + 1) ! 42: sy(i + 2) = sx(i + 2) ! 43: sy(i + 3) = sx(i + 3) ! 44: sy(i + 4) = sx(i + 4) ! 45: sy(i + 5) = sx(i + 5) ! 46: sy(i + 6) = sx(i + 6) ! 47: 50 continue ! 48: return ! 49: end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.