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