LAPACK  3.4.1
LAPACK: Linear Algebra PACKage
zppsv.f
Go to the documentation of this file.
00001 *> \brief <b> ZPPSV computes the solution to system of linear equations A * X = B for OTHER matrices</b>
00002 *
00003 *  =========== DOCUMENTATION ===========
00004 *
00005 * Online html documentation available at 
00006 *            http://www.netlib.org/lapack/explore-html/ 
00007 *
00008 *> \htmlonly
00009 *> Download ZPPSV + dependencies 
00010 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zppsv.f"> 
00011 *> [TGZ]</a> 
00012 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zppsv.f"> 
00013 *> [ZIP]</a> 
00014 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zppsv.f"> 
00015 *> [TXT]</a>
00016 *> \endhtmlonly 
00017 *
00018 *  Definition:
00019 *  ===========
00020 *
00021 *       SUBROUTINE ZPPSV( 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 *       COMPLEX*16         AP( * ), B( LDB, * )
00029 *       ..
00030 *  
00031 *
00032 *> \par Purpose:
00033 *  =============
00034 *>
00035 *> \verbatim
00036 *>
00037 *> ZPPSV computes the solution to a complex system of linear equations
00038 *>    A * X = B,
00039 *> where A is an N-by-N Hermitian positive definite matrix stored in
00040 *> packed format and X and B are N-by-NRHS matrices.
00041 *>
00042 *> The Cholesky decomposition is used to factor A as
00043 *>    A = U**H * U,  if UPLO = 'U', or
00044 *>    A = L * L**H,  if UPLO = 'L',
00045 *> where U is an upper triangular matrix and L is a lower triangular
00046 *> matrix.  The factored form of A is then used to solve the system of
00047 *> equations A * X = B.
00048 *> \endverbatim
00049 *
00050 *  Arguments:
00051 *  ==========
00052 *
00053 *> \param[in] UPLO
00054 *> \verbatim
00055 *>          UPLO is CHARACTER*1
00056 *>          = 'U':  Upper triangle of A is stored;
00057 *>          = 'L':  Lower triangle of A is stored.
00058 *> \endverbatim
00059 *>
00060 *> \param[in] N
00061 *> \verbatim
00062 *>          N is INTEGER
00063 *>          The number of linear equations, i.e., the order of the
00064 *>          matrix A.  N >= 0.
00065 *> \endverbatim
00066 *>
00067 *> \param[in] NRHS
00068 *> \verbatim
00069 *>          NRHS is INTEGER
00070 *>          The number of right hand sides, i.e., the number of columns
00071 *>          of the matrix B.  NRHS >= 0.
00072 *> \endverbatim
00073 *>
00074 *> \param[in,out] AP
00075 *> \verbatim
00076 *>          AP is COMPLEX*16 array, dimension (N*(N+1)/2)
00077 *>          On entry, the upper or lower triangle of the Hermitian matrix
00078 *>          A, packed columnwise in a linear array.  The j-th column of A
00079 *>          is stored in the array AP as follows:
00080 *>          if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
00081 *>          if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
00082 *>          See below for further details.
00083 *>
00084 *>          On exit, if INFO = 0, the factor U or L from the Cholesky
00085 *>          factorization A = U**H*U or A = L*L**H, in the same storage
00086 *>          format as A.
00087 *> \endverbatim
00088 *>
00089 *> \param[in,out] B
00090 *> \verbatim
00091 *>          B is COMPLEX*16 array, dimension (LDB,NRHS)
00092 *>          On entry, the N-by-NRHS right hand side matrix B.
00093 *>          On exit, if INFO = 0, the N-by-NRHS solution matrix 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 = -i, the i-th argument had an illegal value
00107 *>          > 0:  if INFO = i, the leading minor of order i of A is not
00108 *>                positive definite, so the factorization could not be
00109 *>                completed, and the solution has not been computed.
00110 *> \endverbatim
00111 *
00112 *  Authors:
00113 *  ========
00114 *
00115 *> \author Univ. of Tennessee 
00116 *> \author Univ. of California Berkeley 
00117 *> \author Univ. of Colorado Denver 
00118 *> \author NAG Ltd. 
00119 *
00120 *> \date November 2011
00121 *
00122 *> \ingroup complex16OTHERsolve
00123 *
00124 *> \par Further Details:
00125 *  =====================
00126 *>
00127 *> \verbatim
00128 *>
00129 *>  The packed storage scheme is illustrated by the following example
00130 *>  when N = 4, UPLO = 'U':
00131 *>
00132 *>  Two-dimensional storage of the Hermitian matrix A:
00133 *>
00134 *>     a11 a12 a13 a14
00135 *>         a22 a23 a24
00136 *>             a33 a34     (aij = conjg(aji))
00137 *>                 a44
00138 *>
00139 *>  Packed storage of the upper triangle of A:
00140 *>
00141 *>  AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
00142 *> \endverbatim
00143 *>
00144 *  =====================================================================
00145       SUBROUTINE ZPPSV( UPLO, N, NRHS, AP, B, LDB, INFO )
00146 *
00147 *  -- LAPACK driver routine (version 3.4.0) --
00148 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00149 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00150 *     November 2011
00151 *
00152 *     .. Scalar Arguments ..
00153       CHARACTER          UPLO
00154       INTEGER            INFO, LDB, N, NRHS
00155 *     ..
00156 *     .. Array Arguments ..
00157       COMPLEX*16         AP( * ), B( LDB, * )
00158 *     ..
00159 *
00160 *  =====================================================================
00161 *
00162 *     .. External Functions ..
00163       LOGICAL            LSAME
00164       EXTERNAL           LSAME
00165 *     ..
00166 *     .. External Subroutines ..
00167       EXTERNAL           XERBLA, ZPPTRF, ZPPTRS
00168 *     ..
00169 *     .. Intrinsic Functions ..
00170       INTRINSIC          MAX
00171 *     ..
00172 *     .. Executable Statements ..
00173 *
00174 *     Test the input parameters.
00175 *
00176       INFO = 0
00177       IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
00178          INFO = -1
00179       ELSE IF( N.LT.0 ) THEN
00180          INFO = -2
00181       ELSE IF( NRHS.LT.0 ) THEN
00182          INFO = -3
00183       ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
00184          INFO = -6
00185       END IF
00186       IF( INFO.NE.0 ) THEN
00187          CALL XERBLA( 'ZPPSV ', -INFO )
00188          RETURN
00189       END IF
00190 *
00191 *     Compute the Cholesky factorization A = U**H *U or A = L*L**H.
00192 *
00193       CALL ZPPTRF( UPLO, N, AP, INFO )
00194       IF( INFO.EQ.0 ) THEN
00195 *
00196 *        Solve the system A*X = B, overwriting B with X.
00197 *
00198          CALL ZPPTRS( UPLO, N, NRHS, AP, B, LDB, INFO )
00199 *
00200       END IF
00201       RETURN
00202 *
00203 *     End of ZPPSV
00204 *
00205       END
 All Files Functions