1 *> \brief <b> ZHPSV computes the solution to system of linear equations A * X = B for OTHER matrices</b>
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZHPSV + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zhpsv.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zhpsv.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zhpsv.f">
21 * SUBROUTINE ZHPSV( UPLO, N, NRHS, AP, IPIV, B, LDB, INFO )
23 * .. Scalar Arguments ..
25 * INTEGER INFO, LDB, N, NRHS
27 * .. Array Arguments ..
29 * COMPLEX*16 AP( * ), B( LDB, * )
38 *> ZHPSV computes the solution to a complex system of linear equations
40 *> where A is an N-by-N Hermitian matrix stored in packed format and X
41 *> and B are N-by-NRHS matrices.
43 *> The diagonal pivoting method is used to factor A as
44 *> A = U * D * U**H, if UPLO = 'U', or
45 *> A = L * D * L**H, if UPLO = 'L',
46 *> where U (or L) is a product of permutation and unit upper (lower)
47 *> triangular matrices, D is Hermitian and block diagonal with 1-by-1
48 *> and 2-by-2 diagonal blocks. The factored form of A is then used to
49 *> solve the system of equations A * X = B.
57 *> UPLO is CHARACTER*1
58 *> = 'U': Upper triangle of A is stored;
59 *> = 'L': Lower triangle of A is stored.
65 *> The number of linear equations, i.e., the order of the
72 *> The number of right hand sides, i.e., the number of columns
73 *> of the matrix B. NRHS >= 0.
78 *> AP is COMPLEX*16 array, dimension (N*(N+1)/2)
79 *> On entry, the upper or lower triangle of the Hermitian matrix
80 *> A, packed columnwise in a linear array. The j-th column of A
81 *> is stored in the array AP as follows:
82 *> if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
83 *> if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
84 *> See below for further details.
86 *> On exit, the block diagonal matrix D and the multipliers used
87 *> to obtain the factor U or L from the factorization
88 *> A = U*D*U**H or A = L*D*L**H as computed by ZHPTRF, stored as
89 *> a packed triangular matrix in the same storage format as A.
94 *> IPIV is INTEGER array, dimension (N)
95 *> Details of the interchanges and the block structure of D, as
96 *> determined by ZHPTRF. If IPIV(k) > 0, then rows and columns
97 *> k and IPIV(k) were interchanged, and D(k,k) is a 1-by-1
98 *> diagonal block. If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0,
99 *> then rows and columns k-1 and -IPIV(k) were interchanged and
100 *> D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If UPLO = 'L' and
101 *> IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and
102 *> -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2
108 *> B is COMPLEX*16 array, dimension (LDB,NRHS)
109 *> On entry, the N-by-NRHS right hand side matrix B.
110 *> On exit, if INFO = 0, the N-by-NRHS solution matrix X.
116 *> The leading dimension of the array B. LDB >= max(1,N).
122 *> = 0: successful exit
123 *> < 0: if INFO = -i, the i-th argument had an illegal value
124 *> > 0: if INFO = i, D(i,i) is exactly zero. The factorization
125 *> has been completed, but the block diagonal matrix D is
126 *> exactly singular, so the solution could not be
133 *> \author Univ. of Tennessee
134 *> \author Univ. of California Berkeley
135 *> \author Univ. of Colorado Denver
138 *> \date November 2011
140 *> \ingroup complex16OTHERsolve
142 *> \par Further Details:
143 * =====================
147 *> The packed storage scheme is illustrated by the following example
148 *> when N = 4, UPLO = 'U':
150 *> Two-dimensional storage of the Hermitian matrix A:
154 *> a33 a34 (aij = conjg(aji))
157 *> Packed storage of the upper triangle of A:
159 *> AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
162 * =====================================================================
163 SUBROUTINE ZHPSV( UPLO, N, NRHS, AP, IPIV, B, LDB, INFO )
165 * -- LAPACK driver routine (version 3.4.0) --
166 * -- LAPACK is a software package provided by Univ. of Tennessee, --
167 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
170 * .. Scalar Arguments ..
172 INTEGER INFO, LDB, N, NRHS
174 * .. Array Arguments ..
176 COMPLEX*16 AP( * ), B( LDB, * )
179 * =====================================================================
181 * .. External Functions ..
185 * .. External Subroutines ..
186 EXTERNAL XERBLA, ZHPTRF, ZHPTRS
188 * .. Intrinsic Functions ..
191 * .. Executable Statements ..
193 * Test the input parameters.
196 IF( .NOT.LSAME( UPLO, 'U' ) .AND. .NOT.LSAME( UPLO, 'L' ) ) THEN
198 ELSE IF( N.LT.0 ) THEN
200 ELSE IF( NRHS.LT.0 ) THEN
202 ELSE IF( LDB.LT.MAX( 1, N ) ) THEN
206 CALL XERBLA( 'ZHPSV ', -INFO )
210 * Compute the factorization A = U*D*U**H or A = L*D*L**H.
212 CALL ZHPTRF( UPLO, N, AP, IPIV, INFO )
215 * Solve the system A*X = B, overwriting B with X.
217 CALL ZHPTRS( UPLO, N, NRHS, AP, IPIV, B, LDB, INFO )