hpsvx#
Functions
-
void chpsvx(const char *fact, const char *uplo, const INT n, const INT nrhs, const c64 *restrict AP, c64 *restrict AFP, INT *restrict ipiv, const c64 *restrict B, const INT ldb, c64 *restrict X, const INT ldx, f32 *rcond, f32 *restrict ferr, f32 *restrict berr, c64 *restrict work, f32 *restrict rwork, INT *info)#
CHPSVX uses the diagonal pivoting factorization A = U*D*U**H or A = L*D*L**H to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian matrix stored in packed format and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided.
The following steps are performed:
If
fact='N', the diagonal pivoting method is used to factor A asA = 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-by-1 and 2-by-2 diagonal blocks.
If some D(i,i)=0, so that D is exactly singular, then the routine returns with
info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision,info=n+1is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.The system of equations is solved for X using the factored form of A.
Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
- Further Details:
The packed storage scheme is illustrated by the following example when
n=4,uplo='U':Two-dimensional storage of the Hermitian matrix A:
a00 a01 a02 a03 a11 a12 a13 a22 a23 (aij = conjg(aji)) a33Packed storage of the upper triangle of A:
AP = [ a00, a01, a11, a02, a12, a22, a03, a13, a23, a33 ]
Parameters
infact'F': On entry, AFP and IPIV contain the factored form of A. AP, AFP and IPIV will not be modified.'N': The matrix A will be copied to AFP and factored.
inuplo'U': Upper triangle of A is stored'L': Lower triangle of A is stored
innThe number of linear equations, i.e., the order of the matrix A.
n>=0.innrhsThe number of right hand sides.
nrhs>=0.inAPArray of dimension
n*(n+1)/2. The upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows: ifuplo='U',AP[i + j*(j+1)/2] = A(i,j)for0<=i<=j; ifuplo='L',AP[i + j*(2*n-j-1)/2] = A(i,j)forj<=i<=n-1. See below for further details.inoutAFPArray of dimension
n*(n+1)/2. Iffact='F', then AFP is an input argument and on entry contains 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 bychptrf, stored as a packed triangular matrix in the same storage format as A. Iffact='N', then AFP is an output argument and on exit contains the block diagonal matrix D and the multipliers used to obtain the factor U or L.inoutipivArray of dimension
n. Pivot indices (0-based). Iffact='F', then ipiv is an input argument and on entry contains details of the interchanges and the block structure of D, as determined bychptrf. Ifipiv[k]>=0, then rows and columnskandipiv[k]were interchanged andD(k,k)is a 1-by-1 diagonal block. Ifuplo='U'andipiv[k]=ipiv[k-1]<0, then rows and columnsk-1and-ipiv[k]-1were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. Ifuplo='L'andipiv[k]=ipiv[k+1]<0, then rows and columnsk+1and-ipiv[k]-1were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block. Iffact='N', then ipiv is an output argument and on exit contains details of the interchanges and the block structure of D, as determined bychptrf.inBArray of dimension
(ldb,nrhs). The n-by-nrhs right hand side matrix B.inldbThe leading dimension of the array B.
ldb>=max(1,n).outXArray of dimension
(ldx,nrhs). Ifinfo=0orinfo=n+1, the n-by-nrhs solution matrix X.inldxThe leading dimension of the array X.
ldx>=max(1,n).outrcondThe estimate of the reciprocal condition number of the matrix A. If
rcondis 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.outferrArray of dimension
nrhs. The estimated forward error bound for each solution vector X(j).outberrArray of dimension
nrhs. The componentwise relative backward error of each solution vector X(j).outworkArray of dimension
2*n.outrworkArray of dimension
n.outinfoinfo=0: successful exitinfo<0: ifinfo=-i, the i-th argument had an illegal valueinfo>0: ifinfo=i, andi<=n,D(i,i)is exactly zero. The factorization has been completed but D is exactly singular, so the solution and error bounds could not be computed.rcond=0is returned.info=n+1: D is nonsingular, butrcondis less than machine precision, meaning that the matrix is singular to working precision.
void chpsvx(
const char* fact,
const char* uplo,
const INT n,
const INT nrhs,
const c64* restrict AP,
c64* restrict AFP,
INT* restrict ipiv,
const c64* restrict B,
const INT ldb,
c64* restrict X,
const INT ldx,
f32* rcond,
f32* restrict ferr,
f32* restrict berr,
c64* restrict work,
f32* restrict rwork,
INT* info
);
Functions
-
void zhpsvx(const char *fact, const char *uplo, const INT n, const INT nrhs, const c128 *restrict AP, c128 *restrict AFP, INT *restrict ipiv, const c128 *restrict B, const INT ldb, c128 *restrict X, const INT ldx, f64 *rcond, f64 *restrict ferr, f64 *restrict berr, c128 *restrict work, f64 *restrict rwork, INT *info)#
ZHPSVX uses the diagonal pivoting factorization A = U*D*U**H or A = L*D*L**H to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian matrix stored in packed format and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided.
The following steps are performed:
If
fact='N', the diagonal pivoting method is used to factor A asA = 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-by-1 and 2-by-2 diagonal blocks.
If some D(i,i)=0, so that D is exactly singular, then the routine returns with
info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision,info=n+1is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.The system of equations is solved for X using the factored form of A.
Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
- Further Details:
The packed storage scheme is illustrated by the following example when
n=4,uplo='U':Two-dimensional storage of the Hermitian matrix A:
a00 a01 a02 a03 a11 a12 a13 a22 a23 (aij = conjg(aji)) a33Packed storage of the upper triangle of A:
AP = [ a00, a01, a11, a02, a12, a22, a03, a13, a23, a33 ]
Parameters
infact'F': On entry, AFP and IPIV contain the factored form of A. AP, AFP and IPIV will not be modified.'N': The matrix A will be copied to AFP and factored.
inuplo'U': Upper triangle of A is stored'L': Lower triangle of A is stored
innThe number of linear equations, i.e., the order of the matrix A.
n>=0.innrhsThe number of right hand sides.
nrhs>=0.inAPArray of dimension
n*(n+1)/2. The upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows: ifuplo='U',AP[i + j*(j+1)/2] = A(i,j)for0<=i<=j; ifuplo='L',AP[i + j*(2*n-j-1)/2] = A(i,j)forj<=i<=n-1. See below for further details.inoutAFPArray of dimension
n*(n+1)/2. Iffact='F', then AFP is an input argument and on entry contains 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 byzhptrf, stored as a packed triangular matrix in the same storage format as A. Iffact='N', then AFP is an output argument and on exit contains the block diagonal matrix D and the multipliers used to obtain the factor U or L.inoutipivArray of dimension
n. Pivot indices (0-based). Iffact='F', then ipiv is an input argument and on entry contains details of the interchanges and the block structure of D, as determined byzhptrf. Ifipiv[k]>=0, then rows and columnskandipiv[k]were interchanged andD(k,k)is a 1-by-1 diagonal block. Ifuplo='U'andipiv[k]=ipiv[k-1]<0, then rows and columnsk-1and-ipiv[k]-1were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. Ifuplo='L'andipiv[k]=ipiv[k+1]<0, then rows and columnsk+1and-ipiv[k]-1were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block. Iffact='N', then ipiv is an output argument and on exit contains details of the interchanges and the block structure of D, as determined byzhptrf.inBArray of dimension
(ldb,nrhs). The n-by-nrhs right hand side matrix B.inldbThe leading dimension of the array B.
ldb>=max(1,n).outXArray of dimension
(ldx,nrhs). Ifinfo=0orinfo=n+1, the n-by-nrhs solution matrix X.inldxThe leading dimension of the array X.
ldx>=max(1,n).outrcondThe estimate of the reciprocal condition number of the matrix A. If
rcondis 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.outferrArray of dimension
nrhs. The estimated forward error bound for each solution vector X(j).outberrArray of dimension
nrhs. The componentwise relative backward error of each solution vector X(j).outworkArray of dimension
2*n.outrworkArray of dimension
n.outinfoinfo=0: successful exitinfo<0: ifinfo=-i, the i-th argument had an illegal valueinfo>0: ifinfo=i, andi<=n,D(i,i)is exactly zero. The factorization has been completed but D is exactly singular, so the solution and error bounds could not be computed.rcond=0is returned.info=n+1: D is nonsingular, butrcondis less than machine precision, meaning that the matrix is singular to working precision.
void zhpsvx(
const char* fact,
const char* uplo,
const INT n,
const INT nrhs,
const c128* restrict AP,
c128* restrict AFP,
INT* restrict ipiv,
const c128* restrict B,
const INT ldb,
c128* restrict X,
const INT ldx,
f64* rcond,
f64* restrict ferr,
f64* restrict berr,
c128* restrict work,
f64* restrict rwork,
INT* info
);