hesvx(3)
okay so bestie, this is hesvx from the Library Functions Manual ๐ and it's giving "the expert one" energy โ it solves your complex linear system and reports how wrong the answer might be. Iconic, honestly ๐
let's go.
โจ NAME โจ
hesvx โ {he,sy}svx: rook (v1, expert)
๐ SYNOPSIS ๐
๐ซถ Functions
subroutine chesvx (fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, rwork, info)โ CHESVX computes the solution to system of linear equationsA * X = Bfor HE matrices ๐ธsubroutine csysvx (fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, rwork, info)โ CSYSVX computes the solution to system of linear equationsA * X = Bfor SY matrices ๐ฆsubroutine dsysvx (fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, iwork, info)โ DSYSVX computes the solution to system of linear equationsA * X = Bfor SY matrices ๐subroutine ssysvx (fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, iwork, info)โ SSYSVX computes the solution to system of linear equationsA * X = Bfor SY matrices ๐subroutine zhesvx (fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, rwork, info)โ ZHESVX computes the solution to system of linear equationsA * X = Bfor HE matrices ๐ฅsubroutine zsysvx (fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, rcond, ferr, berr, work, lwork, rwork, info)โ ZSYSVX computes the solution to system of linear equationsA * X = Bfor SY matrices โญ
๐ Detailed Description
bestie there's literally nothing here, it's just the heading doing its little intro walk ๐ญ the actual tea is all under Function Documentation โฌ๏ธ
๐ Function Documentation
๐ซ subroutine chesvx
subroutine chesvx (character fact, character uplo, integer n, integer nrhs,
complex, dimension( lda, * ) a, integer lda, complex, dimension( ldaf, *
) af, integer ldaf, integer, dimension( * ) ipiv, complex, dimension(
ldb, * ) b, integer ldb, complex, dimension( ldx, * ) x, integer ldx,
real rcond, real, dimension( * ) ferr, real, dimension( * ) berr,
complex, dimension( * ) work, integer lwork, real, dimension( * ) rwork,
integer info)
CHESVX computes the solution to system of linear equations A * X = B for HE matrices โจ
๐ธ Purpose:
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. she does the math and the quality report, no cap ๐
๐ฆ Description:
here's the little step-by-step, bestie โ the following steps are performed:
- If
FACT = 'N', the diagonal pivoting method is used to factor A. The form of the factorization is
A = 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 withINFO = 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
FACT
FACT is CHARACTER*1 โ tells the routine whether you already did the factoring homework or whether she's doing it for you ๐ซถ
= 'F': on entry,AFandIPIVcontain the factored form of A.A,AFandIPIVwill not be modified.= 'N': the matrix A will be copied toAFand factored.
UPLO
UPLO is CHARACTER*1
= 'U': upper triangle of A is stored;= 'L': lower triangle of A is stored.
N
N is INTEGER โ the number of linear equations, i.e., the order of the matrix A. N >= 0 ๐
NRHS
NRHS is INTEGER โ the number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0 ๐
A
A is COMPLEX array, dimension (LDA,N) โ the Hermitian matrix A.
If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced.
If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced ๐
LDA
LDA is INTEGER โ the leading dimension of the array A. LDA >= max(1,N).
AF
AF is COMPLEX array, dimension (LDAF,N)
- If
FACT = '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 factorizationA = U*D*U**HorA = L*D*L**Has computed byCHETRF. - If
FACT = '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 from the factorizationA = U*D*U**HorA = L*D*L**Hโจ
LDAF
LDAF is INTEGER โ the leading dimension of the array AF. LDAF >= max(1,N).
IPIV
IPIV is INTEGER array, dimension (N)
- If
FACT = 'F', then IPIV is an input argument and on entry contains details of the interchanges and the block structure of D, as determined byCHETRF๐ฆ - If
FACT = 'N', then IPIV is an output argument and on exit contains details of the interchanges and the block structure of D, as determined byCHETRF.
and here's how to read it, iykyk:
- If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
UPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. - If
UPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block ๐
B
B is COMPLEX array, dimension (LDB,NRHS) โ the N-by-NRHS right hand side matrix B ๐ธ
LDB
LDB is INTEGER โ the leading dimension of the array B. LDB >= max(1,N).
X
X is COMPLEX array, dimension (LDX,NRHS) โ if INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X โญ
LDX
LDX is INTEGER โ the leading dimension of the array X. LDX >= max(1,N).
RCOND
RCOND is REAL โ the estimate of the reciprocal condition number of the matrix A.
If RCOND is less than the machine precision (in particular, if RCOND = 0), the matrix is singular to working precision ๐ This condition is indicated by a return code of INFO > 0.
FERR
FERR is REAL array, dimension (NRHS) โ the estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X) ๐ซถ
If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error ๐
BERR
BERR is REAL array, dimension (NRHS) โ the componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution) ๐ฅ
WORK
WORK is COMPLEX array, dimension (MAX(1,LWORK)) โ on exit, if INFO = 0, WORK(1) returns the optimal LWORK โจ
LWORK
LWORK is INTEGER โ the length of WORK.
LWORK >= max(1,2*N), and for best performance, when FACT = 'N', LWORK >= max(1,2*N,N*NB), where NB is the optimal blocksize for CHETRF.
IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued byXERBLA๐
RWORK
RWORK is REAL array, dimension (N) ๐
INFO
INFOโINFO is INTEGER, aka the final vibe report ๐= 0: successful exit โ clean run, we love to see it โจ< 0: ifINFO = -i, thei-th argument had an illegal value โ check your inputs bestie ๐ญ> 0: ifINFO = i, andiis:<= N:D(i,i)is exactly zero. The factorization has been completed but the factorDis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+1:Dis nonsingular, butRCONDis 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 ofRCONDwould suggest.
โจ Author โจ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Definition
Definition at line 282 of file chesvx.f.
๐ subroutine csysvx ๐
subroutine csysvx (character fact, character uplo, integer n, integer nrhs,
complex, dimension( lda, * ) a, integer lda, complex, dimension( ldaf, *
) af, integer ldaf, integer, dimension( * ) ipiv, complex, dimension(
ldb, * ) b, integer ldb, complex, dimension( ldx, * ) x, integer ldx,
real rcond, real, dimension( * ) ferr, real, dimension( * ) berr,
complex, dimension( * ) work, integer lwork, real, dimension( * ) rwork,
integer info)
CSYSVX computes the solution to system of linear equations A * X = B for SY matrices โ that's the whole assignment bestie, no cap.
๐ฏ Purpose
Okay so CSYSVX 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 symmetric matrix and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided. Iconic.
๐ Description
The following steps are performed:
- If
FACT = 'N', the diagonal pivoting method is used to factorA. The form of the factorization is:
A = U * D * U**T, if UPLO = 'U', or
A = L * D * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
- If some
D(i,i)=0, so thatDis exactly singular, then the routine returns withINFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA. 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 forXand compute error bounds as described below. - The system of equations is solved for
Xusing the factored form ofA. - Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
๐ธ Parameters
FACTโFACT is CHARACTER*1. Specifies whether or not the factored form ofAhas been supplied on entry.= 'F': on entry,AFandIPIVcontain the factored form ofA.A,AFandIPIVwill not be modified.= 'N': the matrixAwill be copied toAFand factored.
UPLOโUPLO is CHARACTER*1.= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.
NโN is INTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSโNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.AโA is COMPLEX array, dimension (LDA,N). The symmetric matrixA. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโAF is COMPLEX array, dimension (LDAF,N). IfFACT = 'F', thenAFis an input argument and on entry contains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed byCSYTRF. IfFACT = 'N', thenAFis an output argument and on exit returns the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**T.LDAFโLDAF is INTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโIPIV is INTEGER array, dimension (N). IfFACT = 'F', thenIPIVis an input argument and on entry contains details of the interchanges and the block structure ofD, as determined byCSYTRF. 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)were 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)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block. IfFACT = 'N', thenIPIVis an output argument and on exit contains details of the interchanges and the block structure ofD, as determined byCSYTRF.BโB is COMPLEX array, dimension (LDB,NRHS). TheN-by-NRHSright hand side matrixB.LDBโLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XโX is COMPLEX array, dimension (LDX,NRHS). IfINFO = 0orINFO = N+1, theN-by-NRHSsolution matrixX.LDXโLDX is INTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDโRCOND is REAL. The 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โFERR is REAL array, dimension (NRHS). The estimated forward error bound for each solution vectorX(j)(thej-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error.BERRโBERR is REAL array, dimension (NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).WORKโWORK is COMPLEX array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORK is INTEGER. The length ofWORK.LWORK >= max(1,2*N), and for best performance, whenFACT = 'N',LWORK >= max(1,2*N,N*NB), whereNBis the optimal blocksize forCSYTRF. 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 byXERBLA.RWORKโRWORK is REAL array, dimension (N).INFOโINFO is INTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i, andiis<= N:D(i,i)is exactly zero. The factorization has been completed but the factorDis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+1:Dis nonsingular, butRCONDis 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 ofRCONDwould suggest.
โจ Author โจ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Definition
Definition at line 282 of file csysvx.f.
๐ธ subroutine dsysvx
subroutine dsysvx (character fact, character uplo, integer n, integer nrhs,
double precision, dimension( lda, * ) a, integer lda, double precision,
dimension( ldaf, * ) af, integer ldaf, integer, dimension( * ) ipiv,
double precision, dimension( ldb, * ) b, integer ldb, double precision,
dimension( ldx, * ) x, integer ldx, double precision rcond, double
precision, dimension( * ) ferr, double precision, dimension( * ) berr,
double precision, dimension( * ) work, integer lwork, integer,
dimension( * ) iwork, integer info)
DSYSVX computes the solution to system of linear equations A * X = B for SY matrices. ๐
๐ Purpose ๐
Okay so DSYSVX uses the diagonal pivoting factorization to compute the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices. โจ
It also gives you error bounds on the solution and a condition estimate โ those are included, bestie. ๐ซถ
๐ซ Description ๐ซ
The following steps are performed:
- If
FACT = 'N', the diagonal pivoting method is used to factorA. The form of the factorization isA = U * D * U**T, ifUPLO = 'U', orA = L * D * L**T, ifUPLO = 'L', whereU(orL) is a product of permutation and unit upper (lower) triangular matrices, andDis symmetric and block diagonal with1-by-1and2-by-2diagonal blocks. - If some
D(i,i)=0, so thatDis exactly singular, then the routine returns withINFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA. 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 forXand compute error bounds as described below. ๐ญ - The system of equations is solved for
Xusing the factored form ofA. - Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it. ๐ฅ
โจ Parameters โจ
FACTโFACTisCHARACTER*1. Specifies whether or not the factored form ofAhas been supplied on entry.= 'F': On entry,AFandIPIVcontain the factored form ofA.AFandIPIVwill not be modified.= 'N': The matrixAwill be copied toAFand factored.UPLOโUPLOisCHARACTER*1.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.NโNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.AโAisDOUBLE PRECISIONarray, dimension(LDA,N). The symmetric matrixA. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. ๐LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโAFisDOUBLE PRECISIONarray, dimension(LDAF,N). IfFACT = 'F', thenAFis an input argument and on entry contains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed byDSYTRF. IfFACT = 'N', thenAFis an output argument and on exit returns the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**T.LDAFโLDAFisINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโIPIVisINTEGERarray, dimension(N). IfFACT = 'F', thenIPIVis an input argument and on entry contains details of the interchanges and the block structure ofD, as determined byDSYTRF. IfIPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a1-by-1diagonal block. IfUPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a2-by-2diagonal block. IfUPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a2-by-2diagonal block. IfFACT = 'N', thenIPIVis an output argument and on exit contains details of the interchanges and the block structure ofD, as determined byDSYTRF.BโBisDOUBLE PRECISIONarray, dimension(LDB,NRHS). TheN-by-NRHSright hand side matrixB.LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XโXisDOUBLE PRECISIONarray, dimension(LDX,NRHS). IfINFO = 0orINFO = N+1, theN-by-NRHSsolution matrixX. ๐LDXโLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDโRCONDisDOUBLE PRECISION. The 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โFERRisDOUBLE PRECISIONarray, dimension(NRHS). The estimated forward error bound for each solution vectorX(j)(thej-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error. ๐ฆBERRโBERRisDOUBLE PRECISIONarray, dimension(NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).WORKโWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGER. The length ofWORK.LWORK >= max(1,3*N), and for best performance, whenFACT = 'N',LWORK >= max(1,3*N,N*NB), whereNBis the optimal blocksize forDSYTRF. 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 byXERBLA. ๐IWORKโIWORKisINTEGERarray, dimension(N).INFOโINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i, andiis<= N:D(i,i)is exactly zero. The factorization has been completed but the factorDis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+1:Dis nonsingular, butRCONDis 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 ofRCONDwould suggest. ๐ญ
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 281 of file dsysvx.f.
๐ subroutine ssysvx
subroutine ssysvx (character fact, character uplo, integer n, integer nrhs,
real, dimension( lda, * ) a, integer lda, real, dimension( ldaf, * ) af,
integer ldaf, integer, dimension( * ) ipiv, real, dimension( ldb, * ) b,
integer ldb, real, dimension( ldx, * ) x, integer ldx, real rcond, real,
dimension( * ) ferr, real, dimension( * ) berr, real, dimension( * )
work, integer lwork, integer, dimension( * ) iwork, integer info)
SSYSVX computes the solution to system of linear equations A * X = B for SY matrices. ๐
๐ฆ Purpose ๐ฆ
Okay so SSYSVX uses the diagonal pivoting factorization to compute the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices. โจ
Error bounds on the solution and a condition estimate are also provided. ๐ซถ
๐ Description ๐
So the actual play-by-play of what this routine does โ because you know you wanted the steps:
- If
FACT = 'N', the diagonal pivoting method is used to factor A. The form of the factorization is:
A = U * D * U**T, if UPLO = 'U', or
A = L * D * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric 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 withINFO = 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 bestie, the routine still goes on to solve for X and compute error bounds as described below. It does not give up on you. ๐ซถ - The system of equations is solved for X using the factored form of A. Slay.
- Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it. Iconic glow-up behavior tbh.
๐ Parameters ๐
FACTโFACTisCHARACTER*1. Specifies whether or not the factored form of A has been supplied on entry.= 'F': on entry,AFandIPIVcontain the factored form of A.AFandIPIVwill not be modified.= 'N': the matrix A will be copied toAFand factored.
UPLOโUPLOisCHARACTER*1.= 'U': upper triangle of A is stored;= 'L': lower triangle of A is stored.
NโNisINTEGER. The number of linear equations, i.e., the order of the matrix A.N >= 0.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X.NRHS >= 0.AโAisREAL array, dimension (LDA,N). The symmetric matrix A. IfUPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. Half the matrix is literally just vibes, not data. ๐ฆLDAโLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).AFโAFisREAL array, dimension (LDAF,N).- If
FACT = 'F', thenAFis 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 factorizationA = U*D*U**TorA = L*D*L**Tas computed bySSYTRF. - If
FACT = 'N', thenAFis an output argument and on exit returns the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorizationA = U*D*U**TorA = L*D*L**T.
- If
LDAFโLDAFisINTEGER. The leading dimension of the array AF.LDAF >= max(1,N).IPIVโIPIVisINTEGER array, dimension (N).- If
FACT = 'F', thenIPIVis an input argument and on entry contains details of the interchanges and the block structure of D, as determined bySSYTRF. - If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
UPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. - If
UPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block. (Yes the sign flip is on purpose, don't @ me ๐) - If
FACT = 'N', thenIPIVis an output argument and on exit contains details of the interchanges and the block structure of D, as determined bySSYTRF.
- If
BโBisREAL array, dimension (LDB,NRHS). The N-by-NRHS right hand side matrix B.LDBโLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).XโXisREAL array, dimension (LDX,NRHS). IfINFO = 0orINFO = N+1, the N-by-NRHS solution matrix X. The whole point of the exercise, honestly. ๐LDXโLDXisINTEGER. The leading dimension of the array X.LDX >= max(1,N).RCONDโRCONDisREAL. The estimate of the reciprocal condition number of the matrix A. 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โFERRisREAL array, dimension (NRHS). The estimated forward error bound for each solution vectorX(j)(the j-th column of the solution matrix X). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error. Overestimating is self-care. ๐ธBERRโBERRisREAL array, dimension (NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element of A or B that makesX(j)an exact solution).WORKโWORKisREAL array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGER. The length ofWORK.LWORK >= max(1,3*N), and for best performance, whenFACT = 'N',LWORK >= max(1,3*N,N*NB), where NB is the optimal blocksize forSSYTRF.
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 byXERBLA. It's the "just asking, not committing" of Fortran. ๐
IWORKโIWORKisINTEGER array, dimension (N). That's it, that's the whole description. No notes. ๐INFOโINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, and i is<= N:D(i,i)is exactly zero. The factorization has been completed but the factor D is exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+1: D is nonsingular, butRCONDis 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 ofRCONDwould suggest.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 281 of file ssysvx.f. (yes, a whole squad wrote this, we stan a collaborative effort ๐ซถ)
๐ฆ zhesvx ๐ฆ
Okay bestie, now the complex one, literally โ same energy, more imaginary numbers:
subroutine zhesvx (character fact, character uplo, integer n, integer nrhs,
complex*16, dimension( lda, * ) a, integer lda, complex*16, dimension(
ldaf, * ) af, integer ldaf, integer, dimension( * ) ipiv, complex*16,
dimension( ldb, * ) b, integer ldb, complex*16, dimension( ldx, * ) x,
integer ldx, double precision rcond, double precision, dimension( * )
ferr, double precision, dimension( * ) berr, complex*16, dimension( * )
work, integer lwork, double precision, dimension( * ) rwork, integer
info)
ZHESVX computes the solution to system of linear equations A * X = B for HE matrices. โจ
๐ Purpose ๐
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. Because we don't just want an answer, we want a receipt. ๐งพ
๐ Description ๐
The following steps are performed:
- If
FACT = 'N', the diagonal pivoting method is used to factor A. The form of the factorization is:
A = 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. (Note the **H, not **T โ conjugate transpose, she's Hermitian, not merely symmetric, respect her. ๐
)
- If some
D(i,i)=0, so that D is exactly singular, then the routine returns withINFO = 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 ๐
okay so FACT is up first, andโ
FACTโFACT is CHARACTER*1. It tells you whether the factored form ofAhas already been handed to you on entry, bestie. The values are:= 'F': On entry,AFandIPIVcontain the factored form ofA.A,AFandIPIVwill not be modified.= 'N': The matrixAwill be copied toAFand factored.
UPLOโUPLO is CHARACTER*1. Which triangle ofAis stored:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NโN is INTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSโNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.AโA is COMPLEX*16 array, dimension (LDA,N). The Hermitian matrixA. IfUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโAF is COMPLEX*16 array, dimension (LDAF,N). IfFACT = 'F', thenAFis an input argument and on entry contains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**HorA = L*D*L**Has computed byZHETRF.
If FACT = '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 from the factorization A = U*D*U**H or A = L*D*L**H.
LDAFโLDAF is INTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโIPIV is INTEGER array, dimension (N). IfFACT = 'F', thenIPIVis an input argument and on entry contains details of the interchanges and the block structure ofD, as determined byZHETRF. The rules are:- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
UPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. - If
UPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- If
If FACT = 'N', then IPIV is an output argument and on exit contains details of the interchanges and the block structure of D, as determined by ZHETRF.
BโB is COMPLEX*16 array, dimension (LDB,NRHS). The N-by-NRHS right hand side matrixB.LDBโLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XโX is COMPLEX*16 array, dimension (LDX,NRHS). IfINFO = 0orINFO = N+1, the N-by-NRHS solution matrixX.LDXโLDX is INTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDโRCOND is DOUBLE PRECISION. The 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โFERR is DOUBLE PRECISION array, dimension (NRHS). The estimated forward error bound for each solution vectorX(j)(thej-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error.BERRโBERR is DOUBLE PRECISION array, dimension (NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).WORKโWORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORK is INTEGER. The length ofWORK.LWORK >= MAX(1,2*N), and for best performance, whenFACT = 'N',LWORK >= MAX(1,2*N,N*NB), whereNBis the optimal blocksize forZHETRF.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
RWORKโRWORK is DOUBLE PRECISION array, dimension (N).INFOโINFO is INTEGER. The exit-status tea โ:= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i, andiis<= N:D(i,i)is exactly zero. The factorization has been completed but the factorDis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+1:Dis nonsingular, butRCONDis 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 ofRCONDwould suggest.
๐ซถ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 282 of file zhesvx.f.
๐ ZSYSVX โ symmetric-matrix solver, same iconic energy ๐
subroutine zsysvx (character fact, character uplo, integer n, integer nrhs,
complex*16, dimension( lda, * ) a, integer lda, complex*16, dimension(
ldaf, * ) af, integer ldaf, integer, dimension( * ) ipiv, complex*16,
dimension( ldb, * ) b, integer ldb, complex*16, dimension( ldx, * ) x,
integer ldx, double precision rcond, double precision, dimension( * )
ferr, double precision, dimension( * ) berr, complex*16, dimension( * )
work, integer lwork, double precision, dimension( * ) rwork, integer
info)
ZSYSVX computes the solution to system of linear equations A * X = B for SY matrices. Periodt. ๐
Purpose ๐ฏ
ZSYSVX 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 symmetric matrix and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided.
Description ๐ง
The following steps are performed:
- If
FACT = 'N', the diagonal pivoting method is used to factorA. The form of the factorization is
A = U * D * U**T, if UPLO = 'U', or
A = L * D * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
- If some
D(i,i)=0, so thatDis exactly singular, then the routine returns withINFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA. 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 forXand compute error bounds as described below. - The system of equations is solved for
Xusing the factored form ofA. - Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
Parameters ๐งฎ
FACTโFACT is CHARACTER*1. Specifies whether or not the factored form ofAhas been supplied on entry.= 'F': On entry,AFandIPIVcontain the factored form ofA.A,AFandIPIVwill not be modified.= 'N': The matrixAwill be copied toAFand factored.
UPLOโUPLO is CHARACTER*1.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NโN is INTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSโNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.Aโ and theAdescription rolls into the next part, bestie โ hold that thought ๐ซถ
back in the arg docs at A, bestie โ lowkey the main character of this whole call ๐
AโCOMPLEX*16array, dimension(LDA,N). This is the symmetric matrixA, no cap. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. ๐ฆLDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). periodt.AFโCOMPLEX*16array, dimension(LDAF,N). IfFACT = 'F', thenAFis an input argument and on entry contains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed byZSYTRF.
If FACT = '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 from the factorization A = U*D*U**T or A = L*D*L**T. โจ
LDAFโINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N). ๐IPIVโINTEGERarray, dimension(N). IfFACT = 'F', thenIPIVis an input argument and on entry contains details of the interchanges and the block structure ofD, as determined byZSYTRF.- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a1-by-1diagonal block. - If
UPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a2-by-2diagonal block. - If
UPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a2-by-2diagonal block.
- If
If FACT = 'N', then IPIV is an output argument and on exit contains details of the interchanges and the block structure of D, as determined by ZSYTRF. iykyk ๐
BโCOMPLEX*16array, dimension(LDB,NRHS). TheN-by-NRHSright hand side matrixB. ๐ซถLDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XโCOMPLEX*16array, dimension(LDX,NRHS). IfINFO = 0orINFO = N+1, theN-by-NRHSsolution matrixX. the way thatXjust shows up when everything works? iconic.LDXโINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDโDOUBLE PRECISION. The 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. not me side-eyeingRCOND = 0๐ญFERRโDOUBLE PRECISIONarray, dimension(NRHS). The estimated forward error bound for each solution vectorX(j)(thej-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error. highkey helpful ๐BERRโDOUBLE PRECISIONarray, dimension(NRHS). The componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution). ๐WORKโCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโINTEGER. The length ofWORK.LWORK >= max(1,2*N), and for best performance, whenFACT = 'N',LWORK >= max(1,2*N,N*NB), whereNBis the optimal blocksize forZSYTRF.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. main character workspace behavior, fr fr ๐
RWORKโDOUBLE PRECISIONarray, dimension(N). ๐งINFOโINTEGER. the whole vibe check right here:= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i, andiis<= N:D(i,i)is exactly zero. The factorization has been completed but the factorDis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+1:Dis nonsingular, butRCONDis 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 ofRCONDwould suggest. no cap, that last part is lowkey important ๐ฅ
๐ AUTHOR ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line282of filezsysvx.f.
๐ AUTHOR (the auto-generated one) ๐
Generated automatically by Doxygen for LAPACK from the source code.
signing off from LAPACK, version 3.12.0, on the hesvx(3) page โ the footer doesnโt show a separate date here, so thatโs the whole tail, bestie ๐ซถโจ๐
๐ฆ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 ยท custom
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms