Annotation of rpl/lapack/lapack/zhetrs_aa_2stage.f, revision 1.3

1.1       bertrand    1: *> \brief \b ZHETRS_AA_2STAGE
                      2: *
                      3: * @generated from SRC/dsytrs_aa_2stage.f, fortran d -> c, Mon Oct 30 11:59:02 2017
                      4: *
                      5: *  =========== DOCUMENTATION ===========
                      6: *
                      7: * Online html documentation available at
                      8: *            http://www.netlib.org/lapack/explore-html/
                      9: *
                     10: *> \htmlonly
                     11: *> Download ZHETRS_AA_2STAGE + dependencies
                     12: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zhetrs_aa_2stage.f">
                     13: *> [TGZ]</a>
                     14: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zhetrs_aa_2stage.f">
                     15: *> [ZIP]</a>
                     16: *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhetrs_aa_2stage.f">
                     17: *> [TXT]</a>
                     18: *> \endhtmlonly
                     19: *
                     20: *  Definition:
                     21: *  ===========
                     22: *
                     23: *      SUBROUTINE ZHETRS_AA_2STAGE( UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, 
                     24: *                                   IPIV2, B, LDB, INFO )
                     25: *
                     26: *       .. Scalar Arguments ..
                     27: *       CHARACTER          UPLO
                     28: *       INTEGER            N, NRHS, LDA, LTB, LDB, INFO
                     29: *       ..
                     30: *       .. Array Arguments ..
                     31: *       INTEGER            IPIV( * ), IPIV2( * )
                     32: *       COMPLEX*16         A( LDA, * ), TB( * ), B( LDB, * )
                     33: *       ..
                     34: *
                     35: *> \par Purpose:
                     36: *  =============
                     37: *>
                     38: *> \verbatim
                     39: *>
                     40: *> ZHETRS_AA_2STAGE solves a system of linear equations A*X = B with a 
1.2       bertrand   41: *> hermitian matrix A using the factorization A = U**H*T*U or
                     42: *> A = L*T*L**H computed by ZHETRF_AA_2STAGE.
1.1       bertrand   43: *> \endverbatim
                     44: *
                     45: *  Arguments:
                     46: *  ==========
                     47: *
                     48: *> \param[in] UPLO
                     49: *> \verbatim
                     50: *>          UPLO is CHARACTER*1
                     51: *>          Specifies whether the details of the factorization are stored
                     52: *>          as an upper or lower triangular matrix.
1.2       bertrand   53: *>          = 'U':  Upper triangular, form is A = U**H*T*U;
                     54: *>          = 'L':  Lower triangular, form is A = L*T*L**H.
1.1       bertrand   55: *> \endverbatim
                     56: *>
                     57: *> \param[in] N
                     58: *> \verbatim
                     59: *>          N is INTEGER
                     60: *>          The order of the matrix A.  N >= 0.
                     61: *> \endverbatim
                     62: *>
                     63: *> \param[in] NRHS
                     64: *> \verbatim
                     65: *>          NRHS is INTEGER
                     66: *>          The number of right hand sides, i.e., the number of columns
                     67: *>          of the matrix B.  NRHS >= 0.
                     68: *> \endverbatim
                     69: *>
                     70: *> \param[in] A
                     71: *> \verbatim
1.2       bertrand   72: *>          A is COMPLEX*16 array, dimension (LDA,N)
1.1       bertrand   73: *>          Details of factors computed by ZHETRF_AA_2STAGE.
                     74: *> \endverbatim
                     75: *>
                     76: *> \param[in] LDA
                     77: *> \verbatim
                     78: *>          LDA is INTEGER
                     79: *>          The leading dimension of the array A.  LDA >= max(1,N).
                     80: *> \endverbatim
                     81: *>
                     82: *> \param[out] TB
                     83: *> \verbatim
1.2       bertrand   84: *>          TB is COMPLEX*16 array, dimension (LTB)
1.1       bertrand   85: *>          Details of factors computed by ZHETRF_AA_2STAGE.
                     86: *> \endverbatim
                     87: *>
                     88: *> \param[in] LTB
                     89: *> \verbatim
1.2       bertrand   90: *>          LTB is INTEGER
1.1       bertrand   91: *>          The size of the array TB. LTB >= 4*N.
                     92: *> \endverbatim
                     93: *>
                     94: *> \param[in] IPIV
                     95: *> \verbatim
                     96: *>          IPIV is INTEGER array, dimension (N)
                     97: *>          Details of the interchanges as computed by
                     98: *>          ZHETRF_AA_2STAGE.
                     99: *> \endverbatim
                    100: *>
                    101: *> \param[in] IPIV2
                    102: *> \verbatim
                    103: *>          IPIV2 is INTEGER array, dimension (N)
                    104: *>          Details of the interchanges as computed by
                    105: *>          ZHETRF_AA_2STAGE.
                    106: *> \endverbatim
                    107: *>
                    108: *> \param[in,out] B
                    109: *> \verbatim
1.2       bertrand  110: *>          B is COMPLEX*16 array, dimension (LDB,NRHS)
1.1       bertrand  111: *>          On entry, the right hand side matrix B.
                    112: *>          On exit, the solution matrix X.
                    113: *> \endverbatim
                    114: *>
                    115: *> \param[in] LDB
                    116: *> \verbatim
                    117: *>          LDB is INTEGER
                    118: *>          The leading dimension of the array B.  LDB >= max(1,N).
                    119: *> \endverbatim
                    120: *>
                    121: *> \param[out] INFO
                    122: *> \verbatim
                    123: *>          INFO is INTEGER
                    124: *>          = 0:  successful exit
                    125: *>          < 0:  if INFO = -i, the i-th argument had an illegal value
                    126: *> \endverbatim
                    127: *
                    128: *  Authors:
                    129: *  ========
                    130: *
                    131: *> \author Univ. of Tennessee
                    132: *> \author Univ. of California Berkeley
                    133: *> \author Univ. of Colorado Denver
                    134: *> \author NAG Ltd.
                    135: *
                    136: *> \ingroup complex16SYcomputational
                    137: *
                    138: *  =====================================================================
                    139:       SUBROUTINE ZHETRS_AA_2STAGE( UPLO, N, NRHS, A, LDA, TB, LTB,
                    140:      $                             IPIV, IPIV2, B, LDB, INFO )
                    141: *
1.3     ! bertrand  142: *  -- LAPACK computational routine --
1.1       bertrand  143: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
                    144: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
                    145: *
                    146:       IMPLICIT NONE
                    147: *
                    148: *     .. Scalar Arguments ..
                    149:       CHARACTER          UPLO
                    150:       INTEGER            N, NRHS, LDA, LTB, LDB, INFO
                    151: *     ..
                    152: *     .. Array Arguments ..
                    153:       INTEGER            IPIV( * ), IPIV2( * )
                    154:       COMPLEX*16         A( LDA, * ), TB( * ), B( LDB, * )
                    155: *     ..
                    156: *
                    157: *  =====================================================================
                    158: *
                    159:       COMPLEX*16         ONE
                    160:       PARAMETER          ( ONE = ( 1.0D+0, 0.0D+0 ) )
                    161: *     ..
                    162: *     .. Local Scalars ..
                    163:       INTEGER            LDTB, NB
                    164:       LOGICAL            UPPER
                    165: *     ..
                    166: *     .. External Functions ..
                    167:       LOGICAL            LSAME
                    168:       EXTERNAL           LSAME
                    169: *     ..
                    170: *     .. External Subroutines ..
                    171:       EXTERNAL           ZGBTRS, ZLASWP, ZTRSM, XERBLA
                    172: *     ..
                    173: *     .. Intrinsic Functions ..
                    174:       INTRINSIC          MAX
                    175: *     ..
                    176: *     .. Executable Statements ..
                    177: *
                    178:       INFO = 0
                    179:       UPPER = LSAME( UPLO, 'U' )
                    180:       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
                    181:          INFO = -1
                    182:       ELSE IF( N.LT.0 ) THEN
                    183:          INFO = -2
                    184:       ELSE IF( NRHS.LT.0 ) THEN
                    185:          INFO = -3
                    186:       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
                    187:          INFO = -5
                    188:       ELSE IF( LTB.LT.( 4*N ) ) THEN
                    189:          INFO = -7
                    190:       ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
                    191:          INFO = -11
                    192:       END IF
                    193:       IF( INFO.NE.0 ) THEN
                    194:          CALL XERBLA( 'ZHETRS_AA_2STAGE', -INFO )
                    195:          RETURN
                    196:       END IF
                    197: *
                    198: *     Quick return if possible
                    199: *
                    200:       IF( N.EQ.0 .OR. NRHS.EQ.0 )
                    201:      $   RETURN
                    202: *
                    203: *     Read NB and compute LDTB
                    204: *
                    205:       NB = INT( TB( 1 ) )
                    206:       LDTB = LTB/N
                    207: *
                    208:       IF( UPPER ) THEN
                    209: *
1.2       bertrand  210: *        Solve A*X = B, where A = U**H*T*U.
1.1       bertrand  211: *
                    212:          IF( N.GT.NB ) THEN
                    213: *
1.2       bertrand  214: *           Pivot, P**T * B -> B
1.1       bertrand  215: *
                    216:             CALL ZLASWP( NRHS, B, LDB, NB+1, N, IPIV, 1 )
                    217: *
1.2       bertrand  218: *           Compute (U**H \ B) -> B    [ (U**H \P**T * B) ]
1.1       bertrand  219: *
                    220:             CALL ZTRSM( 'L', 'U', 'C', 'U', N-NB, NRHS, ONE, A(1, NB+1),
                    221:      $                 LDA, B(NB+1, 1), LDB)
                    222: *
                    223:          END IF
                    224: *
1.2       bertrand  225: *        Compute T \ B -> B   [ T \ (U**H \P**T * B) ]
1.1       bertrand  226: *
                    227:          CALL ZGBTRS( 'N', N, NB, NB, NRHS, TB, LDTB, IPIV2, B, LDB,
                    228:      $               INFO)
                    229:          IF( N.GT.NB ) THEN
                    230: *
1.2       bertrand  231: *           Compute (U \ B) -> B   [ U \ (T \ (U**H \P**T * B) ) ]
1.1       bertrand  232: *
                    233:             CALL ZTRSM( 'L', 'U', 'N', 'U', N-NB, NRHS, ONE, A(1, NB+1),
                    234:      $                  LDA, B(NB+1, 1), LDB)
                    235: *
1.2       bertrand  236: *           Pivot, P * B -> B  [ P * (U \ (T \ (U**H \P**T * B) )) ]
1.1       bertrand  237: *
                    238:             CALL ZLASWP( NRHS, B, LDB, NB+1, N, IPIV, -1 )
                    239: *
                    240:          END IF
                    241: *
                    242:       ELSE
                    243: *
1.2       bertrand  244: *        Solve A*X = B, where A = L*T*L**H.
1.1       bertrand  245: *
                    246:          IF( N.GT.NB ) THEN
                    247: *
1.2       bertrand  248: *           Pivot, P**T * B -> B
1.1       bertrand  249: *
                    250:             CALL ZLASWP( NRHS, B, LDB, NB+1, N, IPIV, 1 )
                    251: *
1.2       bertrand  252: *           Compute (L \ B) -> B    [ (L \P**T * B) ]
1.1       bertrand  253: *
                    254:             CALL ZTRSM( 'L', 'L', 'N', 'U', N-NB, NRHS, ONE, A(NB+1, 1),
                    255:      $                 LDA, B(NB+1, 1), LDB)
                    256: *
                    257:          END IF
                    258: *
                    259: *        Compute T \ B -> B   [ T \ (L \P**T * B) ]
                    260: *
                    261:          CALL ZGBTRS( 'N', N, NB, NB, NRHS, TB, LDTB, IPIV2, B, LDB,
                    262:      $               INFO)
                    263:          IF( N.GT.NB ) THEN
                    264: *
1.2       bertrand  265: *           Compute (L**H \ B) -> B   [ L**H \ (T \ (L \P**T * B) ) ]
1.1       bertrand  266: *
                    267:             CALL ZTRSM( 'L', 'L', 'C', 'U', N-NB, NRHS, ONE, A(NB+1, 1),
                    268:      $                  LDA, B(NB+1, 1), LDB)
                    269: *
1.2       bertrand  270: *           Pivot, P * B -> B  [ P * (L**H \ (T \ (L \P**T * B) )) ]
1.1       bertrand  271: *
                    272:             CALL ZLASWP( NRHS, B, LDB, NB+1, N, IPIV, -1 )
                    273: *
                    274:          END IF
                    275:       END IF
                    276: *
                    277:       RETURN
                    278: *
                    279: *     End of ZHETRS_AA_2STAGE
                    280: *
                    281:       END

CVSweb interface <joel.bertrand@systella.fr>