?hpsvx
?hpsvx
Uses the diagonal pivoting factorization to compute the solution to the system of linear equations with a Hermitian coefficient matrix A stored in packed format, and provides error bounds on the solution.
Syntax
lapack_int LAPACKE_chpsvx
(
int
matrix_layout
,
char
fact
,
char
uplo
,
lapack_int
n
,
lapack_int
nrhs
,
const lapack_complex_float*
ap
,
lapack_complex_float*
afp
,
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_zhpsvx
(
int
matrix_layout
,
char
fact
,
char
uplo
,
lapack_int
n
,
lapack_int
nrhs
,
const lapack_complex_double*
ap
,
lapack_complex_double*
afp
,
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 a n
-by-n
Hermitian matrix stored in packed format, 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
?hpsvx
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*UH, whereA=L*D*LHU(orL) is a product of permutation and unit upper (lower) triangular matrices, andDis a Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
- If somed= 0, so thati,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'afpandipivcontain the factored form ofA. Arraysap,afp, andipivare not modified.If, the matrixfact='N'Ais copied toafpand factored.
- uplo
- Must be'U'or'L'.Indicates whether the upper or lower triangular part ofAis stored and howAis factored:If, the arrayuplo='U'apstores the upper triangular part of the Hermitian matrixA, andAis factored as.U*D*UHIf, the arrayuplo='L'apstores the lower triangular part of the Hermitian matrixA, andAis 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
- ap,afp,b
- Arrays:ap(size max(1,,n*(n+1)/2)afp(size max(1,,n*(n+1)/2)bof size max(1,.ldb*nrhs) for column major layout and max(1,ldb*n) for row major layoutThe arrayapcontains the upper or lower triangle of the Hermitian matrixAin packed storage (see Matrix Storage Schemes).The arrayafpis an input argument if. It contains the block diagonal matrixfact='F'Dand the multipliers used to obtain the factorUorLfrom the factorizationorA=U*D*UHas computed byA=L*D*LH?hptrf, in the same storage format asA.The arraybcontains the matrixBwhose columns are the right-hand sides for the systems of equations.
- 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?hptrf.If, thenipiv[i-1] =k> 0dis a 1-by-1 block, and theiii-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/columnsiandi+1, andi-th row and column ofAwas interchanged with them-th row and column.Ifanduplo='L'ipiv[i-1] =ipiv[i] = -m< 0, thenDhas a 2-by-2 block in rows/columnsiandi+1, and (i+1)-th row and column ofAwas 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.
- afp,ipiv
- These arrays are output arguments if. See the description offact='N'afp,ipivinInput Argumentssection.
- rcond
- An estimate of the reciprocal condition number of the matrixA. Ifrcondis less than the machine precision (in particular, ifrcond= 0), the matrix is singular to working precision. This condition is indicated by a return code ofinfo> 0.
- ferr
- Array, size at leastmax(1,. Contains the estimated forward error bound for each solution vectornrhs)(thexjj-th column of the solution matrixX). Ifxtrueis the true solution corresponding to,xjis an estimated upper bound for the magnitude of the largest element in (ferr[j-1]-xjxtrue) divided by the magnitude of the largest element in. The estimate is as reliable as the estimate forxjrcond, and is almost always a slight overestimate of the true error.
- berr
- Array, size at leastmax(1,. Contains the component-wise relative backward error for each solution vectornrhs), that is, the smallest relative change in any element ofxjAorBthat makesan exact solution.xj
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.