381 $ AF, LDAF, COLEQU, C, B, LDB, Y,
382 $ LDY, BERR_OUT, N_NORMS,
383 $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES,
384 $ AYB, DY, Y_TAIL, RCOND, ITHRESH,
385 $ RTHRESH, DZ_UB, IGNORE_CWISE,
393 INTEGER INFO, LDA, LDAF, LDB, LDY, N, NRHS, PREC_TYPE,
396 LOGICAL COLEQU, IGNORE_CWISE
400 COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
401 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
402 REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ),
403 $ err_bnds_norm( nrhs, * ),
404 $ err_bnds_comp( nrhs, * )
410 INTEGER UPLO2, CNT, I, J, X_STATE, Z_STATE,
412 REAL YK, DYK, YMIN, NORMY, NORMX, NORMDX, DXRAT,
413 $ DZRAT, PREVNORMDX, PREV_DZ_Z, DXRATMAX,
414 $ DZRATMAX, DX_X, DZ_Z, FINAL_DX_X, FINAL_DZ_Z,
415 $ EPS, HUGEVAL, INCR_THRESH
420 INTEGER UNSTABLE_STATE, WORKING_STATE, CONV_STATE,
421 $ NOPROG_STATE, BASE_RESIDUAL, EXTRA_RESIDUAL,
423 parameter( unstable_state = 0, working_state = 1,
424 $ conv_state = 2, noprog_state = 3 )
425 parameter( base_residual = 0, extra_residual = 1,
427 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
428 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
429 INTEGER CMP_ERR_I, PIV_GROWTH_I
430 PARAMETER ( FINAL_NRM_ERR_I = 1, final_cmp_err_i = 2,
432 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
433 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
435 INTEGER LA_LINRX_ITREF_I, LA_LINRX_ITHRESH_I,
437 parameter( la_linrx_itref_i = 1,
438 $ la_linrx_ithresh_i = 2 )
439 parameter( la_linrx_cwise_i = 3 )
440 INTEGER LA_LINRX_TRUST_I, LA_LINRX_ERR_I,
442 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
443 parameter( la_linrx_rcond_i = 3 )
457 INTRINSIC abs, real, aimag, max, min
463 cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
467 IF (info.NE.0)
RETURN
468 eps = slamch(
'Epsilon' )
469 hugeval = slamch(
'Overflow' )
471 hugeval = hugeval * hugeval
473 incr_thresh = real(n) * eps
475 IF (lsame(uplo,
'L'))
THEN
476 uplo2 = ilauplo(
'L' )
478 uplo2 = ilauplo(
'U' )
482 y_prec_state = extra_residual
483 IF (y_prec_state .EQ. extra_y)
THEN
500 x_state = working_state
501 z_state = unstable_state
509 CALL ccopy( n, b( 1, j ), 1, res, 1 )
510 IF (y_prec_state .EQ. base_residual)
THEN
511 CALL chemv(uplo, n, cmplx(-1.0), a, lda, y(1,j), 1,
512 $ cmplx(1.0), res, 1)
513 ELSE IF (y_prec_state .EQ. extra_residual)
THEN
514 CALL blas_chemv_x(uplo2, n, cmplx(-1.0), a, lda,
515 $ y( 1, j ), 1, cmplx(1.0), res, 1, prec_type)
517 CALL blas_chemv2_x(uplo2, n, cmplx(-1.0), a, lda,
518 $ y(1, j), y_tail, 1, cmplx(1.0), res, 1, prec_type)
522 CALL ccopy( n, res, 1, dy, 1 )
523 CALL cpotrs( uplo, n, 1, af, ldaf, dy, n, info)
537 IF (yk .NE. 0.0)
THEN
538 dz_z = max( dz_z, dyk / yk )
539 ELSE IF (dyk .NE. 0.0)
THEN
543 ymin = min( ymin, yk )
545 normy = max( normy, yk )
548 normx = max(normx, yk * c(i))
549 normdx = max(normdx, dyk * c(i))
552 normdx = max(normdx, dyk)
556 IF (normx .NE. 0.0)
THEN
557 dx_x = normdx / normx
558 ELSE IF (normdx .EQ. 0.0)
THEN
564 dxrat = normdx / prevnormdx
565 dzrat = dz_z / prev_dz_z
569 IF (ymin*rcond .LT. incr_thresh*normy
570 $ .AND. y_prec_state .LT. extra_y)
573 IF (x_state .EQ. noprog_state .AND. dxrat .LE. rthresh)
574 $ x_state = working_state
575 IF (x_state .EQ. working_state)
THEN
576 IF (dx_x .LE. eps)
THEN
578 ELSE IF (dxrat .GT. rthresh)
THEN
579 IF (y_prec_state .NE. extra_y)
THEN
582 x_state = noprog_state
585 IF (dxrat .GT. dxratmax) dxratmax = dxrat
587 IF (x_state .GT. working_state) final_dx_x = dx_x
590 IF (z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub)
591 $ z_state = working_state
592 IF (z_state .EQ. noprog_state .AND. dzrat .LE. rthresh)
593 $ z_state = working_state
594 IF (z_state .EQ. working_state)
THEN
595 IF (dz_z .LE. eps)
THEN
597 ELSE IF (dz_z .GT. dz_ub)
THEN
598 z_state = unstable_state
601 ELSE IF (dzrat .GT. rthresh)
THEN
602 IF (y_prec_state .NE. extra_y)
THEN
605 z_state = noprog_state
608 IF (dzrat .GT. dzratmax) dzratmax = dzrat
610 IF (z_state .GT. working_state) final_dz_z = dz_z
613 IF ( x_state.NE.working_state.AND.
614 $ (ignore_cwise.OR.z_state.NE.working_state) )
619 y_prec_state = y_prec_state + 1
630 IF (y_prec_state .LT. extra_y)
THEN
631 CALL caxpy( n, cmplx(1.0), dy, 1, y(1,j), 1 )
642 IF (x_state .EQ. working_state) final_dx_x = dx_x
643 IF (z_state .EQ. working_state) final_dz_z = dz_z
647 IF (n_norms .GE. 1)
THEN
648 err_bnds_norm( j, la_linrx_err_i ) =
649 $ final_dx_x / (1 - dxratmax)
651 IF (n_norms .GE. 2)
THEN
652 err_bnds_comp( j, la_linrx_err_i ) =
653 $ final_dz_z / (1 - dzratmax)
664 CALL ccopy( n, b( 1, j ), 1, res, 1 )
665 CALL chemv(uplo, n, cmplx(-1.0), a, lda, y(1,j), 1, cmplx(1.0),
669 ayb( i ) = cabs1( b( i, j ) )
675 $ a, lda, y(1, j), 1, 1.0, ayb, 1)
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine chemv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
CHEMV
subroutine cla_heamv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
CLA_HEAMV computes a matrix-vector product using a Hermitian indefinite matrix to calculate error bou...
subroutine cla_lin_berr(n, nz, nrhs, res, ayb, berr)
CLA_LIN_BERR computes a component-wise relative backward error.
subroutine cla_porfsx_extended(prec_type, uplo, n, nrhs, a, lda, af, ldaf, colequ, c, b, ldb, y, ldy, berr_out, n_norms, err_bnds_norm, err_bnds_comp, res, ayb, dy, y_tail, rcond, ithresh, rthresh, dz_ub, ignore_cwise, info)
CLA_PORFSX_EXTENDED improves the computed solution to a system of linear equations for symmetric or H...
subroutine cla_wwaddw(n, x, y, w)
CLA_WWADDW adds a vector into a doubled-single vector.
real function slamch(cmach)
SLAMCH
subroutine cpotrs(uplo, n, nrhs, a, lda, b, ldb, info)
CPOTRS