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

◆ dsyswapr()

subroutine dsyswapr ( character  UPLO,
integer  N,
double precision, dimension( lda, * )  A,
integer  LDA,
integer  I1,
integer  I2 
)

DSYSWAPR applies an elementary permutation on the rows and columns of a symmetric matrix.

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

Purpose:
 DSYSWAPR 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 DOUBLE PRECISION 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 dsyswapr.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 DOUBLE PRECISION A( LDA, * )
111*
112* =====================================================================
113*
114* ..
115* .. Local Scalars ..
116 LOGICAL UPPER
117 DOUBLE PRECISION TMP
118*
119* .. External Functions ..
120 LOGICAL LSAME
121 EXTERNAL lsame
122* ..
123* .. External Subroutines ..
124 EXTERNAL dswap
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 dswap( 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 dswap( 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 dswap( 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 dswap( 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 dswap( 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 dswap( n-i2, a(i2+1,i1), 1, a(i2+1,i2), 1 )
170*
171 ENDIF
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine dswap(N, DX, INCX, DY, INCY)
DSWAP
Definition: dswap.f:82
Here is the call graph for this function:
Here is the caller graph for this function: