TESTING/LIN/ctpt02.f(3)

πŸ“¦
version 3.12.1 Β· 3 versions
, in arch rolling

✨ NAME ✨

ctpt02.f β€” the absolute icon of a test routine for packed triangular systems, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

subroutine ctpt02 (uplo, trans, diag, n, nrhs, ap, x, ldx, b, ldb, work,
    rwork, resid)

CTPT02 β€” the baddie that computes residuals and we're obsessed 🫢


🌸 DESCRIPTION 🌸

Okay bestie, so here's the tea: CTPT02 computes the residual for the computed solution to a triangular system of linear equations op(A)*X = B, when the triangular matrix A is stored in packed format. It's literally serving main character energy for accuracy checks ✨.

The test ratio is the maximum over:

norm(b - op(A)*x) / ( ||op(A)||_1 * norm(x) * EPS ),

where op(A) = A, A**T, or A**H, b is the column of B, x is the solution vector, and EPS is the machine epsilon. So it's basically asking "how good is your solution, really?" and the answer better be slay πŸ’―.


πŸ‘‘ PARAMETERS πŸ‘‘

  • UPLO β€” is a CHARACTER*1. It specifies whether the matrix A is upper or lower triangular, periodt.
    • = 'U': Upper triangular πŸ’–
    • = 'L': Lower triangular πŸ’œ
  • TRANS β€” is a CHARACTER*1. It specifies the operation applied to A. The way this works is lowkey iconic.
    • = 'N': A * X = B (No transpose) πŸ™…β€β™€οΈ
    • = 'T': A**T * X = B (Transpose) πŸ”„
    • = 'C': A**H * X = B (Conjugate transpose) 🌈
  • DIAG β€” is a CHARACTER*1. It specifies whether or not the matrix A is unit triangular. No cap, this matters.
    • = 'N': Non-unit triangular 😀
    • = 'U': Unit triangular πŸ‘‘
  • N β€” is INTEGER. The order of the matrix A. So like, N >= 0. Must be, okay? πŸ’€
  • NRHS β€” is INTEGER. The number of right hand sides, i.e., the number of columns of the matrices X and B. NRHS >= 0. Giving us all the X and B energy fr fr.
  • AP β€” is COMPLEX array, dimension (N*(N+1)/2). This is the upper or lower triangular matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:
    • if UPLO = 'U', AP((j-1)*j/2 + i) = A(i,j) for 1<=i<=j;
    • if UPLO = 'L', AP((j-1)*(n-j) + j*(j+1)/2 + i-j) = A(i,j) for j<=i<=n.

It's giving packed storage realness πŸ’…

  • X β€” is COMPLEX array, dimension (LDX,NRHS). The computed solution vectors for the system of linear equations. So proud of you, X πŸ₯²
  • LDX β€” is INTEGER. The leading dimension of the array X. LDX >= max(1,N). Don't play with this, bestie.
  • B β€” is COMPLEX array, dimension (LDB,NRHS). The right hand side vectors for the system of linear equations. We <3 B for holding it down πŸ’–
  • LDB β€” is INTEGER. The leading dimension of the array B. LDB >= max(1,N). It's literal math, no shortcuts πŸ”₯
  • WORK β€” is COMPLEX array, dimension (N). Just doing its job, lowkey iconic πŸ’Ό
  • RWORK β€” is REAL array, dimension (N). Real ones know 🌸
  • RESID β€” is REAL. The maximum over the number of right hand sides of
norm(op(A)*B - B) / ( norm(op(A)) * norm(X) * EPS ).

This is the final boss of the residual check. The whole point. The moment. Periodt. πŸ‘‘


πŸ¦‹ AUTHOR πŸ¦‹

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Definition at line 145 of file ctpt02.f. So go check it out if you want the full source πŸ’«


🌈 SIGN-OFF 🌈

Brought to you with love by the absolute legends at LAPACK, Version 3.12.0, straight from TESTING/LIN/ctpt02.f β€” generated automatically by Doxygen for LAPACK from the source code. Stay slay, bestie, and remember: residuals are just vibes with numbers πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from