LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
dptts2.f
Go to the documentation of this file.
00001 *> \brief \b DPTTS2
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download DPTTS2 + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dptts2.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dptts2.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dptts2.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE DPTTS2( N, NRHS, D, E, B, LDB )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       INTEGER            LDB, N, NRHS
00025 *       ..
00026 *       .. Array Arguments ..
00027 *       DOUBLE PRECISION   B( LDB, * ), D( * ), E( * )
00028 *       ..
00029 *  
00030 *
00031 *> \par Purpose:
00032 *  =============
00033 *>
00034 *> \verbatim
00035 *>
00036 *> DPTTS2 solves a tridiagonal system of the form
00037 *>    A * X = B
00038 *> using the L*D*L**T factorization of A computed by DPTTRF.  D is a
00039 *> diagonal matrix specified in the vector D, L is a unit bidiagonal
00040 *> matrix whose subdiagonal is specified in the vector E, and X and B
00041 *> are N by NRHS matrices.
00042 *> \endverbatim
00043 *
00044 *  Arguments:
00045 *  ==========
00046 *
00047 *> \param[in] N
00048 *> \verbatim
00049 *>          N is INTEGER
00050 *>          The order of the tridiagonal matrix A.  N >= 0.
00051 *> \endverbatim
00052 *>
00053 *> \param[in] NRHS
00054 *> \verbatim
00055 *>          NRHS is INTEGER
00056 *>          The number of right hand sides, i.e., the number of columns
00057 *>          of the matrix B.  NRHS >= 0.
00058 *> \endverbatim
00059 *>
00060 *> \param[in] D
00061 *> \verbatim
00062 *>          D is DOUBLE PRECISION array, dimension (N)
00063 *>          The n diagonal elements of the diagonal matrix D from the
00064 *>          L*D*L**T factorization of A.
00065 *> \endverbatim
00066 *>
00067 *> \param[in] E
00068 *> \verbatim
00069 *>          E is DOUBLE PRECISION array, dimension (N-1)
00070 *>          The (n-1) subdiagonal elements of the unit bidiagonal factor
00071 *>          L from the L*D*L**T factorization of A.  E can also be regarded
00072 *>          as the superdiagonal of the unit bidiagonal factor U from the
00073 *>          factorization A = U**T*D*U.
00074 *> \endverbatim
00075 *>
00076 *> \param[in,out] B
00077 *> \verbatim
00078 *>          B is DOUBLE PRECISION array, dimension (LDB,NRHS)
00079 *>          On entry, the right hand side vectors B for the system of
00080 *>          linear equations.
00081 *>          On exit, the solution vectors, X.
00082 *> \endverbatim
00083 *>
00084 *> \param[in] LDB
00085 *> \verbatim
00086 *>          LDB is INTEGER
00087 *>          The leading dimension of the array B.  LDB >= max(1,N).
00088 *> \endverbatim
00089 *
00090 *  Authors:
00091 *  ========
00092 *
00093 *> \author Univ. of Tennessee 
00094 *> \author Univ. of California Berkeley 
00095 *> \author Univ. of Colorado Denver 
00096 *> \author NAG Ltd. 
00097 *
00098 *> \date November 2011
00099 *
00100 *> \ingroup doubleOTHERcomputational
00101 *
00102 *  =====================================================================
00103       SUBROUTINE DPTTS2( N, NRHS, D, E, B, LDB )
00104 *
00105 *  -- LAPACK computational routine (version 3.4.0) --
00106 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00107 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00108 *     November 2011
00109 *
00110 *     .. Scalar Arguments ..
00111       INTEGER            LDB, N, NRHS
00112 *     ..
00113 *     .. Array Arguments ..
00114       DOUBLE PRECISION   B( LDB, * ), D( * ), E( * )
00115 *     ..
00116 *
00117 *  =====================================================================
00118 *
00119 *     .. Local Scalars ..
00120       INTEGER            I, J
00121 *     ..
00122 *     .. External Subroutines ..
00123       EXTERNAL           DSCAL
00124 *     ..
00125 *     .. Executable Statements ..
00126 *
00127 *     Quick return if possible
00128 *
00129       IF( N.LE.1 ) THEN
00130          IF( N.EQ.1 )
00131      $      CALL DSCAL( NRHS, 1.D0 / D( 1 ), B, LDB )
00132          RETURN
00133       END IF
00134 *
00135 *     Solve A * X = B using the factorization A = L*D*L**T,
00136 *     overwriting each right hand side vector with its solution.
00137 *
00138       DO 30 J = 1, NRHS
00139 *
00140 *           Solve L * x = b.
00141 *
00142          DO 10 I = 2, N
00143             B( I, J ) = B( I, J ) - B( I-1, J )*E( I-1 )
00144    10    CONTINUE
00145 *
00146 *           Solve D * L**T * x = b.
00147 *
00148          B( N, J ) = B( N, J ) / D( N )
00149          DO 20 I = N - 1, 1, -1
00150             B( I, J ) = B( I, J ) / D( I ) - B( I+1, J )*E( I )
00151    20    CONTINUE
00152    30 CONTINUE
00153 *
00154       RETURN
00155 *
00156 *     End of DPTTS2
00157 *
00158       END
 All Files Functions