hprfs(3)
π hprfs(3) π
okay so bestie, you're looking at hprfs(3) β straight out of the Library Functions Manual, and it's giving "the whole {hp,sp}rfs family in one place" β¨. Buckle up, because there are six subroutines in here and each one is a whole vibe.
πΈ NAME πΈ
hprfs β {hp,sp}rfs: iterative refinement π
β¨ SYNOPSIS β¨
π¦ Functions π¦
Here's the whole squad, all six of them π β every one takes the same shape, and the letter in front tells you the type and the flavor:
chprfsβ CHPRFScsprfsβ CSPRFSdsprfsβ DSPRFSssprfsβ SSPRFSzhprfsβ ZHPRFSzsprfsβ ZSPRFS
subroutine chprfs (uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr,
berr, work, rwork, info)
CHPRFS
subroutine csprfs (uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr,
berr, work, rwork, info)
CSPRFS
subroutine dsprfs (uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr,
berr, work, iwork, info)
DSPRFS
subroutine ssprfs (uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr,
berr, work, iwork, info)
SSPRFS
subroutine zhprfs (uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr,
berr, work, rwork, info)
ZHPRFS
subroutine zsprfs (uplo, n, nrhs, ap, afp, ipiv, b, ldb, x, ldx, ferr,
berr, work, rwork, info)
ZSPRFS
quick heads up: the real ones carry full type declarations, and those are spelled out (character for character, no cap) down in the [Function Documentation](#-function-documentation-) π
π₯ DETAILED DESCRIPTION π₯
the details live in the function docs below, one subroutine at a time π
π FUNCTION DOCUMENTATION π
π chprfs β CHPRFS
subroutine chprfs (character uplo, integer n, integer nrhs, complex,
dimension( * ) ap, complex, dimension( * ) afp, integer, dimension( * )
ipiv, complex, dimension( ldb, * ) b, integer ldb, complex, dimension(
ldx, * ) x, integer ldx, real, dimension( * ) ferr, real, dimension( * )
berr, complex, dimension( * ) work, real, dimension( * ) rwork, integer
info)
π Purpose
CHPRFS is the glow-up arc for a solution you already have. When your coefficient matrix is Hermitian indefinite and packed, it takes the computed solution to a system of linear equations and refines it, then hands you error bounds and backward error estimates for that solution. literally the "make it make sense" subroutine π«Ά
β Parameters
UPLOβUPLO is CHARACTER*1. Which triangle ofAyou've stashed:'U'means the upper triangle of A is stored;'L'means the lower triangle of A is stored.NβN is INTEGER. The order of the matrix A. Constraint:N >= 0.NRHSβNRHS is INTEGER. How many right hand sides you're slinging β like, the number of columns of the matrices B and X. Constraint:NRHS >= 0.APβAP is COMPLEX array, dimension (N*(N+1)/2). This is the upper or lower triangle of the Hermitian matrix A, packed columnwise into one long linear array. The j-th column of A lands 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.
AFPβAFP is COMPLEX array, dimension (N*(N+1)/2). The factored form of the matrix A, periodt. AFP is holding the block diagonal matrix D plus the multipliers that got you the factor U or L from the factorizationA = U*D*U**HorA = L*D*L**Hβ exactly asCHPTRFcomputed them β stored as a packed triangular matrix.IPIVβIPIV is INTEGER array, dimension (N). The receipts on the interchanges and the block structure of D, as determined byCHPTRF.BβB is COMPLEX array, dimension (LDB,NRHS). The right hand side matrix B. π§LDBβLDB is INTEGER. The leading dimension of the array B. Constraint:LDB >= max(1,N).XβX is COMPLEX array, dimension (LDX,NRHS). On entry: the solution matrix X, as computed byCHPTRS. On exit: the improved solution matrix X. glow-up complete β¨LDXβLDX is INTEGER. The leading dimension of the array X. Constraint:LDX >= max(1,N).FERRβFERR is REAL 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), 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). The estimate is as reliable as the estimate forRCOND, and it is almost always a slight overestimate of the true error. (yes, overestimating is the safe direction, we love a cautious queen π«Ά)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 of A or B that makesX(j)an exact solution.WORKβWORK is COMPLEX array, dimension (2*N). Scratch space, no thoughts head empty πRWORKβRWORK is REAL array, dimension (N). More scratch space, real edition.INFOβINFO is INTEGER. The vibe check on the exit:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π
π§ Internal Parameters
ITMAX is the maximum number of steps of iterative refinement.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Definition
Definition at line 178 of file chprfs.f.
π csprfs β CSPRFS
subroutine csprfs (character uplo, integer n, integer nrhs, complex,
dimension( * ) ap, complex, dimension( * ) afp, integer, dimension( * )
ipiv, complex, dimension( ldb, * ) b, integer ldb, complex, dimension(
ldx, * ) x, integer ldx, real, dimension( * ) ferr, real, dimension( * )
berr, complex, dimension( * ) work, real, dimension( * ) rwork, integer
info)
π Purpose
CSPRFS does the exact same iterative-refinement magic, but for the case where the coefficient matrix is symmetric indefinite and packed. It improves your computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. same energy, different symmetry π
β Parameters
UPLOβUPLO is CHARACTER*1. Which triangle ofAyou've stored:'U'means the upper triangle of A is stored;'L'means the lower triangle of A is stored.NβN is INTEGER. The order of the matrix A. Constraint:N >= 0.NRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X. Constraint:NRHS >= 0.APβAP is COMPLEX array, dimension (N*(N+1)/2). The upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A is stored in AP as follows:
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.
AFPβAFP is COMPLEX 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 factorizationA = U*D*U**TorA = L*D*L**Tas computed byCSPTRF, stored as a packed triangular matrix. (note:**T, not**Hβ she's symmetric, not Hermitian, and that distinction is the whole personality π₯)IPIVβIPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure of D as determined byCSPTRF.BβB is COMPLEX array, dimension (LDB,NRHS). The right hand side matrix B.LDBβLDB is INTEGER. The leading dimension of the array B. Constraint:LDB >= max(1,N).XβX is COMPLEX array, dimension (LDX,NRHS). On entry, the solution matrix X, as computed byCSPTRS. On exit, the improved solution matrix X. β¨LDXβLDX is INTEGER. The leading dimension of the array X. Constraint:LDX >= max(1,N).FERRβFERR is REAL 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.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 of A or B that makesX(j)an exact solution).WORKβWORK is COMPLEX array, dimension (2*N).RWORKβRWORK is REAL array, dimension (N).INFOβINFO is INTEGER:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π
π§ Internal Parameters
ITMAX is the maximum number of steps of iterative refinement.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Definition
Definition at line 178 of file csprfs.f.
π dsprfs β DSPRFS
subroutine dsprfs (character uplo, integer n, integer nrhs, double
precision, dimension( * ) ap, double precision, dimension( * ) afp,
integer, dimension( * ) ipiv, double precision, dimension( ldb, * ) b,
integer ldb, double precision, dimension( ldx, * ) x, integer ldx,
double precision, dimension( * ) ferr, double precision, dimension( * )
berr, double precision, dimension( * ) work, integer, dimension( * )
iwork, integer info)
β Parameters
UPLOβUPLO is CHARACTER*1. Which triangle ofAis stored:'U'means the upper triangle of A is stored;'L'means the lower triangle of A is stored.NβN is INTEGER. The order of the matrix A. Constraint:N >= 0.NRHSβ ...and this is exactly where part 1 runs out, bestie β theNRHSdescription picks up in part 2 π«NRHSβINTEGER. The number of right hand sides, aka the number of columns of the matricesBandX. Gotta beNRHS >= 0, no cap.APβDOUBLE PRECISIONarray, 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 ofAis stored inAPlike so:
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.
AFPβDOUBLE PRECISIONarray, dimension(N*(N+1)/2). It's the factored form of the matrixA, bestie.AFPcontains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed byDSPTRF, stored as a packed triangular matrix. It's giving "already did the hard work" energy πIPIVβINTEGERarray, dimension(N). The details of the interchanges and the block structure ofD, exactly as determined byDSPTRF. Receipts included π§ΎBβDOUBLE PRECISIONarray, dimension(LDB,NRHS). The right hand side matrixB. That's the "what we're solving for" side, iykyk.LDBβINTEGER. The leading dimension of the arrayB. Constraint:LDB >= max(1,N). Respect the leading dimension or it will not respect you πXβDOUBLE PRECISIONarray, dimension(LDX,NRHS). On entry, the solution matrixX, as computed byDSPTRS. On exit, the improved solution matrixX. So it comes in solved and leaves even more solved. Character development β¨LDXβINTEGER. The leading dimension of the arrayX. Constraint:LDX >= max(1,N). Same deal asLDB, do not play with it.FERRβDOUBLE PRECISIONarray, 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). 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 "better safe than sorry" way, not a "lying to you" way π«Ά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. Basically: how much would we have to fudge the inputs to make this answer perfect. A tiny amount = slay βWORKβDOUBLE PRECISIONarray, dimension(3*N). Scratch space, do not perceive it πIWORKβINTEGERarray, dimension(N). Also scratch space, just integer flavored πINFOβINTEGER. The vibes report:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π
π§ Internal Parameters:
ITMAX is the maximum number of steps of iterative refinement. It's literally the "okay one more pass" budget π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Definition at line 177 of file dsprfs.f.
π subroutine ssprfs β SSPRFS π
Same whole situation but in single precision, and it ate:
subroutine ssprfs (character uplo, integer n, integer nrhs, real, dimension(
* ) ap, real, dimension( * ) afp, integer, dimension( * ) ipiv, real,
dimension( ldb, * ) b, integer ldb, real, dimension( ldx, * ) x, integer
ldx, real, dimension( * ) ferr, real, dimension( * ) berr, real,
dimension( * ) work, integer, dimension( * ) iwork, integer info)
SSPRFS
π― Purpose:
SSPRFS improves the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite and packed, and it provides error bounds and backward error estimates for the solution. So it's not just solving β it's refining and then handing you the receipts. Main character behavior, honestly π
β¨ Parameters
UPLOβCHARACTER*1. Which triangle ofAwe're storing:= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.
NβINTEGER. The order of the matrixA. Constraint:N >= 0. Zero is a valid vibe, apparently.NRHSβINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX. Constraint:NRHS >= 0.APβREALarray, dimension(N*(N+1)/2). The upper or lower triangle of the symmetric matrixA, packed columnwise in a linear array. The j-th column ofAis stored inAPas follows:
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.
AFPβREALarray, 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 bySSPTRF, stored as a packed triangular matrix. Already factored, already iconic πIPIVβINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined bySSPTRF. The whole plot, in integer form.BβREALarray, dimension(LDB,NRHS). The right hand side matrixB.LDBβINTEGER. The leading dimension of the arrayB. Constraint:LDB >= max(1,N).XβREALarray, dimension(LDX,NRHS). On entry, the solution matrixX, as computed bySSPTRS. On exit, the improved solution matrixX. Glow-up arc, honestly.LDXβINTEGER. The leading dimension of the arrayX. Constraint:LDX >= max(1,N).FERRβREALarray, 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). The estimate is as reliable as the estimate forRCOND, and it is almost always a slight overestimate of the true error. Overthinking but correct π«ΆBERRβREALarray, 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βREALarray, dimension(3*N). Scratch space, moving on π¦IWORKβINTEGERarray, dimension(N). More scratch space, also moving on πΈINFOβINTEGER:= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value π
π§ Internal Parameters:
ITMAX is the maximum number of steps of iterative refinement. Same deal as before, it's the "one more little pass" allowance π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Definition at line 177 of file ssprfs.f.
π¦ subroutine zhprfs β ZHPRFS π¦
Now we're in complex double precision territory and she is Hermitian and indefinite, which is honestly such a mood. Signature:
subroutine zhprfs (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)
ZHPRFS
π― Purpose:
ZHPRFS improves the computed solution to a system of linear equations when the coefficient matrix is Hermitian indefinite and packed, and provides error bounds and backward error estimates for the solution. Note the H instead of T in the factorizations below β complex conjugates are literally part of the lore π§
β¨ Parameters
UPLOβCHARACTER*1:= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.
NβINTEGER. The order of the matrixA. Constraint:N >= 0.NRHSβINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX. Constraint:NRHS >= 0.APβCOMPLEX*16array, dimension(N*(N+1)/2). The upper or lower triangle of the Hermitian matrixA, packed columnwise in a linear array. The j-th column ofAis stored inAPas follows:
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.
AFPβCOMPLEX*16array, 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**HorA = L*D*L**Has computed byZHPTRF, stored as a packed triangular matrix. Yes,**Hβ conjugate transpose, she's fancy like that πIPIVβINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZHPTRF.BβCOMPLEX*16array, dimension(LDB,NRHS). The right hand side matrixB.LDBβINTEGER. The leading dimension of the arrayB. Constraint:LDB >= max(1,N).XβCOMPLEX*16array, dimension(LDX,NRHS). On entry, the solution matrixX, as computed byZHPTRS. On exit, the improved solution matrixX.LDXβINTEGER. The leading dimension of the arrayX. Constraint:LDX >= max(1,N).FERRβFERRβFERRisDOUBLE PRECISIONarray, dimension(NRHS). Itβs 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). Itβs 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βWORKisCOMPLEX*16array, dimension(2*N). π§RWORKβRWORKisDOUBLE PRECISIONarray, dimension(N). πΈINFOβINFOisINTEGER:= 0: successful exit β¨< 0: ifINFO = -i, thei-th argument had an illegal value π
π οΈ Internal Parameters
ITMAX is the maximum number of steps of iterative refinement. π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 178 of file zhprfs.f. π
π zsprfs / ZSPRFS
Signature, exactly as the source serves it:
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
ZSPRFS improves the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite and packed, and provides error bounds and backward error estimates for the solution. iconic behavior, honestly. π
π Parameters
UPLOβUPLOisCHARACTER*1:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. 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. πAPβAPisCOMPLEX*16array, dimension(N*(N+1)/2). The upper or lower triangle of the symmetric matrixA, packed columnwise in a linear array. Thej-th column ofAis stored in the arrayAPas follows:- 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
AFPβAFPisCOMPLEX*16array, 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. π¦IPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSPTRF. π₯BβBisCOMPLEX*16array, dimension(LDB,NRHS). The right hand side matrixB. πLDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). πXβXisCOMPLEX*16array, dimension(LDX,NRHS). On entry, the solution matrixX, as computed byZSPTRS. On exit, the improved solution matrixX. glow-up complete β¨LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,N). π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βWORKisCOMPLEX*16array, dimension(2*N). π§RWORKβRWORKisDOUBLE PRECISIONarray, dimension(N). πΈINFOβINFOisINTEGER:= 0: successful exit β¨< 0: ifINFO = -i, thei-th argument had an illegal value π
π οΈ Internal Parameters
ITMAX is the maximum number of steps of iterative refinement. π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 178 of file zsprfs.f. π
π§ Author
Generated automatically by Doxygen for LAPACK from the source code.
okay thatβs the whole page, bestie π β source/version is LAPACK Version 3.12.0, and the footer tag is hprfs(3). mwah π«Ά
π¦ 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