gtrfs(3)
π
gtrfs(3) β Library Functions Manual
okay bestie, buckle up, because this one is a whole family of routines, not just one. we're in the <gtrfs> section 3 pages, the Library Functions Manual vibe. this is part 1 of the gtrfs saga, and it's giving "iterative refinement, but make it a girlboss". π
πΈ NAME
gtrfs β gtrfs: iterative refinement π«
like, that's literally the whole name section. short and iconic. π
β¨ SYNOPSIS
π Functions
here's the whole squad, all four of them, and yes they all take the same shape of args except the last couple (that's the whole real/complex divide, iykyk):
subroutine cgtrfs (trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv,
b, ldb, x, ldx, ferr, berr, work, rwork, info)
CGTRFS
subroutine dgtrfs (trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv,
b, ldb, x, ldx, ferr, berr, work, iwork, info)
DGTRFS
subroutine sgtrfs (trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv,
b, ldb, x, ldx, ferr, berr, work, iwork, info)
SGTRFS
subroutine zgtrfs (trans, n, nrhs, dl, d, du, dlf, df, duf, du2, ipiv,
b, ldb, x, ldx, ferr, berr, work, rwork, info)
ZGTRFS
<cute note>the work array is the main character who sometimes brings a plus-one: the single/double ones roll with iwork, the complex ones bring rwork instead. slay.</cute note>
π« Detailed Description
okay so the original page literally has this heading with nothing under it. empty. void. a vibe. π³οΈ we move on, bestie β the good stuff is right below. π«Ά
π Function Documentation
π₯ subroutine cgtrfs β CGTRFS
subroutine cgtrfs (character trans, integer n, integer nrhs, complex,
dimension( * ) dl, complex, dimension( * ) d, complex, dimension( * )
du, complex, dimension( * ) dlf, complex, dimension( * ) df, complex,
dimension( * ) duf, complex, dimension( * ) du2, 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)
CGTRFS
π¦ Purpose
CGTRFS improves the computed solution to a system of linear equations when the coefficient matrix is tridiagonal, and provides error bounds and backward error estimates for the solution.
so basically: your tridiagonal solve came out a little crusty, and this routine polishes it up π and then hands you receipts (the error bounds) proving how good the polished answer is. no cap, it's giving "trust but verify".
πΈ Parameters
TRANSβCHARACTER*1. tells us which flavor of system we're solving:= 'N':A * X = B(no transpose)= 'T':A**T * X = B(transpose)= 'C':A**H * X = B(conjugate transpose)
NβINTEGER. the order of the matrixA. must beN >= 0.NRHSβINTEGER. the number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.DLβCOMPLEX array, dimension(N-1). the(n-1)subdiagonal elements ofA.DβCOMPLEX array, dimension(N). the diagonal elements ofA.DUβCOMPLEX array, dimension(N-1). the(n-1)superdiagonal elements ofA.DLFβCOMPLEX array, dimension(N-1). the(n-1)multipliers that define the matrixLfrom the LU factorization ofAas computed byCGTTRF.DFβCOMPLEX array, dimension(N). thendiagonal elements of the upper triangular matrixUfrom the LU factorization ofA.DUFβCOMPLEX array, dimension(N-1). the(n-1)elements of the first superdiagonal ofU.DU2βCOMPLEX array, dimension(N-2). the(n-2)elements of the second superdiagonal ofU.IPIVβINTEGER array, dimension(N). the pivot indices; for1 <= i <= n, rowiof the matrix was interchanged with rowIPIV(i).IPIV(i)will always be eitheriori+1;IPIV(i) = iindicates a row interchange was not required. (so like, minimal drama pivoting π)BβCOMPLEX array, dimension(LDB,NRHS). the right hand side matrixB.LDBβINTEGER. the leading dimension of the arrayB.LDB >= max(1,N).XβCOMPLEX array, dimension(LDX,NRHS). on entry, the solution matrixX, as computed byCGTTRS. on exit, the improved solution matrixX. β¨ glow-up complete β¨LDXβINTEGER. the leading dimension of the arrayX.LDX >= max(1,N).FERRβ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.
so yeah, it's a bound, and it's almost always a lil bit dramatic (slight overestimate). reliable though β same trust level as RCOND. π«Ά
BERRβ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βCOMPLEX array, dimension(2*N).RWORKβREAL array, dimension(N).INFOβINTEGER.= 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.
(yes, it's internal, so don't come for her, she's not in your arg list.)
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 207 of file cgtrfs.f.
π subroutine dgtrfs β DGTRFS
subroutine dgtrfs (character trans, integer n, integer nrhs, double
precision, dimension( * ) dl, double precision, dimension( * ) d, double
precision, dimension( * ) du, double precision, dimension( * ) dlf,
double precision, dimension( * ) df, double precision, dimension( * )
duf, double precision, dimension( * ) du2, 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)
DGTRFS
π¦ Purpose
DGTRFS improves the computed solution to a system of linear equations when the coefficient matrix is tridiagonal, and provides error bounds and backward error estimates for the solution.
same energy, double precision flavor. the double-precision girlies get the exact same deal: better solution + receipts. π
πΈ Parameters
TRANSβCHARACTER*1. specifies the form of the system of equations:= 'N':A * X = B(no transpose)= 'T':A**T * X = B(transpose)= 'C':A**H * X = B(conjugate transpose = Transpose)
small but important detail bestie: over here in real-land, 'C' is literally the same thing as transpose, and the page says so out loud. π«Ά
NβINTEGER. the order of the matrixA.N >= 0.NRHSβINTEGER. the number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.DLβDOUBLE PRECISION array, dimension(N-1). the(n-1)subdiagonal elements ofA.DβDOUBLE PRECISION array, dimension(N). the diagonal elements ofA.DUβDOUBLE PRECISION array, dimension(N-1). the(n-1)superdiagonal elements ofA.DLFβDOUBLE PRECISION array, dimension(N-1). the(n-1)multipliers that define the matrixLfrom the LU factorization ofAas computed byDGTTRF.DFβDOUBLE PRECISION array, dimension(N). thendiagonal elements of the upper triangular matrixUfrom the LU factorization ofA.DUFβDOUBLE PRECISION array, dimension(N-1). the(n-1)elements of the first superdiagonal ofU.DU2βDOUBLE PRECISION array, dimension(N-2). the(n-2)elements of the second superdiagonal ofU.IPIVβINTEGER array, dimension(N). the pivot indices; for1 <= i <= n, rowiof the matrix was interchanged with rowIPIV(i).IPIV(i)will always be eitheriori+1;IPIV(i) = iindicates a row interchange was not required.BβDOUBLE PRECISION array, dimension(LDB,NRHS). the right hand side matrixB.LDBβINTEGER. the leading dimension of the arrayB.LDB >= max(1,N).XβDOUBLE PRECISION array, dimension(LDX,NRHS). on entry, the solution matrixX, as computed byDGTTRS. on exit, the improved solution matrixX. β¨LDXβINTEGER. the leading dimension of the arrayX.LDX >= max(1,N).FERRβ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β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βDOUBLE PRECISION array, dimension(3*N).
π yes,3*Nhere, not the2*Nthe complex one uses. don't mix them up, bestie, that's a whole different girl.
IWORKβINTEGER array, dimension(N).INFOβINTEGER.= 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.
okay and that's where part 1 stops β <sgtrfs> and <zgtrfs> are still backstage getting ready, and there's more of dgtrfs's paperwork to come. don't go anywhere bestie, part 2 is literally right there. π
π« Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 206 of file dgtrfs.f.
π¦ sgtrfs π
subroutine sgtrfs (character trans, integer n, integer nrhs, real,
dimension( * ) dl, real, dimension( * ) d, real, dimension( * ) du,
real, dimension( * ) dlf, real, dimension( * ) df, real, dimension( * )
duf, real, dimension( * ) du2, 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)
SGTRFS β single precision, real, tridiagonal, and honestly? She ate. π
β¨ Purpose β¨
okay so real talk: SGTRFS improves the computed solution to a system of linear equations when the coefficient matrix is tridiagonal, and provides error bounds and backward error estimates for the solution. That's the whole gig. She takes your kinda-good answer and makes it good good. π«Ά
π Parameters π
TRANSβCHARACTER*1. Specifies the form of the system of equations:= 'N': A * X = B (No transpose)= 'T': A**T * X = B (Transpose)= 'C': A**H * X = B (Conjugate transpose = Transpose)
NβINTEGER. The order of the matrix A.N >= 0.NRHSβINTEGER. The number of right hand sides, i.e., the number of columns of the matrix B.NRHS >= 0.DLβREAL array, dimension (N-1). The(n-1)subdiagonal elements of A.DβREAL array, dimension (N). The diagonal elements of A. the main character energy of the tridiagonal trio tbh. πDUβREAL array, dimension (N-1). The(n-1)superdiagonal elements of A.DLFβREAL array, dimension (N-1). The(n-1)multipliers that define the matrix L from the LU factorization of A as computed bySGTTRF.DFβREAL array, dimension (N). Thendiagonal elements of the upper triangular matrix U from the LU factorization of A.DUFβREAL array, dimension (N-1). The(n-1)elements of the first superdiagonal of U.DU2βREAL array, dimension (N-2). The(n-2)elements of the second superdiagonal of U.IPIVβINTEGER array, dimension (N). The pivot indices; for1 <= i <= n, rowiof the matrix was interchanged with rowIPIV(i).IPIV(i)will always be eitheriori+1;IPIV(i) = iindicates a row interchange was not required. lowkey the receipts of who moved where. π₯BβREAL array, dimension (LDB,NRHS). The right hand side matrix B.LDBβINTEGER. The leading dimension of the array B.LDB >= max(1,N).XβREAL array, dimension (LDX,NRHS). On entry, the solution matrix X, as computed bySGTTRS. On exit, the improved solution matrix X. glow-up arc fr fr. β¨LDXβINTEGER. The leading dimension of the array X.LDX >= max(1,N).FERRβREAL array, dimension (NRHS). The estimated forward error bound for each solution vectorX(j)(thej-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 she's a little dramatic but she's not wrong. πBERRβ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βREAL array, dimension (3*N).IWORKβINTEGER array, dimension (N).INFOβINTEGER.= 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. she doesn't grind forever, okay? there's a limit. π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 206 of file sgtrfs.f.
π zgtrfs π
subroutine zgtrfs (character trans, integer n, integer nrhs, complex*16,
dimension( * ) dl, complex*16, dimension( * ) d, complex*16, dimension(
* ) du, complex*16, dimension( * ) dlf, complex*16, dimension( * ) df,
complex*16, dimension( * ) duf, complex*16, dimension( * ) du2, 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)
ZGTRFS β complex*16 era, double precision error bounds, absolutely serving. π¦
β¨ Purpose β¨
ZGTRFS improves the computed solution to a system of linear equations when the coefficient matrix is tridiagonal, and provides error bounds and backward error estimates for the solution. same assignment as her single-precision sister, just with complex numbers in the mix. no cap. π
π Parameters π
TRANSβCHARACTER*1. Specifies the form of the system of equations:= 'N': A * X = B (No transpose)= 'T': A**T * X = B (Transpose)= 'C': A**H * X = B (Conjugate transpose)
NβINTEGER. The order of the matrix A.N >= 0.NRHSβINTEGER. The number of right hand sides, i.e., the number of columns of the matrix B.NRHS >= 0.DLβCOMPLEX*16 array, dimension (N-1). The(n-1)subdiagonal elements of A.DβCOMPLEX*16 array, dimension (N). The diagonal elements of A.DUβCOMPLEX*16 array, dimension (N-1). The(n-1)superdiagonal elements of A.DLFβCOMPLEX*16 array, dimension (N-1). The(n-1)multipliers that define the matrix L from the LU factorization of A as computed byZGTTRF.DFβCOMPLEX*16 array, dimension (N). Thendiagonal elements of the upper triangular matrix U from the LU factorization of A.DUFβCOMPLEX*16 array, dimension (N-1). The(n-1)elements of the first superdiagonal of U.DU2βCOMPLEX*16 array, dimension (N-2). The(n-2)elements of the second superdiagonal of U.IPIVβINTEGER array, dimension (N). The pivot indices; for1 <= i <= n, rowiof the matrix was interchanged with rowIPIV(i).IPIV(i)will always be eitheriori+1;IPIV(i) = iindicates a row interchange was not required.BβCOMPLEX*16 array, dimension (LDB,NRHS). The right hand side matrix B.LDBβINTEGER. The leading dimension of the array B.LDB >= max(1,N).XβCOMPLEX*16 array, dimension (LDX,NRHS). On entry, the solution matrix X, as computed byZGTTRS. On exit, the improved solution matrix X.LDXβINTEGER. The leading dimension of the array X.LDX >= max(1,N).FERRβDOUBLE PRECISION array, dimension (NRHS). The estimated forward error bound for each solution vectorX(j)(thej-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βDOUBLE PRECISION 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βCOMPLEX*16 array, dimension (2*N).RWORKβDOUBLE PRECISION array, dimension (N).INFOβINTEGER.= 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. yes bestie, there's a cap on the grinding. π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 207 of file zgtrfs.f.
β Author β
Generated automatically by Doxygen for LAPACK from the source code. not a human author, a machine author, and honestly she's slaying the automation. π€π
that's the whole page bestie, you made it to the end!! π this one's stamped LAPACK, Version 3.12.0, and it lives at gtrfs(3) in the manual β so if you ever need to find her again, that's the address. mwah, go improve some solutions. πΈππ«Ά
π¦ 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