File:  [local] / rpl / lapack / lapack / dptsv.f
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Fri Aug 6 15:32:33 2010 UTC (13 years, 9 months ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Cohérence

    1:       SUBROUTINE DPTSV( N, NRHS, D, E, B, LDB, INFO )
    2: *
    3: *  -- LAPACK routine (version 3.2) --
    4: *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
    5: *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
    6: *     November 2006
    7: *
    8: *     .. Scalar Arguments ..
    9:       INTEGER            INFO, LDB, N, NRHS
   10: *     ..
   11: *     .. Array Arguments ..
   12:       DOUBLE PRECISION   B( LDB, * ), D( * ), E( * )
   13: *     ..
   14: *
   15: *  Purpose
   16: *  =======
   17: *
   18: *  DPTSV computes the solution to a real system of linear equations
   19: *  A*X = B, where A is an N-by-N symmetric positive definite tridiagonal
   20: *  matrix, and X and B are N-by-NRHS matrices.
   21: *
   22: *  A is factored as A = L*D*L**T, and the factored form of A is then
   23: *  used to solve the system of equations.
   24: *
   25: *  Arguments
   26: *  =========
   27: *
   28: *  N       (input) INTEGER
   29: *          The order of the matrix A.  N >= 0.
   30: *
   31: *  NRHS    (input) INTEGER
   32: *          The number of right hand sides, i.e., the number of columns
   33: *          of the matrix B.  NRHS >= 0.
   34: *
   35: *  D       (input/output) DOUBLE PRECISION array, dimension (N)
   36: *          On entry, the n diagonal elements of the tridiagonal matrix
   37: *          A.  On exit, the n diagonal elements of the diagonal matrix
   38: *          D from the factorization A = L*D*L**T.
   39: *
   40: *  E       (input/output) DOUBLE PRECISION array, dimension (N-1)
   41: *          On entry, the (n-1) subdiagonal elements of the tridiagonal
   42: *          matrix A.  On exit, the (n-1) subdiagonal elements of the
   43: *          unit bidiagonal factor L from the L*D*L**T factorization of
   44: *          A.  (E can also be regarded as the superdiagonal of the unit
   45: *          bidiagonal factor U from the U**T*D*U factorization of A.)
   46: *
   47: *  B       (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
   48: *          On entry, the N-by-NRHS right hand side matrix B.
   49: *          On exit, if INFO = 0, the N-by-NRHS solution matrix X.
   50: *
   51: *  LDB     (input) INTEGER
   52: *          The leading dimension of the array B.  LDB >= max(1,N).
   53: *
   54: *  INFO    (output) INTEGER
   55: *          = 0:  successful exit
   56: *          < 0:  if INFO = -i, the i-th argument had an illegal value
   57: *          > 0:  if INFO = i, the leading minor of order i is not
   58: *                positive definite, and the solution has not been
   59: *                computed.  The factorization has not been completed
   60: *                unless i = N.
   61: *
   62: *  =====================================================================
   63: *
   64: *     .. External Subroutines ..
   65:       EXTERNAL           DPTTRF, DPTTRS, XERBLA
   66: *     ..
   67: *     .. Intrinsic Functions ..
   68:       INTRINSIC          MAX
   69: *     ..
   70: *     .. Executable Statements ..
   71: *
   72: *     Test the input parameters.
   73: *
   74:       INFO = 0
   75:       IF( N.LT.0 ) THEN
   76:          INFO = -1
   77:       ELSE IF( NRHS.LT.0 ) THEN
   78:          INFO = -2
   79:       ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
   80:          INFO = -6
   81:       END IF
   82:       IF( INFO.NE.0 ) THEN
   83:          CALL XERBLA( 'DPTSV ', -INFO )
   84:          RETURN
   85:       END IF
   86: *
   87: *     Compute the L*D*L' (or U'*D*U) factorization of A.
   88: *
   89:       CALL DPTTRF( N, D, E, INFO )
   90:       IF( INFO.EQ.0 ) THEN
   91: *
   92: *        Solve the system A*X = B, overwriting B with X.
   93: *
   94:          CALL DPTTRS( N, NRHS, D, E, B, LDB, INFO )
   95:       END IF
   96:       RETURN
   97: *
   98: *     End of DPTSV
   99: *
  100:       END

CVSweb interface <joel.bertrand@systella.fr>