SRC/cherfs.f(3)

πŸ’… SRC/cherfs.f β€” like, the whole entire page

ok so first things first, bestie: this is a page from the Library Functions Manual, and it's all about one little subroutine that is genuinely SO underrated. her name is cherfs and she's here to make your solutions better. no cap. ✨


πŸŽ€ NAME πŸŽ€

SRC/cherfs.f

that's it. that's the name. iconic of her tbh.


🌸 SYNOPSIS 🌸

Functions/Subroutines

  • subroutine cherfs (uplo, n, nrhs, a, lda, af, ldaf, ipiv, b, ldb, x, ldx, ferr, berr, work, rwork, info) β€” CHERFS

ok that's a lot of arguments and yes we're gonna go through every single one of them, don't worry 🫢


✨ Function/Subroutine Documentation ✨

subroutine cherfs (character uplo, integer n, integer nrhs, complex,
    dimension( lda, * ) a, integer lda, complex, dimension( ldaf, * ) af,
    integer ldaf, integer, dimension( * ) ipiv, complex, dimension( ldb, * )
    b, integer ldb, complex, dimension( ldx, * ) x, integer ldx, real,
    dimension( * ) ferr, real, dimension( * ) berr, complex, dimension( * )
    work, real, dimension( * ) rwork, integer info)

CHERFS πŸ’–

πŸ¦‹ Purpose πŸ¦‹

!> !> CHERFS improves the computed solution to a system of linear !> equations when the coefficient matrix is Hermitian indefinite, and !> provides error bounds and backward error estimates for the solution. !>

so literally what she does: you already got a solution, she makes it better, and then she hands you the receipts (aka the error bounds) so you know how much you can trust it. queen behaviour πŸ‘‘

πŸ’œ Parameters πŸ’œ

  • UPLO
!> UPLO is CHARACTER*1 !> = 'U': Upper triangle of A is stored; !> = 'L': Lower triangle of A is stored.

which triangle of A are we even talking about bestie, pick one 🌈

  • N
!> N is INTEGER !> The order of the matrix A. N >= 0.

the order of A. and she said N >= 0, so no negative vibes allowed πŸ’€

  • NRHS
!> NRHS is INTEGER !> The number of right hand sides, i.e., the number of columns !> of the matrices B and X. NRHS >= 0.

how many right hand sides you got β€” like, how many columns B and X have. also NRHS >= 0, we stay non-negative ✨

  • A
!> A is COMPLEX array, dimension (LDA,N) !> The Hermitian matrix A. If UPLO = 'U', the leading N-by-N !> upper triangular part of A contains the upper triangular part !> of the matrix A, and the strictly lower triangular part of A !> is not referenced. If UPLO = 'L', the leading N-by-N lower !> triangular part of A contains the lower triangular part of !> the matrix A, and the strictly upper triangular part of A is !> not referenced.

the Hermitian matrix herself. if UPLO = 'U', the leading N-by-N upper triangular part holds the upper triangular part, and the strictly lower triangular part? not referenced, she doesn't even look at it πŸ™ˆ if UPLO = 'L' it's the other way round β€” lower triangle is in, strictly upper triangle is not referenced.

  • LDA
!> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,N).

leading dimension of A. LDA >= max(1,N). periodt.

  • AF
!> AF is COMPLEX array, dimension (LDAF,N) !> The factored form of the matrix A. AF contains the block !> diagonal matrix D and the multipliers used to obtain the !> factor U or L from the factorization A = U*D*UH or !> A = L*D*LH as computed by CHETRF.

the factored form of A β€” she's carrying the block diagonal matrix D plus the multipliers that got you the factor U or L from A = U*D*U**H or A = L*D*L**H, exactly as computed by CHETRF. teamwork slay 🀝

  • LDAF
!> LDAF is INTEGER !> The leading dimension of the array AF. LDAF >= max(1,N).

leading dimension of AF, LDAF >= max(1,N), same energy πŸ’«

  • IPIV
!> IPIV is INTEGER array, dimension (N) !> Details of the interchanges and the block structure of D !> as determined by CHETRF.

array of dimension (N) with the tea on the interchanges and the block structure of D, as determined by CHETRF β˜•

  • B
!> B is COMPLEX array, dimension (LDB,NRHS) !> The right hand side matrix B.

the right hand side matrix B. that's her whole job, honestly.

  • LDB
!> LDB is INTEGER !> The leading dimension of the array B. LDB >= max(1,N).

leading dimension of B. LDB >= max(1,N). you know the drill πŸŽ€

  • X
!> X is COMPLEX array, dimension (LDX,NRHS) !> On entry, the solution matrix X, as computed by CHETRS. !> On exit, the improved solution matrix X.

on entry: the solution matrix X as computed by CHETRS. on exit: the improved solution matrix X. that's the glow-up, literally πŸ”₯

  • LDX
!> LDX is INTEGER !> The leading dimension of the array X. LDX >= max(1,N).

leading dimension of X, LDX >= max(1,N). yes, again. consistency is key bestie πŸ’…

  • FERR
!> FERR is REAL array, dimension (NRHS) !> The estimated forward error bound for each solution vector !> X(j) (the j-th column of the solution matrix X). !> If XTRUE is the true solution corresponding to X(j), FERR(j) !> is an estimated upper bound for the magnitude of the largest !> element in (X(j) - XTRUE) divided by the magnitude of the !> largest element in X(j). The estimate is as reliable as !> the estimate for RCOND, and is almost always a slight !> overestimate of the true error.

the estimated forward error bound for each solution vector X(j) (that's the j-th column of X, iykyk). if XTRUE is the true solution for X(j), then FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). and ngl this estimate is as reliable as the estimate for RCOND, and it's almost always a slight overestimate of the true error β€” she's cautious like that πŸ™ˆ

  • BERR
!> BERR is REAL array, dimension (NRHS) !> The componentwise relative backward error of each solution !> vector X(j) (i.e., the smallest relative change in !> any element of A or B that makes X(j) an exact solution).

the componentwise relative backward error of each solution vector X(j) β€” like, the smallest relative change in any element of A or B that would make X(j) an exact solution. the "how close was I actually" metric 🎯

  • WORK
!> WORK is COMPLEX array, dimension (2*N)

complex workspace, dimension (2*N). she works hard, respect 🫑

  • RWORK
!> RWORK is REAL array, dimension (N)

real workspace, dimension (N). also working hard 🌸

  • INFO
!> INFO is INTEGER !> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value

the vibe check at the end: = 0 means successful exit πŸ’–, and < 0 means if INFO = -i, then the i-th argument had an illegal value πŸ’€ (not me, not you, the argument)

πŸ”₯ Internal Parameters πŸ”₯

!> ITMAX is the maximum number of steps of iterative refinement.

ITMAX is the maximum number of steps of iterative refinement. that's the whole note. the limit. the ceiling. the "we stop refining here" line ⭐

πŸ‘‘ Author πŸ‘‘

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

four whole institutions contributed, we love a collaborative moment 🌈

Definition at line 190 of file cherfs.f.


⭐ Author ⭐

Generated automatically by Doxygen for LAPACK from the source code. (yes bestie, a robot wrote the docs, and honestly? she ate πŸ€–βœ¨)


ok so that's the whole page, no details skipped, all facts intact, all vibes immaculate πŸ’œ This absolute banger of a page comes to you from LAPACK, Version 3.12.0, sourced straight from SRC/cherfs.f(3) β€” go forth and refine your solutions, bestie πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from