LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ dlaswp()

subroutine dlaswp ( integer n,
double precision, dimension( lda, * ) a,
integer lda,
integer k1,
integer k2,
integer, dimension( * ) ipiv,
integer incx )

DLASWP performs a series of row interchanges on a general rectangular matrix.

Download DLASWP + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> DLASWP performs a series of row interchanges on the matrix A.
!> One row interchange is initiated for each of rows K1 through K2 of A.
!> 
Parameters
[in]N
!>          N is INTEGER
!>          The number of columns of the matrix A.
!> 
[in,out]A
!>          A is DOUBLE PRECISION array, dimension (LDA,N)
!>          On entry, the matrix of column dimension N to which the row
!>          interchanges will be applied.
!>          On exit, the permuted matrix.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.
!> 
[in]K1
!>          K1 is INTEGER
!>          The first element of IPIV for which a row interchange will
!>          be done.
!> 
[in]K2
!>          K2 is INTEGER
!>          (K2-K1+1) is the number of elements of IPIV for which a row
!>          interchange will be done.
!> 
[in]IPIV
!>          IPIV is INTEGER array, dimension (K1+(K2-K1)*abs(INCX))
!>          The vector of pivot indices. Only the elements in positions
!>          K1 through K1+(K2-K1)*abs(INCX) of IPIV are accessed.
!>          IPIV(K1+(K-K1)*abs(INCX)) = L implies rows K and L are to be
!>          interchanged.
!> 
[in]INCX
!>          INCX is INTEGER
!>          The increment between successive values of IPIV. If INCX
!>          is negative, the pivots are applied in reverse order.
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
!>
!>  Modified by
!>   R. C. Whaley, Computer Science Dept., Univ. of Tenn., Knoxville, USA
!> 

Definition at line 112 of file dlaswp.f.

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*
Here is the caller graph for this function: