|
|
◆ zcposv()
| void zcposv |
( |
char |
uplo, |
|
|
int |
n, |
|
|
int |
nrhs, |
|
|
int |
lda, |
|
|
doublecomplex |
a[], |
|
|
int |
ldb, |
|
|
doublecomplex |
b[], |
|
|
int |
ldx, |
|
|
doublecomplex |
x[], |
|
|
doublecomplex |
work[], |
|
|
floatcomplex |
swork[], |
|
|
double |
rwork[], |
|
|
int * |
iter, |
|
|
int * |
info |
|
) |
| |
(Simple driver) Solution to system of linear equations AX = B for a Hermitian positive definite matrix (mixed precision with iterative refinement)
- Purpose
- This routine computes the solution to a complex system of linear equations where A is an n x n Hermitian positive definite matrix and X and B are n x nrhs matrices.
zcposv first attempts to factorize the matrix in single precision and use this factorization within an iterative refinement procedure to produce a solution with double precision normwise backward error quality (see below). If the approach fails the method switches to a double precision factorization and solve.
The iterative refinement is not going to be a winning strategy if the ratio single precision performance over double precision performance is too small. A reasonable strategy should take the number of right-hand sides and the size of the matrix into account. Up to now, we always try iterative refinement.
The iterative refinement process is stopped if
iter > itermax
or for all the rhs we have:
rnrm < sqrt(n)*xnrm*anrm*eps*bwdmax
where
iter is the number of the current iteration in the iterative refinement process
rnrm is the infinity-norm of the residual
xnrm is the infinity-norm of the solution
anrm is the infinity-operator-norm of the matrix A
eps is the machine epsilon returned by dlamch('E')
The value itermax and bwdmax are fixed to 30 and 1.0D+00 respectively.
- 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) |
| [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 positove definite matrix A. The upper or lower triangular part is to be referenced in accordance with uplo.
[out] If iterative refinement has been successfully used (info = 0 and iter >= 0, see description below), then a[][] is unchanged. If double precision factorization has been used (info = 0 and iter < 0, see description below), then the array a[][] contains the factor U or L from the Cholesky factorization A = U^H*U or A = L*L^H. |
| [in] | ldb | Leading dimension of the two dimensional array b[][]. (ldb >= max(1, n)) |
| [in] | b[][] | Array b[lb][ldb] (lb >= nrhs)
n x nrhs right hand side matrix B. |
| [in] | ldx | Leading dimension of the two dimensional array x[][]. (ldx >= max(1, n)) |
| [out] | x[][] | Array x[lx][ldx] (lx >= nrhs)
If info = 0, n x nrhs solution matrix X. |
| [out] | work[] | Array work[lwork] (lwork >= n*nrhs)
This array is used to hold the residual vectors. |
| [out] | swork[] | Array swork[lswork] (lswork >= n*(n + nrhs))
This array is used to use the single precision matrix and the right-hand sides or solutions in single precision. |
| [out] | rwork[] | Array rwork[lrwork] (lrwork >= n)
Work array. |
| [out] | iter | < 0: Iterative refinement has failed, double precision factorization has been performed.
= -1: The routine fell back to full precision for implementation- or machine-specific reasons.
= -2: Narrowing the precision induced an overflow, the routine fell back to full precision.
= -3: Failure of cpotrf.
= -31: Stop the iterative refinement after the 30th iterations.
> 0: Iterative refinement has been successfully used. Returns the number of iterations. |
| [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))
= -6: The argument ldb had an illegal value (ldb < max(1, n))
= -8: The argument ldx had an illegal value (ldx < max(1, n))
= i > 0: The leading minor of order i of (double precision) A is not positive definite, so the factorization could not be completed, and the solution has not been computed. |
- Reference
- LAPACK
|