source: trunk/SOURCES/BLAS/scopy.f @ 23

Last change on this file since 23 was 4, checked in by dumas, 10 years ago

initial import GRISLI trunk

File size: 1.2 KB
Line 
1      subroutine scopy(n,sx,incx,sy,incy)
2c
3c     copies a vector, x, to a vector, y.
4c     uses unrolled loops for increments equal to 1.
5c     jack dongarra, linpack, 3/11/78.
6c     modified 12/3/93, array(1) declarations changed to array(*)
7c
8      real sx(*),sy(*)
9      integer i,incx,incy,ix,iy,m,mp1,n
10c
11      if(n.le.0)return
12      if(incx.eq.1.and.incy.eq.1)go to 20
13c
14c        code for unequal increments or equal increments
15c          not equal to 1
16c
17      ix = 1
18      iy = 1
19      if(incx.lt.0)ix = (-n+1)*incx + 1
20      if(incy.lt.0)iy = (-n+1)*incy + 1
21      do 10 i = 1,n
22        sy(iy) = sx(ix)
23        ix = ix + incx
24        iy = iy + incy
25   10 continue
26      return
27c
28c        code for both increments equal to 1
29c
30c
31c        clean-up loop
32c
33   20 m = mod(n,7)
34      if( m .eq. 0 ) go to 40
35      do 30 i = 1,m
36        sy(i) = sx(i)
37   30 continue
38      if( n .lt. 7 ) return
39   40 mp1 = m + 1
40      do 50 i = mp1,n,7
41        sy(i) = sx(i)
42        sy(i + 1) = sx(i + 1)
43        sy(i + 2) = sx(i + 2)
44        sy(i + 3) = sx(i + 3)
45        sy(i + 4) = sx(i + 4)
46        sy(i + 5) = sx(i + 5)
47        sy(i + 6) = sx(i + 6)
48   50 continue
49      return
50      end
Note: See TracBrowser for help on using the repository browser.