SRC/cptcon.f(3)
π SRC/cptcon.f π
okay so this is a page from the Library Functions Manual, and it's literally all about one lil subroutine that does one very specific slay. let's get into it π«Ά
β¨ NAME β¨
SRC/cptcon.f β bestie, that's the whole name, that's the file, that's the vibe π
π¦ SYNOPSIS π¦
Functions/Subroutines
subroutine cptcon (n, d, e, anorm, rcond, rwork, info)β this is the one, this is CPTCON herself π
πΈ Function/Subroutine Documentation πΈ
subroutine cptcon (integer n, real, dimension( * ) d, complex, dimension( * ) e, real anorm, real rcond, real, dimension( * ) rwork, integer info)
CPTCON β icon behavior, no notes π₯
π Purpose:
okay so here's the whole point of her existence, pay attention bestie:
!>
!> CPTCON computes the reciprocal of the condition number (in the
!> 1-norm) of a complex Hermitian positive definite tridiagonal matrix
!> using the factorization A = L*D*L**H or A = U**H*D*U computed by
!> CPTTRF.
!>
!> Norm(inv(A)) is computed by a direct method, and the reciprocal of
!> the condition number is computed as
!> RCOND = 1 / (ANORM * norm(inv(A))).
!>
so like. it takes a complex Hermitian positive definite tridiagonal matrix, uses the factorization A = L*D*L**H or A = U**H*D*U that CPTTRF already did, computes norm(inv(A)) by a direct method (no games), and then hits you with RCOND = 1 / (ANORM * norm(inv(A))). periodt. π
β¨ Parameters β¨
NβNisINTEGER, and it's the order of the matrixA. the rule isN >= 0, we do not do negative orders here π
!> N is INTEGER
!> The order of the matrix A. N >= 0.
!>
DβDis aREAL array, dimension (N). it's holding thendiagonal elements of the diagonal matrixDfrom the factorization ofA, exactly asCPTTRFcomputed them π
!> D is REAL array, dimension (N)
!> The n diagonal elements of the diagonal matrix D from the
!> factorization of A, as computed by CPTTRF.
!>
EβEis aCOMPLEX array, dimension (N-1). the(n-1)off-diagonal elements of the unit bidiagonal factorUorLfrom the factorization ofA, as computed byCPTTRF. note theN-1, she's one shorter, that's not a typo bestie π¦
!> E is COMPLEX array, dimension (N-1)
!> The (n-1) off-diagonal elements of the unit bidiagonal factor
!> U or L from the factorization of A, as computed by CPTTRF.
!>
ANORMβANORMisREAL. it's the 1-norm of the original matrixA. like, the original original, not the factored one π
!> ANORM is REAL
!> The 1-norm of the original matrix A.
!>
RCONDβRCONDisREAL, and this is the output moment, the main character reveal π it's the reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis the 1-norm ofinv(A)computed in this routine. she's computed right here, in this routine, homegrown π
!> RCOND is REAL
!> The reciprocal of the condition number of the matrix A,
!> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is the
!> 1-norm of inv(A) computed in this routine.
!>
RWORKβRWORKis aREAL array, dimension (N). that's it, that's the whole description, she's a workspace, she works, respect her π
!> RWORK is REAL array, dimension (N)
!>
INFOβINFOisINTEGER, aka the vibe check on whether it worked:= 0β successful exit, we love a win π< 0β ifINFO = -i, thei-th argument had an illegal value. so like, you broke it, that's on you π
!> INFO is INTEGER
!> = 0: successful exit
!> < 0: if INFO = -i, the i-th argument had an illegal value
!>
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
(the whole squad, iconic collab π«Ά)
π₯ Further Details:
!>
!> The method used is described in Nicholas J. Higham, , SIAM J. Sci. Stat. Comput., Vol. 7, No. 1, January 1986.
!>
yes bestie, there's a paper, the method is cited, we love a documented algorithm, iykyk π
β Definition at line 118 of file cptcon.f.
πΈ Author πΈ
Generated automatically by Doxygen for LAPACK from the source code. (she didn't write herself, a robot did, but she's still slaying β¨)
ngl, if RCOND comes back looking crusty, that matrix is lowkey ill-conditioned and you should maybe rethink some things π
that's the page bestie, go forth and condition some numbers π π
LAPACK β Version 3.12.0 β SRC/cptcon.f(3) β mwah, catch you on the next manpage ππ¦π
π¦ 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