383 $ af, ldaf, colequ, c, b, ldb, y,
384 $ ldy, berr_out, n_norms,
385 $ err_bnds_norm, err_bnds_comp, res,
386 $ ayb, dy, y_tail, rcond, ithresh,
387 $ rthresh, dz_ub, ignore_cwise,
396 INTEGER info, lda, ldaf, ldb, ldy, n, nrhs, prec_type,
399 LOGICAL colequ, ignore_cwise
403 REAL a( lda, * ), af( ldaf, * ), b( ldb, * ),
404 $ y( ldy, * ), res( * ), dy( * ), y_tail( * )
405 REAL c( * ), ayb(*), rcond, berr_out( * ),
406 $ err_bnds_norm( nrhs, * ),
407 $ err_bnds_comp( nrhs, * )
413 INTEGER uplo2, cnt, i, j, x_state, z_state
414 REAL yk, dyk, ymin, normy, normx, normdx, dxrat,
415 $ dzrat, prevnormdx, prev_dz_z, dxratmax,
416 $ dzratmax, dx_x, dz_z, final_dx_x, final_dz_z,
417 $ eps, hugeval, incr_thresh
421 INTEGER unstable_state, working_state, conv_state,
422 $ noprog_state, y_prec_state, base_residual,
423 $ extra_residual, extra_y
424 parameter( unstable_state = 0, working_state = 1,
425 $ conv_state = 2, noprog_state = 3 )
426 parameter( base_residual = 0, extra_residual = 1,
428 INTEGER final_nrm_err_i, final_cmp_err_i, berr_i
429 INTEGER rcond_i, nrm_rcond_i, nrm_err_i, cmp_rcond_i
430 INTEGER cmp_err_i, piv_growth_i
431 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
433 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
434 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
436 INTEGER la_linrx_itref_i, la_linrx_ithresh_i,
438 parameter( la_linrx_itref_i = 1,
439 $ la_linrx_ithresh_i = 2 )
440 parameter( la_linrx_cwise_i = 3 )
441 INTEGER la_linrx_trust_i, la_linrx_err_i,
443 parameter( la_linrx_trust_i = 1, la_linrx_err_i = 2 )
444 parameter( la_linrx_rcond_i = 3 )
458 INTRINSIC abs, max, min
462 IF (info.NE.0) return
464 hugeval =
slamch(
'Overflow' )
466 hugeval = hugeval * hugeval
468 incr_thresh =
REAL( N ) * eps
470 IF (
lsame( uplo,
'L' ) )
THEN
477 y_prec_state = extra_residual
478 IF ( y_prec_state .EQ. extra_y )
THEN
495 x_state = working_state
496 z_state = unstable_state
504 CALL
scopy( n, b( 1, j ), 1, res, 1 )
505 IF ( y_prec_state .EQ. base_residual )
THEN
506 CALL
ssymv( uplo, n, -1.0, a, lda, y(1,j), 1,
508 ELSE IF ( y_prec_state .EQ. extra_residual )
THEN
509 CALL blas_ssymv_x( uplo2, n, -1.0, a, lda,
510 $ y( 1, j ), 1, 1.0, res, 1, prec_type )
512 CALL blas_ssymv2_x(uplo2, n, -1.0, a, lda,
513 $ y(1, j), y_tail, 1, 1.0, res, 1, prec_type)
517 CALL
scopy( n, res, 1, dy, 1 )
518 CALL
spotrs( uplo, n, 1, af, ldaf, dy, n, info )
529 yk = abs( y( i, j ) )
532 IF ( yk .NE. 0.0 )
THEN
533 dz_z = max( dz_z, dyk / yk )
534 ELSE IF ( dyk .NE. 0.0 )
THEN
538 ymin = min( ymin, yk )
540 normy = max( normy, yk )
543 normx = max( normx, yk * c( i ) )
544 normdx = max( normdx, dyk * c( i ) )
547 normdx = max( normdx, dyk )
551 IF ( normx .NE. 0.0 )
THEN
552 dx_x = normdx / normx
553 ELSE IF ( normdx .EQ. 0.0 )
THEN
559 dxrat = normdx / prevnormdx
560 dzrat = dz_z / prev_dz_z
564 IF ( ymin*rcond .LT. incr_thresh*normy
565 $ .AND. y_prec_state .LT. extra_y )
568 IF ( x_state .EQ. noprog_state .AND. dxrat .LE. rthresh )
569 $ x_state = working_state
570 IF ( x_state .EQ. working_state )
THEN
571 IF ( dx_x .LE. eps )
THEN
573 ELSE IF ( dxrat .GT. rthresh )
THEN
574 IF ( y_prec_state .NE. extra_y )
THEN
577 x_state = noprog_state
580 IF ( dxrat .GT. dxratmax ) dxratmax = dxrat
582 IF ( x_state .GT. working_state ) final_dx_x = dx_x
585 IF ( z_state .EQ. unstable_state .AND. dz_z .LE. dz_ub )
586 $ z_state = working_state
587 IF ( z_state .EQ. noprog_state .AND. dzrat .LE. rthresh )
588 $ z_state = working_state
589 IF ( z_state .EQ. working_state )
THEN
590 IF ( dz_z .LE. eps )
THEN
592 ELSE IF ( dz_z .GT. dz_ub )
THEN
593 z_state = unstable_state
596 ELSE IF ( dzrat .GT. rthresh )
THEN
597 IF ( y_prec_state .NE. extra_y )
THEN
600 z_state = noprog_state
603 IF ( dzrat .GT. dzratmax ) dzratmax = dzrat
605 IF ( z_state .GT. working_state ) final_dz_z = dz_z
608 IF ( x_state.NE.working_state.AND.
609 $ ( ignore_cwise.OR.z_state.NE.working_state ) )
612 IF ( incr_prec )
THEN
614 y_prec_state = y_prec_state + 1
625 IF (y_prec_state .LT. extra_y)
THEN
626 CALL
saxpy( n, 1.0, dy, 1, y(1,j), 1 )
637 IF ( x_state .EQ. working_state ) final_dx_x = dx_x
638 IF ( z_state .EQ. working_state ) final_dz_z = dz_z
642 IF ( n_norms .GE. 1 )
THEN
643 err_bnds_norm( j, la_linrx_err_i ) =
644 $ final_dx_x / (1 - dxratmax)
646 IF ( n_norms .GE. 2 )
THEN
647 err_bnds_comp( j, la_linrx_err_i ) =
648 $ final_dz_z / (1 - dzratmax)
659 CALL
scopy( n, b( 1, j ), 1, res, 1 )
660 CALL
ssymv( uplo, n, -1.0, a, lda, y(1,j), 1, 1.0, res, 1 )
663 ayb( i ) = abs( b( i, j ) )
669 $ a, lda, y(1, j), 1, 1.0, ayb, 1 )