KTH framework for Nek5000 toolboxes; testing version  0.0.1
dlaswp.f
Go to the documentation of this file.
1  SUBROUTINE dlaswp( N, A, LDA, K1, K2, IPIV, INCX )
2 *
3 * -- LAPACK auxiliary routine (version 3.0) --
4 * Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
5 * Courant Institute, Argonne National Lab, and Rice University
6 * June 30, 1999
7 *
8 * .. Scalar Arguments ..
9  INTEGER INCX, K1, K2, LDA, N
10 * ..
11 * .. Array Arguments ..
12  INTEGER IPIV( * )
13  DOUBLE PRECISION A( LDA, * )
14 * ..
15 *
16 * Purpose
17 * =======
18 *
19 * DLASWP performs a series of row interchanges on the matrix A.
20 * One row interchange is initiated for each of rows K1 through K2 of A.
21 *
22 * Arguments
23 * =========
24 *
25 * N (input) INTEGER
26 * The number of columns of the matrix A.
27 *
28 * A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
29 * On entry, the matrix of column dimension N to which the row
30 * interchanges will be applied.
31 * On exit, the permuted matrix.
32 *
33 * LDA (input) INTEGER
34 * The leading dimension of the array A.
35 *
36 * K1 (input) INTEGER
37 * The first element of IPIV for which a row interchange will
38 * be done.
39 *
40 * K2 (input) INTEGER
41 * The last element of IPIV for which a row interchange will
42 * be done.
43 *
44 * IPIV (input) INTEGER array, dimension (M*abs(INCX))
45 * The vector of pivot indices. Only the elements in positions
46 * K1 through K2 of IPIV are accessed.
47 * IPIV(K) = L implies rows K and L are to be interchanged.
48 *
49 * INCX (input) INTEGER
50 * The increment between successive values of IPIV. If IPIV
51 * is negative, the pivots are applied in reverse order.
52 *
53 * Further Details
54 * ===============
55 *
56 * Modified by
57 * R. C. Whaley, Computer Science Dept., Univ. of Tenn., Knoxville, USA
58 *
59 * =====================================================================
60 *
61 * .. Local Scalars ..
62  INTEGER I, I1, I2, INC, IP, IX, IX0, J, K, N32
63  DOUBLE PRECISION TEMP
64 * ..
65 * .. Executable Statements ..
66 *
67 * Interchange row I with row IPIV(I) for each of rows K1 through K2.
68 *
69  IF( incx.GT.0 ) THEN
70  ix0 = k1
71  i1 = k1
72  i2 = k2
73  inc = 1
74  ELSE IF( incx.LT.0 ) THEN
75  ix0 = 1 + ( 1-k2 )*incx
76  i1 = k2
77  i2 = k1
78  inc = -1
79  ELSE
80  RETURN
81  END IF
82 *
83  n32 = ( n / 32 )*32
84  IF( n32.NE.0 ) THEN
85  DO 30 j = 1, n32, 32
86  ix = ix0
87  DO 20 i = i1, i2, inc
88  ip = ipiv( ix )
89  IF( ip.NE.i ) THEN
90  DO 10 k = j, j + 31
91  temp = a( i, k )
92  a( i, k ) = a( ip, k )
93  a( ip, k ) = temp
94  10 CONTINUE
95  END IF
96  ix = ix + incx
97  20 CONTINUE
98  30 CONTINUE
99  END IF
100  IF( n32.NE.n ) THEN
101  n32 = n32 + 1
102  ix = ix0
103  DO 50 i = i1, i2, inc
104  ip = ipiv( ix )
105  IF( ip.NE.i ) THEN
106  DO 40 k = n32, n
107  temp = a( i, k )
108  a( i, k ) = a( ip, k )
109  a( ip, k ) = temp
110  40 CONTINUE
111  END IF
112  ix = ix + incx
113  50 CONTINUE
114  END IF
115 *
116  RETURN
117 *
118 * End of DLASWP
119 *
120  END
subroutine dlaswp(N, A, LDA, K1, K2, IPIV, INCX)
Definition: dlaswp.f:2