|
|
◆ zhesv()
| void zhesv |
( |
char |
uplo, |
|
|
int |
n, |
|
|
int |
nrhs, |
|
|
int |
lda, |
|
|
doublecomplex |
a[], |
|
|
int |
ipiv[], |
|
|
int |
ldb, |
|
|
doublecomplex |
b[], |
|
|
doublecomplex |
work[], |
|
|
int |
lwork, |
|
|
int * |
info |
|
) |
| |
(Simple driver) Solution to system of linear equations AX = B for a Hermitian matrix
- Purpose
- This routine computes the solution to a complex system of linear equations where A is an n x n Hermitian matrix 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] | lda | Leading dimension of the two dimensional array a[][]. (lda >= max(1, n)) |
| [in,out] | a[][] | Array a[la][lda] (la >= n)
[in] n x n Hermitian matrix A. The upper or lower triangular part is to be referenced in accordance with uplo.
[out] If info = 0, 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 zhetrf. |
| [out] | ipiv[] | Array ipiv[lipiv] (lipiv >= n)
Details of the interchanges and the block structure of D, as determined by zhetrf.
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] | work[] | Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork. |
| [in] | lwork | The length of work[] (lwork >= 1)
For best performance, lwork >= max(1, n*nb), where nb is the optimal blocksize for zhetrf.
For lwork < n, the factorization will be done with Level 2 BLAS. For lwork >= n, the factorization will be done with Level 3 BLAS.
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work array and returns the value in work[0]. |
| [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)
= -4: The argument lda had an illegal value (lda < max(1, n))
= -7: The argument ldb had an illegal value (ldb < max(1, n))
= -10: The argument lwork had an illegal value (lwork too small)
= i > 0: The i-th element of 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
|