hesvx#
Functions
-
void chesvx(const char *fact, const char *uplo, const INT n, const INT nrhs, const c64 *restrict A, const INT lda, c64 *restrict AF, const INT ldaf, 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, const INT lwork, f32 *restrict rwork, INT *info)#
CHESVX uses the diagonal pivoting factorization to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian matrix 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. The form of the factorization isA = 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.
Parameters
infact'F': On entry, AF and IPIV contain the factored form of A. AF and IPIV will not be modified.'N': The matrix A will be copied to AF 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.inAArray of dimension
(lda,n). The Hermitian matrix A.inldaThe leading dimension of the array A.
lda>=max(1,n).inoutAFArray of dimension
(ldaf,n). Iffact='F', then AF 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 bychetrf. Iffact='N', then AF is an output argument and on exit returns the block diagonal matrix D and the multipliers used to obtain the factor U or L.inldafThe leading dimension of the array AF.
ldaf>=max(1,n).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 bychetrf. 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 bychetrf.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
max(1,lwork). On exit, ifinfo=0,work[0]returns the optimallwork.inlworkThe length of
work.lwork>=max(1,2*n), and for best performance, whenfact='N',lwork>=max(1,2*n,n*nb), wherenbis the optimal block size forchetrf. Iflwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of theworkarray, returns this value as the first entry of theworkarray, and no error message related tolworkis issued.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 chesvx(
const char* fact,
const char* uplo,
const INT n,
const INT nrhs,
const c64* restrict A,
const INT lda,
c64* restrict AF,
const INT ldaf,
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,
const INT lwork,
f32* restrict rwork,
INT* info
);
Functions
-
void zhesvx(const char *fact, const char *uplo, const INT n, const INT nrhs, const c128 *restrict A, const INT lda, c128 *restrict AF, const INT ldaf, 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, const INT lwork, f64 *restrict rwork, INT *info)#
ZHESVX uses the diagonal pivoting factorization to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian matrix 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. The form of the factorization isA = 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.
Parameters
infact'F': On entry, AF and IPIV contain the factored form of A. AF and IPIV will not be modified.'N': The matrix A will be copied to AF 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.inAArray of dimension
(lda,n). The Hermitian matrix A.inldaThe leading dimension of the array A.
lda>=max(1,n).inoutAFArray of dimension
(ldaf,n). Iffact='F', then AF 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 byzhetrf. Iffact='N', then AF is an output argument and on exit returns the block diagonal matrix D and the multipliers used to obtain the factor U or L.inldafThe leading dimension of the array AF.
ldaf>=max(1,n).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 byzhetrf. 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 byzhetrf.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
max(1,lwork). On exit, ifinfo=0,work[0]returns the optimallwork.inlworkThe length of
work.lwork>=max(1,2*n), and for best performance, whenfact='N',lwork>=max(1,2*n,n*nb), wherenbis the optimal block size forzhetrf. Iflwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of theworkarray, returns this value as the first entry of theworkarray, and no error message related tolworkis issued.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 zhesvx(
const char* fact,
const char* uplo,
const INT n,
const INT nrhs,
const c128* restrict A,
const INT lda,
c128* restrict AF,
const INT ldaf,
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,
const INT lwork,
f64* restrict rwork,
INT* info
);