OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
chptrf.f
Go to the documentation of this file.
1*> \brief \b CHPTRF
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> \htmlonly
9*> Download CHPTRF + dependencies
10*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/chptrf.f">
11*> [TGZ]</a>
12*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/chptrf.f">
13*> [ZIP]</a>
14*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chptrf.f">
15*> [TXT]</a>
16*> \endhtmlonly
17*
18* Definition:
19* ===========
20*
21* SUBROUTINE CHPTRF( UPLO, N, AP, IPIV, INFO )
22*
23* .. Scalar Arguments ..
24* CHARACTER UPLO
25* INTEGER INFO, N
26* ..
27* .. Array Arguments ..
28* INTEGER IPIV( * )
29* COMPLEX AP( * )
30* ..
31*
32*
33*> \par Purpose:
34* =============
35*>
36*> \verbatim
37*>
38*> CHPTRF computes the factorization of a complex Hermitian packed
39*> matrix A using the Bunch-Kaufman diagonal pivoting method:
40*>
41*> A = U*D*U**H or A = L*D*L**H
42*>
43*> where U (or L) is a product of permutation and unit upper (lower)
44*> triangular matrices, and D is Hermitian and block diagonal with
45*> 1-by-1 and 2-by-2 diagonal blocks.
46*> \endverbatim
47*
48* Arguments:
49* ==========
50*
51*> \param[in] UPLO
52*> \verbatim
53*> UPLO is CHARACTER*1
54*> = 'U': Upper triangle of A is stored;
55*> = 'L': Lower triangle of A is stored.
56*> \endverbatim
57*>
58*> \param[in] N
59*> \verbatim
60*> N is INTEGER
61*> The order of the matrix A. N >= 0.
62*> \endverbatim
63*>
64*> \param[in,out] AP
65*> \verbatim
66*> AP is COMPLEX array, dimension (N*(N+1)/2)
67*> On entry, the upper or lower triangle of the Hermitian matrix
68*> A, packed columnwise in a linear array. The j-th column of A
69*> is stored in the array AP as follows:
70*> if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
71*> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
72*>
73*> On exit, the block diagonal matrix D and the multipliers used
74*> to obtain the factor U or L, stored as a packed triangular
75*> matrix overwriting A (see below for further details).
76*> \endverbatim
77*>
78*> \param[out] IPIV
79*> \verbatim
80*> IPIV is INTEGER array, dimension (N)
81*> Details of the interchanges and the block structure of D.
82*> If IPIV(k) > 0, then rows and columns k and IPIV(k) were
83*> interchanged and D(k,k) is a 1-by-1 diagonal block.
84*> If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0, then rows and
85*> columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k)
86*> is a 2-by-2 diagonal block. If UPLO = 'L' and IPIV(k) =
87*> IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were
88*> interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
89*> \endverbatim
90*>
91*> \param[out] INFO
92*> \verbatim
93*> INFO is INTEGER
94*> = 0: successful exit
95*> < 0: if INFO = -i, the i-th argument had an illegal value
96*> > 0: if INFO = i, D(i,i) is exactly zero. The factorization
97*> has been completed, but the block diagonal matrix D is
98*> exactly singular, and division by zero will occur if it
99*> is used to solve a system of equations.
100*> \endverbatim
101*
102* Authors:
103* ========
104*
105*> \author Univ. of Tennessee
106*> \author Univ. of California Berkeley
107*> \author Univ. of Colorado Denver
108*> \author NAG Ltd.
109*
110*> \ingroup complexOTHERcomputational
111*
112*> \par Further Details:
113* =====================
114*>
115*> \verbatim
116*>
117*> If UPLO = 'U', then A = U*D*U**H, where
118*> U = P(n)*U(n)* ... *P(k)U(k)* ...,
119*> i.e., U is a product of terms P(k)*U(k), where k decreases from n to
120*> 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1
121*> and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as
122*> defined by IPIV(k), and U(k) is a unit upper triangular matrix, such
123*> that if the diagonal block D(k) is of order s (s = 1 or 2), then
124*>
125*> ( I v 0 ) k-s
126*> U(k) = ( 0 I 0 ) s
127*> ( 0 0 I ) n-k
128*> k-s s n-k
129*>
130*> If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k).
131*> If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k),
132*> and A(k,k), and v overwrites A(1:k-2,k-1:k).
133*>
134*> If UPLO = 'L', then A = L*D*L**H, where
135*> L = P(1)*L(1)* ... *P(k)*L(k)* ...,
136*> i.e., L is a product of terms P(k)*L(k), where k increases from 1 to
137*> n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1
138*> and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as
139*> defined by IPIV(k), and L(k) is a unit lower triangular matrix, such
140*> that if the diagonal block D(k) is of order s (s = 1 or 2), then
141*>
142*> ( I 0 0 ) k-1
143*> L(k) = ( 0 I 0 ) s
144*> ( 0 v I ) n-k-s+1
145*> k-1 s n-k-s+1
146*>
147*> If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k).
148*> If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k),
149*> and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
150*> \endverbatim
151*
152*> \par Contributors:
153* ==================
154*>
155*> J. Lewis, Boeing Computer Services Company
156*>
157* =====================================================================
158 SUBROUTINE chptrf( UPLO, N, AP, IPIV, INFO )
159*
160* -- LAPACK computational routine --
161* -- LAPACK is a software package provided by Univ. of Tennessee, --
162* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
163*
164* .. Scalar Arguments ..
165 CHARACTER UPLO
166 INTEGER INFO, N
167* ..
168* .. Array Arguments ..
169 INTEGER IPIV( * )
170 COMPLEX AP( * )
171* ..
172*
173* =====================================================================
174*
175* .. Parameters ..
176 REAL ZERO, ONE
177 parameter( zero = 0.0e+0, one = 1.0e+0 )
178 REAL EIGHT, SEVTEN
179 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
180* ..
181* .. Local Scalars ..
182 LOGICAL UPPER
183 INTEGER I, IMAX, J, JMAX, K, KC, KK, KNC, KP, KPC,
184 $ KSTEP, KX, NPP
185 REAL ABSAKK, ALPHA, COLMAX, D, D11, D22, R1, ROWMAX,
186 $ TT
187 COMPLEX D12, D21, T, WK, WKM1, WKP1, ZDUM
188* ..
189* .. External Functions ..
190 LOGICAL LSAME
191 INTEGER ICAMAX
192 REAL SLAPY2
193 EXTERNAL lsame, icamax, slapy2
194* ..
195* .. External Subroutines ..
196 EXTERNAL chpr, csscal, cswap, xerbla
197* ..
198* .. Intrinsic Functions ..
199 INTRINSIC abs, aimag, cmplx, conjg, max, real, sqrt
200* ..
201* .. Statement Functions ..
202 REAL CABS1
203* ..
204* .. Statement Function definitions ..
205 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
206* ..
207* .. Executable Statements ..
208*
209* Test the input parameters.
210*
211 info = 0
212 upper = lsame( uplo, 'U' )
213 IF( .NOT.upper .AND. .NOT.lsame( uplo, 'l' ) ) THEN
214 INFO = -1
215.LT. ELSE IF( N0 ) THEN
216 INFO = -2
217 END IF
218.NE. IF( INFO0 ) THEN
219 CALL XERBLA( 'chptrf', -INFO )
220 RETURN
221 END IF
222*
223* Initialize ALPHA for use in choosing pivot block size.
224*
225 ALPHA = ( ONE+SQRT( SEVTEN ) ) / EIGHT
226*
227 IF( UPPER ) THEN
228*
229* Factorize A as U*D*U**H using the upper triangle of A
230*
231* K is the main loop index, decreasing from N to 1 in steps of
232* 1 or 2
233*
234 K = N
235 KC = ( N-1 )*N / 2 + 1
236 10 CONTINUE
237 KNC = KC
238*
239* If K < 1, exit from loop
240*
241.LT. IF( K1 )
242 $ GO TO 110
243 KSTEP = 1
244*
245* Determine rows and columns to be interchanged and whether
246* a 1-by-1 or 2-by-2 pivot block will be used
247*
248 ABSAKK = ABS( REAL( AP( KC+K-1 ) ) )
249*
250* IMAX is the row-index of the largest off-diagonal element in
251* column K, and COLMAX is its absolute value
252*
253.GT. IF( K1 ) THEN
254 IMAX = ICAMAX( K-1, AP( KC ), 1 )
255 COLMAX = CABS1( AP( KC+IMAX-1 ) )
256 ELSE
257 COLMAX = ZERO
258 END IF
259*
260.EQ. IF( MAX( ABSAKK, COLMAX )ZERO ) THEN
261*
262* Column K is zero: set INFO and continue
263*
264.EQ. IF( INFO0 )
265 $ INFO = K
266 KP = K
267 AP( KC+K-1 ) = REAL( AP( KC+K-1 ) )
268 ELSE
269.GE. IF( ABSAKKALPHA*COLMAX ) THEN
270*
271* no interchange, use 1-by-1 pivot block
272*
273 KP = K
274 ELSE
275*
276* JMAX is the column-index of the largest off-diagonal
277* element in row IMAX, and ROWMAX is its absolute value
278*
279 ROWMAX = ZERO
280 JMAX = IMAX
281 KX = IMAX*( IMAX+1 ) / 2 + IMAX
282 DO 20 J = IMAX + 1, K
283.GT. IF( CABS1( AP( KX ) )ROWMAX ) THEN
284 ROWMAX = CABS1( AP( KX ) )
285 JMAX = J
286 END IF
287 KX = KX + J
288 20 CONTINUE
289 KPC = ( IMAX-1 )*IMAX / 2 + 1
290.GT. IF( IMAX1 ) THEN
291 JMAX = ICAMAX( IMAX-1, AP( KPC ), 1 )
292 ROWMAX = MAX( ROWMAX, CABS1( AP( KPC+JMAX-1 ) ) )
293 END IF
294*
295.GE. IF( ABSAKKALPHA*COLMAX*( COLMAX / ROWMAX ) ) THEN
296*
297* no interchange, use 1-by-1 pivot block
298*
299 KP = K
300.GE. ELSE IF( ABS( REAL( AP( KPC+IMAX-1 ) ) )ALPHA*
301 $ ROWMAX ) THEN
302*
303* interchange rows and columns K and IMAX, use 1-by-1
304* pivot block
305*
306 KP = IMAX
307 ELSE
308*
309* interchange rows and columns K-1 and IMAX, use 2-by-2
310* pivot block
311*
312 KP = IMAX
313 KSTEP = 2
314 END IF
315 END IF
316*
317 KK = K - KSTEP + 1
318.EQ. IF( KSTEP2 )
319 $ KNC = KNC - K + 1
320.NE. IF( KPKK ) THEN
321*
322* Interchange rows and columns KK and KP in the leading
323* submatrix A(1:k,1:k)
324*
325 CALL CSWAP( KP-1, AP( KNC ), 1, AP( KPC ), 1 )
326 KX = KPC + KP - 1
327 DO 30 J = KP + 1, KK - 1
328 KX = KX + J - 1
329 T = CONJG( AP( KNC+J-1 ) )
330 AP( KNC+J-1 ) = CONJG( AP( KX ) )
331 AP( KX ) = T
332 30 CONTINUE
333 AP( KX+KK-1 ) = CONJG( AP( KX+KK-1 ) )
334 R1 = REAL( AP( KNC+KK-1 ) )
335 AP( KNC+KK-1 ) = REAL( AP( KPC+KP-1 ) )
336 AP( KPC+KP-1 ) = R1
337.EQ. IF( KSTEP2 ) THEN
338 AP( KC+K-1 ) = REAL( AP( KC+K-1 ) )
339 T = AP( KC+K-2 )
340 AP( KC+K-2 ) = AP( KC+KP-1 )
341 AP( KC+KP-1 ) = T
342 END IF
343 ELSE
344 AP( KC+K-1 ) = REAL( AP( KC+K-1 ) )
345.EQ. IF( KSTEP2 )
346 $ AP( KC-1 ) = REAL( AP( KC-1 ) )
347 END IF
348*
349* Update the leading submatrix
350*
351.EQ. IF( KSTEP1 ) THEN
352*
353* 1-by-1 pivot block D(k): column k now holds
354*
355* W(k) = U(k)*D(k)
356*
357* where U(k) is the k-th column of U
358*
359* Perform a rank-1 update of A(1:k-1,1:k-1) as
360*
361* A := A - U(k)*D(k)*U(k)**H = A - W(k)*1/D(k)*W(k)**H
362*
363 R1 = ONE / REAL( AP( KC+K-1 ) )
364 CALL CHPR( UPLO, K-1, -R1, AP( KC ), 1, AP )
365*
366* Store U(k) in column k
367*
368 CALL CSSCAL( K-1, R1, AP( KC ), 1 )
369 ELSE
370*
371* 2-by-2 pivot block D(k): columns k and k-1 now hold
372*
373* ( W(k-1) W(k) ) = ( U(k-1) U(k) )*D(k)
374*
375* where U(k) and U(k-1) are the k-th and (k-1)-th columns
376* of U
377*
378* Perform a rank-2 update of A(1:k-2,1:k-2) as
379*
380* A := A - ( U(k-1) U(k) )*D(k)*( U(k-1) U(k) )**H
381* = A - ( W(k-1) W(k) )*inv(D(k))*( W(k-1) W(k) )**H
382*
383.GT. IF( K2 ) THEN
384*
385 D = SLAPY2( REAL( AP( K-1+( K-1 )*K / 2 ) ),
386 $ AIMAG( AP( K-1+( K-1 )*K / 2 ) ) )
387 D22 = REAL( AP( K-1+( K-2 )*( K-1 ) / 2 ) ) / D
388 D11 = REAL( AP( K+( K-1 )*K / 2 ) ) / D
389 TT = ONE / ( D11*D22-ONE )
390 D12 = AP( K-1+( K-1 )*K / 2 ) / D
391 D = TT / D
392*
393 DO 50 J = K - 2, 1, -1
394 WKM1 = D*( D11*AP( J+( K-2 )*( K-1 ) / 2 )-
395 $ CONJG( D12 )*AP( J+( K-1 )*K / 2 ) )
396 WK = D*( D22*AP( J+( K-1 )*K / 2 )-D12*
397 $ AP( J+( K-2 )*( K-1 ) / 2 ) )
398 DO 40 I = J, 1, -1
399 AP( I+( J-1 )*J / 2 ) = AP( I+( J-1 )*J / 2 ) -
400 $ AP( I+( K-1 )*K / 2 )*CONJG( WK ) -
401 $ AP( I+( K-2 )*( K-1 ) / 2 )*CONJG( WKM1 )
402 40 CONTINUE
403 AP( J+( K-1 )*K / 2 ) = WK
404 AP( J+( K-2 )*( K-1 ) / 2 ) = WKM1
405 AP( J+( J-1 )*J / 2 ) = CMPLX( REAL( AP( J+( J-1 )*
406 $ J / 2 ) ), 0.0E+0 )
407 50 CONTINUE
408*
409 END IF
410*
411 END IF
412 END IF
413*
414* Store details of the interchanges in IPIV
415*
416.EQ. IF( KSTEP1 ) THEN
417 IPIV( K ) = KP
418 ELSE
419 IPIV( K ) = -KP
420 IPIV( K-1 ) = -KP
421 END IF
422*
423* Decrease K and return to the start of the main loop
424*
425 K = K - KSTEP
426 KC = KNC - K
427 GO TO 10
428*
429 ELSE
430*
431* Factorize A as L*D*L**H using the lower triangle of A
432*
433* K is the main loop index, increasing from 1 to N in steps of
434* 1 or 2
435*
436 K = 1
437 KC = 1
438 NPP = N*( N+1 ) / 2
439 60 CONTINUE
440 KNC = KC
441*
442* If K > N, exit from loop
443*
444.GT. IF( KN )
445 $ GO TO 110
446 KSTEP = 1
447*
448* Determine rows and columns to be interchanged and whether
449* a 1-by-1 or 2-by-2 pivot block will be used
450*
451 ABSAKK = ABS( REAL( AP( KC ) ) )
452*
453* IMAX is the row-index of the largest off-diagonal element in
454* column K, and COLMAX is its absolute value
455*
456.LT. IF( KN ) THEN
457 IMAX = K + ICAMAX( N-K, AP( KC+1 ), 1 )
458 COLMAX = CABS1( AP( KC+IMAX-K ) )
459 ELSE
460 COLMAX = ZERO
461 END IF
462*
463.EQ. IF( MAX( ABSAKK, COLMAX )ZERO ) THEN
464*
465* Column K is zero: set INFO and continue
466*
467.EQ. IF( INFO0 )
468 $ INFO = K
469 KP = K
470 AP( KC ) = REAL( AP( KC ) )
471 ELSE
472.GE. IF( ABSAKKALPHA*COLMAX ) THEN
473*
474* no interchange, use 1-by-1 pivot block
475*
476 KP = K
477 ELSE
478*
479* JMAX is the column-index of the largest off-diagonal
480* element in row IMAX, and ROWMAX is its absolute value
481*
482 ROWMAX = ZERO
483 KX = KC + IMAX - K
484 DO 70 J = K, IMAX - 1
485.GT. IF( CABS1( AP( KX ) )ROWMAX ) THEN
486 ROWMAX = CABS1( AP( KX ) )
487 JMAX = J
488 END IF
489 KX = KX + N - J
490 70 CONTINUE
491 KPC = NPP - ( N-IMAX+1 )*( N-IMAX+2 ) / 2 + 1
492.LT. IF( IMAXN ) THEN
493 JMAX = IMAX + ICAMAX( N-IMAX, AP( KPC+1 ), 1 )
494 ROWMAX = MAX( ROWMAX, CABS1( AP( KPC+JMAX-IMAX ) ) )
495 END IF
496*
497.GE. IF( ABSAKKALPHA*COLMAX*( COLMAX / ROWMAX ) ) THEN
498*
499* no interchange, use 1-by-1 pivot block
500*
501 KP = K
502.GE. ELSE IF( ABS( REAL( AP( KPC ) ) )ALPHA*ROWMAX ) THEN
503*
504* interchange rows and columns K and IMAX, use 1-by-1
505* pivot block
506*
507 KP = IMAX
508 ELSE
509*
510* interchange rows and columns K+1 and IMAX, use 2-by-2
511* pivot block
512*
513 KP = IMAX
514 KSTEP = 2
515 END IF
516 END IF
517*
518 KK = K + KSTEP - 1
519.EQ. IF( KSTEP2 )
520 $ KNC = KNC + N - K + 1
521.NE. IF( KPKK ) THEN
522*
523* Interchange rows and columns KK and KP in the trailing
524* submatrix A(k:n,k:n)
525*
526.LT. IF( KPN )
527 $ CALL CSWAP( N-KP, AP( KNC+KP-KK+1 ), 1, AP( KPC+1 ),
528 $ 1 )
529 KX = KNC + KP - KK
530 DO 80 J = KK + 1, KP - 1
531 KX = KX + N - J + 1
532 T = CONJG( AP( KNC+J-KK ) )
533 AP( KNC+J-KK ) = CONJG( AP( KX ) )
534 AP( KX ) = T
535 80 CONTINUE
536 AP( KNC+KP-KK ) = CONJG( AP( KNC+KP-KK ) )
537 R1 = REAL( AP( KNC ) )
538 AP( KNC ) = REAL( AP( KPC ) )
539 AP( KPC ) = R1
540.EQ. IF( KSTEP2 ) THEN
541 AP( KC ) = REAL( AP( KC ) )
542 T = AP( KC+1 )
543 AP( KC+1 ) = AP( KC+KP-K )
544 AP( KC+KP-K ) = T
545 END IF
546 ELSE
547 AP( KC ) = REAL( AP( KC ) )
548.EQ. IF( KSTEP2 )
549 $ AP( KNC ) = REAL( AP( KNC ) )
550 END IF
551*
552* Update the trailing submatrix
553*
554.EQ. IF( KSTEP1 ) THEN
555*
556* 1-by-1 pivot block D(k): column k now holds
557*
558* W(k) = L(k)*D(k)
559*
560* where L(k) is the k-th column of L
561*
562.LT. IF( KN ) THEN
563*
564* Perform a rank-1 update of A(k+1:n,k+1:n) as
565*
566* A := A - L(k)*D(k)*L(k)**H = A - W(k)*(1/D(k))*W(k)**H
567*
568 R1 = ONE / REAL( AP( KC ) )
569 CALL CHPR( UPLO, N-K, -R1, AP( KC+1 ), 1,
570 $ AP( KC+N-K+1 ) )
571*
572* Store L(k) in column K
573*
574 CALL CSSCAL( N-K, R1, AP( KC+1 ), 1 )
575 END IF
576 ELSE
577*
578* 2-by-2 pivot block D(k): columns K and K+1 now hold
579*
580* ( W(k) W(k+1) ) = ( L(k) L(k+1) )*D(k)
581*
582* where L(k) and L(k+1) are the k-th and (k+1)-th columns
583* of L
584*
585.LT. IF( KN-1 ) THEN
586*
587* Perform a rank-2 update of A(k+2:n,k+2:n) as
588*
589* A := A - ( L(k) L(k+1) )*D(k)*( L(k) L(k+1) )**H
590* = A - ( W(k) W(k+1) )*inv(D(k))*( W(k) W(k+1) )**H
591*
592* where L(k) and L(k+1) are the k-th and (k+1)-th
593* columns of L
594*
595 D = SLAPY2( REAL( AP( K+1+( K-1 )*( 2*N-K ) / 2 ) ),
596 $ AIMAG( AP( K+1+( K-1 )*( 2*N-K ) / 2 ) ) )
597 D11 = REAL( AP( K+1+K*( 2*N-K-1 ) / 2 ) ) / D
598 D22 = REAL( AP( K+( K-1 )*( 2*N-K ) / 2 ) ) / D
599 TT = ONE / ( D11*D22-ONE )
600 D21 = AP( K+1+( K-1 )*( 2*N-K ) / 2 ) / D
601 D = TT / D
602*
603 DO 100 J = K + 2, N
604 WK = D*( D11*AP( J+( K-1 )*( 2*N-K ) / 2 )-D21*
605 $ AP( J+K*( 2*N-K-1 ) / 2 ) )
606 WKP1 = D*( D22*AP( J+K*( 2*N-K-1 ) / 2 )-
607 $ CONJG( D21 )*AP( J+( K-1 )*( 2*N-K ) / 2 ) )
608 DO 90 I = J, N
609 AP( I+( J-1 )*( 2*N-J ) / 2 ) = AP( I+( J-1 )*
610 $ ( 2*N-J ) / 2 ) - AP( I+( K-1 )*( 2*N-K ) /
611 $ 2 )*CONJG( WK ) - AP( I+K*( 2*N-K-1 ) / 2 )*
612 $ CONJG( WKP1 )
613 90 CONTINUE
614 AP( J+( K-1 )*( 2*N-K ) / 2 ) = WK
615 AP( J+K*( 2*N-K-1 ) / 2 ) = WKP1
616 AP( J+( J-1 )*( 2*N-J ) / 2 )
617 $ = CMPLX( REAL( AP( J+( J-1 )*( 2*N-J ) / 2 ) ),
618 $ 0.0E+0 )
619 100 CONTINUE
620 END IF
621 END IF
622 END IF
623*
624* Store details of the interchanges in IPIV
625*
626.EQ. IF( KSTEP1 ) THEN
627 IPIV( K ) = KP
628 ELSE
629 IPIV( K ) = -KP
630 IPIV( K+1 ) = -KP
631 END IF
632*
633* Increase K and return to the start of the main loop
634*
635 K = K + KSTEP
636 KC = KNC + N - K + 2
637 GO TO 60
638*
639 END IF
640*
641 110 CONTINUE
642 RETURN
643*
644* End of CHPTRF
645*
646 END
float cmplx[2]
Definition pblas.h:136
subroutine xerbla(srname, info)
XERBLA
Definition xerbla.f:60
subroutine chptrf(uplo, n, ap, ipiv, info)
CHPTRF
Definition chptrf.f:159
subroutine cswap(n, cx, incx, cy, incy)
CSWAP
Definition cswap.f:81
subroutine csscal(n, sa, cx, incx)
CSSCAL
Definition csscal.f:78
subroutine chpr(uplo, n, alpha, x, incx, ap)
CHPR
Definition chpr.f:130
#define max(a, b)
Definition macros.h:21