SRC/ctptri.f(3)
β¨ SRC/ctptri.f(3) β¨
ok so bestie, welcome to the glow-up era of the Library Functions Manual π
this is the page for SRC/ctptri.f and it's honestly a whole vibe β we're out here inverting complex triangular matrices that are living their best packed life. let's get into it π«Ά
πΈ SYNOPSIS πΈ
Functions/Subroutines
subroutine ctptri (uplo, diag, n, ap, info)β the main character herself,CTPTRIπ
π¦ Function/Subroutine Documentation π¦
subroutine ctptri (character uplo, character diag, integer n, complex,
dimension( * ) ap, integer info)
CTPTRI β iconic, no notes π
π Purpose:
!>!> CTPTRI computes the inverse of a complex upper or lower triangular!> matrix A stored in packed format.!>
like, literally what it says on the tin: you hand her a complex triangular matrix A, packed, and she hands you back the inverse. easy. ATE. π₯
π Parameters
UPLO
!>UPLO is CHARACTER*1!>= 'U': A is upper triangular;!>= 'L': A is lower triangular.!>
your vibe check on which half of the matrix actually matters, bestie. 'U' for upper triangular, 'L' for lower triangular π«
DIAG
!>DIAG is CHARACTER*1!>= 'N': A is non-unit triangular;!>= 'U': A is unit triangular.!>
so 'N' means the diagonal is a real, actual participating member of the matrix (non-unit), and 'U' means the diagonal is unit triangular. pick your fighter β¨
N
!>N is INTEGER!>The order of the matrix A. N >= 0.!>
the order of A, and the bar is on the floor: N >= 0. zero is literally allowed, she's not picky π
AP
!>AP is COMPLEX array, dimension (N*(N+1)/2)!>On entry, the upper or lower triangular matrix A, stored!>columnwise in a linear array. The j-th column of A is stored!>in the array AP as follows:!>if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;!>if UPLO = 'L', AP(i + (j-1)*((2*n-j)/2) = A(i,j) for j<=i<=n.!>See below for further details.!>On exit, the (triangular) inverse of the original matrix, in!>the same packed storage format.!>
ok so AP is a COMPLEX array with dimension (N*(N+1)/2) β that's the packed storage, no wasted zeros, we love efficiency π
on entry it's your triangular matrix A stored columnwise in a linear array, indexed like this:
- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*((2*n-j)/2) = A(i,j)forj<=i<=n;
(and yeah, that second one is literally how it's written here β I'm not touching the parentheses, that's her business π)
deets are further down if you wanna scroll. on exit you get the triangular inverse of the original matrix, in the exact same packed storage format. in and out, same fit, no cap π§
INFO
!>INFO is INTEGER!>= 0: successful exit!>< 0: if INFO = -i, the i-th argument had an illegal value!>> 0: if INFO = i, A(i,i) is exactly zero. The triangular!>matrix is singular and its inverse can not be computed.!>
the receipts, basically:
= 0: successful exit, we slayed π< 0: ifINFO = -i, the i-th argument had an illegal value β somebody passed something unserious π> 0: ifINFO = i,A(i,i)is exactly zero. the triangular matrix is singular and its inverse can not be computed. so sorry bestie, that one's a dead end π
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole group chat of legends that made this happen π
π Further Details:
!>!> A triangular matrix A can be transferred to packed storage using one!> of the following program segments:!>!> UPLO = 'U': UPLO = 'L':!>!> JC = 1 JC = 1!> DO 2 J = 1, N DO 2 J = 1, N!> DO 1 I = 1, J DO 1 I = J, N!> AP(JC+I-1) = A(I,J) AP(JC+I-J) = A(I,J)!> 1 CONTINUE 1 CONTINUE!> JC = JC + J JC = JC + N - J + 1!> 2 CONTINUE 2 CONTINUE!>
so if you ever need to shove a triangular matrix A into packed storage yourself, here's the exact recipe, side by side, UPLO = 'U' on the left and UPLO = 'L' on the right:
JC = 1 JC = 1
DO 2 J = 1, N DO 2 J = 1, N
DO 1 I = 1, J DO 1 I = J, N
AP(JC+I-1) = A(I,J) AP(JC+I-J) = A(I,J)
1 CONTINUE 1 CONTINUE
JC = JC + J JC = JC + N - J + 1
2 CONTINUE 2 CONTINUE
copy it, paste it, iconic behaviour, honestly π
β Definition at line 116 of file ctptri.f.
that's where she lives, line 116. go say hi π
Author
Generated automatically by Doxygen for LAPACK from the source code.
(yes, a robot wrote the page about the subroutine. girlboss behaviour, we respect it π€π )
ok that's the whole thing !! this page is from LAPACK, Version 3.12.0, and it's the SRC/ctptri.f(3) entry β go forth and invert those triangular matrices, bestie, you've got this fr fr πβ¨ππ¦πΈ
π¦ 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