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 β€” N is INTEGER. The order of the matrix A.
  • DL β€” DL is COMPLEX array, dimension (N-1). On entry, DL must contain the (n-1) sub-diagonal elements of A. On exit, DL is overwritten by the (n-1) multipliers that define the matrix L from the LU factorization of A. πŸ’…
  • D β€” D is COMPLEX array, dimension (N). On entry, D must contain the diagonal elements of A. On exit, D is overwritten by the n diagonal elements of the upper triangular matrix U from the LU factorization of A.
  • DU β€” DU is COMPLEX array, dimension (N-1). On entry, DU must contain the (n-1) super-diagonal elements of A. On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U. πŸ¦‹
  • DU2 β€” DU2 is COMPLEX array, dimension (N-2). On exit, DU2 is overwritten by the (n-2) elements of the second super-diagonal of U.
  • IPIV β€” IPIV is INTEGER array, dimension (N). The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.
  • INFO β€” INFO is INTEGER.
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -k, the k-th argument had an illegal value 😭
    • > 0: if INFO = k, U(k,k) is exactly zero. The factorization has been completed, but the factor U is 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 β€” N is INTEGER. The order of the matrix A.
  • DL β€” DL is DOUBLE PRECISION array, dimension (N-1). On entry, DL must contain the (n-1) sub-diagonal elements of A. On exit, DL is overwritten by the (n-1) multipliers that define the matrix L from the LU factorization of A. πŸ’…
  • D β€” D is DOUBLE PRECISION array, dimension (N). On entry, D must contain the diagonal elements of A. On exit, D is overwritten by the n diagonal elements of the upper triangular matrix U from the LU factorization of A.
  • DU β€” DU is DOUBLE PRECISION array, dimension (N-1). On entry, DU must contain the (n-1) super-diagonal elements of A. On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U. πŸ¦‹
  • DU2 β€” DU2 is DOUBLE PRECISION array, dimension (N-2). On exit, DU2 is overwritten by the (n-2) elements of the second super-diagonal of U.
  • IPIV β€” IPIV is INTEGER array, dimension (N). The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.
  • INFO β€” INFO is INTEGER.
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -k, the k-th argument had an illegal value 😭
    • > 0: if INFO = k, U(k,k) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations. > ⚠️ Fr fr, singular U means 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 β€” N is INTEGER. The order of the matrix A.
  • DL β€” DL is REAL array, dimension (N-1). On entry, DL must contain the (n-1) sub-diagonal elements of A. On exit, DL is overwritten by the (n-1) multipliers that define the matrix L from the LU factorization of A. πŸ’…
  • D β€” D is REAL array, dimension (N). On entry, D must contain the diagonal elements of A. On exit, D is overwritten by the n diagonal elements of the upper triangular matrix U from the LU factorization of A.
  • DU β€” DU is REAL array, dimension (N-1). On entry, DU must contain the (n-1) super-diagonal elements of A. On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U. πŸ¦‹
  • DU2 β€” DU2 is REAL array, dimension (N-2). On exit, DU2 is overwritten by the (n-2) elements of the second super-diagonal of U.
  • IPIV β€” IPIV is INTEGER array, dimension (N). The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.
  • INFO β€” INFO is INTEGER.
    • = 0: successful exit πŸŽ‰
    • < 0: if INFO = -k, the k-th argument had an illegal value 😭
    • > 0: if INFO = k, U(k,k) is exactly zero. The factorization has been completed, but the factor U is 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 β€” N is INTEGER. The order of the matrix A.
  • DL β€” DL is COMPLEX*16 array, dimension (N-1). On entry, DL must contain the (n-1) sub-diagonal elements of A. On exit, DL is overwritten by the (n-1) multipliers that define the matrix L from the LU factorization of A. πŸ’…
  • D β€” D is COMPLEX*16 array, dimension (N). On entry, D must contain the diagonal elements of A. On exit, D is overwritten by the n diagonal elements of the upper triangular matrix U from the LU factorization of A.

πŸ¦‹ DU

COMPLEX*16 array, dimension (N-1)

on entry, DU must contain the (n-1) super-diagonal elements of A.
on exit, DU gets overwritten by the (n-1) elements of the first super-diagonal of U. she gets a whole new identity, no cap πŸ’…

πŸŽ€ DU2

COMPLEX*16 array, dimension (N-2)

on exit, DU2 is overwritten by the (n-2) elements of the second super-diagonal of U. 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: if INFO = -k, the k-th argument had an illegal value 😭 somebody passed her something cursed
  • > 0: if INFO = 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