~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to routines/blas/zswap.f

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine  zswap (n,zx,incx,zy,incy)
 
2
c
 
3
c     interchanges two vectors.
 
4
c     jack dongarra, 3/11/78.
 
5
c     modified 12/3/93, array(1) declarations changed to array(*)
 
6
c
 
7
      double complex zx(*),zy(*),ztemp
 
8
      integer i,incx,incy,ix,iy,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 not equal
 
14
c         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
        ztemp = zx(ix)
 
22
        zx(ix) = zy(iy)
 
23
        zy(iy) = ztemp
 
24
        ix = ix + incx
 
25
        iy = iy + incy
 
26
   10 continue
 
27
      return
 
28
c
 
29
c       code for both increments equal to 1
 
30
   20 do 30 i = 1,n
 
31
        ztemp = zx(i)
 
32
        zx(i) = zy(i)
 
33
        zy(i) = ztemp
 
34
   30 continue
 
35
      return
 
36
      end