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

◆ csyconv()

subroutine csyconv ( character uplo,
character way,
integer n,
complex, dimension( lda, * ) a,
integer lda,
integer, dimension( * ) ipiv,
complex, dimension( * ) e,
integer info )

CSYCONV

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

Purpose:
!>
!> CSYCONV convert A given by TRF into L and D and vice-versa.
!> Get Non-diag elements of D (returned in workspace) and
!> apply or reverse permutation done in TRF.
!> 
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]WAY
!>          WAY is CHARACTER*1
!>          = 'C': Convert
!>          = 'R': Revert
!> 
[in]N
!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!> 
[in,out]A
!>          A is COMPLEX array, dimension (LDA,N)
!>          The block diagonal matrix D and the multipliers used to
!>          obtain the factor U or L as computed by CSYTRF.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,N).
!> 
[in]IPIV
!>          IPIV is INTEGER array, dimension (N)
!>          Details of the interchanges and the block structure of D
!>          as determined by CSYTRF.
!> 
[out]E
!>          E is COMPLEX array, dimension (N)
!>          E stores the supdiagonal/subdiagonal of the symmetric 1-by-1
!>          or 2-by-2 block diagonal matrix D in LDLT.
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 111 of file csyconv.f.

112*
113* -- LAPACK computational routine --
114* -- LAPACK is a software package provided by Univ. of Tennessee, --
115* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
116*
117* .. Scalar Arguments ..
118 CHARACTER UPLO, WAY
119 INTEGER INFO, LDA, N
120* ..
121* .. Array Arguments ..
122 INTEGER IPIV( * )
123 COMPLEX A( LDA, * ), E( * )
124* ..
125*
126* =====================================================================
127*
128* .. Parameters ..
129 COMPLEX ZERO
130 parameter( zero = (0.0e+0,0.0e+0) )
131* ..
132* .. External Functions ..
133 LOGICAL LSAME
134 EXTERNAL lsame
135*
136* .. External Subroutines ..
137 EXTERNAL xerbla
138* .. Local Scalars ..
139 LOGICAL UPPER, CONVERT
140 INTEGER I, IP, J
141 COMPLEX TEMP
142* ..
143* .. Executable Statements ..
144*
145 info = 0
146 upper = lsame( uplo, 'U' )
147 convert = lsame( way, 'C' )
148 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
149 info = -1
150 ELSE IF( .NOT.convert .AND. .NOT.lsame( way, 'R' ) ) THEN
151 info = -2
152 ELSE IF( n.LT.0 ) THEN
153 info = -3
154 ELSE IF( lda.LT.max( 1, n ) ) THEN
155 info = -5
156
157 END IF
158 IF( info.NE.0 ) THEN
159 CALL xerbla( 'CSYCONV', -info )
160 RETURN
161 END IF
162*
163* Quick return if possible
164*
165 IF( n.EQ.0 )
166 $ RETURN
167*
168 IF( upper ) THEN
169*
170* A is UPPER
171*
172* Convert A (A is upper)
173*
174* Convert VALUE
175*
176 IF ( convert ) THEN
177 i=n
178 e(1)=zero
179 DO WHILE ( i .GT. 1 )
180 IF( ipiv(i) .LT. 0 ) THEN
181 e(i)=a(i-1,i)
182 e(i-1)=zero
183 a(i-1,i)=zero
184 i=i-1
185 ELSE
186 e(i)=zero
187 ENDIF
188 i=i-1
189 END DO
190*
191* Convert PERMUTATIONS
192*
193 i=n
194 DO WHILE ( i .GE. 1 )
195 IF( ipiv(i) .GT. 0) THEN
196 ip=ipiv(i)
197 IF( i .LT. n) THEN
198 DO 12 j= i+1,n
199 temp=a(ip,j)
200 a(ip,j)=a(i,j)
201 a(i,j)=temp
202 12 CONTINUE
203 ENDIF
204 ELSE
205 ip=-ipiv(i)
206 IF( i .LT. n) THEN
207 DO 13 j= i+1,n
208 temp=a(ip,j)
209 a(ip,j)=a(i-1,j)
210 a(i-1,j)=temp
211 13 CONTINUE
212 ENDIF
213 i=i-1
214 ENDIF
215 i=i-1
216 END DO
217
218 ELSE
219*
220* Revert A (A is upper)
221*
222*
223* Revert PERMUTATIONS
224*
225 i=1
226 DO WHILE ( i .LE. n )
227 IF( ipiv(i) .GT. 0 ) THEN
228 ip=ipiv(i)
229 IF( i .LT. n) THEN
230 DO j= i+1,n
231 temp=a(ip,j)
232 a(ip,j)=a(i,j)
233 a(i,j)=temp
234 END DO
235 ENDIF
236 ELSE
237 ip=-ipiv(i)
238 i=i+1
239 IF( i .LT. n) THEN
240 DO j= i+1,n
241 temp=a(ip,j)
242 a(ip,j)=a(i-1,j)
243 a(i-1,j)=temp
244 END DO
245 ENDIF
246 ENDIF
247 i=i+1
248 END DO
249*
250* Revert VALUE
251*
252 i=n
253 DO WHILE ( i .GT. 1 )
254 IF( ipiv(i) .LT. 0 ) THEN
255 a(i-1,i)=e(i)
256 i=i-1
257 ENDIF
258 i=i-1
259 END DO
260 END IF
261 ELSE
262*
263* A is LOWER
264*
265 IF ( convert ) THEN
266*
267* Convert A (A is lower)
268*
269*
270* Convert VALUE
271*
272 i=1
273 e(n)=zero
274 DO WHILE ( i .LE. n )
275 IF( i.LT.n .AND. ipiv(i) .LT. 0 ) THEN
276 e(i)=a(i+1,i)
277 e(i+1)=zero
278 a(i+1,i)=zero
279 i=i+1
280 ELSE
281 e(i)=zero
282 ENDIF
283 i=i+1
284 END DO
285*
286* Convert PERMUTATIONS
287*
288 i=1
289 DO WHILE ( i .LE. n )
290 IF( ipiv(i) .GT. 0 ) THEN
291 ip=ipiv(i)
292 IF (i .GT. 1) THEN
293 DO 22 j= 1,i-1
294 temp=a(ip,j)
295 a(ip,j)=a(i,j)
296 a(i,j)=temp
297 22 CONTINUE
298 ENDIF
299 ELSE
300 ip=-ipiv(i)
301 IF (i .GT. 1) THEN
302 DO 23 j= 1,i-1
303 temp=a(ip,j)
304 a(ip,j)=a(i+1,j)
305 a(i+1,j)=temp
306 23 CONTINUE
307 ENDIF
308 i=i+1
309 ENDIF
310 i=i+1
311 END DO
312 ELSE
313*
314* Revert A (A is lower)
315*
316*
317* Revert PERMUTATIONS
318*
319 i=n
320 DO WHILE ( i .GE. 1 )
321 IF( ipiv(i) .GT. 0 ) THEN
322 ip=ipiv(i)
323 IF (i .GT. 1) THEN
324 DO j= 1,i-1
325 temp=a(i,j)
326 a(i,j)=a(ip,j)
327 a(ip,j)=temp
328 END DO
329 ENDIF
330 ELSE
331 ip=-ipiv(i)
332 i=i-1
333 IF (i .GT. 1) THEN
334 DO j= 1,i-1
335 temp=a(i+1,j)
336 a(i+1,j)=a(ip,j)
337 a(ip,j)=temp
338 END DO
339 ENDIF
340 ENDIF
341 i=i-1
342 END DO
343*
344* Revert VALUE
345*
346 i=1
347 DO WHILE ( i .LE. n-1 )
348 IF( ipiv(i) .LT. 0 ) THEN
349 a(i+1,i)=e(i)
350 i=i+1
351 ENDIF
352 i=i+1
353 END DO
354 END IF
355 END IF
356
357 RETURN
358*
359* End of CSYCONV
360*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: