File:  [local] / rpl / lapack / lapack / ztrtri.f
Revision 1.17: download - view: text, annotated - select for diffs - revision graph
Mon Aug 7 08:39:42 2023 UTC (8 months, 3 weeks ago) by bertrand
Branches: MAIN
CVS tags: rpl-4_1_35, rpl-4_1_34, HEAD
Première mise à jour de lapack et blas.

    1: *> \brief \b ZTRTRI
    2: *
    3: *  =========== DOCUMENTATION ===========
    4: *
    5: * Online html documentation available at
    6: *            http://www.netlib.org/lapack/explore-html/
    7: *
    8: *> \htmlonly
    9: *> Download ZTRTRI + dependencies
   10: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ztrtri.f">
   11: *> [TGZ]</a>
   12: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ztrtri.f">
   13: *> [ZIP]</a>
   14: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztrtri.f">
   15: *> [TXT]</a>
   16: *> \endhtmlonly
   17: *
   18: *  Definition:
   19: *  ===========
   20: *
   21: *       SUBROUTINE ZTRTRI( UPLO, DIAG, N, A, LDA, INFO )
   22: *
   23: *       .. Scalar Arguments ..
   24: *       CHARACTER          DIAG, UPLO
   25: *       INTEGER            INFO, LDA, N
   26: *       ..
   27: *       .. Array Arguments ..
   28: *       COMPLEX*16         A( LDA, * )
   29: *       ..
   30: *
   31: *
   32: *> \par Purpose:
   33: *  =============
   34: *>
   35: *> \verbatim
   36: *>
   37: *> ZTRTRI computes the inverse of a complex upper or lower triangular
   38: *> matrix A.
   39: *>
   40: *> This is the Level 3 BLAS version of the algorithm.
   41: *> \endverbatim
   42: *
   43: *  Arguments:
   44: *  ==========
   45: *
   46: *> \param[in] UPLO
   47: *> \verbatim
   48: *>          UPLO is CHARACTER*1
   49: *>          = 'U':  A is upper triangular;
   50: *>          = 'L':  A is lower triangular.
   51: *> \endverbatim
   52: *>
   53: *> \param[in] DIAG
   54: *> \verbatim
   55: *>          DIAG is CHARACTER*1
   56: *>          = 'N':  A is non-unit triangular;
   57: *>          = 'U':  A is unit triangular.
   58: *> \endverbatim
   59: *>
   60: *> \param[in] N
   61: *> \verbatim
   62: *>          N is INTEGER
   63: *>          The order of the matrix A.  N >= 0.
   64: *> \endverbatim
   65: *>
   66: *> \param[in,out] A
   67: *> \verbatim
   68: *>          A is COMPLEX*16 array, dimension (LDA,N)
   69: *>          On entry, the triangular matrix A.  If UPLO = 'U', the
   70: *>          leading N-by-N upper triangular part of the array A contains
   71: *>          the upper triangular matrix, and the strictly lower
   72: *>          triangular part of A is not referenced.  If UPLO = 'L', the
   73: *>          leading N-by-N lower triangular part of the array A contains
   74: *>          the lower triangular matrix, and the strictly upper
   75: *>          triangular part of A is not referenced.  If DIAG = 'U', the
   76: *>          diagonal elements of A are also not referenced and are
   77: *>          assumed to be 1.
   78: *>          On exit, the (triangular) inverse of the original matrix, in
   79: *>          the same storage format.
   80: *> \endverbatim
   81: *>
   82: *> \param[in] LDA
   83: *> \verbatim
   84: *>          LDA is INTEGER
   85: *>          The leading dimension of the array A.  LDA >= max(1,N).
   86: *> \endverbatim
   87: *>
   88: *> \param[out] INFO
   89: *> \verbatim
   90: *>          INFO is INTEGER
   91: *>          = 0: successful exit
   92: *>          < 0: if INFO = -i, the i-th argument had an illegal value
   93: *>          > 0: if INFO = i, A(i,i) is exactly zero.  The triangular
   94: *>               matrix is singular and its inverse can not be computed.
   95: *> \endverbatim
   96: *
   97: *  Authors:
   98: *  ========
   99: *
  100: *> \author Univ. of Tennessee
  101: *> \author Univ. of California Berkeley
  102: *> \author Univ. of Colorado Denver
  103: *> \author NAG Ltd.
  104: *
  105: *> \ingroup complex16OTHERcomputational
  106: *
  107: *  =====================================================================
  108:       SUBROUTINE ZTRTRI( UPLO, DIAG, N, A, LDA, INFO )
  109: *
  110: *  -- LAPACK computational routine --
  111: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
  112: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  113: *
  114: *     .. Scalar Arguments ..
  115:       CHARACTER          DIAG, UPLO
  116:       INTEGER            INFO, LDA, N
  117: *     ..
  118: *     .. Array Arguments ..
  119:       COMPLEX*16         A( LDA, * )
  120: *     ..
  121: *
  122: *  =====================================================================
  123: *
  124: *     .. Parameters ..
  125:       COMPLEX*16         ONE, ZERO
  126:       PARAMETER          ( ONE = ( 1.0D+0, 0.0D+0 ),
  127:      $                   ZERO = ( 0.0D+0, 0.0D+0 ) )
  128: *     ..
  129: *     .. Local Scalars ..
  130:       LOGICAL            NOUNIT, UPPER
  131:       INTEGER            J, JB, NB, NN
  132: *     ..
  133: *     .. External Functions ..
  134:       LOGICAL            LSAME
  135:       INTEGER            ILAENV
  136:       EXTERNAL           LSAME, ILAENV
  137: *     ..
  138: *     .. External Subroutines ..
  139:       EXTERNAL           XERBLA, ZTRMM, ZTRSM, ZTRTI2
  140: *     ..
  141: *     .. Intrinsic Functions ..
  142:       INTRINSIC          MAX, MIN
  143: *     ..
  144: *     .. Executable Statements ..
  145: *
  146: *     Test the input parameters.
  147: *
  148:       INFO = 0
  149:       UPPER = LSAME( UPLO, 'U' )
  150:       NOUNIT = LSAME( DIAG, 'N' )
  151:       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
  152:          INFO = -1
  153:       ELSE IF( .NOT.NOUNIT .AND. .NOT.LSAME( DIAG, 'U' ) ) THEN
  154:          INFO = -2
  155:       ELSE IF( N.LT.0 ) THEN
  156:          INFO = -3
  157:       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
  158:          INFO = -5
  159:       END IF
  160:       IF( INFO.NE.0 ) THEN
  161:          CALL XERBLA( 'ZTRTRI', -INFO )
  162:          RETURN
  163:       END IF
  164: *
  165: *     Quick return if possible
  166: *
  167:       IF( N.EQ.0 )
  168:      $   RETURN
  169: *
  170: *     Check for singularity if non-unit.
  171: *
  172:       IF( NOUNIT ) THEN
  173:          DO 10 INFO = 1, N
  174:             IF( A( INFO, INFO ).EQ.ZERO )
  175:      $         RETURN
  176:    10    CONTINUE
  177:          INFO = 0
  178:       END IF
  179: *
  180: *     Determine the block size for this environment.
  181: *
  182:       NB = ILAENV( 1, 'ZTRTRI', UPLO // DIAG, N, -1, -1, -1 )
  183:       IF( NB.LE.1 .OR. NB.GE.N ) THEN
  184: *
  185: *        Use unblocked code
  186: *
  187:          CALL ZTRTI2( UPLO, DIAG, N, A, LDA, INFO )
  188:       ELSE
  189: *
  190: *        Use blocked code
  191: *
  192:          IF( UPPER ) THEN
  193: *
  194: *           Compute inverse of upper triangular matrix
  195: *
  196:             DO 20 J = 1, N, NB
  197:                JB = MIN( NB, N-J+1 )
  198: *
  199: *              Compute rows 1:j-1 of current block column
  200: *
  201:                CALL ZTRMM( 'Left', 'Upper', 'No transpose', DIAG, J-1,
  202:      $                     JB, ONE, A, LDA, A( 1, J ), LDA )
  203:                CALL ZTRSM( 'Right', 'Upper', 'No transpose', DIAG, J-1,
  204:      $                     JB, -ONE, A( J, J ), LDA, A( 1, J ), LDA )
  205: *
  206: *              Compute inverse of current diagonal block
  207: *
  208:                CALL ZTRTI2( 'Upper', DIAG, JB, A( J, J ), LDA, INFO )
  209:    20       CONTINUE
  210:          ELSE
  211: *
  212: *           Compute inverse of lower triangular matrix
  213: *
  214:             NN = ( ( N-1 ) / NB )*NB + 1
  215:             DO 30 J = NN, 1, -NB
  216:                JB = MIN( NB, N-J+1 )
  217:                IF( J+JB.LE.N ) THEN
  218: *
  219: *                 Compute rows j+jb:n of current block column
  220: *
  221:                   CALL ZTRMM( 'Left', 'Lower', 'No transpose', DIAG,
  222:      $                        N-J-JB+1, JB, ONE, A( J+JB, J+JB ), LDA,
  223:      $                        A( J+JB, J ), LDA )
  224:                   CALL ZTRSM( 'Right', 'Lower', 'No transpose', DIAG,
  225:      $                        N-J-JB+1, JB, -ONE, A( J, J ), LDA,
  226:      $                        A( J+JB, J ), LDA )
  227:                END IF
  228: *
  229: *              Compute inverse of current diagonal block
  230: *
  231:                CALL ZTRTI2( 'Lower', DIAG, JB, A( J, J ), LDA, INFO )
  232:    30       CONTINUE
  233:          END IF
  234:       END IF
  235: *
  236:       RETURN
  237: *
  238: *     End of ZTRTRI
  239: *
  240:       END

CVSweb interface <joel.bertrand@systella.fr>