TESTING/LIN/zgtt02.f(3)
π TESTING/LIN/zgtt02.f
okay so bestie, this is a page from the Library Functions Manual for LAPACK, and it's literally all about one humble little tester subroutine that checks how good your tridiagonal solve actually is. no cap, it's giving "quality control but make it math." π
β¨ SYNOPSIS β¨
Functions/Subroutines
subroutine zgtt02 (trans, n, nrhs, dl, d, du, x, ldx, b, ldb, resid)
ZGTT02 β that's the whole vibe, honestly. π¦
π§ Function/Subroutine Documentation π§
subroutine zgtt02 (character trans, integer n, integer nrhs, complex*16,
dimension( * ) dl, complex*16, dimension( * ) d, complex*16, dimension(
* ) du, complex*16, dimension( ldx, * ) x, integer ldx, complex*16,
dimension( ldb, * ) b, integer ldb, double precision resid)
ZGTT02 π
πΈ Purpose πΈ
!> !> ZGTT02 computes the residual for the solution to a tridiagonal !> system of equations: !> RESID = norm(B - op(A)*X) / (norm(op(A)) * norm(X) * EPS), !> where EPS is the machine epsilon. !>
so basically it's out here like "hey, how wrong is your answer, actually?" and it measures that against norm(op(A)) * norm(X) * EPS so the number means something. iconic behavior, fr fr. πβ¨
π«Ά Parameters π«Ά
TRANSβ this one's aCHARACTER, and it specifies the form of the residual, bestie:
!> TRANS is CHARACTER !> Specifies the form of the residual. !> = 'N': B - A * X (No transpose) !> = 'T': B - AT * X (Transpose) !> = 'C': B - AH * X (Conjugate transpose) !>
Nβ anINTEGER, and it's the order of the matrixA. constraint era:N >= 0.
!> N is INTEGER !> The order of the matrix A. N >= 0. !>
NRHSβINTEGER, the number of right hand sides, i.e. the number of columns of the matricesBandX. alsoNRHS >= 0, no exceptions.
!> NRHS is INTEGER !> The number of right hand sides, i.e., the number of columns !> of the matrices B and X. NRHS >= 0. !>
DLβ aCOMPLEX*16array, dimension(N-1). it's the(n-1)sub-diagonal elements ofA. the under-appreciated ones. π
!> DL is COMPLEX*16 array, dimension (N-1) !> The (n-1) sub-diagonal elements of A. !>
DβCOMPLEX*16array, dimension(N). the diagonal elements ofAβ the main character energy of the matrix, obviously. β
!> D is COMPLEX*16 array, dimension (N) !> The diagonal elements of A. !>
DUβCOMPLEX*16array, dimension(N-1). the(n-1)super-diagonal elements ofA. yes queen, float above the diagonal. π¦
!> DU is COMPLEX*16 array, dimension (N-1) !> The (n-1) super-diagonal elements of A. !>
XβCOMPLEX*16array, dimension(LDX,NRHS). these are the computed solution vectorsX. the actual answers, the moment of truth. π₯
!> X is COMPLEX*16 array, dimension (LDX,NRHS) !> The computed solution vectors X. !>
LDXβINTEGER, the leading dimension of the arrayX. rule:LDX >= max(1,N). respect the leading dimension or perish.
!> LDX is INTEGER !> The leading dimension of the array X. LDX >= max(1,N). !>
BβCOMPLEX*16array, dimension(LDB,NRHS). on entry it's the right hand side vectors for the system of linear equations. but on exit,Bis overwritten with the differenceB - op(A)*Xβ so heads up, your input does not survive the call. π
!> B is COMPLEX*16 array, dimension (LDB,NRHS) !> On entry, the right hand side vectors for the system of !> linear equations. !> On exit, B is overwritten with the difference B - op(A)*X. !>
LDBβINTEGER, the leading dimension of the arrayB. rule:LDB >= max(1,N). same energy asLDX, different letter. π
!> LDB is INTEGER !> The leading dimension of the array B. LDB >= max(1,N). !>
RESIDβ aDOUBLE PRECISION, and this is the whole point of the exercise:
!> RESID is DOUBLE PRECISION !> norm(B - op(A)*X) / (norm(op(A)) * norm(X) * EPS) !>
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 122 of file zgtt02.f. π
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (not me writing this by hand, the robots did it, slay π€β¨)
and that's the page, bestie β LAPACK, Version 3.12.0, with the date tucked into the footer as TESTING/LIN/zgtt02.f(3). go forth and check those residuals. periodt. ππ
π¦ 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