comparison libcruft/blas/cswap.f @ 7789:82be108cc558

First attempt at single precision tyeps * * * corrections to qrupdate single precision routines * * * prefer demotion to single over promotion to double * * * Add single precision support to log2 function * * * Trivial PROJECT file update * * * Cache optimized hermitian/transpose methods * * * Add tests for tranpose/hermitian and ChangeLog entry for new transpose code
author David Bateman <dbateman@free.fr>
date Sun, 27 Apr 2008 22:34:17 +0200
parents
children
comparison
equal deleted inserted replaced
7788:45f5faba05a2 7789:82be108cc558
1 SUBROUTINE CSWAP(N,CX,INCX,CY,INCY)
2 * .. Scalar Arguments ..
3 INTEGER INCX,INCY,N
4 * ..
5 * .. Array Arguments ..
6 COMPLEX CX(*),CY(*)
7 * ..
8 *
9 * Purpose
10 * =======
11 *
12 * interchanges two vectors.
13 * jack dongarra, linpack, 3/11/78.
14 * modified 12/3/93, array(1) declarations changed to array(*)
15 *
16 *
17 * .. Local Scalars ..
18 COMPLEX CTEMP
19 INTEGER I,IX,IY
20 * ..
21 IF (N.LE.0) RETURN
22 IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
23 *
24 * code for unequal increments or equal increments not equal
25 * to 1
26 *
27 IX = 1
28 IY = 1
29 IF (INCX.LT.0) IX = (-N+1)*INCX + 1
30 IF (INCY.LT.0) IY = (-N+1)*INCY + 1
31 DO 10 I = 1,N
32 CTEMP = CX(IX)
33 CX(IX) = CY(IY)
34 CY(IY) = CTEMP
35 IX = IX + INCX
36 IY = IY + INCY
37 10 CONTINUE
38 RETURN
39 *
40 * code for both increments equal to 1
41 20 DO 30 I = 1,N
42 CTEMP = CX(I)
43 CX(I) = CY(I)
44 CY(I) = CTEMP
45 30 CONTINUE
46 RETURN
47 END