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

◆ zlaswp()

subroutine zlaswp ( integer  n,
complex*16, dimension( lda, * )  a,
integer  lda,
integer  k1,
integer  k2,
integer, dimension( * )  ipiv,
integer  incx 
)

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

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

Purpose:
 ZLASWP 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 COMPLEX*16 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 114 of file zlaswp.f.

115*
116* -- LAPACK auxiliary routine --
117* -- LAPACK is a software package provided by Univ. of Tennessee, --
118* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
119*
120* .. Scalar Arguments ..
121 INTEGER INCX, K1, K2, LDA, N
122* ..
123* .. Array Arguments ..
124 INTEGER IPIV( * )
125 COMPLEX*16 A( LDA, * )
126* ..
127*
128* =====================================================================
129*
130* .. Local Scalars ..
131 INTEGER I, I1, I2, INC, IP, IX, IX0, J, K, N32
132 COMPLEX*16 TEMP
133* ..
134* .. Executable Statements ..
135*
136* Interchange row I with row IPIV(K1+(I-K1)*abs(INCX)) for each of rows
137* K1 through K2.
138*
139 IF( incx.GT.0 ) THEN
140 ix0 = k1
141 i1 = k1
142 i2 = k2
143 inc = 1
144 ELSE IF( incx.LT.0 ) THEN
145 ix0 = k1 + ( k1-k2 )*incx
146 i1 = k2
147 i2 = k1
148 inc = -1
149 ELSE
150 RETURN
151 END IF
152*
153 n32 = ( n / 32 )*32
154 IF( n32.NE.0 ) THEN
155 DO 30 j = 1, n32, 32
156 ix = ix0
157 DO 20 i = i1, i2, inc
158 ip = ipiv( ix )
159 IF( ip.NE.i ) THEN
160 DO 10 k = j, j + 31
161 temp = a( i, k )
162 a( i, k ) = a( ip, k )
163 a( ip, k ) = temp
164 10 CONTINUE
165 END IF
166 ix = ix + incx
167 20 CONTINUE
168 30 CONTINUE
169 END IF
170 IF( n32.NE.n ) THEN
171 n32 = n32 + 1
172 ix = ix0
173 DO 50 i = i1, i2, inc
174 ip = ipiv( ix )
175 IF( ip.NE.i ) THEN
176 DO 40 k = n32, n
177 temp = a( i, k )
178 a( i, k ) = a( ip, k )
179 a( ip, k ) = temp
180 40 CONTINUE
181 END IF
182 ix = ix + incx
183 50 CONTINUE
184 END IF
185*
186 RETURN
187*
188* End of ZLASWP
189*
Here is the caller graph for this function: