157 SUBROUTINE csptrf( UPLO, N, AP, IPIV, INFO )
176 parameter( zero = 0.0e+0, one = 1.0e+0 )
178 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
180 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
184 INTEGER I, IMAX, J, JMAX, K, KC, KK, KNC, KP, KPC,
186 REAL ABSAKK, ALPHA, COLMAX, ROWMAX
187 COMPLEX D11, D12, D21, D22, R1, T, WK, WKM1, WKP1, ZDUM
192 EXTERNAL lsame, icamax
198 INTRINSIC abs, aimag, max, real, sqrt
204 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
211 upper = lsame( uplo,
'U' )
212 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
214 ELSE IF( n.LT.0 )
THEN
218 CALL xerbla(
'CSPTRF', -info )
224 alpha = ( one+sqrt( sevten ) ) / eight
234 kc = ( n-1 )*n / 2 + 1
247 absakk = cabs1( ap( kc+k-1 ) )
253 imax = icamax( k-1, ap( kc ), 1 )
254 colmax = cabs1( ap( kc+imax-1 ) )
259 IF( max( absakk, colmax ).EQ.zero )
THEN
267 IF( absakk.GE.alpha*colmax )
THEN
276 kx = imax*( imax+1 ) / 2 + imax
277 DO 20 j = imax + 1, k
278 IF( cabs1( ap( kx ) ).GT.rowmax )
THEN
279 rowmax = cabs1( ap( kx ) )
284 kpc = ( imax-1 )*imax / 2 + 1
286 jmax = icamax( imax-1, ap( kpc ), 1 )
287 rowmax = max( rowmax, cabs1( ap( kpc+jmax-1 ) ) )
290 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
295 ELSE IF( cabs1( ap( kpc+imax-1 ) ).GE.alpha*rowmax )
THEN
319 CALL cswap( kp-1, ap( knc ), 1, ap( kpc ), 1 )
321 DO 30 j = kp + 1, kk - 1
324 ap( knc+j-1 ) = ap( kx )
328 ap( knc+kk-1 ) = ap( kpc+kp-1 )
330 IF( kstep.EQ.2 )
THEN
332 ap( kc+k-2 ) = ap( kc+kp-1 )
339 IF( kstep.EQ.1 )
THEN
351 r1 = cone / ap( kc+k-1 )
352 CALL cspr( uplo, k-1, -r1, ap( kc ), 1, ap )
356 CALL cscal( k-1, r1, ap( kc ), 1 )
373 d12 = ap( k-1+( k-1 )*k / 2 )
374 d22 = ap( k-1+( k-2 )*( k-1 ) / 2 ) / d12
375 d11 = ap( k+( k-1 )*k / 2 ) / d12
376 t = cone / ( d11*d22-cone )
379 DO 50 j = k - 2, 1, -1
380 wkm1 = d12*( d11*ap( j+( k-2 )*( k-1 ) / 2 )-
381 $ ap( j+( k-1 )*k / 2 ) )
382 wk = d12*( d22*ap( j+( k-1 )*k / 2 )-
383 $ ap( j+( k-2 )*( k-1 ) / 2 ) )
385 ap( i+( j-1 )*j / 2 ) = ap( i+( j-1 )*j / 2 ) -
386 $ ap( i+( k-1 )*k / 2 )*wk -
387 $ ap( i+( k-2 )*( k-1 ) / 2 )*wkm1
389 ap( j+( k-1 )*k / 2 ) = wk
390 ap( j+( k-2 )*( k-1 ) / 2 ) = wkm1
399 IF( kstep.EQ.1 )
THEN
434 absakk = cabs1( ap( kc ) )
440 imax = k + icamax( n-k, ap( kc+1 ), 1 )
441 colmax = cabs1( ap( kc+imax-k ) )
446 IF( max( absakk, colmax ).EQ.zero )
THEN
454 IF( absakk.GE.alpha*colmax )
THEN
466 DO 70 j = k, imax - 1
467 IF( cabs1( ap( kx ) ).GT.rowmax )
THEN
468 rowmax = cabs1( ap( kx ) )
473 kpc = npp - ( n-imax+1 )*( n-imax+2 ) / 2 + 1
475 jmax = imax + icamax( n-imax, ap( kpc+1 ), 1 )
476 rowmax = max( rowmax, cabs1( ap( kpc+jmax-imax ) ) )
479 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
484 ELSE IF( cabs1( ap( kpc ) ).GE.alpha*rowmax )
THEN
502 $ knc = knc + n - k + 1
509 $
CALL cswap( n-kp, ap( knc+kp-kk+1 ), 1, ap( kpc+1 ),
512 DO 80 j = kk + 1, kp - 1
515 ap( knc+j-kk ) = ap( kx )
519 ap( knc ) = ap( kpc )
521 IF( kstep.EQ.2 )
THEN
523 ap( kc+1 ) = ap( kc+kp-k )
530 IF( kstep.EQ.1 )
THEN
545 CALL cspr( uplo, n-k, -r1, ap( kc+1 ), 1,
550 CALL cscal( n-k, r1, ap( kc+1 ), 1 )
571 d21 = ap( k+1+( k-1 )*( 2*n-k ) / 2 )
572 d11 = ap( k+1+k*( 2*n-k-1 ) / 2 ) / d21
573 d22 = ap( k+( k-1 )*( 2*n-k ) / 2 ) / d21
574 t = cone / ( d11*d22-cone )
578 wk = d21*( d11*ap( j+( k-1 )*( 2*n-k ) / 2 )-
579 $ ap( j+k*( 2*n-k-1 ) / 2 ) )
580 wkp1 = d21*( d22*ap( j+k*( 2*n-k-1 ) / 2 )-
581 $ ap( j+( k-1 )*( 2*n-k ) / 2 ) )
583 ap( i+( j-1 )*( 2*n-j ) / 2 ) = ap( i+( j-1 )*
584 $ ( 2*n-j ) / 2 ) - ap( i+( k-1 )*( 2*n-k ) /
585 $ 2 )*wk - ap( i+k*( 2*n-k-1 ) / 2 )*wkp1
587 ap( j+( k-1 )*( 2*n-k ) / 2 ) = wk
588 ap( j+k*( 2*n-k-1 ) / 2 ) = wkp1
596 IF( kstep.EQ.1 )
THEN
subroutine xerbla(srname, info)
subroutine cspr(uplo, n, alpha, x, incx, ap)
CSPR performs the symmetrical rank-1 update of a complex symmetric packed matrix.
subroutine csptrf(uplo, n, ap, ipiv, info)
CSPTRF
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP