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 matrix A. Rule of the house: N >= 0.
  • NRHS β€” NRHS is INTEGER, the number of right hand sides, i.e., the number of columns of the matrices B and X. Also gotta be NRHS >= 0.
  • AP β€” AP is COMPLEX*16 array, dimension (N*(N+1)/2). This is the upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A lives in AP like this:
    • if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
    • if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n.

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 matrix A. AFP contains 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 as computed by ZSPTRF, 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 of D, as determined by ZSPTRF. It's the receipts. 🧾
  • B β€” B is COMPLEX*16 array, dimension (LDB,NRHS). The right hand side matrix B. The whole reason we're here, lowkey.
  • LDB β€” LDB is INTEGER, the leading dimension of the array B. Requirement: LDB >= max(1,N).
  • X β€” X is COMPLEX*16 array, dimension (LDX,NRHS). On entry, the solution matrix X, as computed by ZSPTRS. On exit, the improved solution matrix X. Glow-up confirmed, no cap. ✨
  • LDX β€” LDX is INTEGER, the leading dimension of the array X. Requirement: LDX >= max(1,N).
  • FERR β€” FERR is DOUBLE PRECISION 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), then 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). Heads up: the estimate is as reliable as the estimate for RCOND, 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 vector X(j) β€” that is, the smallest relative change in any element of A or B that makes X(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:

  • ITMAX is 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