LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
csyconv.f
Go to the documentation of this file.
1*> \brief \b CSYCONV
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download CSYCONV + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/csyconv.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/csyconv.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/csyconv.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE CSYCONV( UPLO, WAY, N, A, LDA, IPIV, E, INFO )
20*
21* .. Scalar Arguments ..
22* CHARACTER UPLO, WAY
23* INTEGER INFO, LDA, N
24* ..
25* .. Array Arguments ..
26* INTEGER IPIV( * )
27* COMPLEX A( LDA, * ), E( * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> CSYCONV convert A given by TRF into L and D and vice-versa.
37*> Get Non-diag elements of D (returned in workspace) and
38*> apply or reverse permutation done in TRF.
39*> \endverbatim
40*
41* Arguments:
42* ==========
43*
44*> \param[in] UPLO
45*> \verbatim
46*> UPLO is CHARACTER*1
47*> Specifies whether the details of the factorization are stored
48*> as an upper or lower triangular matrix.
49*> = 'U': Upper triangular, form is A = U*D*U**T;
50*> = 'L': Lower triangular, form is A = L*D*L**T.
51*> \endverbatim
52*>
53*> \param[in] WAY
54*> \verbatim
55*> WAY is CHARACTER*1
56*> = 'C': Convert
57*> = 'R': Revert
58*> \endverbatim
59*>
60*> \param[in] N
61*> \verbatim
62*> N is INTEGER
63*> The order of the matrix A. N >= 0.
64*> \endverbatim
65*>
66*> \param[in,out] A
67*> \verbatim
68*> A is COMPLEX array, dimension (LDA,N)
69*> The block diagonal matrix D and the multipliers used to
70*> obtain the factor U or L as computed by CSYTRF.
71*> \endverbatim
72*>
73*> \param[in] LDA
74*> \verbatim
75*> LDA is INTEGER
76*> The leading dimension of the array A. LDA >= max(1,N).
77*> \endverbatim
78*>
79*> \param[in] IPIV
80*> \verbatim
81*> IPIV is INTEGER array, dimension (N)
82*> Details of the interchanges and the block structure of D
83*> as determined by CSYTRF.
84*> \endverbatim
85*>
86*> \param[out] E
87*> \verbatim
88*> E is COMPLEX array, dimension (N)
89*> E stores the supdiagonal/subdiagonal of the symmetric 1-by-1
90*> or 2-by-2 block diagonal matrix D in LDLT.
91*> \endverbatim
92*>
93*> \param[out] INFO
94*> \verbatim
95*> INFO is INTEGER
96*> = 0: successful exit
97*> < 0: if INFO = -i, the i-th argument had an illegal value
98*> \endverbatim
99*
100* Authors:
101* ========
102*
103*> \author Univ. of Tennessee
104*> \author Univ. of California Berkeley
105*> \author Univ. of Colorado Denver
106*> \author NAG Ltd.
107*
108*> \ingroup syconv
109*
110* =====================================================================
111 SUBROUTINE csyconv( UPLO, WAY, N, A, LDA, IPIV, E, INFO )
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*
361 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine csyconv(uplo, way, n, a, lda, ipiv, e, info)
CSYCONV
Definition csyconv.f:112