LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine cheswapr ( character  UPLO,
integer  N,
complex, dimension( lda, n )  A,
integer  LDA,
integer  I1,
integer  I2 
)

CHESWAPR applies an elementary permutation on the rows and columns of a Hermitian matrix.

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

Purpose:
 CHESWAPR applies an elementary permutation on the rows and the columns of
 a hermitian 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 array, dimension (LDA,N)
          On entry, the NB diagonal matrix D and the multipliers
          used to obtain the factor U or L as computed by CSYTRF.

          On exit, if INFO = 0, the (symmetric) inverse of the original
          matrix.  If UPLO = 'U', the upper triangular part of the
          inverse is formed and the part of A below the diagonal is not
          referenced; if UPLO = 'L' the lower triangular part of the
          inverse is formed 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.
Date
September 2012

Definition at line 104 of file cheswapr.f.

104 *
105 * -- LAPACK auxiliary routine (version 3.4.2) --
106 * -- LAPACK is a software package provided by Univ. of Tennessee, --
107 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
108 * September 2012
109 *
110 * .. Scalar Arguments ..
111  CHARACTER uplo
112  INTEGER i1, i2, lda, n
113 * ..
114 * .. Array Arguments ..
115  COMPLEX a( lda, n )
116 *
117 * =====================================================================
118 *
119 * ..
120 * .. Local Scalars ..
121  LOGICAL upper
122  INTEGER i
123  COMPLEX tmp
124 *
125 * .. External Functions ..
126  LOGICAL lsame
127  EXTERNAL lsame
128 * ..
129 * .. External Subroutines ..
130  EXTERNAL cswap
131 * ..
132 * .. Executable Statements ..
133 *
134  upper = lsame( uplo, 'U' )
135  IF (upper) THEN
136 *
137 * UPPER
138 * first swap
139 * - swap column I1 and I2 from I1 to I1-1
140  CALL cswap( i1-1, a(1,i1), 1, a(1,i2), 1 )
141 *
142 * second swap :
143 * - swap A(I1,I1) and A(I2,I2)
144 * - swap row I1 from I1+1 to I2-1 with col I2 from I1+1 to I2-1
145 * - swap A(I2,I1) and A(I1,I2)
146 
147  tmp=a(i1,i1)
148  a(i1,i1)=a(i2,i2)
149  a(i2,i2)=tmp
150 *
151  DO i=1,i2-i1-1
152  tmp=a(i1,i1+i)
153  a(i1,i1+i)=conjg(a(i1+i,i2))
154  a(i1+i,i2)=conjg(tmp)
155  END DO
156 *
157  a(i1,i2)=conjg(a(i1,i2))
158 
159 *
160 * third swap
161 * - swap row I1 and I2 from I2+1 to N
162  DO i=i2+1,n
163  tmp=a(i1,i)
164  a(i1,i)=a(i2,i)
165  a(i2,i)=tmp
166  END DO
167 *
168  ELSE
169 *
170 * LOWER
171 * first swap
172 * - swap row I1 and I2 from 1 to I1-1
173  CALL cswap ( i1-1, a(i1,1), lda, a(i2,1), lda )
174 *
175 * second swap :
176 * - swap A(I1,I1) and A(I2,I2)
177 * - swap col I1 from I1+1 to I2-1 with row I2 from I1+1 to I2-1
178 * - swap A(I2,I1) and A(I1,I2)
179 
180  tmp=a(i1,i1)
181  a(i1,i1)=a(i2,i2)
182  a(i2,i2)=tmp
183 *
184  DO i=1,i2-i1-1
185  tmp=a(i1+i,i1)
186  a(i1+i,i1)=conjg(a(i2,i1+i))
187  a(i2,i1+i)=conjg(tmp)
188  END DO
189 *
190  a(i2,i1)=conjg(a(i2,i1))
191 *
192 * third swap
193 * - swap col I1 and I2 from I2+1 to N
194  DO i=i2+1,n
195  tmp=a(i,i1)
196  a(i,i1)=a(i,i2)
197  a(i,i2)=tmp
198  END DO
199 *
200  ENDIF
201 
subroutine cswap(N, CX, INCX, CY, INCY)
CSWAP
Definition: cswap.f:52
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: