LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dlaswp.f
Go to the documentation of this file.
1*> \brief \b DLASWP performs a series of row interchanges on a general rectangular matrix.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DLASWP + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlaswp.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlaswp.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaswp.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DLASWP( N, A, LDA, K1, K2, IPIV, INCX )
20*
21* .. Scalar Arguments ..
22* INTEGER INCX, K1, K2, LDA, N
23* ..
24* .. Array Arguments ..
25* INTEGER IPIV( * )
26* DOUBLE PRECISION A( LDA, * )
27* ..
28*
29*
30*> \par Purpose:
31* =============
32*>
33*> \verbatim
34*>
35*> DLASWP performs a series of row interchanges on the matrix A.
36*> One row interchange is initiated for each of rows K1 through K2 of A.
37*> \endverbatim
38*
39* Arguments:
40* ==========
41*
42*> \param[in] N
43*> \verbatim
44*> N is INTEGER
45*> The number of columns of the matrix A.
46*> \endverbatim
47*>
48*> \param[in,out] A
49*> \verbatim
50*> A is DOUBLE PRECISION array, dimension (LDA,N)
51*> On entry, the matrix of column dimension N to which the row
52*> interchanges will be applied.
53*> On exit, the permuted matrix.
54*> \endverbatim
55*>
56*> \param[in] LDA
57*> \verbatim
58*> LDA is INTEGER
59*> The leading dimension of the array A.
60*> \endverbatim
61*>
62*> \param[in] K1
63*> \verbatim
64*> K1 is INTEGER
65*> The first element of IPIV for which a row interchange will
66*> be done.
67*> \endverbatim
68*>
69*> \param[in] K2
70*> \verbatim
71*> K2 is INTEGER
72*> (K2-K1+1) is the number of elements of IPIV for which a row
73*> interchange will be done.
74*> \endverbatim
75*>
76*> \param[in] IPIV
77*> \verbatim
78*> IPIV is INTEGER array, dimension (K1+(K2-K1)*abs(INCX))
79*> The vector of pivot indices. Only the elements in positions
80*> K1 through K1+(K2-K1)*abs(INCX) of IPIV are accessed.
81*> IPIV(K1+(K-K1)*abs(INCX)) = L implies rows K and L are to be
82*> interchanged.
83*> \endverbatim
84*>
85*> \param[in] INCX
86*> \verbatim
87*> INCX is INTEGER
88*> The increment between successive values of IPIV. If INCX
89*> is negative, the pivots are applied in reverse order.
90*> \endverbatim
91*
92* Authors:
93* ========
94*
95*> \author Univ. of Tennessee
96*> \author Univ. of California Berkeley
97*> \author Univ. of Colorado Denver
98*> \author NAG Ltd.
99*
100*> \ingroup laswp
101*
102*> \par Further Details:
103* =====================
104*>
105*> \verbatim
106*>
107*> Modified by
108*> R. C. Whaley, Computer Science Dept., Univ. of Tenn., Knoxville, USA
109*> \endverbatim
110*>
111* =====================================================================
112 SUBROUTINE dlaswp( N, A, LDA, K1, K2, IPIV, INCX )
113*
114* -- LAPACK auxiliary routine --
115* -- LAPACK is a software package provided by Univ. of Tennessee, --
116* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
117*
118* .. Scalar Arguments ..
119 INTEGER INCX, K1, K2, LDA, N
120* ..
121* .. Array Arguments ..
122 INTEGER IPIV( * )
123 DOUBLE PRECISION A( LDA, * )
124* ..
125*
126* =====================================================================
127*
128* .. Local Scalars ..
129 INTEGER I, I1, I2, INC, IP, IX, IX0, J, K, N32
130 DOUBLE PRECISION TEMP
131* ..
132* .. Executable Statements ..
133*
134* Interchange row I with row IPIV(K1+(I-K1)*abs(INCX)) for each of rows
135* K1 through K2.
136*
137 IF( incx.GT.0 ) THEN
138 ix0 = k1
139 i1 = k1
140 i2 = k2
141 inc = 1
142 ELSE IF( incx.LT.0 ) THEN
143 ix0 = k1 + ( k1-k2 )*incx
144 i1 = k2
145 i2 = k1
146 inc = -1
147 ELSE
148 RETURN
149 END IF
150*
151 n32 = ( n / 32 )*32
152 IF( n32.NE.0 ) THEN
153 DO 30 j = 1, n32, 32
154 ix = ix0
155 DO 20 i = i1, i2, inc
156 ip = ipiv( ix )
157 IF( ip.NE.i ) THEN
158 DO 10 k = j, j + 31
159 temp = a( i, k )
160 a( i, k ) = a( ip, k )
161 a( ip, k ) = temp
162 10 CONTINUE
163 END IF
164 ix = ix + incx
165 20 CONTINUE
166 30 CONTINUE
167 END IF
168 IF( n32.NE.n ) THEN
169 n32 = n32 + 1
170 ix = ix0
171 DO 50 i = i1, i2, inc
172 ip = ipiv( ix )
173 IF( ip.NE.i ) THEN
174 DO 40 k = n32, n
175 temp = a( i, k )
176 a( i, k ) = a( ip, k )
177 a( ip, k ) = temp
178 40 CONTINUE
179 END IF
180 ix = ix + incx
181 50 CONTINUE
182 END IF
183*
184 RETURN
185*
186* End of DLASWP
187*
188 END
subroutine dlaswp(n, a, lda, k1, k2, ipiv, incx)
DLASWP performs a series of row interchanges on a general rectangular matrix.
Definition dlaswp.f:113