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

◆ csyswapr()

subroutine csyswapr ( character uplo,
integer n,
complex, dimension( lda, n ) a,
integer lda,
integer i1,
integer i2 )

CSYSWAPR

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

Purpose:
!>
!> CSYSWAPR 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 array, dimension (LDA,N)
!>          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 97 of file csyswapr.f.

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