gttrf(3)
π¦ gttrf(3) β triangular factor, bestie edition π
So you opened the gttrf page from the Library Functions Manual and your eyes glazed over? Relatable. Sit down, hydrate, and let me walk you through it, because honestly this one is kind of iconic once you get past the Fortran cosplay. π
Short version: gttrf = triangular factor. It's the family name for four lil sibling routines (cgttrf, dgttrf, sgttrf, zgttrf) that all do the same thing, just with different precisions and real-vs-complex vibes. Think of them as the same friend group in four different aesthetics. β¨
β¨ NAME β¨
gttrf β gttrf: triangular factor
πΈ SYNOPSIS πΈ
Functions
subroutine cgttrf (n, dl, d, du, du2, ipiv, info)β CGTTRF πsubroutine dgttrf (n, dl, d, du, du2, ipiv, info)β DGTTRF π₯subroutine sgttrf (n, dl, d, du, du2, ipiv, info)β SGTTRF βsubroutine zgttrf (n, dl, d, du, du2, ipiv, info)β ZGTTRF π
π§ Detailed Description
Okay so this section is literally just the heading in the original β no big essay, no lore drop. The actual tea is all in Function Documentation below. Slay. π«Ά
π Function Documentation π
π subroutine cgttrf (integer n, complex, dimension( * ) dl, complex, dimension( * ) d, complex, dimension( * ) du, complex, dimension( * ) du2, integer, dimension( * ) ipiv, integer info) β CGTTRF
Purpose π«
CGTTRF computes an LU factorization of a complex tridiagonal matrix A using elimination with partial pivoting and row interchanges.
The factorization has the form
A = L * U
where L is a product of permutation and unit lower bidiagonal matrices, and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals. No cap, that's the whole vibe. β¨
Parameters πΈ
NβNisINTEGER. The order of the matrixA.DLβDLisCOMPLEXarray, dimension(N-1). On entry,DLmust contain the(n-1)sub-diagonal elements ofA. On exit,DLis overwritten by the(n-1)multipliers that define the matrixLfrom the LU factorization ofA. πDβDisCOMPLEXarray, dimension(N). On entry,Dmust contain the diagonal elements ofA. On exit,Dis overwritten by thendiagonal elements of the upper triangular matrixUfrom the LU factorization ofA.DUβDUisCOMPLEXarray, dimension(N-1). On entry,DUmust contain the(n-1)super-diagonal elements ofA. On exit,DUis overwritten by the(n-1)elements of the first super-diagonal ofU. π¦DU2βDU2isCOMPLEXarray, dimension(N-2). On exit,DU2is overwritten by the(n-2)elements of the second super-diagonal ofU.IPIVβIPIVisINTEGERarray, 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.INFOβINFOisINTEGER.= 0: successful exit π< 0: ifINFO = -k, thek-th argument had an illegal value π> 0: ifINFO = k,U(k,k)is exactly zero. The factorization has been completed, but the factorUis exactly singular, and division by zero will occur if it is used to solve a system of equations. > β οΈ Like, actually though β that's a real "do not pass go" situation. Division by zero is not the move.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 123 of file cgttrf.f.
π₯ subroutine dgttrf (integer n, double precision, dimension( * ) dl, double precision, dimension( * ) d, double precision, dimension( * ) du, double precision, dimension( * ) du2, integer, dimension( * ) ipiv, integer info) β DGTTRF
Purpose π«
DGTTRF computes an LU factorization of a real tridiagonal matrix A using elimination with partial pivoting and row interchanges.
The factorization has the form
A = L * U
where L is a product of permutation and unit lower bidiagonal matrices, and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals. Same energy as its complex sibling, just, you know, real. β
Parameters πΈ
NβNisINTEGER. The order of the matrixA.DLβDLisDOUBLE PRECISIONarray, dimension(N-1). On entry,DLmust contain the(n-1)sub-diagonal elements ofA. On exit,DLis overwritten by the(n-1)multipliers that define the matrixLfrom the LU factorization ofA. πDβDisDOUBLE PRECISIONarray, dimension(N). On entry,Dmust contain the diagonal elements ofA. On exit,Dis overwritten by thendiagonal elements of the upper triangular matrixUfrom the LU factorization ofA.DUβDUisDOUBLE PRECISIONarray, dimension(N-1). On entry,DUmust contain the(n-1)super-diagonal elements ofA. On exit,DUis overwritten by the(n-1)elements of the first super-diagonal ofU. π¦DU2βDU2isDOUBLE PRECISIONarray, dimension(N-2). On exit,DU2is overwritten by the(n-2)elements of the second super-diagonal ofU.IPIVβIPIVisINTEGERarray, 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.INFOβINFOisINTEGER.= 0: successful exit π< 0: ifINFO = -k, thek-th argument had an illegal value π> 0: ifINFO = k,U(k,k)is exactly zero. The factorization has been completed, but the factorUis exactly singular, and division by zero will occur if it is used to solve a system of equations. > β οΈ Fr fr, singularUmeans don't go solving systems with it unless you want chaos.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 123 of file dgttrf.f.
β subroutine sgttrf (integer n, real, dimension( * ) dl, real, dimension( * ) d, real, dimension( * ) du, real, dimension( * ) du2, integer, dimension( * ) ipiv, integer info) β SGTTRF
Purpose π«
SGTTRF computes an LU factorization of a real tridiagonal matrix A using elimination with partial pivoting and row interchanges.
The factorization has the form
A = L * U
where L is a product of permutation and unit lower bidiagonal matrices, and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals. Yep, SGTTRF and DGTTRF are basically twins β one's single precision, one's double. Iykyk. π₯
Parameters πΈ
NβNisINTEGER. The order of the matrixA.DLβDLisREALarray, dimension(N-1). On entry,DLmust contain the(n-1)sub-diagonal elements ofA. On exit,DLis overwritten by the(n-1)multipliers that define the matrixLfrom the LU factorization ofA. πDβDisREALarray, dimension(N). On entry,Dmust contain the diagonal elements ofA. On exit,Dis overwritten by thendiagonal elements of the upper triangular matrixUfrom the LU factorization ofA.DUβDUisREALarray, dimension(N-1). On entry,DUmust contain the(n-1)super-diagonal elements ofA. On exit,DUis overwritten by the(n-1)elements of the first super-diagonal ofU. π¦DU2βDU2isREALarray, dimension(N-2). On exit,DU2is overwritten by the(n-2)elements of the second super-diagonal ofU.IPIVβIPIVisINTEGERarray, 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.INFOβINFOisINTEGER.= 0: successful exit π< 0: ifINFO = -k, thek-th argument had an illegal value π> 0: ifINFO = k,U(k,k)is exactly zero. The factorization has been completed, but the factorUis exactly singular, and division by zero will occur if it is used to solve a system of equations. > β οΈ Exactly singular. Not "a little singular". Exactly. Respect the warning, bestie.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 123 of file sgttrf.f.
π subroutine zgttrf (integer n, complex*16, dimension( * ) dl, complex*16, dimension( * ) d, complex*16, dimension( * ) du, complex*16, dimension( * ) du2, integer, dimension( * ) ipiv, integer info) β ZGTTRF
Purpose π«
ZGTTRF computes an LU factorization of a complex tridiagonal matrix A using elimination with partial pivoting and row interchanges.
The factorization has the form
A = L * U
where L is a product of permutation and unit lower bidiagonal matrices, and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals. Complex and double β the main character of the group, honestly. π
Parameters πΈ
NβNisINTEGER. The order of the matrixA.DLβDLisCOMPLEX*16array, dimension(N-1). On entry,DLmust contain the(n-1)sub-diagonal elements ofA. On exit,DLis overwritten by the(n-1)multipliers that define the matrixLfrom the LU factorization ofA. πDβDisCOMPLEX*16array, dimension(N). On entry,Dmust contain the diagonal elements ofA. On exit,Dis overwritten by thendiagonal elements of the upper triangular matrixUfrom the LU factorization ofA.
π¦ DU
COMPLEX*16 array, dimension (N-1)
on entry,DUmust contain the(n-1)super-diagonal elements ofA.
on exit,DUgets overwritten by the(n-1)elements of the first super-diagonal ofU. she gets a whole new identity, no cap π
π DU2
COMPLEX*16 array, dimension (N-2)
on exit,DU2is overwritten by the(n-2)elements of the second super-diagonal ofU. yep, there's a whole second one, she's stacked like that β¨
π IPIV
INTEGER array, dimension (N)
the pivot indices, bestie β the receipts of who swapped with who π
for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i).
and here's the tea: IPIV(i) will always be either i or i+1. so if IPIV(i) = i, that means a row interchange was not required β she stayed exactly where she was, main character energy, no notes π«Ά
β INFO
INTEGER
the vibe check at the end, fr fr:
= 0: successful exit π everything ate, nothing left on the floor< 0: ifINFO = -k, the k-th argument had an illegal value π somebody passed her something cursed> 0: ifINFO = k,U(k,k)is exactly zero
π¨ okay so about that last one β the factorization has been completed, but the factor U is exactly singular. that means division by zero will occur if it's used to solve a system of equations. she finished the job but the job is a hazard, proceed with caution π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 123 of file zgttrf.f.
π Author
Generated automatically by Doxygen for LAPACK from the source code. (not a human, just a lil robot doing her thing π€β¨)
and that's the whole page, bestie β gttrf(3), straight out of LAPACK Version 3.12.0. go forth and factorize responsibly πππ¦
π¦ 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