LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
dpptrs.f
Go to the documentation of this file.
00001 *> \brief \b DPPTRS
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download DPPTRS + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dpptrs.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dpptrs.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dpptrs.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE DPPTRS( UPLO, N, NRHS, AP, B, LDB, INFO )
00022 * 
00023 *       .. Scalar Arguments ..
00024 *       CHARACTER          UPLO
00025 *       INTEGER            INFO, LDB, N, NRHS
00026 *       ..
00027 *       .. Array Arguments ..
00028 *       DOUBLE PRECISION   AP( * ), B( LDB, * )
00029 *       ..
00030 *  
00031 *
00032 *> \par Purpose:
00033 *  =============
00034 *>
00035 *> \verbatim
00036 *>
00037 *> DPPTRS solves a system of linear equations A*X = B with a symmetric
00038 *> positive definite matrix A in packed storage using the Cholesky
00039 *> factorization A = U**T*U or A = L*L**T computed by DPPTRF.
00040 *> \endverbatim
00041 *
00042 *  Arguments:
00043 *  ==========
00044 *
00045 *> \param[in] UPLO
00046 *> \verbatim
00047 *>          UPLO is CHARACTER*1
00048 *>          = 'U':  Upper triangle of A is stored;
00049 *>          = 'L':  Lower triangle of A is stored.
00050 *> \endverbatim
00051 *>
00052 *> \param[in] N
00053 *> \verbatim
00054 *>          N is INTEGER
00055 *>          The order of the matrix A.  N >= 0.
00056 *> \endverbatim
00057 *>
00058 *> \param[in] NRHS
00059 *> \verbatim
00060 *>          NRHS is INTEGER
00061 *>          The number of right hand sides, i.e., the number of columns
00062 *>          of the matrix B.  NRHS >= 0.
00063 *> \endverbatim
00064 *>
00065 *> \param[in] AP
00066 *> \verbatim
00067 *>          AP is DOUBLE PRECISION array, dimension (N*(N+1)/2)
00068 *>          The triangular factor U or L from the Cholesky factorization
00069 *>          A = U**T*U or A = L*L**T, packed columnwise in a linear
00070 *>          array.  The j-th column of U or L is stored in the array AP
00071 *>          as follows:
00072 *>          if UPLO = 'U', AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;
00073 *>          if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.
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 matrix B.
00080 *>          On exit, the solution matrix X.
00081 *> \endverbatim
00082 *>
00083 *> \param[in] LDB
00084 *> \verbatim
00085 *>          LDB is INTEGER
00086 *>          The leading dimension of the array B.  LDB >= max(1,N).
00087 *> \endverbatim
00088 *>
00089 *> \param[out] INFO
00090 *> \verbatim
00091 *>          INFO is INTEGER
00092 *>          = 0:  successful exit
00093 *>          < 0:  if INFO = -i, the i-th argument had an illegal value
00094 *> \endverbatim
00095 *
00096 *  Authors:
00097 *  ========
00098 *
00099 *> \author Univ. of Tennessee 
00100 *> \author Univ. of California Berkeley 
00101 *> \author Univ. of Colorado Denver 
00102 *> \author NAG Ltd. 
00103 *
00104 *> \date November 2011
00105 *
00106 *> \ingroup doubleOTHERcomputational
00107 *
00108 *  =====================================================================
00109       SUBROUTINE DPPTRS( UPLO, N, NRHS, AP, B, LDB, INFO )
00110 *
00111 *  -- LAPACK computational routine (version 3.4.0) --
00112 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00113 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00114 *     November 2011
00115 *
00116 *     .. Scalar Arguments ..
00117       CHARACTER          UPLO
00118       INTEGER            INFO, LDB, N, NRHS
00119 *     ..
00120 *     .. Array Arguments ..
00121       DOUBLE PRECISION   AP( * ), B( LDB, * )
00122 *     ..
00123 *
00124 *  =====================================================================
00125 *
00126 *     .. Local Scalars ..
00127       LOGICAL            UPPER
00128       INTEGER            I
00129 *     ..
00130 *     .. External Functions ..
00131       LOGICAL            LSAME
00132       EXTERNAL           LSAME
00133 *     ..
00134 *     .. External Subroutines ..
00135       EXTERNAL           DTPSV, XERBLA
00136 *     ..
00137 *     .. Intrinsic Functions ..
00138       INTRINSIC          MAX
00139 *     ..
00140 *     .. Executable Statements ..
00141 *
00142 *     Test the input parameters.
00143 *
00144       INFO = 0
00145       UPPER = LSAME( UPLO, 'U' )
00146       IF( .NOT.UPPER .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00147          INFO = -1
00148       ELSE IF( N.LT.0 ) THEN
00149          INFO = -2
00150       ELSE IF( NRHS.LT.0 ) THEN
00151          INFO = -3
00152       ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
00153          INFO = -6
00154       END IF
00155       IF( INFO.NE.0 ) THEN
00156          CALL XERBLA( 'DPPTRS', -INFO )
00157          RETURN
00158       END IF
00159 *
00160 *     Quick return if possible
00161 *
00162       IF( N.EQ.0 .OR. NRHS.EQ.0 )
00163      $   RETURN
00164 *
00165       IF( UPPER ) THEN
00166 *
00167 *        Solve A*X = B where A = U**T * U.
00168 *
00169          DO 10 I = 1, NRHS
00170 *
00171 *           Solve U**T *X = B, overwriting B with X.
00172 *
00173             CALL DTPSV( 'Upper', 'Transpose', 'Non-unit', N, AP,
00174      $                  B( 1, I ), 1 )
00175 *
00176 *           Solve U*X = B, overwriting B with X.
00177 *
00178             CALL DTPSV( 'Upper', 'No transpose', 'Non-unit', N, AP,
00179      $                  B( 1, I ), 1 )
00180    10    CONTINUE
00181       ELSE
00182 *
00183 *        Solve A*X = B where A = L * L**T.
00184 *
00185          DO 20 I = 1, NRHS
00186 *
00187 *           Solve L*Y = B, overwriting B with X.
00188 *
00189             CALL DTPSV( 'Lower', 'No transpose', 'Non-unit', N, AP,
00190      $                  B( 1, I ), 1 )
00191 *
00192 *           Solve L**T *X = Y, overwriting B with X.
00193 *
00194             CALL DTPSV( 'Lower', 'Transpose', 'Non-unit', N, AP,
00195      $                  B( 1, I ), 1 )
00196    20    CONTINUE
00197       END IF
00198 *
00199       RETURN
00200 *
00201 *     End of DPPTRS
00202 *
00203       END
 All Files Functions