ZHPSVX(3)
π ZHPSVX(3) π
okay bestie, welcome to the zhpsvx.f page β it lives in the Library Functions Manual, and the file itself is chilling at:
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/zhpsvx.f
that's the whole NAME situation, yes it's literally just a path, slay π
β¨ SYNOPSIS β¨
Functions/Subroutines β¨
subroutine ZHPSVX (fact, uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx,
rcond, ferr, berr, work, rwork, info)
ZHPSVX computes the solution to system of linear equations A * X = B for OTHER matrices π
πΈ Function/Subroutine Documentation πΈ
subroutine ZHPSVX (character fact, character uplo, integer n, integer nrhs,
complex*16, dimension( * ) ap, complex*16, dimension( * ) afp, 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, double precision, dimension( * )
rwork, integer info)
ZHPSVX computes the solution to system of linear equations A * X = B for OTHER matrices π¦
π Purpose π
ZHPSVX uses the diagonal pivoting factorizationA = U*D*U**HorA = L*D*L**Hto compute the solution to a complex system of linear equationsA * 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.
like, it literally solves your system AND gives you receipts on how wrong it might be π iconic
π Description π
The following steps are performed: 1. IfFACT = 'N', the diagonal pivoting method is used to factor A asA = U * D * U**H, ifUPLO = 'U', orA = L * D * L**H, ifUPLO = '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. 2. If someD(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. 3. The system of equations is solved for X using the factored form of A. 4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
a whole four-step glow-up routine, we love a process π
π Parameters π
FACT
FACTisCHARACTER*1Specifies whether or not the factored form of A has been supplied on entry. -= 'F': On entry,AFPandIPIVcontain the factored form of A.AFPandIPIVwill not be modified. -= 'N': The matrix A will be copied toAFPand factored.
UPLO
UPLOisCHARACTER*1-= 'U': Upper triangle of A is stored; -= 'L': Lower triangle of A is stored.
N
NisINTEGERThe number of linear equations, i.e., the order of the matrix A.N >= 0.
NRHS
NRHSisINTEGERThe number of right hand sides, i.e., the number of columns of the matrices B and X.NRHS >= 0.
AP
APisCOMPLEX*16array, 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 arrayAPas follows: - ifUPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - ifUPLO = 'L',AP(i + (j-1)*(2*n-j)/2) = A(i,j)forj<=i<=n. See below for further details. π
AFP
AFPisCOMPLEX*16array, dimension(N*(N+1)/2)IfFACT = 'F', thenAFPis 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 byZHPTRF, stored as a packed triangular matrix in the same storage format as A. IfFACT = 'N', thenAFPis an output argument and on exit 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 byZHPTRF, stored as a packed triangular matrix in the same storage format as A.
in-out energy depending on FACT, main character behavior honestly π«Ά
IPIV
IPIVisINTEGERarray, dimension(N)IfFACT = 'F', thenIPIVis 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 columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - IfUPLO = '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. - IfUPLO = '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. IfFACT = 'N', thenIPIVis an output argument and on exit contains details of the interchanges and the block structure of D, as determined byZHPTRF.
B
BisCOMPLEX*16array, dimension(LDB,NRHS)The N-by-NRHS right hand side matrix B.
LDB
LDBisINTEGERThe leading dimension of the array B.LDB >= max(1,N).
X
XisCOMPLEX*16array, dimension(LDX,NRHS)IfINFO = 0orINFO = N+1, the N-by-NRHS solution matrix X.
LDX
LDXisINTEGERThe leading dimension of the array X.LDX >= max(1,N).
RCOND
RCONDisDOUBLE PRECISIONThe 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
FERRisDOUBLE PRECISIONarray, 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.
ngl "almost always a slight overestimate" is so real of it π
BERR
BERRisDOUBLE PRECISIONarray, 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
WORKisCOMPLEX*16array, dimension(2*N)
RWORK
RWORKisDOUBLE PRECISIONarray, dimension(N)
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.
β οΈ bestie watch that INFO = N+1 case β it's a warning, not a vibe. The matrix is singular to working precision but the routine still hands you the solution and error bounds, so don't just assume it's toast.
π¦ Author π¦
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
a whole collab, the group project actually got finished ππ
β Further Details β
The packed storage scheme is illustrated by the following example whenN = 4,UPLO = 'U': Two-dimensional storage of the Hermitian matrix A:a11 a12 a13 a14 a22 a23 a24 a33 a34 (aij = conjg(aji)) a44Packed storage of the upper triangle of A:AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
see how it just stacks the columns into one long array?? lowkey satisfying β¨ also note aij = conjg(aji) β Hermitian, so the mirror image is the conjugate, not a straight copy, iykyk π
Definition at line 275 of file zhpsvx.f.
πΈ Author πΈ
Generated automatically by Doxygen for LAPACK from the source code.
and that's the page, bestie π generated by Doxygen for LAPACK, Version 3.12.0 β source file zhpsvx.f, and yes, it's the same path we started with because the universe is a circle ππ
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms