|
|
◆ zhpsv()
| void zhpsv |
( |
char |
uplo, |
|
|
int |
n, |
|
|
int |
nrhs, |
|
|
doublecomplex |
ap[], |
|
|
int |
ipiv[], |
|
|
int |
ldb, |
|
|
doublecomplex |
b[], |
|
|
int * |
info |
|
) |
| |
(Simple driver) Solution to system of linear equations AX = B for a Hermitian matrix in packed form
- Purpose
- This routine computes the solution to a complex system of linear equations where A is an n x n Hermitian matrix stored in packed form, and X and B are n x nrhs matrices.
The diagonal pivoting method is used to factor A as A = U * D * U^H, if uplo = 'U', or
A = L * D * L^H, if uplo = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is Hermitian and block diagonal with 1 x 1 and 2 x 2 diagonal blocks. The factored form of A is then used to solve the system of equations A * X = B.
- Parameters
-
| [in] | uplo | = 'U': Upper triangle of A is stored.
= 'L': Lower triangle of A is stored. |
| [in] | n | Number of linear equations, i.e., order of the matrix A. (n >= 0) (If n = 0, returns without computation) |
| [in] | nrhs | Number of right hand sides, i.e., number of columns of the matrix B. (nrhs >= 0) (if nrhs = 0, returns without computation) |
| [in,out] | ap[] | Array ap[lap] (lap >= n(n + 1)/2)
[in] n x n Hermitian matrix A in packed form. The upper or lower part is to be stored in accordance with uplo.
[out] The block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U^H or A = L*D*L^H as computed by zhptrf, stored as a packed triangular matrix in the same storage format as A. |
| [out] | ipiv[] | Array ipiv[lipiv] (lipiv >= n)
Details of the interchanges and the block structure of D, as determined by zhptrf. If ipiv[k-1] > 0, then rows and columns k and ipiv[k-1] were interchanged, and k-th diagonal of D is a 1 x 1 diagonal block.
If uplo = 'U' and ipiv[k-1] = ipiv[k-2] < 0, then rows and columns k-1 and -ipiv[k-1] were interchanged and (k-1)-th diagonal of D is a 2 x 2 diagonal block.
If uplo = 'L' and ipiv[k-1] = ipiv[k] < 0, then rows and columns k+1 and -ipiv[k-1] were interchanged and k-th diagonal of D is a 2 x 2 diagonal block. |
| [in] | ldb | Leading dimension of the two dimensional array b[][]. (ldb >= max(1, n)) |
| [in,out] | b[][] | Array b[lb][ldb] (lb >= nrhs)
[in] n x nrhs right hand side matrix B.
[out] If info = 0, n x nrhs solution matrix X. |
| [out] | info | = 0: Successful exit
= -1: The argument uplo had an illegal value (uplo != 'U' nor 'L')
= -2: The argument n had an illegal value (n < 0)
= -3: The argument nrhs had an illegal value (nrhs < 0)
= -6: The argument ldb had an illegal value (ldb < max(1, n))
= i > 0: The i-th element of the factor D is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution could not be computed. |
- Reference
- LAPACK
|