LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
dgttrs.f
Go to the documentation of this file.
00001 *> \brief \b DGTTRS
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download DGTTRS + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgttrs.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgttrs.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgttrs.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE DGTTRS( TRANS, N, NRHS, DL, D, DU, DU2, IPIV, B, LDB,
00022 *                          INFO )
00023 * 
00024 *       .. Scalar Arguments ..
00025 *       CHARACTER          TRANS
00026 *       INTEGER            INFO, LDB, N, NRHS
00027 *       ..
00028 *       .. Array Arguments ..
00029 *       INTEGER            IPIV( * )
00030 *       DOUBLE PRECISION   B( LDB, * ), D( * ), DL( * ), DU( * ), DU2( * )
00031 *       ..
00032 *  
00033 *
00034 *> \par Purpose:
00035 *  =============
00036 *>
00037 *> \verbatim
00038 *>
00039 *> DGTTRS solves one of the systems of equations
00040 *>    A*X = B  or  A**T*X = B,
00041 *> with a tridiagonal matrix A using the LU factorization computed
00042 *> by DGTTRF.
00043 *> \endverbatim
00044 *
00045 *  Arguments:
00046 *  ==========
00047 *
00048 *> \param[in] TRANS
00049 *> \verbatim
00050 *>          TRANS is CHARACTER*1
00051 *>          Specifies the form of the system of equations.
00052 *>          = 'N':  A * X = B  (No transpose)
00053 *>          = 'T':  A**T* X = B  (Transpose)
00054 *>          = 'C':  A**T* X = B  (Conjugate transpose = Transpose)
00055 *> \endverbatim
00056 *>
00057 *> \param[in] N
00058 *> \verbatim
00059 *>          N is INTEGER
00060 *>          The order of the matrix A.
00061 *> \endverbatim
00062 *>
00063 *> \param[in] NRHS
00064 *> \verbatim
00065 *>          NRHS is INTEGER
00066 *>          The number of right hand sides, i.e., the number of columns
00067 *>          of the matrix B.  NRHS >= 0.
00068 *> \endverbatim
00069 *>
00070 *> \param[in] DL
00071 *> \verbatim
00072 *>          DL is DOUBLE PRECISION array, dimension (N-1)
00073 *>          The (n-1) multipliers that define the matrix L from the
00074 *>          LU factorization of A.
00075 *> \endverbatim
00076 *>
00077 *> \param[in] D
00078 *> \verbatim
00079 *>          D is DOUBLE PRECISION array, dimension (N)
00080 *>          The n diagonal elements of the upper triangular matrix U from
00081 *>          the LU factorization of A.
00082 *> \endverbatim
00083 *>
00084 *> \param[in] DU
00085 *> \verbatim
00086 *>          DU is DOUBLE PRECISION array, dimension (N-1)
00087 *>          The (n-1) elements of the first super-diagonal of U.
00088 *> \endverbatim
00089 *>
00090 *> \param[in] DU2
00091 *> \verbatim
00092 *>          DU2 is DOUBLE PRECISION array, dimension (N-2)
00093 *>          The (n-2) elements of the second super-diagonal of U.
00094 *> \endverbatim
00095 *>
00096 *> \param[in] IPIV
00097 *> \verbatim
00098 *>          IPIV is INTEGER array, dimension (N)
00099 *>          The pivot indices; for 1 <= i <= n, row i of the matrix was
00100 *>          interchanged with row IPIV(i).  IPIV(i) will always be either
00101 *>          i or i+1; IPIV(i) = i indicates a row interchange was not
00102 *>          required.
00103 *> \endverbatim
00104 *>
00105 *> \param[in,out] B
00106 *> \verbatim
00107 *>          B is DOUBLE PRECISION array, dimension (LDB,NRHS)
00108 *>          On entry, the matrix of right hand side vectors B.
00109 *>          On exit, B is overwritten by the solution vectors X.
00110 *> \endverbatim
00111 *>
00112 *> \param[in] LDB
00113 *> \verbatim
00114 *>          LDB is INTEGER
00115 *>          The leading dimension of the array B.  LDB >= max(1,N).
00116 *> \endverbatim
00117 *>
00118 *> \param[out] INFO
00119 *> \verbatim
00120 *>          INFO is INTEGER
00121 *>          = 0:  successful exit
00122 *>          < 0:  if INFO = -i, the i-th argument had an illegal value
00123 *> \endverbatim
00124 *
00125 *  Authors:
00126 *  ========
00127 *
00128 *> \author Univ. of Tennessee 
00129 *> \author Univ. of California Berkeley 
00130 *> \author Univ. of Colorado Denver 
00131 *> \author NAG Ltd. 
00132 *
00133 *> \date November 2011
00134 *
00135 *> \ingroup doubleOTHERcomputational
00136 *
00137 *  =====================================================================
00138       SUBROUTINE DGTTRS( TRANS, N, NRHS, DL, D, DU, DU2, IPIV, B, LDB,
00139      $                   INFO )
00140 *
00141 *  -- LAPACK computational routine (version 3.4.0) --
00142 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00143 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00144 *     November 2011
00145 *
00146 *     .. Scalar Arguments ..
00147       CHARACTER          TRANS
00148       INTEGER            INFO, LDB, N, NRHS
00149 *     ..
00150 *     .. Array Arguments ..
00151       INTEGER            IPIV( * )
00152       DOUBLE PRECISION   B( LDB, * ), D( * ), DL( * ), DU( * ), DU2( * )
00153 *     ..
00154 *
00155 *  =====================================================================
00156 *
00157 *     .. Local Scalars ..
00158       LOGICAL            NOTRAN
00159       INTEGER            ITRANS, J, JB, NB
00160 *     ..
00161 *     .. External Functions ..
00162       INTEGER            ILAENV
00163       EXTERNAL           ILAENV
00164 *     ..
00165 *     .. External Subroutines ..
00166       EXTERNAL           DGTTS2, XERBLA
00167 *     ..
00168 *     .. Intrinsic Functions ..
00169       INTRINSIC          MAX, MIN
00170 *     ..
00171 *     .. Executable Statements ..
00172 *
00173       INFO = 0
00174       NOTRAN = ( TRANS.EQ.'N' .OR. TRANS.EQ.'n' )
00175       IF( .NOT.NOTRAN .AND. .NOT.( TRANS.EQ.'T' .OR. TRANS.EQ.
00176      $    't' ) .AND. .NOT.( TRANS.EQ.'C' .OR. TRANS.EQ.'c' ) ) THEN
00177          INFO = -1
00178       ELSE IF( N.LT.0 ) THEN
00179          INFO = -2
00180       ELSE IF( NRHS.LT.0 ) THEN
00181          INFO = -3
00182       ELSE IF( LDB.LT.MAX( N, 1 ) ) THEN
00183          INFO = -10
00184       END IF
00185       IF( INFO.NE.0 ) THEN
00186          CALL XERBLA( 'DGTTRS', -INFO )
00187          RETURN
00188       END IF
00189 *
00190 *     Quick return if possible
00191 *
00192       IF( N.EQ.0 .OR. NRHS.EQ.0 )
00193      $   RETURN
00194 *
00195 *     Decode TRANS
00196 *
00197       IF( NOTRAN ) THEN
00198          ITRANS = 0
00199       ELSE
00200          ITRANS = 1
00201       END IF
00202 *
00203 *     Determine the number of right-hand sides to solve at a time.
00204 *
00205       IF( NRHS.EQ.1 ) THEN
00206          NB = 1
00207       ELSE
00208          NB = MAX( 1, ILAENV( 1, 'DGTTRS', TRANS, N, NRHS, -1, -1 ) )
00209       END IF
00210 *
00211       IF( NB.GE.NRHS ) THEN
00212          CALL DGTTS2( ITRANS, N, NRHS, DL, D, DU, DU2, IPIV, B, LDB )
00213       ELSE
00214          DO 10 J = 1, NRHS, NB
00215             JB = MIN( NRHS-J+1, NB )
00216             CALL DGTTS2( ITRANS, N, JB, DL, D, DU, DU2, IPIV, B( 1, J ),
00217      $                   LDB )
00218    10    CONTINUE
00219       END IF
00220 *
00221 *     End of DGTTRS
00222 *
00223       END
 All Files Functions