SRC/sgetrf.f(3)

πŸ¦‹ sgetrf β€” SRC/sgetrf.f(3) πŸ¦‹

okay so bestie, real talk: this page lives in the Library Functions Manual and it's all about SRC/sgetrf.f, which is genuinely one of the most iconic files in LAPACK. LU factorization?? on a general matrix?? with partial pivoting?? she ate, no cap. let's get into it πŸ’…


✨ NAME ✨

SRC/sgetrf.f β€” that's the whole name, she's lowkey mysterious like that πŸŽ€


🌸 SYNOPSIS 🌸

Functions/Subroutines

  • subroutine sgetrf (m, n, a, lda, ipiv, info) β€” literally the whole vibe. this is SGETRF ✨
subroutine sgetrf (integer m, integer n, real, dimension( lda, * ) a,
     integer lda, integer, dimension( * ) ipiv, integer info)

πŸ‘‘ Function/Subroutine Documentation πŸ‘‘

⭐ subroutine sgetrf ⭐

subroutine sgetrf (integer m, integer n, real, dimension( lda, * ) a,
     integer lda, integer, dimension( * ) ipiv, integer info)
🫢 SGETRF β€” say her name, she's famous

πŸ’– Purpose πŸ’–

okay so here's the tea, straight from the source:

!>
!> SGETRF computes an LU factorization of a general M-by-N matrix A
!> using partial pivoting with row interchanges.
!>
!> The factorization has the form
!>    A = P * L * U
!> where P is a permutation matrix, L is lower triangular with unit
!> diagonal elements (lower trapezoidal if m > n), and U is upper
!> triangular (upper trapezoidal if m < n).
!>
!> This is the right-looking Level 3 BLAS version of the algorithm.
!>

so basically: she factors A into A = P * L * U, where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if m > n, and yes the trapezoid era is real 🌈), and U is upper triangular (upper trapezoidal if m < n). she's the right-looking Level 3 BLAS version of the algorithm, which is giving main character energy fr fr πŸ”₯


πŸ’œ Parameters πŸ’œ

M

!>          M is INTEGER
!>          The number of rows of the matrix A.  M >= 0.
!>

M is an INTEGER β€” the number of rows of the matrix A. she requires M >= 0 ⭐

N

!>          N is INTEGER
!>          The number of columns of the matrix A.  N >= 0.
!>

N is an INTEGER β€” the number of columns of the matrix A. also N >= 0, we love a boundary πŸŽ€

A

!>          A is REAL array, dimension (LDA,N)
!>          On entry, the M-by-N matrix to be factored.
!>          On exit, the factors L and U from the factorization
!>          A = P*L*U; the unit diagonal elements of L are not stored.
!>

A is a REAL array, dimension (LDA,N). on entry, it's the M-by-N matrix to be factored. on exit, it holds the factors L and U from the factorization A = P*L*U β€” and bestie, listen, the unit diagonal elements of L are not stored. she said "save space, stay slay" πŸ¦‹

LDA

!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,M).
!>

LDA is an INTEGER β€” the leading dimension of the array A, and it has to be LDA >= max(1,M). respect the leading dimension or perish πŸ™ˆ

IPIV

!>          IPIV is INTEGER array, dimension (min(M,N))
!>          The pivot indices; for 1 <= i <= min(M,N), row i of the
!>          matrix was interchanged with row IPIV(i).
!>

IPIV is an INTEGER array, dimension (min(M,N)). these are the pivot indices β€” for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i). she's tracking every swap, she's organized like that πŸ’…

INFO

!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!>          > 0:  if INFO = i, U(i,i) 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.
!>

INFO is an INTEGER and she is the vibe check of the whole operation:

  • = 0 β€” successful exit πŸŽ‰ slay
  • < 0 β€” if INFO = -i, the i-th argument had an illegal value 😭 someone passed bad input
  • > 0 β€” if INFO = i, U(i,i) is exactly zero. the factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it's used to solve a system of equations. πŸ’€ this is the "she finished the job but the job is cursed" ending
🚨 periodt: a positive INFO is not an error in the computation β€” the factorization completed β€” but U is singular and using it to solve a system of equations means division by zero. take that seriously, bestie.

🧚 Author 🧚

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

absolute legends, each and every one πŸ«ΆπŸ‘‘

Definition at line 107 of file sgetrf.f. ⭐


🌈 Author 🌈

Generated automatically by Doxygen for LAPACK from the source code. (she didn't write herself, a robot did, and honestly? still iconic πŸ€–βœ¨)


πŸ’Œ and that's the whole page bestie β€” LAPACK, Version 3.12.0, SRC/sgetrf.f(3). go forth and factor, and remember: partial pivoting with row interchanges is not a personality trait but it is a lifestyle πŸ“πŸ’œπŸŽ€
πŸ“¦ where this page comes from