la_gerfsx_extended(3)

okay bestie, welcome to la_gerfsx_extended(3) from the Library Functions Manual β€” this is the LAPACK extended-refinement girlie and she has so much to say πŸ’…βœ¨

🌸 NAME 🌸

la_gerfsx_extended β€” la_gerfsx_extended: step in gerfsx


✨ SYNOPSIS ✨

🧚 Functions

πŸ”Ή cla_gerfsx_extended

subroutine cla_gerfsx_extended (prec_type, trans_type, n, nrhs, a, lda,
    af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms,
    errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh,
    dz_ub, ignore_cwise, info)

CLA_GERFSX_EXTENDED β€” that's the whole description in the original, bestie. no extra tea here πŸ«–

πŸ”Ή dla_gerfsx_extended

subroutine dla_gerfsx_extended (prec_type, trans_type, n, nrhs, a, lda,
    af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms,
    errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh,
    dz_ub, ignore_cwise, info)

DLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations for general matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. πŸ”₯

πŸ”Ή sla_gerfsx_extended

subroutine sla_gerfsx_extended (prec_type, trans_type, n, nrhs, a, lda,
    af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms,
    errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh,
    dz_ub, ignore_cwise, info)

SLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations for general matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. πŸ’–

πŸ”Ή zla_gerfsx_extended

subroutine zla_gerfsx_extended (prec_type, trans_type, n, nrhs, a, lda,
    af, ldaf, ipiv, colequ, c, b, ldb, y, ldy, berr_out, n_norms,
    errs_n, errs_c, res, ayb, dy, y_tail, rcond, ithresh, rthresh,
    dz_ub, ignore_cwise, info)

ZLA_GERFSX_EXTENDED β€” again, that's it in the original, no extra description. she's mysterious πŸ’…


πŸ’« DETAILED DESCRIPTION πŸ’«

bestie, the original has this heading and then immediately moves on to Function Documentation β€” so yeah, it's giving mysterious empty section energy πŸŽ€


πŸ› οΈ FUNCTION DOCUMENTATION πŸ› οΈ

🌸 subroutine cla_gerfsx_extended 🌸

subroutine cla_gerfsx_extended (integer prec_type, integer trans_type,
    integer n, integer nrhs, complex, dimension( lda, * ) a, integer lda,
    complex, dimension( ldaf, * ) af, integer ldaf, integer, dimension( * )
    ipiv, logical colequ, real, dimension( * ) c, complex, dimension( ldb, *
    ) b, integer ldb, complex, dimension( ldy, * ) y, integer ldy, real,
    dimension( * ) berr_out, integer n_norms, real, dimension( nrhs, * )
    errs_n, real, dimension( nrhs, * ) errs_c, complex, dimension( * ) res,
    real, dimension( * ) ayb, complex, dimension( * ) dy, complex,
    dimension( * ) y_tail, real rcond, integer ithresh, real rthresh, real
    dz_ub, logical ignore_cwise, integer info)

CLA_GERFSX_EXTENDED

🎯 Purpose

okay so CLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. she's called by CGERFSX to perform iterative refinement. 🫢

in addition to normwise error bound, the code provides maximum componentwise error bound if possible. see the comments for ERRS_N and ERRS_C for details of the error bounds. note that this subroutine is only responsible for setting the second fields of ERRS_N and ERRS_C. periodt. πŸ’…

🧾 Parameters

  • PREC_TYPE β€” INTEGER. specifies the intermediate precision to be used in refinement. the value is defined by ILAPREC(P) where P is a CHARACTER and P = 'S': Single, = 'D': Double, = 'I': Indigenous, = 'X' or 'E': Extra. ✨
  • TRANS_TYPE β€” INTEGER. specifies the transposition operation on A. the value is defined by ILATRANS(T) where T is a CHARACTER and T = 'N': No transpose, = 'T': Transpose, = 'C': Conjugate transpose. πŸ¦‹
  • N β€” INTEGER. the number of linear equations, i.e., the order of the matrix A. N >= 0. πŸ’–
  • NRHS β€” INTEGER. the number of right-hand-sides, i.e., the number of columns of the matrix B. 🌸
  • A β€” COMPLEX array, dimension (LDA,N). on entry, the N-by-N matrix A. πŸ‘‘
  • LDA β€” INTEGER. the leading dimension of the array A. LDA >= max(1,N). 🌈
  • AF β€” COMPLEX array, dimension (LDAF,N). the factors L and U from the factorization A = P*L*U as computed by CGETRF. πŸ”₯
  • LDAF β€” INTEGER. the leading dimension of the array AF. LDAF >= max(1,N). ⭐
  • IPIV β€” INTEGER array, dimension (N). the pivot indices from the factorization A = P*L*U as computed by CGETRF; row i of the matrix was interchanged with row IPIV(i). πŸ’€
  • COLEQU β€” LOGICAL. if .TRUE. then column equilibration was done to A before calling this routine. this is needed to compute the solution and error bounds correctly. πŸ™ˆ
  • C β€” REAL array, dimension (N). the column scale factors for A. if COLEQU = .FALSE., C is not accessed. if C is input, each element of C should be a power of the radix to ensure a reliable solution and error estimates. scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. πŸ“
  • B β€” COMPLEX array, dimension (LDB,NRHS). the right-hand-side matrix B. 🧚
  • LDB β€” INTEGER. the leading dimension of the array B. LDB >= max(1,N). πŸ’œ
  • Y β€” COMPLEX array, dimension (LDY,NRHS). on entry, the solution matrix X, as computed by CGETRS. on exit, the improved solution matrix Y. 🌟
  • LDY β€” INTEGER. the leading dimension of the array Y. LDY >= max(1,N). πŸŽ€
  • BERR_OUT β€” REAL array, dimension (NRHS). on exit, BERR_OUT(j) contains the componentwise relative backward error for right-hand-side j from the formula max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) where abs(Z) is the componentwise absolute value of the matrix or vector Z. this is computed by CLA_LIN_BERR. πŸ’…
  • N_NORMS β€” INTEGER. determines which error bounds to return (see ERRS_N and ERRS_C). if N_NORMS >= 1 return normwise error bounds. if N_NORMS >= 2 return componentwise error bounds. 🫢
  • ERRS_N β€” REAL array, dimension (NRHS, N_ERR_BNDS). for each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the ith solution vector:
        max_j (abs(XTRUE(j,i) - X(j,i)))
       ------------------------------
             max_j abs(X(j,i))

the array is indexed by the type of error information as described below. there currently are up to three pieces of information returned. 😭

the first index in ERRS_N(i,:) corresponds to the ith right-hand side.

the second index in ERRS_N(:,err) contains the following three fields:

  • err = 1 boolean. trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon'). βœ…
  • err = 2 error bound: the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). this error bound should only be trusted if the previous boolean is true. πŸ”₯
  • err = 3 reciprocal condition number: estimated normwise reciprocal condition number. compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . (yes bestie, the original literally has a space before that period β€” we don't make the rules, we just report them πŸ’€) these reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1. 🌈

this subroutine is only responsible for setting the second field above. see Lapack Working Note 165 for further details and extra cautions. πŸ““

ERRS_C

(and that's where part 1 stops β€” part 2 has the rest of ERRS_C and beyond, no cap)

  • ERRS_C (REAL array, dimension (NRHS, N_ERR_BNDS)) β€” bestie this one is the whole componentwise situation πŸ’… For each right-hand side, it holds info about the various error bounds and condition numbers that correspond to the componentwise relative error, which is defined like this:
Componentwise relative error in the ith solution vector:
                   abs(XTRUE(j,i) - X(j,i))
            max_j ----------------------
                        abs(X(j,i))

The array is indexed by the right-hand side i (because that's what the componentwise relative error depends on, duh), and then by the type of error info, described below. Right now there are up to three pieces of info returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERRS_C is not accessed at all β€” like, it's not even invited to the party. And if N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.

The first index in ERRS_C(i,:) corresponds to the ith right-hand side.

The second index in ERRS_C(:,err) contains the following three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2 β€” error bound: the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 β€” Reciprocal condition number: estimated componentwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.

And listen β€” this subroutine is only responsible for setting the second field above. That's it, that's the job 🫑 See Lapack Working Note 165 for further details and extra cautions.

  • RES (COMPLEX array, dimension (N)) β€” workspace to hold the intermediate residual. Scratching pad energy πŸŽ€
  • AYB (REAL array, dimension (N)) β€” workspace. That's it. That's the whole description. Iconic minimalism ✨
  • DY (COMPLEX array, dimension (N)) β€” workspace to hold the intermediate solution.
  • Y_TAIL (COMPLEX array, dimension (N)) β€” workspace to hold the trailing bits of the intermediate solution. The crumbs, basically πŸ“
  • RCOND (REAL) β€” Reciprocal scaled condition number. It's an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if equilibration was done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision 😭 Note though β€” the error may still be small even if this number is very small and the matrix appears ill-conditioned. So don't panic-spiral prematurely, k?
  • ITHRESH (INTEGER) β€” The maximum number of residual computations allowed for refinement. The default is 10. For 'aggressive' set it to 100 to permit convergence using approximate factorizations or factorizations other than LU. ⚠️ But fr fr: if the factorization uses a technique other than Gaussian elimination, the guarantees in ERRS_N and ERRS_C may no longer be trustworthy. No cap.
  • RTHRESH (REAL) β€” Determines when to stop refinement if the error estimate stops decreasing. Refinement will stop when the next solution no longer satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The default value is 0.5. For 'aggressive' set it to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details πŸ‘‘
  • DZ_UB (REAL) β€” Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, which we define as the relative change in each component being less than DZ_UB. The default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details πŸ¦‹
  • IGNORE_CWISE (LOGICAL) β€” If .TRUE. then ignore componentwise convergence. Default value is .FALSE..
  • INFO (INTEGER) β€”
    • = 0: Successful exit πŸ’–
    • < 0: if INFO = -i, the ith argument to CGETRS had an illegal value

Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Definition at line 391 of file cla_gerfsx_extended.f.


πŸ’œ subroutine dla_gerfsx_extended πŸ’œ

Bestie, here's the whole signature, and yes it's a lot β€” read it slowly, it's giving very long but very precise:

subroutine dla_gerfsx_extended (integer prec_type, integer trans_type,
    integer n, integer nrhs, double precision, dimension( lda, * ) a,
    integer lda, double precision, dimension( ldaf, * ) af, integer ldaf,
    integer, dimension( * ) ipiv, logical colequ, double precision,
    dimension( * ) c, double precision, dimension( ldb, * ) b, integer ldb,
    double precision, dimension( ldy, * ) y, integer ldy, double precision,
    dimension( * ) berr_out, integer n_norms, double precision, dimension(
    nrhs, * ) errs_n, double precision, dimension( nrhs, * ) errs_c, double
    precision, dimension( * ) res, double precision, dimension( * ) ayb,
    double precision, dimension( * ) dy, double precision, dimension( * )
    y_tail, double precision rcond, integer ithresh, double precision
    rthresh, double precision dz_ub, logical ignore_cwise, integer info)

DLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations for general matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. The double-precision twin of the one above β€” same lore, different letters 🌈

Purpose:

DLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. This subroutine is called by DGERFSX to perform iterative refinement. In addition to the normwise error bound, the code provides the maximum componentwise error bound if possible. See the comments for ERRS_N and ERRS_C for details of the error bounds. Note that this subroutine is only responsible for setting the second fields of ERRS_N and ERRS_C. πŸ’…

Parameters

  • PREC_TYPE (INTEGER) β€” Specifies the intermediate precision to be used in refinement. The value is defined by ILAPREC(P) where P is a CHARACTER and P:
    • = 'S': Single
    • = 'D': Double
    • = 'I': Indigenous
    • = 'X' or 'E': Extra
  • TRANS_TYPE (INTEGER) β€” Specifies the transposition operation on A. The value is defined by ILATRANS(T) where T is a CHARACTER and T:
    • = 'N': No transpose
    • = 'T': Transpose
    • = 'C': Conjugate transpose
  • N (INTEGER) β€” The number of linear equations, i.e., the order of the matrix A. N >= 0. Zero is allowed, she's flexible 🧚
  • NRHS (INTEGER) β€” The number of right-hand-sides, i.e., the number of columns of the matrix B.
  • A (DOUBLE PRECISION array, dimension (LDA,N)) β€” On entry, the N-by-N matrix A. The main character πŸ‘‘
  • LDA (INTEGER) β€” The leading dimension of the array A. LDA >= max(1,N).
  • AF (DOUBLE PRECISION array, dimension (LDAF,N)) β€” The factors L and U from the factorization A = P*L*U as computed by DGETRF.
  • LDAF (INTEGER) β€” The leading dimension of the array AF. LDAF >= max(1,N).
  • IPIV (INTEGER array, dimension (N)) β€” The pivot indices from the factorization A = P*L*U as computed by DGETRF; row i of the matrix was interchanged with row IPIV(i). The receipts of who swapped with whom 🫢
  • COLEQU (LOGICAL) β€” If .TRUE. then column equilibration was done to A before calling this routine. This is needed to compute the solution and error bounds correctly. So don't lie about it, bestie 😭
  • C (DOUBLE PRECISION array, dimension (N)) β€” The column scale factors for A. If COLEQU = .FALSE., C is not accessed. If C is input, each element of C should be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. ⚠️ Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. So like, stay in your radix-power lane.
  • B (DOUBLE PRECISION array, dimension (LDB,NRHS)) β€” The right-hand-side matrix B.
  • LDB (INTEGER) β€” The leading dimension of the array B. LDB >= max(1,N).
  • Y (DOUBLE PRECISION array, dimension (LDY,NRHS)) β€” On entry, the solution matrix X, as computed by DGETRS. On exit, the improved solution matrix Y. Glow-up arc 🌸
  • LDY
  • LDY β€” INTEGER, the leading dimension of the array Y. And bestie, LDY >= max(1,N). Non-negotiable, the compiler is not gonna hold your hand on this one πŸ™ˆ
  • BERR_OUT β€” DOUBLE PRECISION array, dimension (NRHS). On exit, BERR_OUT(j) is holding the componentwise relative backward error for right-hand-side j, straight from this iconic little formula:
    max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )

where abs(Z) is the componentwise absolute value of the matrix or vector Z. This one is computed by DLA_LIN_BERR. πŸ’–

  • N_NORMS β€” INTEGER that literally decides which error bounds you get back (see ERRS_N and ERRS_C, they're the receipts):
    • If N_NORMS >= 1 β†’ normwise error bounds, you get the vibe-level accuracy.
    • If N_NORMS >= 2 β†’ componentwise error bounds, every single entry gets checked. thorough queen behavior πŸ‘‘
  • ERRS_N β€” DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). For each right-hand side it's stuffed with info about all the different error bounds and condition numbers for the normwise relative error, which is defined like this:
    Normwise relative error in the ith solution vector:
            max_j (abs(XTRUE(j,i) - X(j,i)))
           ------------------------------
                 max_j abs(X(j,i))

The array is indexed by the type of error information, described below. There are currently up to three pieces of information returned.

The first index in ERRS_N(i,:) corresponds to the *i*th right-hand side.

The second index in ERRS_N(:,err) holds these three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2 β€” error bound: the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 β€” reciprocal condition number: estimated normwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . (yes, that sentence is literally cut off in the source like that, no cap 😭 not me fixing Fortran docs)

These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.

This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions. 🫢

  • ERRS_C β€” DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). Same deal, but for componentwise relative error:
    Componentwise relative error in the ith solution vector:
                   abs(XTRUE(j,i) - X(j,i))
            max_j ----------------------
                        abs(X(j,i))

The array is indexed by the right-hand side i (the componentwise relative error depends on it, bestie, they're linked) and by the type of error information described below. There are currently up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERRS_C is not accessed. And if N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned. slay, partial data ✨

The first index in ERRS_C(i,:) corresponds to the *i*th right-hand side.

The second index in ERRS_C(:,err) contains these three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2 β€” error bound: the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 β€” reciprocal condition number: estimated componentwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . (same cut-off sentence energy πŸ’€)

These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.

This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.

  • RES β€” DOUBLE PRECISION array, dimension (N). Workspace that holds the intermediate residual. it's giving scratch paper πŸŽ€
  • AYB β€” DOUBLE PRECISION array, dimension (N). Workspace. And here's the fun part: this can be the same workspace you passed for Y_TAIL. sharing is caring, we love memory efficiency πŸ’…
  • DY β€” DOUBLE PRECISION array, dimension (N). Workspace holding the intermediate solution. main character workspace, honestly 🌟
  • Y_TAIL β€” DOUBLE PRECISION array, dimension (N). Workspace holding the trailing bits of the intermediate solution. the little crumbs at the end, we love her πŸ“
  • RCOND β€” DOUBLE PRECISION. Reciprocal scaled condition number β€” an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if equilibration was done). If this is less than machine precision (in particular, if it is zero), the matrix is singular to working precision. ⚠️ Big note though: the error may still be small even if this number is very small and the matrix appears ill-conditioned. so don't panic-spiral, okay? 😭
  • ITHRESH β€” INTEGER. The maximum number of residual computations allowed for refinement. Default is 10. For 'aggressive' set it to 100 to permit convergence using approximate factorizations or factorizations other than LU. 🚨 But if the factorization uses a technique other than Gaussian elimination, the guarantees in ERRS_N and ERRS_C may no longer be trustworthy. you've been warned, bestie.
  • RTHRESH β€” DOUBLE PRECISION. Decides when to stop refining if the error estimate stops decreasing. Refinement stops when the next solution no longer satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i), where norm(Z) is the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. Default value is 0.5. For 'aggressive' set it to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details. πŸ”₯
  • DZ_UB β€” DOUBLE PRECISION. Tells us when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, and we define stable as the relative change in each component being less than DZ_UB. Default value is 0.25, which requires the first bit to be stable. See LAWN 165 for more details. 🌸
  • IGNORE_CWISE β€” LOGICAL. If .TRUE. then ignore componentwise convergence. Default value is .FALSE.. sometimes you just gotta ignore the componentwise drama πŸ™ˆ
  • INFO β€” INTEGER, the final verdict:
    • = 0: successful exit. we ate. πŸ’…
    • < 0: if INFO = -i, the *i*th argument to DGETRS had an illegal value. πŸ’€

πŸ¦‹ Author πŸ¦‹

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

Definition at line 390 of file dla_gerfsx_extended.f. go off, line 390 πŸ‘‘


⭐ subroutine sla_gerfsx_extended ⭐

okay so now the single-precision sibling steps in, and she's got a whole signature that is long long. Behold:

subroutine sla_gerfsx_extended (integer prec_type, integer trans_type,
    integer n, integer nrhs, real, dimension( lda, * ) a, integer lda, real,
    dimension( ldaf, * ) af, integer ldaf, integer, dimension( * ) ipiv,
    logical colequ, real, dimension( * ) c, real, dimension( ldb, * ) b,
    integer ldb, real, dimension( ldy, * ) y, integer ldy, real, dimension(
    * ) berr_out, integer n_norms, real, dimension( nrhs, * ) errs_n, real,
    dimension( nrhs, * ) errs_c, real, dimension( * ) res, real, dimension(
    * ) ayb, real, dimension( * ) dy, real, dimension( * ) y_tail, real
    rcond, integer ithresh, real rthresh, real dz_ub, logical ignore_cwise,
    integer info)

SLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations for general matrices by performing extra-precise iterative refinement, and it provides error bounds and backward error estimates for the solution. the whole package, honestly πŸŽ€

πŸ’– Purpose πŸ’–

SLA_GERFSX_EXTENDED improves the computed solution to a system of linear equations by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. This subroutine is called by SGERFSX to perform iterative refinement. On top of the normwise error bound, the code provides the maximum componentwise error bound if possible. See the comments for ERRS_N and ERRS_C for the details of the error bounds. Note that this subroutine is only responsible for setting the second fields of ERRS_N and ERRS_C. ✨

🫢 Parameters 🫢

and the parameter train keeps on rolling, starting with…

  • PREC_TYPE β€”
  • PREC_TYPE β€” INTEGER. This one tells the routine which intermediate precision to use while it's refining, bestie. The value comes from ILAPREC(P) where P is a CHARACTER, and P behaves like this:
    • = 'S': Single
    • = 'D': Double
    • = 'I': Indigenous
    • = 'X' or 'E': Extra
  • TRANS_TYPE β€” INTEGER. Specifies the transposition operation on A, okay? The value is defined by ILATRANS(T) where T is a CHARACTER, and T goes:
    • = 'N': No transpose
    • = 'T': Transpose
    • = 'C': Conjugate transpose
  • N β€” INTEGER. The number of linear equations, aka the order of the matrix A. Literally N >= 0, no exceptions πŸ’…
  • NRHS β€” INTEGER. The number of right-hand-sides, i.e. the number of columns of the matrix B. Multiple besties, one A ✨
  • A β€” REAL array, dimension (LDA,N). On entry, the N-by-N matrix A. That's her, the main character πŸ‘‘
  • LDA β€” INTEGER. The leading dimension of the array A. LDA >= max(1,N). Respect the constraint fr fr.
  • AF β€” REAL array, dimension (LDAF,N). The factors L and U from the factorization A = P*L*U as computed by SGETRF. Pre-chewed A, iconic.
  • LDAF β€” INTEGER. The leading dimension of the array AF. LDAF >= max(1,N).
  • IPIV β€” INTEGER array, dimension (N). The pivot indices from the factorization A = P*L*U as computed by SGETRF; row i of the matrix was interchanged with row IPIV(i). Receipts of every glow-up 🫢
  • COLEQU β€” LOGICAL. If .TRUE. then column equilibration was done to A before calling this routine. This is needed to compute the solution and error bounds correctly β€” like, this is not a vibe you can skip, okay?
  • C β€” REAL array, dimension (N). The column scale factors for A. If COLEQU = .FALSE., C is not accessed β€” she's not invited to that party. If C is input, each element of C should be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable.
lowkey this one matters: screw up the scaling and your error estimates are giving speculation, not math 😭
  • B β€” REAL array, dimension (LDB,NRHS). The right-hand-side matrix B. The other half of the equation, always.
  • LDB β€” INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • Y β€” REAL array, dimension (LDY,NRHS). On entry, the solution matrix X, as computed by SGETRS. On exit, the improved solution matrix Y. She comes in as X and leaves as Y β€” a whole character arc πŸ’–
  • LDY β€” INTEGER. The leading dimension of the array Y. LDY >= max(1,N).
  • BERR_OUT β€” REAL array, dimension (NRHS). On exit, BERR_OUT(j) contains the componentwise relative backward error for right-hand-side j from the formula:
max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )

where abs(Z) is the componentwise absolute value of the matrix or vector Z. This is computed by SLA_LIN_BERR. So, like, the homework is done by someone else and you just collect the grade πŸŽ€

  • N_NORMS β€” INTEGER. Determines which error bounds to return (see ERRS_N and ERRS_C). Like a little menu:
    • If N_NORMS >= 1 return normwise error bounds.
    • If N_NORMS >= 2 return componentwise error bounds.
  • ERRS_N β€” REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:

Normwise relative error in the ith solution vector:

        max_j (abs(XTRUE(j,i) - X(j,i)))
       ------------------------------
             max_j abs(X(j,i))

The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.

The first index in ERRS_N(i,:) corresponds to the ith right-hand side.

The second index in ERRS_N(:,err) contains the following three fields:

  • err = 1 boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2 error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.
ngl the manpage literally drops a word at "the error estimate is ." β€” that's the original, we're not fixing it, we're reporting it πŸ™ˆ

This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.

  • ERRS_C β€” REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:

Componentwise relative error in the ith solution vector:

               abs(XTRUE(j,i) - X(j,i))
        max_j ----------------------
                    abs(X(j,i))

The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERRS_C is not accessed β€” she's on read receipt mode only. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.

The first index in ERRS_C(i,:) corresponds to the ith right-hand side.

The second index in ERRS_C(:,err) contains the following three fields:

  • err = 1 boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2 error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.

This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.

  • RES β€” REAL array, dimension (N). Workspace to hold the intermediate residual. Scrap paper energy πŸ“
  • AYB β€” REAL array, dimension (N). Workspace. This can be the same workspace passed for Y_TAIL β€” sharing is caring, we love a sustainable buffer.
  • DY β€” REAL array, dimension (N). Workspace to hold the intermediate solution.
  • Y_TAIL β€” REAL array, dimension (N). Workspace to hold the trailing bits of the intermediate solution. The little crumbs at the end, we keep them ✨
  • RCOND β€” REAL. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision β€” like actually singular, no cap. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. So don't spiral just because the number looks tiny, bestie, the vibes can still be fine πŸ’€
  • ITHRESH β€” INTEGER. The maximum number of residual computations allowed for refinement. The default is 10. For 'aggressive' set to 100 to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees in ERRS_N and ERRS_C may no longer be trustworthy.
so if you go aggressive-and-not-LU, the guarantees start wearing a disguise β€” the manpage says they may no longer be trustworthy, and we respect the disclaimer πŸ”₯
  • RTHRESH β€”

RTHRESH

RTHRESH is REAL πŸ’…

okay so this one decides when to stop refining if the error estimate just. stops decreasing. like bestie, we're not gonna loop forever hoping for a miracle, right? 🫢 Refinement will stop when the next solution no longer satisfies

norm(dx_{i+1}) < RTHRESH * norm(dx_i)

where norm(Z) is the infinity norm of Z. And <yellow>RTHRESH</yellow> satisfies 0 < RTHRESH <= 1. Default value is 0.5. For 'aggressive' set to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details. iykyk ✨

DZ_UB

DZ_UB is REAL πŸ¦‹

this cutie determines when to start considering componentwise convergence. and no, componentwise convergence is only considered after each component of the solution Y is stable β€” and we define "stable" as the relative change in each component being less than DZ_UB. Default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details. periodt πŸ’–

IGNORE_CWISE

IGNORE_CWISE is LOGICAL πŸŽ€

If .TRUE. then ignore componentwise convergence. Default value is .FALSE.. simple as that, no notes πŸ’…

INFO

INFO is INTEGER ⭐

  • = 0: Successful exit. we love a zero, slay πŸŽ‰
  • < 0: if INFO = -i, the ith argument to SGETRS had an illegal value πŸ’€

πŸ‘‘ Author

Univ. of Tennessee

Univ. of California Berkeley

Univ. of Colorado Denver

NAG Ltd.

πŸ“ Definition

Definition at line 391 of file sla_gerfsx_extended.f.


🌈 subroutine zla_gerfsx_extended

subroutine zla_gerfsx_extended (integer prec_type, integer trans_type,
    integer n, integer nrhs, complex*16, dimension( lda, * ) a, integer lda,
    complex*16, dimension( ldaf, * ) af, integer ldaf, integer, dimension( *
    ) ipiv, logical colequ, double precision, dimension( * ) c, complex*16,
    dimension( ldb, * ) b, integer ldb, complex*16, dimension( ldy, * ) y,
    integer ldy, double precision, dimension( * ) berr_out, integer n_norms,
    double precision, dimension( nrhs, * ) errs_n, double precision,
    dimension( nrhs, * ) errs_c, complex*16, dimension( * ) res, double
    precision, dimension( * ) ayb, complex*16, dimension( * ) dy,
    complex*16, dimension( * ) y_tail, double precision rcond, integer
    ithresh, double precision rthresh, double precision dz_ub, logical
    ignore_cwise, integer info)
    ZLA_GERFSX_EXTENDED

ZLA_GERFSX_EXTENDED β€” say that three times fast, I dare you 😭

Purpose

okay bestie, the whole point of ZLA_GERFSX_EXTENDED is that it improves the computed solution to a system of linear equations by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. 🧚 This subroutine is called by ZGERFSX to perform iterative refinement. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERRS_N and ERRS_C for details of the error bounds. Note that this subroutine is only responsible for setting the second fields of ERRS_N and ERRS_C. king of doing exactly one job πŸ’…

✨ Parameters ✨

PREC_TYPE

PREC_TYPE is INTEGER πŸ’œ

Specifies the intermediate precision to be used in refinement. The value is defined by ILAPREC(P) where P is a CHARACTER and

  • P = 'S': Single
  • P = 'D': Double
  • P = 'I': Indigenous
  • P = 'X' or 'E': Extra

TRANS_TYPE

TRANS_TYPE is INTEGER πŸ¦‹

Specifies the transposition operation on A. The value is defined by ILATRANS(T) where T is a CHARACTER and

  • T = 'N': No transpose
  • T = 'T': Transpose
  • T = 'C': Conjugate transpose

N

N is INTEGER ⭐

The number of linear equations, i.e., the order of the matrix A. N >= 0. (yes bestie, zero is allowed, we're not judging πŸ™ˆ)

NRHS

NRHS is INTEGER 🌸

The number of right-hand-sides, i.e., the number of columns of the matrix B.

A

A is COMPLEX*16 array, dimension (LDA,N) πŸ’–

On entry, the N-by-N matrix A. main character matrix energy fr fr πŸ‘‘

LDA

LDA is INTEGER πŸŽ€

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

AF

AF is COMPLEX*16 array, dimension (LDAF,N) πŸ¦‹

The factors L and U from the factorization A = P*L*U as computed by ZGETRF.

LDAF

LDAF is INTEGER ✨

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

IPIV

IPIV is INTEGER array, dimension (N) πŸ”₯

The pivot indices from the factorization A = P*L*U as computed by ZGETRF; row i of the matrix was interchanged with row IPIV(i). it's giving "put it back where it belongs" 😭

COLEQU

COLEQU is LOGICAL πŸ’…

If .TRUE. then column equilibration was done to A before calling this routine. This is needed to compute the solution and error bounds correctly. like, don't skip it, it matters 🫢

C

C is DOUBLE PRECISION array, dimension (N) 🌈

The column scale factors for A. If COLEQU = .FALSE., C is not accessed. If C is input, each element of C should be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows.

⚠️ Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. so like, do not play with this one bestie πŸ’€

B

B is COMPLEX*16 array, dimension (LDB,NRHS) πŸ“

The right-hand-side matrix B. the moment it all comes down to πŸ’–

LDB

LDB is INTEGER πŸŽ€

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

Y

Y is COMPLEX*16 array, dimension (LDY,NRHS) 🌸

On entry, the solution matrix X, as computed by ZGETRS. On exit, the improved solution matrix Y. glow-up in real time, we love to see it ✨

LDY

LDY is INTEGER πŸ¦‹

The leading dimension of the array Y. LDY >= max(1,N).

BERR_OUT

BERR_OUT is DOUBLE PRECISION array, dimension (NRHS) πŸ”₯

On exit, BERR_OUT(j) contains the componentwise relative backward error for right-hand-side j from the formula

    max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )

where abs(Z) is the componentwise absolute value of the matrix or vector Z. This is computed by ZLA_LIN_BERR. iconic helper routine behavior ngl πŸ‘‘

N_NORMS

N_NORMS is INTEGER πŸ’œ

Determines which error bounds to return (see ERRS_N and ERRS_C).

  • If N_NORMS >= 1 return normwise error bounds.
  • If N_NORMS >= 2 return componentwise error bounds.

ERRS_N

ERRS_N is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS) 🌈

For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:

Normwise relative error in the ith solution vector:

            max_j (abs(XTRUE(j,i) - X(j,i)))
           ------------------------------
                 max_j abs(X(j,i))

The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.

The first index in ERRS_N(i,:) corresponds to the ith right-hand side.

The second index in ERRS_N(:,err) contains the following three fields:

  • err = 1: boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon').
  • err = 2: error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3: Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.

This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions.

ERRS_C

  • ERRS_C β€” okay so ERRS_C is a DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). πŸ’– For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the ith solution vector:
                   abs(XTRUE(j,i) - X(j,i))
            max_j ----------------------
                         abs(X(j,i))

The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERRS_C is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned. 🫢

The first index in ERRS_C(i,:) corresponds to the ith right-hand side.

The second index in ERRS_C(:,err) contains the following three fields:

  • err = 1 β€” boolean. Trust the answer if the reciprocal condition number is less than the threshold sqrt(n) * slamch('Epsilon'). ✨
  • err = 2 β€” error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the threshold sqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.
  • err = 3 β€” Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the threshold sqrt(n) * slamch('Epsilon') to determine if the error estimate is . These reciprocal condition numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some appropriately scaled matrix Z. Let Z = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row of A*diag(x) by a power of the radix so all absolute row sums of Z are approximately 1.

This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions. πŸ’…

  • RES β€” RES is COMPLEX*16 array, dimension (N). Workspace to hold the intermediate residual. πŸŽ€
  • AYB β€” AYB is DOUBLE PRECISION array, dimension (N). Workspace. πŸ¦‹
  • DY β€” DY is COMPLEX*16 array, dimension (N). Workspace to hold the intermediate solution. 🌸
  • Y_TAIL β€” Y_TAIL is COMPLEX*16 array, dimension (N). Workspace to hold the trailing bits of the intermediate solution. 🧚
  • RCOND β€” RCOND is DOUBLE PRECISION. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. 😭
  • ITHRESH β€” ITHRESH is INTEGER. The maximum number of residual computations allowed for refinement. The default is 10. For 'aggressive' set to 100 to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees in ERRS_N and ERRS_C may no longer be trustworthy. πŸ”₯
  • RTHRESH β€” RTHRESH is DOUBLE PRECISION. Determines when to stop refinement if the error estimate stops decreasing. Refinement will stop when the next solution no longer satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The default value is 0.5. For 'aggressive' set to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details. πŸ‘‘
  • DZ_UB β€” DZ_UB is DOUBLE PRECISION. Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, which we define as the relative change in each component being less than DZ_UB. The default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details. 🌈
  • IGNORE_CWISE β€” IGNORE_CWISE is LOGICAL. If .TRUE. then ignore componentwise convergence. Default value is .FALSE.. ⭐
  • INFO β€” INFO is INTEGER.
    • = 0: Successful exit. πŸ’–
    • < 0: if INFO = -i, the ith argument to ZGETRS had an illegal value. πŸ’€

πŸ‘‘ AUTHOR

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

Definition at line 390 of file zla_gerfsx_extended.f. πŸŽ€

🌸 AUTHOR

Generated automatically by Doxygen for LAPACK from the source code. 🧚


This footer energy is LAPACK Version 3.12.0 + la_gerfsx_extended(3), straight from the source code β€” source-code realness, no cap. Bye bestie! πŸ’–βœ¨

πŸ“¦ where this page comes from