SRC/zsprfs.f(3)
π SRC/zsprfs.f
Okay bestie, so this is a page from the LAPACK manual β SRC/zsprfs.f β and honestly? It's giving "quietly iconic linear algebra workhorse." π¦ Ngl, it's a Fortran file, so grab a snack, get comfy, and let's go through it together. β¨
πΈ SYNOPSIS πΈ
Functions/Subroutines
subroutine zsprfs (uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr,
berr, work, rwork, info)
ZSPRFS
π Function/Subroutine Documentation π
subroutine zsprfs
The full signature, verbatim, so nobody comes for me in the replies:
subroutine zsprfs (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, dimension( * )
ferr, double precision, dimension( * ) berr, complex*16, dimension( * )
work, double precision, dimension( * ) rwork, integer info)
ZSPRFS
π Purpose
Okay so here's the vibe: ZSPRFS improves the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite and packed, and it also hands you error bounds and backward error estimates for that solution. Basically it's your solution's personal glow-up artist and its brutally honest bestie at the same time. π
β¨ Parameters
UPLOβUPLO is CHARACTER*1. Which triangle we're working with:= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβN is INTEGER, the order of the matrixA. Rule of the house:N >= 0.NRHSβNRHS is INTEGER, the number of right hand sides, i.e., the number of columns of the matricesBandX. Also gotta beNRHS >= 0.APβAP is COMPLEX*16 array, dimension (N*(N+1)/2). This is the upper or lower triangle of the symmetric matrixA, packed columnwise in a linear array. The j-th column ofAlives inAPlike this:- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2*n-j)/2) = A(i,j)forj<=i<=n.
- if
Yes, the arithmetic is giving "trust the process," but it's correct, I promise. π«Ά
AFPβAFP is COMPLEX*16 array, dimension (N*(N+1)/2). The factored form of the matrixA.AFPcontains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed byZSPTRF, stored as a packed triangular matrix. Main character energy, honestly. πIPIVβIPIV is INTEGER array, dimension (N). The details of the interchanges and the block structure ofD, as determined byZSPTRF. It's the receipts. π§ΎBβB is COMPLEX*16 array, dimension (LDB,NRHS). The right hand side matrixB. The whole reason we're here, lowkey.LDBβLDB is INTEGER, the leading dimension of the arrayB. Requirement:LDB >= max(1,N).XβX is COMPLEX*16 array, dimension (LDX,NRHS). On entry, the solution matrixX, as computed byZSPTRS. On exit, the improved solution matrixX. Glow-up confirmed, no cap. β¨LDXβLDX is INTEGER, the leading dimension of the arrayX. Requirement:LDX >= max(1,N).FERRβFERR is DOUBLE PRECISION array, dimension (NRHS). The estimated forward error bound for each solution vectorX(j)(the j-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j), thenFERR(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). Heads up: the estimate is as reliable as the estimate forRCOND, and it is almost always a slight overestimate of the true error. So it's a little dramatic, but in a self-aware way. πBERRβBERR is DOUBLE PRECISION array, dimension (NRHS). The componentwise relative backward error of each solution vectorX(j)β that is, the smallest relative change in any element ofAorBthat makesX(j)an exact solution. The "how close am I actually" check. πWORKβWORK is COMPLEX*16 array, dimension (2*N). Just a workspace. It carries things. πRWORKβRWORK is DOUBLE PRECISION array, dimension (N). Also a workspace, but make it real. πΈINFOβINFO is INTEGER. The status report:= 0: successful exit< 0: if INFO = -i, the i-th argument had an illegal value
So if INFO comes back negative, somebody passed a bad argument and we're all going to talk about it. π
π¦ Internal Parameters:
ITMAXis the maximum number of steps of iterative refinement. That's how many tries the little refinement loop gets to be great. π₯
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 178 of file zsprfs.f.
π Author (the meta one)
Generated automatically by Doxygen for LAPACK from the source code. Not a human, not a vibe curator, just Doxygen doing its thing. π€β¨
Okay that's the whole page, bestie β you ate that. π This was LAPACK, Version 3.12.0, straight out of SRC/zsprfs.f(3). Go forth and refine your solutions iteratively, and remember: overestimating your error is basically humility. πππ«Ά
π¦ 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