394 $ af, ldaf, ipiv, colequ, c, b, ldb,
395 $ y, ldy, berr_out, n_norms,
396 $ err_bnds_norm, err_bnds_comp, res,
397 $ ayb, dy, y_tail, rcond, ithresh,
398 $ rthresh, dz_ub, ignore_cwise,
407 INTEGER info, lda, ldaf, ldb, ldy, n, nrhs, prec_type,
410 LOGICAL colequ, ignore_cwise
411 DOUBLE PRECISION rthresh, dz_ub
415 COMPLEX*16 a( lda, * ), af( ldaf, * ), b( ldb, * ),
416 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
417 DOUBLE PRECISION c( * ), ayb( * ), rcond, berr_out( * ),
418 $ err_bnds_norm( nrhs, * ),
419 $ err_bnds_comp( nrhs, * )
425 INTEGER uplo2, cnt, i, j, x_state, z_state,
427 DOUBLE PRECISION yk, dyk, ymin, normy, normx, normdx, dxrat,
428 $ dzrat, prevnormdx, prev_dz_z, dxratmax,
429 $ dzratmax, dx_x, dz_z, final_dx_x, final_dz_z,
430 $ eps, hugeval, incr_thresh
431 LOGICAL incr_prec, upper
435 INTEGER unstable_state, working_state, conv_state,
436 $ noprog_state, base_residual, extra_residual,
438 parameter( unstable_state = 0, working_state = 1,
439 $ conv_state = 2, noprog_state = 3 )
440 parameter( base_residual = 0, extra_residual = 1,
442 INTEGER final_nrm_err_i, final_cmp_err_i, berr_i
443 INTEGER rcond_i, nrm_rcond_i, nrm_err_i, cmp_rcond_i
444 INTEGER cmp_err_i, piv_growth_i
445 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
447 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
448 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
450 INTEGER la_linrx_itref_i, la_linrx_ithresh_i,
452 parameter( la_linrx_itref_i = 1,
453 $ la_linrx_ithresh_i = 2 )
454 parameter( la_linrx_cwise_i = 3 )
455 INTEGER la_linrx_trust_i, la_linrx_err_i,
457 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
458 parameter( la_linrx_rcond_i = 3 )
472 INTRINSIC abs,
REAL, dimag, max, min
475 DOUBLE PRECISION cabs1
478 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
483 upper =
lsame( uplo,
'U' )
484 IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
486 ELSE IF( n.LT.0 )
THEN
488 ELSE IF( nrhs.LT.0 )
THEN
490 ELSE IF( lda.LT.max( 1, n ) )
THEN
492 ELSE IF( ldaf.LT.max( 1, n ) )
THEN
494 ELSE IF( ldb.LT.max( 1, n ) )
THEN
496 ELSE IF( ldy.LT.max( 1, n ) )
THEN
500 CALL
xerbla(
'ZLA_HERFSX_EXTENDED', -info )
504 hugeval =
dlamch(
'Overflow' )
506 hugeval = hugeval * hugeval
508 incr_thresh = dble( n ) * eps
510 IF (
lsame( uplo,
'L' ) )
THEN
517 y_prec_state = extra_residual
518 IF ( y_prec_state .EQ. extra_y )
THEN
535 x_state = working_state
536 z_state = unstable_state
544 CALL
zcopy( n, b( 1, j ), 1, res, 1 )
545 IF ( y_prec_state .EQ. base_residual )
THEN
546 CALL
zsymv( uplo, n, dcmplx(-1.0d+0), a, lda, y(1,j), 1,
547 $ dcmplx(1.0d+0), res, 1 )
548 ELSE IF ( y_prec_state .EQ. extra_residual )
THEN
549 CALL blas_zsymv_x( uplo2, n, dcmplx(-1.0d+0), a, lda,
550 $ y( 1, j ), 1, dcmplx(1.0d+0), res, 1, prec_type )
552 CALL blas_zsymv2_x(uplo2, n, dcmplx(-1.0d+0), a, lda,
553 $ y(1, j), y_tail, 1, dcmplx(1.0d+0), res, 1,
558 CALL
zcopy( n, res, 1, dy, 1 )
559 CALL
zsytrs( uplo, n, 1, af, ldaf, ipiv, dy, n, info )
570 yk = cabs1( y( i, j ) )
571 dyk = cabs1( dy( i ) )
573 IF ( yk .NE. 0.0d+0 )
THEN
574 dz_z = max( dz_z, dyk / yk )
575 ELSE IF ( dyk .NE. 0.0d+0 )
THEN
579 ymin = min( ymin, yk )
581 normy = max( normy, yk )
584 normx = max( normx, yk * c( i ) )
585 normdx = max( normdx, dyk * c( i ) )
588 normdx = max( normdx, dyk )
592 IF ( normx .NE. 0.0d+0 )
THEN
593 dx_x = normdx / normx
594 ELSE IF ( normdx .EQ. 0.0d+0 )
THEN
600 dxrat = normdx / prevnormdx
601 dzrat = dz_z / prev_dz_z
605 IF ( ymin*rcond .LT. incr_thresh*normy
606 $ .AND. y_prec_state .LT. extra_y )
609 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
610 $ x_state = working_state
611 IF ( x_state .EQ. working_state )
THEN
612 IF ( dx_x .LE. eps )
THEN
614 ELSE IF ( dxrat .GT. rthresh )
THEN
615 IF ( y_prec_state .NE. extra_y )
THEN
618 x_state = noprog_state
621 IF (dxrat .GT. dxratmax) dxratmax = dxrat
623 IF ( x_state .GT. working_state ) final_dx_x = dx_x
626 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
627 $ z_state = working_state
628 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
629 $ z_state = working_state
630 IF ( z_state .EQ. working_state )
THEN
631 IF ( dz_z .LE. eps )
THEN
633 ELSE IF ( dz_z .GT. dz_ub )
THEN
634 z_state = unstable_state
637 ELSE IF ( dzrat .GT. rthresh )
THEN
638 IF ( y_prec_state .NE. extra_y )
THEN
641 z_state = noprog_state
644 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
646 IF ( z_state .GT. working_state ) final_dz_z = dz_z
649 IF ( x_state.NE.working_state.AND.
650 $ ( ignore_cwise.OR.z_state.NE.working_state ) )
653 IF ( incr_prec )
THEN
655 y_prec_state = y_prec_state + 1
666 IF ( y_prec_state .LT. extra_y )
THEN
667 CALL
zaxpy( n, dcmplx(1.0d+0), dy, 1, y(1,j), 1 )
678 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
679 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
683 IF ( n_norms .GE. 1 )
THEN
684 err_bnds_norm( j, la_linrx_err_i ) =
685 $ final_dx_x / (1 - dxratmax)
687 IF ( n_norms .GE. 2 )
THEN
688 err_bnds_comp( j, la_linrx_err_i ) =
689 $ final_dz_z / (1 - dzratmax)
700 CALL
zcopy( n, b( 1, j ), 1, res, 1 )
701 CALL
zsymv( uplo, n, dcmplx(-1.0d+0), a, lda, y(1,j), 1,
702 $ dcmplx(1.0d+0), res, 1 )
705 ayb( i ) = cabs1( b( i, j ) )
711 $ a, lda, y(1, j), 1, 1.0d+0, ayb, 1 )