TESTING/LIN/zget04.f(3)
π TESTING/LIN/zget04.f β bestie's fave little residual checker β¨
okay so picture this: it's a Fortran file in TESTING/LIN, and it's the one that stares at your computed answer and your exact answer and goes "hmm. bestie. how far off are we, actually?" π Folding the manual name in right here so you know what you're looking at: zget04.f(3), straight out of the LAPACK library functions manual.
β¨ SYNOPSIS β¨
Functions/Subroutines π¦
subroutine zget04 (n, nrhs, x, ldx, xact, ldxact, rcond, resid)β literally just ZGET04, living its best life, doing one job and doing it well π
π«Ά Function/Subroutine Documentation π«Ά
subroutine zget04 (integer n, integer nrhs, complex*16, dimension( ldx, * )
x, integer ldx, complex*16, dimension( ldxact, * ) xact, integer ldxact,
double precision rcond, double precision resid)
ZGET04 π β that's the name, no cap.
π Purpose π
!> ZGET04 computes the difference between a computed solution and the !> true solution to a system of linear equations. !> !> RESID = ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ), !> where RCOND is the reciprocal of the condition number and EPS is the !> machine epsilon. !>
So likeβ¦ it takes your computed solution, compares it to the true one, and spits out a residual scaled by the condition number and machine epsilon. It's giving "who are you really, mathematically speaking" energy π₯ note that RESID is scaled by RCOND and EPS in exactly that formula β keep it, memorize it, it's iconic.
π Parameters π
Nβ INTEGER, obvi π The number of rows of the matricesXandXACT. Constraint:N >= 0.
!> N is INTEGER !> The number of rows of the matrices X and XACT. N >= 0.
NRHSβ INTEGER, the right-hand-side count, the column count, the whole vibe π¦ The number of columns of the matricesXandXACT. Constraint:NRHS >= 0.
!> NRHS is INTEGER !> The number of columns of the matrices X and XACT. NRHS >= 0.
Xβ COMPLEX*16 array, dimension(LDX,NRHS)β¨ The computed solution vectors β and each vector is stored as a column of the matrixX.
!> X is COMPLEX*16 array, dimension (LDX,NRHS) !> The computed solution vectors. Each vector is stored as a !> column of the matrix X.
LDXβ INTEGER, the leading dimension flex π The leading dimension of the arrayX. Constraint:LDX >= max(1,N).
!> LDX is INTEGER !> The leading dimension of the array X. LDX >= max(1,N).
XACTβ COMPLEX*16 array, dimension(LDX,NRHS)β wait, bestie, read it exactly as written in the source: it's documented asdimension (LDX,NRHS)with leading dimension described below asLDXACTπ The exact solution vectors, each stored as a column of the matrixXACT.
!> XACT is COMPLEX*16 array, dimension (LDX,NRHS) !> The exact solution vectors. Each vector is stored as a !> column of the matrix XACT.
LDXACTβ INTEGER πΈ The leading dimension of the arrayXACT. Constraint:LDXACT >= max(1,N).
!> LDXACT is INTEGER !> The leading dimension of the array XACT. LDXACT >= max(1,N).
RCONDβ DOUBLE PRECISION β The reciprocal of the condition number of the coefficient matrix in the system of equations. (Yes, the reciprocal. Don't come for me, that's what it says.)
!> RCOND is DOUBLE PRECISION !> The reciprocal of the condition number of the coefficient !> matrix in the system of equations.
RESIDβ DOUBLE PRECISION π The output, the moment of truth: the maximum over theNRHSsolution vectors of( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS )
!> RESID is DOUBLE PRECISION !> The maximum over the NRHS solution vectors of !> ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS )
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
(Group project, but make it Fortran π«Ά)
π§ Definition π§
Definition at line 101 of file zget04.f.
π Author (the meta one) π
Generated automatically by Doxygen for LAPACK from the source code. Not a human, just vibes and a parser πΈ
okay that's the whole page, no details left behind, periodt π
and for the cute sign-off: this little masterpiece is from LAPACK, Version 3.12.0, page TESTING/LIN/zget04.f(3) β go forth and compute your residuals, bestie, you're gonna slay πβ¨π¦
π¦ 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