LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zsyconv ( character  UPLO,
character  WAY,
integer  N,
complex*16, dimension( lda, * )  A,
integer  LDA,
integer, dimension( * )  IPIV,
complex*16, dimension( * )  E,
integer  INFO 
)

ZSYCONV

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

Purpose:
 ZSYCONV converts A given by ZHETRF into L and D or vice-versa.
 Get nondiagonal 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*16 array, dimension (LDA,N)
          The block diagonal matrix D and the multipliers used to
          obtain the factor U or L as computed by ZSYTRF.
[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 ZSYTRF.
[out]E
          E is COMPLEX*16 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.
Date
November 2015

Definition at line 116 of file zsyconv.f.

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