Annotation of rpl/lapack/lapack/zla_hercond_x.f, revision 1.18

1.10      bertrand    1: *> \brief \b ZLA_HERCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian indefinite matrices.
1.6       bertrand    2: *
                      3: *  =========== DOCUMENTATION ===========
                      4: *
1.14      bertrand    5: * Online html documentation available at
                      6: *            http://www.netlib.org/lapack/explore-html/
1.6       bertrand    7: *
                      8: *> \htmlonly
1.14      bertrand    9: *> Download ZLA_HERCOND_X + dependencies
                     10: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zla_hercond_x.f">
                     11: *> [TGZ]</a>
                     12: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zla_hercond_x.f">
                     13: *> [ZIP]</a>
                     14: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zla_hercond_x.f">
1.6       bertrand   15: *> [TXT]</a>
1.14      bertrand   16: *> \endhtmlonly
1.6       bertrand   17: *
                     18: *  Definition:
                     19: *  ===========
                     20: *
                     21: *       DOUBLE PRECISION FUNCTION ZLA_HERCOND_X( UPLO, N, A, LDA, AF,
                     22: *                                                LDAF, IPIV, X, INFO,
                     23: *                                                WORK, RWORK )
1.14      bertrand   24: *
1.6       bertrand   25: *       .. Scalar Arguments ..
                     26: *       CHARACTER          UPLO
                     27: *       INTEGER            N, LDA, LDAF, INFO
                     28: *       ..
                     29: *       .. Array Arguments ..
                     30: *       INTEGER            IPIV( * )
                     31: *       COMPLEX*16         A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
                     32: *       DOUBLE PRECISION   RWORK( * )
                     33: *       ..
1.14      bertrand   34: *
1.6       bertrand   35: *
                     36: *> \par Purpose:
                     37: *  =============
                     38: *>
                     39: *> \verbatim
                     40: *>
                     41: *>    ZLA_HERCOND_X computes the infinity norm condition number of
                     42: *>    op(A) * diag(X) where X is a COMPLEX*16 vector.
                     43: *> \endverbatim
                     44: *
                     45: *  Arguments:
                     46: *  ==========
                     47: *
                     48: *> \param[in] UPLO
                     49: *> \verbatim
                     50: *>          UPLO is CHARACTER*1
                     51: *>       = 'U':  Upper triangle of A is stored;
                     52: *>       = 'L':  Lower triangle of A is stored.
                     53: *> \endverbatim
                     54: *>
                     55: *> \param[in] N
                     56: *> \verbatim
                     57: *>          N is INTEGER
                     58: *>     The number of linear equations, i.e., the order of the
                     59: *>     matrix A.  N >= 0.
                     60: *> \endverbatim
                     61: *>
                     62: *> \param[in] A
                     63: *> \verbatim
                     64: *>          A is COMPLEX*16 array, dimension (LDA,N)
                     65: *>     On entry, the N-by-N matrix A.
                     66: *> \endverbatim
                     67: *>
                     68: *> \param[in] LDA
                     69: *> \verbatim
                     70: *>          LDA is INTEGER
                     71: *>     The leading dimension of the array A.  LDA >= max(1,N).
                     72: *> \endverbatim
                     73: *>
                     74: *> \param[in] AF
                     75: *> \verbatim
                     76: *>          AF is COMPLEX*16 array, dimension (LDAF,N)
                     77: *>     The block diagonal matrix D and the multipliers used to
                     78: *>     obtain the factor U or L as computed by ZHETRF.
                     79: *> \endverbatim
                     80: *>
                     81: *> \param[in] LDAF
                     82: *> \verbatim
                     83: *>          LDAF is INTEGER
                     84: *>     The leading dimension of the array AF.  LDAF >= max(1,N).
                     85: *> \endverbatim
                     86: *>
                     87: *> \param[in] IPIV
                     88: *> \verbatim
                     89: *>          IPIV is INTEGER array, dimension (N)
                     90: *>     Details of the interchanges and the block structure of D
                     91: *>     as determined by CHETRF.
                     92: *> \endverbatim
                     93: *>
                     94: *> \param[in] X
                     95: *> \verbatim
                     96: *>          X is COMPLEX*16 array, dimension (N)
                     97: *>     The vector X in the formula op(A) * diag(X).
                     98: *> \endverbatim
                     99: *>
                    100: *> \param[out] INFO
                    101: *> \verbatim
                    102: *>          INFO is INTEGER
                    103: *>       = 0:  Successful exit.
                    104: *>     i > 0:  The ith argument is invalid.
                    105: *> \endverbatim
                    106: *>
1.17      bertrand  107: *> \param[out] WORK
1.6       bertrand  108: *> \verbatim
                    109: *>          WORK is COMPLEX*16 array, dimension (2*N).
                    110: *>     Workspace.
                    111: *> \endverbatim
                    112: *>
1.17      bertrand  113: *> \param[out] RWORK
1.6       bertrand  114: *> \verbatim
                    115: *>          RWORK is DOUBLE PRECISION array, dimension (N).
                    116: *>     Workspace.
                    117: *> \endverbatim
                    118: *
                    119: *  Authors:
                    120: *  ========
                    121: *
1.14      bertrand  122: *> \author Univ. of Tennessee
                    123: *> \author Univ. of California Berkeley
                    124: *> \author Univ. of Colorado Denver
                    125: *> \author NAG Ltd.
1.6       bertrand  126: *
                    127: *> \ingroup complex16HEcomputational
                    128: *
                    129: *  =====================================================================
1.1       bertrand  130:       DOUBLE PRECISION FUNCTION ZLA_HERCOND_X( UPLO, N, A, LDA, AF,
                    131:      $                                         LDAF, IPIV, X, INFO,
                    132:      $                                         WORK, RWORK )
                    133: *
1.18    ! bertrand  134: *  -- LAPACK computational routine --
1.6       bertrand  135: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
                    136: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
1.1       bertrand  137: *
                    138: *     .. Scalar Arguments ..
                    139:       CHARACTER          UPLO
                    140:       INTEGER            N, LDA, LDAF, INFO
                    141: *     ..
                    142: *     .. Array Arguments ..
                    143:       INTEGER            IPIV( * )
                    144:       COMPLEX*16         A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
                    145:       DOUBLE PRECISION   RWORK( * )
                    146: *     ..
                    147: *
                    148: *  =====================================================================
                    149: *
                    150: *     .. Local Scalars ..
                    151:       INTEGER            KASE, I, J
                    152:       DOUBLE PRECISION   AINVNM, ANORM, TMP
1.8       bertrand  153:       LOGICAL            UP, UPPER
1.1       bertrand  154:       COMPLEX*16         ZDUM
                    155: *     ..
                    156: *     .. Local Arrays ..
                    157:       INTEGER            ISAVE( 3 )
                    158: *     ..
                    159: *     .. External Functions ..
                    160:       LOGICAL            LSAME
                    161:       EXTERNAL           LSAME
                    162: *     ..
                    163: *     .. External Subroutines ..
                    164:       EXTERNAL           ZLACN2, ZHETRS, XERBLA
                    165: *     ..
                    166: *     .. Intrinsic Functions ..
                    167:       INTRINSIC          ABS, MAX
                    168: *     ..
                    169: *     .. Statement Functions ..
                    170:       DOUBLE PRECISION CABS1
                    171: *     ..
                    172: *     .. Statement Function Definitions ..
                    173:       CABS1( ZDUM ) = ABS( DBLE( ZDUM ) ) + ABS( DIMAG( ZDUM ) )
                    174: *     ..
                    175: *     .. Executable Statements ..
                    176: *
                    177:       ZLA_HERCOND_X = 0.0D+0
                    178: *
                    179:       INFO = 0
1.8       bertrand  180:       UPPER = LSAME( UPLO, 'U' )
                    181:       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
                    182:          INFO = -1
                    183:       ELSE IF ( N.LT.0 ) THEN
1.1       bertrand  184:          INFO = -2
1.8       bertrand  185:       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
                    186:          INFO = -4
                    187:       ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN
                    188:          INFO = -6
1.1       bertrand  189:       END IF
                    190:       IF( INFO.NE.0 ) THEN
                    191:          CALL XERBLA( 'ZLA_HERCOND_X', -INFO )
                    192:          RETURN
                    193:       END IF
                    194:       UP = .FALSE.
                    195:       IF ( LSAME( UPLO, 'U' ) ) UP = .TRUE.
                    196: *
                    197: *     Compute norm of op(A)*op2(C).
                    198: *
                    199:       ANORM = 0.0D+0
                    200:       IF ( UP ) THEN
                    201:          DO I = 1, N
                    202:             TMP = 0.0D+0
                    203:             DO J = 1, I
                    204:                TMP = TMP + CABS1( A( J, I ) * X( J ) )
                    205:             END DO
                    206:             DO J = I+1, N
                    207:                TMP = TMP + CABS1( A( I, J ) * X( J ) )
                    208:             END DO
                    209:             RWORK( I ) = TMP
                    210:             ANORM = MAX( ANORM, TMP )
                    211:          END DO
                    212:       ELSE
                    213:          DO I = 1, N
                    214:             TMP = 0.0D+0
                    215:             DO J = 1, I
                    216:                TMP = TMP + CABS1( A( I, J ) * X( J ) )
                    217:             END DO
                    218:             DO J = I+1, N
                    219:                TMP = TMP + CABS1( A( J, I ) * X( J ) )
                    220:             END DO
                    221:             RWORK( I ) = TMP
                    222:             ANORM = MAX( ANORM, TMP )
                    223:          END DO
                    224:       END IF
                    225: *
                    226: *     Quick return if possible.
                    227: *
                    228:       IF( N.EQ.0 ) THEN
                    229:          ZLA_HERCOND_X = 1.0D+0
                    230:          RETURN
                    231:       ELSE IF( ANORM .EQ. 0.0D+0 ) THEN
                    232:          RETURN
                    233:       END IF
                    234: *
                    235: *     Estimate the norm of inv(op(A)).
                    236: *
                    237:       AINVNM = 0.0D+0
                    238: *
                    239:       KASE = 0
                    240:    10 CONTINUE
                    241:       CALL ZLACN2( N, WORK( N+1 ), WORK, AINVNM, KASE, ISAVE )
                    242:       IF( KASE.NE.0 ) THEN
                    243:          IF( KASE.EQ.2 ) THEN
                    244: *
                    245: *           Multiply by R.
                    246: *
                    247:             DO I = 1, N
                    248:                WORK( I ) = WORK( I ) * RWORK( I )
                    249:             END DO
                    250: *
                    251:             IF ( UP ) THEN
                    252:                CALL ZHETRS( 'U', N, 1, AF, LDAF, IPIV,
                    253:      $            WORK, N, INFO )
                    254:             ELSE
                    255:                CALL ZHETRS( 'L', N, 1, AF, LDAF, IPIV,
                    256:      $            WORK, N, INFO )
                    257:             ENDIF
                    258: *
                    259: *           Multiply by inv(X).
                    260: *
                    261:             DO I = 1, N
                    262:                WORK( I ) = WORK( I ) / X( I )
                    263:             END DO
                    264:          ELSE
                    265: *
1.5       bertrand  266: *           Multiply by inv(X**H).
1.1       bertrand  267: *
                    268:             DO I = 1, N
                    269:                WORK( I ) = WORK( I ) / X( I )
                    270:             END DO
                    271: *
                    272:             IF ( UP ) THEN
                    273:                CALL ZHETRS( 'U', N, 1, AF, LDAF, IPIV,
                    274:      $            WORK, N, INFO )
                    275:             ELSE
                    276:                CALL ZHETRS( 'L', N, 1, AF, LDAF, IPIV,
                    277:      $            WORK, N, INFO )
                    278:             END IF
                    279: *
                    280: *           Multiply by R.
                    281: *
                    282:             DO I = 1, N
                    283:                WORK( I ) = WORK( I ) * RWORK( I )
                    284:             END DO
                    285:          END IF
                    286:          GO TO 10
                    287:       END IF
                    288: *
                    289: *     Compute the estimate of the reciprocal condition number.
                    290: *
                    291:       IF( AINVNM .NE. 0.0D+0 )
                    292:      $   ZLA_HERCOND_X = 1.0D+0 / AINVNM
                    293: *
                    294:       RETURN
                    295: *
1.18    ! bertrand  296: *     End of ZLA_HERCOND_X
        !           297: *
1.1       bertrand  298:       END

CVSweb interface <joel.bertrand@systella.fr>