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

◆ zsyswapr()

subroutine zsyswapr ( character  uplo,
integer  n,
complex*16, dimension( lda, * )  a,
integer  lda,
integer  i1,
integer  i2 
)

ZSYSWAPR

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

Purpose:
 ZSYSWAPR applies an elementary permutation on the rows and the columns of
 a symmetric matrix.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
          Specifies whether the details of the factorization are stored
          as an upper or lower triangular matrix.
          = 'U':  Upper triangular, form is A = U*D*U**T;
          = 'L':  Lower triangular, form is A = L*D*L**T.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in,out]A
          A is COMPLEX*16 array, dimension (LDA,*)
          On entry, the N-by-N matrix A. On exit, the permuted matrix
          where the rows I1 and I2 and columns I1 and I2 are interchanged.
          If UPLO = 'U', the interchanges are applied to the upper
          triangular part and the strictly lower triangular part of A is
          not referenced; if UPLO = 'L', the interchanges are applied to
          the lower triangular part and the part of A above the diagonal
          is not referenced.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,N).
[in]I1
          I1 is INTEGER
          Index of the first row to swap
[in]I2
          I2 is INTEGER
          Index of the second row to swap
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 99 of file zsyswapr.f.

100*
101* -- LAPACK auxiliary routine --
102* -- LAPACK is a software package provided by Univ. of Tennessee, --
103* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
104*
105* .. Scalar Arguments ..
106 CHARACTER UPLO
107 INTEGER I1, I2, LDA, N
108* ..
109* .. Array Arguments ..
110 COMPLEX*16 A( LDA, * )
111*
112* =====================================================================
113*
114* ..
115* .. Local Scalars ..
116 LOGICAL UPPER
117 COMPLEX*16 TMP
118*
119* .. External Functions ..
120 LOGICAL LSAME
121 EXTERNAL lsame
122* ..
123* .. External Subroutines ..
124 EXTERNAL zswap
125* ..
126* .. Executable Statements ..
127*
128 upper = lsame( uplo, 'U' )
129 IF (upper) THEN
130*
131* UPPER
132* first swap
133* - swap column I1 and I2 from I1 to I1-1
134 CALL zswap( i1-1, a(1,i1), 1, a(1,i2), 1 )
135*
136* second swap :
137* - swap A(I1,I1) and A(I2,I2)
138* - swap row I1 from I1+1 to I2-1 with col I2 from I1+1 to I2-1
139 tmp=a(i1,i1)
140 a(i1,i1)=a(i2,i2)
141 a(i2,i2)=tmp
142*
143 CALL zswap( i2-i1-1, a(i1,i1+1), lda, a(i1+1,i2), 1 )
144*
145* third swap
146* - swap row I1 and I2 from I2+1 to N
147 IF ( i2.LT.n )
148 $ CALL zswap( n-i2, a(i1,i2+1), lda, a(i2,i2+1), lda )
149*
150 ELSE
151*
152* LOWER
153* first swap
154* - swap row I1 and I2 from I1 to I1-1
155 CALL zswap( i1-1, a(i1,1), lda, a(i2,1), lda )
156*
157* second swap :
158* - swap A(I1,I1) and A(I2,I2)
159* - swap col I1 from I1+1 to I2-1 with row I2 from I1+1 to I2-1
160 tmp=a(i1,i1)
161 a(i1,i1)=a(i2,i2)
162 a(i2,i2)=tmp
163*
164 CALL zswap( i2-i1-1, a(i1+1,i1), 1, a(i2,i1+1), lda )
165*
166* third swap
167* - swap col I1 and I2 from I2+1 to N
168 IF ( i2.LT.n )
169 $ CALL zswap( n-i2, a(i2+1,i1), 1, a(i2+1,i2), 1 )
170*
171 ENDIF
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
Definition zswap.f:81
Here is the call graph for this function:
Here is the caller graph for this function: