SRC/cpocon.f(3)
π¦ SRC/cpocon.f π¦
Okay bestie, buckle up and grab your iced coffee because we're about to get intimate with some linear algebra realness. This is a Fortran subroutine from the LAPACK library, and honestly? It's kind of iconic.
β¨ NAME β¨
SRC/cpocon.f β the file you're looking at, and yes, the .f is giving classic Fortran main character energy π
π SYNOPSIS π
So here's the whole function and subroutine situation in all its glory:
subroutine cpocon (uplo, n, a, lda, anorm, rcond, work, rwork, info)
CPOCON
πΈ Function/Subroutine Documentation πΈ
π The Signature π
subroutine cpocon (character uplo, integer n, complex, dimension( lda, * )
a, integer lda, real anorm, real rcond, complex, dimension( * ) work,
real, dimension( * ) rwork, integer info)
Okay so this is CPOCON. Say it with me: C-P-O-C-O-N. Lowkey sounds like a PokΓ©mon but it's actually a real-deal LAPACK routine. π
π₯ Purpose π₯
Bestie, listen. CPOCON is out here estimating the reciprocal of the condition number β in the 1-norm, no less β of a complex Hermitian positive definite matrix. Like, that's a whole lot of adjectives and every single one matters.
The way it does this? It uses the Cholesky factorization that was already computed by CPOTRF, specifically:
A = U**H*UA = L*L**H
One of those. Depends on the vibe. π«Ά
Then it gets an estimate for norm(inv(A)), and computes the reciprocal condition number like so:
RCOND = 1 / (ANORM * norm(inv(A)))
No cap, that's the whole formula. Copy it. Save it. Live by it. β¨
π Parameters π
Okay, this is the part where we go through every single argument, and I mean every single one. No skipping. Periodt.
π
UPLO
UPLO is CHARACTER*1. It's literally just telling you which triangle of A is stored. Cute, right?
= 'U': Upper triangle of A is stored πΈ= 'L': Lower triangle of A is stored π¦
That's it. That's the whole option set. Pick your fighter.
π N
N is INTEGER. It's the order of the matrix A. So like, if A is NΓN, this is the N. And bestie, N >= 0. Always. No negative orders. Not today.
π A
A is a COMPLEX array, dimension (LDA,N). This is the main character right here β the triangular factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H, as computed by CPOTRF.
In other words: CPOTRF did the hard work, and CPOCON is here to evaluate the vibe of it. Iconic teamwork, honestly.
π LDA
LDA is INTEGER β the leading dimension of the array A. And the rule is:
LDA >= max(1,N)
You cannot mess this up. Do not try it. The max is there for a reason. π
β ANORM
ANORM is REAL. This one is the 1-norm (or infinity-norm) of the Hermitian matrix A. That's it. That's the assignment.
π RCOND
RCOND is REAL. This is where the magic number lives:
The reciprocal of the condition number of the matrix A, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine.
So like, AINVNM is the estimate, and RCOND is you dividing 1 by stuff. Math. Slay.
π§ WORK
WORK is a COMPLEX array, dimension (2*N).
Two times N. Not N. Not 3*N. 2*N. Write that down. π
π RWORK
RWORK is a REAL array, dimension (N).
Just N this time. Don't get it twisted with WORK. They're different. They are not the same array. π
ββοΈ
π₯ INFO
INFO is INTEGER, and it's the whole status report of the operation. Here's the full tea:
= 0: successful exit β like, we ate, no crumbs π< 0: if INFO = -i, the i-th argument had an illegal value β somebody messed up andINFOis telling on them, gently but firmly π
π Author π
This masterpiece was brought to you by a whole collab of big-brain institutions:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
And it is defined at line 119 of file cpocon.f. Yes, they counted the lines, don't @ me. π
π Author (the other one, lmao) π
This documentation was generated automatically by Doxygen for LAPACK from the source code. So like, no human typed this for fun (except me, right now, for you). The robots handled it. π€β¨
Okay bestie, that's the whole thing. LAPACK, Version 3.12.0, from SRC/cpocon.f(3). Now go forth and estimate those condition numbers. You've got this. ππ¦πΈβ¨
π¦ 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