?hesvx
?hesvx
Uses the diagonal pivoting factorization to compute the solution to the complex system of linear equations with a Hermitian coefficient matrix A, and provides error bounds on the solution.
Syntax
lapack_int LAPACKE_chesvx
(
int
matrix_layout
,
char
fact
,
char
uplo
,
lapack_int
n
,
lapack_int
nrhs
,
const lapack_complex_float*
a
,
lapack_int
lda
,
lapack_complex_float*
af
,
lapack_int
ldaf
,
lapack_int*
ipiv
,
const lapack_complex_float*
b
,
lapack_int
ldb
,
lapack_complex_float*
x
,
lapack_int
ldx
,
float*
rcond
,
float*
ferr
,
float*
berr
);
lapack_int LAPACKE_zhesvx
(
int
matrix_layout
,
char
fact
,
char
uplo
,
lapack_int
n
,
lapack_int
nrhs
,
const lapack_complex_double*
a
,
lapack_int
lda
,
lapack_complex_double*
af
,
lapack_int
ldaf
,
lapack_int*
ipiv
,
const lapack_complex_double*
b
,
lapack_int
ldb
,
lapack_complex_double*
x
,
lapack_int
ldx
,
double*
rcond
,
double*
ferr
,
double*
berr
);
Include Files
- mkl.h
Description
The routine uses the diagonal pivoting factorization to compute the solution to a complex system of linear equations , where
A*X
= B
A
is an n
-by-n
Hermitian matrix, the columns of matrix B
are individual right-hand sides, and the columns of X
are the corresponding solutions.Error bounds on the solution and a condition estimate are also provided.
The routine
?hesvx
performs the following steps:- If, the diagonal pivoting method is used to factor the matrixfact='N'A. The form of the factorization isorA=U*D*UHA =, whereL*D*LHU(orL) is a product of permutation and unit upper (lower) triangular matrices, andDis Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
- If some= 0, so thatdi,iDis exactly singular, then the routine returns with. Otherwise, the factored form ofinfo=iAis used to estimate the condition number of the matrixA. If the reciprocal of the condition number is less than machine precision,is returned as a warning, but the routine still goes on to solve forinfo=n+1Xand compute error bounds as described below.
- The system of equations is solved forXusing the factored form ofA.
- Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- fact
- Must be'F'or'N'.Specifies whether or not the factored form of the matrixAhas been supplied on entry.If: on entry,fact='F'afandipivcontain the factored form ofA. Arraysa,af, andipivare not modified.If, the matrixfact='N'Ais copied toafand factored.
- uplo
- Must be'U'or'L'.Indicates whether the upper or lower triangular part ofAis stored and howAis factored:If, the arrayuplo='U'astores the upper triangular part of the Hermitian matrixA, andAis factored as.U*D*UHIf, the arrayuplo='L'astores the lower triangular part of the Hermitian matrixA;Ais factored as.L*D*LH
- n
- The order of matrixA;n≥0.
- nrhs
- The number of right-hand sides, the number of columns in.B;nrhs≥0
- a,af,b
- Arrays:a(size max(1,,lda*n))af(size max(1,,ldaf*n))bof size max(1,.ldb*nrhs) for column major layout and max(1,ldb*n) for row major layoutThe arrayacontains the upper or the lower triangular part of the Hermitian matrixA(seeuplo).The arrayafis an input argument if. It contains he block diagonal matrixfact='F'Dand the multipliers used to obtain the factorUorLfrom the factorizationorA=U*D*UHas computed byA=L*D*LH?hetrf.The arraybcontains the matrixBwhose columns are the right-hand sides for the systems of equations.
- lda
- The leading dimension ofa;.lda≥max(1,n)
- ldaf
- The leading dimension ofaf;.ldaf≥max(1,n)
- ldb
- The leading dimension ofb;.ldb≥max(1,n) for column major layout andldb≥nrhsfor row major layout
- ipiv
- Array, size at leastmax(1,. The arrayn)ipivis an input argument if. It contains details of the interchanges and the block structure offact='F'D, as determined by?hetrf.If, thenipiv[i-1] =k> 0is a 1-by-1 diagonal block, and thediii-th row and column ofAwas interchanged with thek-th row and column.Ifanduplo='U'ipiv[i] =ipiv[i-1] = -m< 0, thenDhas a 2-by-2 block in rows/columnsiand, andi+1(-th row and column ofi)Awas interchanged with them-th row and column.Ifanduplo='L'ipiv[i] =ipiv[i-1] = -m< 0, thenDhas a 2-by-2 block in rows/columnsiand, andi+1(th row and column ofi+1)-Awas interchanged with them-th row and column.
- ldx
- The leading dimension of the output arrayx;.ldx≥max(1,n) for column major layout andldx≥nrhsfor row major layout
Output Parameters
- x
- Array, sizemax(1,.ldx*nrhs) for column major layout and max(1,ldx*n) for row major layoutIforinfo= 0, the arrayinfo=n+1xcontains the solution matrixXto the system of equations.
- af,ipiv
- These arrays are output arguments if. See the description offact='N'af,ipivinInput Argumentssection.
- rcond
- An estimate of the reciprocal condition number of the matrixA. Ifrcondis less than the machine precision (in particular, if, the matrix is singular to working precision. This condition is indicated by a return code ofrcond= 0)info> 0.
- ferr
- Array, size at leastmax(1,.nrhs)Contains the estimated forward error bound for each solution vectorThe estimate is as reliable as the estimate forx(thejj-th column of the solution matrixX). Ifxtrueis the true solution corresponding tox,jis an estimated upper bound for the magnitude of the largest element in (ferr[j-1]x) -jxtrue) divided by the magnitude of the largest element inx.jrcon, and is almost always a slight overestimate of the true error.
- berr
- Array, size at leastmax(1,.nrhs)Contains the component-wise relative backward error for each solution vectorx, that is, the smallest relative change in any element ofjAorBthat makesxan exact solution.j
Return Values
This function returns a value
info
.If , the execution is successful.
info
= 0If , parameter
info
= -i
i
had an illegal value.If , and , then is exactly zero. The factorization has been completed, but the block diagonal matrix
info
= i
i
≤
n
d
i
i
D
is exactly singular, so the solution and error bounds could not be computed; rcond
= 0 is returned.If , and
info
= i
i
= n
+ 1, then D
is nonsingular, but rcond
is less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value of rcond
would suggest.