SRC/sgetri.f(3)
β¨ SRC/sgetri.f β¨
okay so this page lives in the Library Functions Manual (LAPACK's own little corner of the internet) and honestly? it's a bop. it's the docs for sgetri, and if you've ever wanted to un-multiply a matrix, bestie, this is your girl π
πΈ SYNOPSIS πΈ
Functions/Subroutines
subroutine sgetri (n, a, lda, ipiv, work, lwork, info)β the whole squad, introduced below. this isSGETRI, no notes π
π¦ Function/Subroutine Documentation π¦
subroutine sgetri (integer n, real, dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv, real, dimension( * ) work, integer lwork, integer info)
SGETRI β literally her name, spelled out twice because she's that iconic π
π Purpose π
so here's the tea, in the original's own framing:
!>
!> SGETRI computes the inverse of a matrix using the LU factorization
!> computed by SGETRF.
!>
!> This method inverts U and then computes inv(A) by solving the system
!> inv(A)*L = inv(U) for inv(A).
!>
like, you already did the work with SGETRF β this just finishes the job. it flips U, then solves inv(A)*L = inv(U) to get inv(A). she's giving "second half of a two-part episode" and honestly it ate π₯
β Parameters β
N
!> N is INTEGER
!> The order of the matrix A. N >= 0.
!>
the order of the matrix A, and bestie she has standards: N >= 0. no negatives, no drama, periodt.
A
!> A is REAL array, dimension (LDA,N)
!> On entry, the factors L and U from the factorization
!> A = P*L*U as computed by SGETRF.
!> On exit, if INFO = 0, the inverse of the original matrix A.
!>
a REAL array sized (LDA,N), and it's basically a glow-up transformation π« on entry it's holding the factors L and U from A = P*L*U (as computed by SGETRF), and on exit, if INFO = 0, it's the inverse of the original matrix A. same array, whole new era. main character energy fr.
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= max(1,N).
!>
the leading dimension of the array A, and the vibe check is LDA >= max(1,N) π«Ά
IPIV
!> IPIV is INTEGER array, dimension (N)
!> The pivot indices from SGETRF; for 1<=i<=N, row i of the
!> matrix was interchanged with row IPIV(i).
!>
an INTEGER array sized (N) holding the pivot indices from SGETRF β for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i). she keeps receipts of every swap π
WORK
!> WORK is REAL array, dimension (MAX(1,LWORK))
!> On exit, if INFO=0, then WORK(1) returns the optimal LWORK.
!>
a REAL array sized (MAX(1,LWORK)), and on exit, if INFO=0, WORK(1) hands you back the optimal LWORK. she's a workspace and a messenger π§
LWORK
!> LWORK is INTEGER
!> The dimension of the array WORK. LWORK >= max(1,N).
!> For optimal performance LWORK >= N*NB, where NB is
!> the optimal blocksize returned by ILAENV.
!>
!> If LWORK = -1, then a workspace query is assumed; the routine
!> only calculates the optimal size of the WORK array, returns
!> this value as the first entry of the WORK array, and no error
!> message related to LWORK is issued by XERBLA.
!>
an INTEGER, the dimension of the array WORK. minimum is LWORK >= max(1,N), but for optimal performance you want LWORK >= N*NB, where NB is the optimal blocksize returned by ILAENV π
and here's the special trick: ifLWORK = -1, a workspace query is assumed πͺ the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. so like, don't panic when nothing yells at you, that's the whole point.
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 matrix is
!> singular and its inverse could not be computed.
!>
an INTEGER and the ultimate vibe report:
= 0: successful exit π she did it< 0: ifINFO = -i, thei-th argument had an illegal value π> 0: ifINFO = i,U(i,i)is exactly zero β the matrix is singular and its inverse could not be computed π no inverse for you, it's giving undefined and honestly, respect the boundary.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
four absolute legends, we stan π
Definition at line 113 of file sgetri.f. yes, exactly line 113, don't @ me π
π Author π
this page was generated automatically by Doxygen for LAPACK from the source code β so like, a robot wrote the layout but the math is all human genius π
okay that's the whole page, bestie, you're officially caught up. go forth and invert responsibly π
LAPACK β Version 3.12.0 Β· SRC/sgetri.f(3) Β· mwah, thanks for reading, ily, bye π«Άβ¨
π¦ 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