001:       SUBROUTINE ZPTSV( N, NRHS, D, E, B, LDB, INFO )
002: *
003: *  -- LAPACK routine (version 3.2) --
004: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
005: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
006: *     November 2006
007: *
008: *     .. Scalar Arguments ..
009:       INTEGER            INFO, LDB, N, NRHS
010: *     ..
011: *     .. Array Arguments ..
012:       DOUBLE PRECISION   D( * )
013:       COMPLEX*16         B( LDB, * ), E( * )
014: *     ..
015: *
016: *  Purpose
017: *  =======
018: *
019: *  ZPTSV computes the solution to a complex system of linear equations
020: *  A*X = B, where A is an N-by-N Hermitian positive definite tridiagonal
021: *  matrix, and X and B are N-by-NRHS matrices.
022: *
023: *  A is factored as A = L*D*L**H, and the factored form of A is then
024: *  used to solve the system of equations.
025: *
026: *  Arguments
027: *  =========
028: *
029: *  N       (input) INTEGER
030: *          The order of the matrix A.  N >= 0.
031: *
032: *  NRHS    (input) INTEGER
033: *          The number of right hand sides, i.e., the number of columns
034: *          of the matrix B.  NRHS >= 0.
035: *
036: *  D       (input/output) DOUBLE PRECISION array, dimension (N)
037: *          On entry, the n diagonal elements of the tridiagonal matrix
038: *          A.  On exit, the n diagonal elements of the diagonal matrix
039: *          D from the factorization A = L*D*L**H.
040: *
041: *  E       (input/output) COMPLEX*16 array, dimension (N-1)
042: *          On entry, the (n-1) subdiagonal elements of the tridiagonal
043: *          matrix A.  On exit, the (n-1) subdiagonal elements of the
044: *          unit bidiagonal factor L from the L*D*L**H factorization of
045: *          A.  E can also be regarded as the superdiagonal of the unit
046: *          bidiagonal factor U from the U**H*D*U factorization of A.
047: *
048: *  B       (input/output) COMPLEX*16 array, dimension (LDB,N)
049: *          On entry, the N-by-NRHS right hand side matrix B.
050: *          On exit, if INFO = 0, the N-by-NRHS solution matrix X.
051: *
052: *  LDB     (input) INTEGER
053: *          The leading dimension of the array B.  LDB >= max(1,N).
054: *
055: *  INFO    (output) INTEGER
056: *          = 0:  successful exit
057: *          < 0:  if INFO = -i, the i-th argument had an illegal value
058: *          > 0:  if INFO = i, the leading minor of order i is not
059: *                positive definite, and the solution has not been
060: *                computed.  The factorization has not been completed
061: *                unless i = N.
062: *
063: *  =====================================================================
064: *
065: *     .. External Subroutines ..
066:       EXTERNAL           XERBLA, ZPTTRF, ZPTTRS
067: *     ..
068: *     .. Intrinsic Functions ..
069:       INTRINSIC          MAX
070: *     ..
071: *     .. Executable Statements ..
072: *
073: *     Test the input parameters.
074: *
075:       INFO = 0
076:       IF( N.LT.0 ) THEN
077:          INFO = -1
078:       ELSE IF( NRHS.LT.0 ) THEN
079:          INFO = -2
080:       ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
081:          INFO = -6
082:       END IF
083:       IF( INFO.NE.0 ) THEN
084:          CALL XERBLA( 'ZPTSV ', -INFO )
085:          RETURN
086:       END IF
087: *
088: *     Compute the L*D*L' (or U'*D*U) factorization of A.
089: *
090:       CALL ZPTTRF( N, D, E, INFO )
091:       IF( INFO.EQ.0 ) THEN
092: *
093: *        Solve the system A*X = B, overwriting B with X.
094: *
095:          CALL ZPTTRS( 'Lower', N, NRHS, D, E, B, LDB, INFO )
096:       END IF
097:       RETURN
098: *
099: *     End of ZPTSV
100: *
101:       END
102: