gbrfsx(3)
๐ gbrfsx(3) โ Library Functions Manual ๐
okay so bestie, you opened gbrfsx(3) and itโs giving expert-level iterative refinement with a whole bouquet of arguments. no cap, this page is long, but weโre keeping every single detail. ๐
๐ NAME ๐
gbrfsx - gbrfsx: iterative refinement, expert
thatโs the name, and yes it says โexpertโ because this is not the beginner band-matrix routine, itโs the one with error bounds and refined tea. ๐ซโจ
โจ SYNOPSIS โจ
Functions
cgbrfsxโCGBRFSX
subroutine cgbrfsx (trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
ipiv, r, c, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
err_bnds_comp, nparams, params, work, rwork, info)
CGBRFSX
dgbrfsxโDGBRFSX
subroutine dgbrfsx (trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
ipiv, r, c, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
err_bnds_comp, nparams, params, work, iwork, info)
DGBRFSX
sgbrfsxโSGBRFSX
subroutine sgbrfsx (trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
ipiv, r, c, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
err_bnds_comp, nparams, params, work, iwork, info)
SGBRFSX
zgbrfsxโZGBRFSX
subroutine zgbrfsx (trans, equed, n, kl, ku, nrhs, ab, ldab, afb, ldafb,
ipiv, r, c, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
err_bnds_comp, nparams, params, work, rwork, info)
ZGBRFSX
๐ง DETAILED DESCRIPTION ๐ง
bestie, the detailed description is the doorway, and the actual function tea is right below in Function Documentation. weโre keeping the sections in order, so here we are. ๐ฆ
๐ FUNCTION DOCUMENTATION ๐
subroutine cgbrfsx โ CGBRFSX
subroutine cgbrfsx (character trans, character equed, integer n, integer kl,
integer ku, integer nrhs, complex, dimension( ldab, * ) ab, integer
ldab, complex, dimension( ldafb, * ) afb, integer ldafb, integer,
dimension( * ) ipiv, real, dimension( * ) r, real, dimension( * ) c,
complex, dimension( ldb, * ) b, integer ldb, complex, dimension( ldx , *
) x, integer ldx, real rcond, real, dimension( * ) berr, integer
n_err_bnds, real, dimension( nrhs, * ) err_bnds_norm, real, dimension(
nrhs, * ) err_bnds_comp, integer nparams, real, dimension( * ) params,
complex, dimension( * ) work, real, dimension( * ) rwork, integer info)
CGBRFSX
๐ซถ PURPOSE ๐ซถ
okay so CGBRFSX improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. in addition to the normwise error bound, the code provides a maximum componentwise error bound if possible. see the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. ๐
the original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED, R, and C below. in this case, the solution and error bounds returned are for the original unequilibrated system. iconic, but important. โจ
some optional parameters are bundled in the PARAMS array. these settings determine how refinement is performed, but often the defaults are acceptable. if the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument. slay. ๐
๐ PARAMETERS ๐
TRANSโCHARACTER*1; specifies the form of the system of equations:= 'N': A * X = B (No transpose)= 'T': A**T * X = B (Transpose)= 'C': A**H * X = B (Conjugate transpose)
EQUEDโCHARACTER*1; specifies the form of equilibration that was done toAbefore calling this routine. this is needed to compute the solution and error bounds correctly.= 'N': No equilibration= 'R': Row equilibration, i.e., A has been premultiplied by diag(R).= 'C': Column equilibration, i.e., A has been postmultiplied by diag(C).= 'B': Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). The right hand side B has been changed accordingly.
NโINTEGER; the order of the matrixA.N >= 0.KLโINTEGER; the number of subdiagonals within the band ofA.KL >= 0.KUโINTEGER; the number of superdiagonals within the band ofA.KU >= 0.NRHSโINTEGER; the number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.ABโCOMPLEX array, dimension (LDAB,N); the original band matrixA, stored in rows1toKL+KU+1. the j-th column ofAis stored in the j-th column of the arrayABas follows:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).
LDABโINTEGER; the leading dimension of the arrayAB.LDAB >= KL+KU+1.AFBโCOMPLEX array, dimension (LDAFB,N); details of the LU factorization of the band matrixA, as computed byCGBTRF.Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1.LDAFBโINTEGER; the leading dimension of the arrayAFB.LDAFB >= 2*KL*KU+1.IPIVโINTEGER array, dimension (N); the pivot indices fromCGETRF; for1<=i<=N, rowiof the matrix was interchanged with rowIPIV(i).RโREAL array, dimension (N); the row scale factors forA. ifEQUED = 'R'or'B',Ais multiplied on the left bydiag(R); ifEQUED = 'N'or'C',Ris not accessed.Ris an input argument ifFACT = 'F'; otherwise,Ris an output argument. ifFACT = 'F'andEQUED = 'R'or'B', each element ofRmust be positive.
if R is output, each element of R is a power of the radix. if R is input, each element of R 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. ๐ญ
CโREAL array, dimension (N); the column scale factors forA. ifEQUED = 'C'or'B',Ais multiplied on the right bydiag(C); ifEQUED = 'N'or'R',Cis not accessed.Cis an input argument ifFACT = 'F'; otherwise,Cis an output argument. ifFACT = 'F'andEQUED = 'C'or'B', each element ofCmust be positive.
if C is output, each element of C is a power of the radix. 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 matrixB.LDBโINTEGER; the leading dimension of the arrayB.LDB >= max(1,N).XโCOMPLEX array, dimension (LDX,NRHS); on entry, the solution matrixX, as computed byCGETRS. on exit, the improved solution matrixX. โจLDXโINTEGER; the leading dimension of the arrayX.LDX >= max(1,N).RCONDโREAL; reciprocal scaled condition number. this is an estimate of the reciprocal Skeel condition number of the matrixAafter 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. ๐BERRโREAL array, dimension (NRHS); componentwise relative backward error. this is the componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).N_ERR_BNDSโINTEGER; number of error bounds to return for each right hand side and each type (normwise or componentwise). seeERR_BNDS_NORMandERR_BNDS_COMPbelow.ERR_BNDS_NORM
๐ ERR_BNDS_NORM
ERR_BNDS_NORM is a REAL array, dimension (NRHS, N_ERR_BNDS) โ okay so for every right-hand side it carries all the little error-bound and condition-number receipts for the normwise relative error, which is defined like this:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error info described below, and there currently are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1โ boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(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 thresholdsqrt(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 thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is . (yeah bestie, the source sentence really does just stop there โ not me) These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately1.
See Lapack Working Note 165 for further details and extra cautions. ๐ซถ
๐ฆ ERR_BNDS_COMP
ERR_BNDS_COMP is a REAL array, dimension (NRHS, N_ERR_BNDS) โ same deal, but this one is serving componentwise relative error energy. For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, defined as:
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 ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1โ boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(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 thresholdsqrt(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 thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately1.
See Lapack Working Note 165 for further details and extra cautions. โจ
๐ NPARAMS
NPARAMS is INTEGER โ it specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. Slay, no cap.
๐ธ PARAMS
PARAMS is a REAL array, dimension NPARAMS โ it specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with the default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters.
PARAMS(LA_LINRX_ITREF_I = 1)โ whether to perform iterative refinement or not.- Default:
1.0 = 0.0: no refinement is performed, and no error bounds are computed.= 1.0: use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not supportDOUBLE PRECISION.- (other values are reserved for future use)
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2)โ maximum number of residual computations allowed for refinement.- Default:
10 - Aggressive: set to
100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. โ ๏ธ
- Default:
PARAMS(LA_LINRX_CWISE_I = 3)โ flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true,0.0is false.- Default:
1.0(attempt componentwise convergence)
- Default:
๐ WORK
WORK is a COMPLEX array, dimension (2*N).
๐ RWORK
RWORK is a REAL array, dimension (2*N).
๐ INFO
INFO is INTEGER.
= 0โ successful exit. The solution to every right-hand side is guaranteed. ๐< 0โ ifINFO = -i, the i-th argument had an illegal value.> 0 and <= NโU(INFO,INFO)is exactly zero. The factorization has been completed, but the factorUis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+Jโ the solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sidesKwithK > Jmay not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0), then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallestJsuch thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0), the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallestJsuch that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_BNDS_COMP.
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 435 of file cgbrfsx.f.
๐ฆ DGBRFSX
subroutine dgbrfsx (character trans, character equed, integer n, integer kl,
integer ku, integer nrhs, double precision, dimension( ldab, * ) ab,
integer ldab, double precision, dimension( ldafb, * ) afb, integer
ldafb, integer, dimension( * ) ipiv, double precision, dimension( * ) r,
double precision, dimension( * ) c, double precision, dimension( ldb, *
) b, integer ldb, double precision, dimension( ldx , * ) x, integer ldx,
double precision rcond, double precision, dimension( * ) berr, integer
n_err_bnds, double precision, dimension( nrhs, * ) err_bnds_norm, double
precision, dimension( nrhs, * ) err_bnds_comp, integer nparams, double
precision, dimension( * ) params, double precision, dimension( * ) work,
integer, dimension( * ) iwork, integer info)
DGBRFSX
๐ฏ Purpose
DGBRFSX improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. ๐
The original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED, R and C below. In this case, the solution and error bounds returned are for the original unequilibrated system.
Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument. Iconic, honestly.
๐ Parameters
TRANS
TRANS ๐
Type: CHARACTER*1 โ this is the flag that tells us which form of the system of equations weโre solving, bestie. ๐
= 'N':A * X = B(No transpose)= 'T':A**T * X = B(Transpose)= 'C':A**H * X = B(Conjugate transpose = Transpose)
EQUED ๐
Type: CHARACTER*1 โ tells you what kind of equilibration got done to A before this routine was called. This is needed to compute the solution and error bounds correctly. Lowkey important, fr fr.
= 'N': No equilibration= 'R': Row equilibration, i.e.,Ahas been premultiplied bydiag(R).= 'C': Column equilibration, i.e.,Ahas been postmultiplied bydiag(C).= 'B': Both row and column equilibration, i.e.,Ahas been replaced bydiag(R) * A * diag(C). The right hand sideBhas been changed accordingly.
N โจ
Type: INTEGER
The order of the matrix A. N >= 0.
KL ๐ซ
Type: INTEGER
The number of subdiagonals within the band of A. KL >= 0.
KU ๐ธ
Type: INTEGER
The number of superdiagonals within the band of A. KU >= 0.
NRHS ๐ฆ
Type: INTEGER
The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
AB ๐
Type: DOUBLE PRECISION array, dimension (LDAB,N)
The original band matrix A, stored in rows 1 to KL+KU+1. The j-th column of A is stored in the j-th column of the array AB as follows:
AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).
LDAB ๐ฅ
Type: INTEGER
The leading dimension of the array AB. LDAB >= KL+KU+1.
AFB ๐ง
Type: DOUBLE PRECISION array, dimension (LDAFB,N)
Details of the LU factorization of the band matrix A, as computed by DGBTRF. U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1.
LDAFB ๐
Type: INTEGER
The leading dimension of the array AFB. LDAFB >= 2*KL*KU+1.
IPIV ๐
Type: INTEGER array, dimension (N)
The pivot indices from DGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).
R ๐บ
Type: DOUBLE PRECISION array, dimension (N)
The row scale factors for A. If EQUED = 'R' or 'B', A is multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is not accessed. R is an input argument if FACT = 'F'; otherwise, R is an output argument. If FACT = 'F' and EQUED = 'R' or 'B', each element of R must be positive.
If R is output, each element of R is a power of the radix. If R is input, each element of R 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.
Bestie, that radix-power thing is not aesthetic fluff โ itโs literally there so the scaling doesnโt mess up your rounding unless underflow or overflow pops off. ๐ญ
C ๐
Type: DOUBLE PRECISION array, dimension (N)
The column scale factors for A. If EQUED = 'C' or 'B', A is multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is not accessed. C is an input argument if FACT = 'F'; otherwise, C is an output argument. If FACT = 'F' and EQUED = 'C' or 'B', each element of C must be positive.
If C is output, each element of C is a power of the radix. 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 ๐
Type: DOUBLE PRECISION array, dimension (LDB,NRHS)
The right hand side matrix B.
LDB โญ
Type: INTEGER
The leading dimension of the array B. LDB >= max(1,N).
X ๐ซถ
Type: DOUBLE PRECISION array, dimension (LDX,NRHS)
On entry, the solution matrix X, as computed by DGETRS. On exit, the improved solution matrix X.
LDX ๐
Type: INTEGER
The leading dimension of the array X. LDX >= max(1,N).
RCOND ๐
Type: 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.
Okay so even if this number is giving tiny and the matrix looks ill-conditioned, the error can still be small. Donโt panic immediately. ๐
BERR ๐ฅ
Type: DOUBLE PRECISION array, dimension (NRHS)
Componentwise relative backward error. This is 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).
N_ERR_BNDS โจ
Type: INTEGER
Number of error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below.
ERR_BNDS_NORM ๐ฆ
Type: 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 ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1โ boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon').err = 2โ error bound: The estimated forward error, almost certainly within a factor of10of the true error so long as the next entry is greater than the thresholdsqrt(n) * dlamch('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 thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately1.
See Lapack Working Note 165 for further details and extra cautions.
ERR_BNDS_COMP
ERR_BNDS_COMP is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS) ๐ For each right-hand side, this array contains info about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
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 ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon').err = 2error bound: The estimated forward error, almost certainly within a factor of10of the true error so long as the next entry is greater than the thresholdsqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately1.
๐ See Lapack Working Note 165 for further details and extra cautions.
NPARAMSโNPARAMSisINTEGER. Specifies the number of parameters set inPARAMS. If<= 0, thePARAMSarray is never referenced and default values are used.PARAMSโPARAMSisDOUBLE PRECISIONarray, dimension(NPARAMS). Specifies algorithm parameters. If an entry is< 0.0, then that entry will be filled with default value used for that parameter. Only positions up toNPARAMSare accessed; defaults are used for higher-numbered parameters.PARAMS(LA_LINRX_ITREF_I = 1): Whether to perform iterative refinement or not. Default:1.0D+0= 0.0: No refinement is performed, and no error bounds are computed.= 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not supportDOUBLE PRECISION. (other values are reserved for future use)PARAMS(LA_LINRX_ITHRESH_I = 2): Maximum number of residual computations allowed for refinement. Default:10Aggressive: Set to100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy.PARAMS(LA_LINRX_CWISE_I = 3): Flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true,0.0is false. Default:1.0(attempt componentwise convergence)
WORKโWORKisDOUBLE PRECISIONarray, dimension(4*N).IWORKโIWORKisINTEGERarray, dimension(N).INFOโINFOisINTEGER.= 0: Successful exit. The solution to every right-hand side is guaranteed.< 0: IfINFO = -i, the i-th argument had an illegal value.> 0and<= N:U(INFO,INFO)is exactly zero. The factorization has been completed, but the factorUis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sidesKwithK > Jmay not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallestJsuch thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallestJsuch that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_BNDS_COMP.
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 435 of file dgbrfsx.f.
Okay bestie, next up is the sgbrfsx synopsis, character-for-character ๐ซถ:
subroutine sgbrfsx (character trans, character equed, integer n, integer kl,
integer ku, integer nrhs, real, dimension( ldab, * ) ab, integer ldab,
real, dimension( ldafb, * ) afb, integer ldafb, integer, dimension( * )
ipiv, real, dimension( * ) r, real, dimension( * ) c, real, dimension(
ldb, * ) b, integer ldb, real, dimension( ldx , * ) x, integer ldx, real
rcond, real, dimension( * ) berr, integer n_err_bnds, real, dimension(
nrhs, * ) err_bnds_norm, real, dimension( nrhs, * ) err_bnds_comp,
integer nparams, real, dimension( * ) params, real, dimension( * ) work,
integer, dimension( * ) iwork, integer info)
โจ SGBRFSX โจ
Purpose:
SGBRFSX improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds.
The original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED, R and C below. In this case, the solution and error bounds returned are for the original unequilibrated system.
Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument.
Parameters:
TRANSโTRANSisCHARACTER*1. Specifies the form of the system of equations:= 'N':A * X = B(No transpose)= 'T':A**T * X = B(Transpose)= 'C':A**H * X = B(Conjugate transpose = Transpose)
EQUEDโEQUEDisCHARACTER*1. Specifies the form of equilibration that was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly.= 'N': No equilibration= 'R': Row equilibration, i.e.,Ahas been premultiplied bydiag(R).= 'C': Column equilibration, i.e.,Ahas been postmultiplied bydiag(C).= 'B': Both row and column equilibration, i.e.,Ahas been replaced bydiag(R) * A * diag(C). The right hand sideBhas been changed accordingly.
NโNisINTEGER. The order of the matrixA.N >= 0.KLโKLisINTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUโKUisINTEGER. The number of superdiagonals within the band ofA.KU >= 0.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.ABโABisREALarray, dimension(LDAB,N). The original band matrixA, stored in rows1toKL+KU+1. The j-th column ofAis stored in the j-th column of the arrayABas follows:AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).LDABโLDABisINTEGER. The leading dimension of the arrayAB.LDAB >= KL+KU+1.AFBโAFBisREALarray, dimension(LDAFB,N). Details of the LU factorization of the band matrixA, as computed bySGBTRF.Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows1toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1.LDAFB
LDAFB
LDAFB is INTEGER ๐
It's the leading dimension of the array AFB, and the vibe check is: LDAFB >= 2*KL*KU+1. That's the rule, no cap. โจ
IPIV
IPIV is INTEGER array, dimension (N) ๐
These are the pivot indices straight out of SGETRF. So for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i) โ that's literally the whole personality of this array, it just tells you who swapped with who ๐
R
R is REAL array, dimension (N) ๐ธ
The row scale factors for A, bestie. So like:
- if
EQUED = 'R'or'B',Ais multiplied on the left bydiag(R) - if
EQUED = 'N'or'C',Ris not accessed, don't even look at it ๐
R is an input argument if FACT = 'F'; otherwise, R is an output argument. And if FACT = 'F' and EQUED = 'R' or 'B', each element of R must be positive โ non-negotiable ๐ซถ
If R is output, each element of R is a power of the radix. If R is input, each element of R 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. ๐ญ That last bit is the "this is why we can't have nice things" of numerical linear algebra, fr fr.
C
C is REAL array, dimension (N) ๐ธ
The column scale factors for A โ same energy as R but sideways:
- if
EQUED = 'C'or'B',Ais multiplied on the right bydiag(C) - if
EQUED = 'N'or'R',Cis not accessed ๐
C is an input argument if FACT = 'F'; otherwise, C is an output argument. And if FACT = 'F' and EQUED = 'C' or 'B', each element of C must be positive. Periodt. ๐
If C is output, each element of C is a power of the radix. 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. ๐ฅ Same warning, same drama, iconic honestly.
B
B is REAL array, dimension (LDB,NRHS) ๐ฆ
The right hand side matrix B. That's it, that's the whole sentence. Main character of the equation, zero explanation needed ๐
LDB
LDB is INTEGER ๐
The leading dimension of the array B. Constraint: LDB >= max(1,N). Respect it โจ
X
X is REAL array, dimension (LDX,NRHS) ๐ฆ
On entry, the solution matrix X, as computed by SGETRS.
On exit, the improved solution matrix X โ glow-up arc, we love to see it ๐
LDX
LDX is INTEGER ๐
The leading dimension of the array X. Constraint: LDX >= max(1,N). Simple as that ๐
RCOND
RCOND is REAL ๐
The reciprocal scaled condition number. It's an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if done).
Now listen ๐ โ if this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. But here's the plot twist: note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. Not me defending an ill-conditioned matrix ๐ญ๐
BERR
BERR is REAL array, dimension (NRHS) ๐ธ
Componentwise relative backward error. Specifically, it's 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. Tiny number, huge meaning ๐ซถ
N_ERR_BNDS
N_ERR_BNDS is INTEGER ๐
The number of error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below ๐
ERR_BNDS_NORM
ERR_BNDS_NORM is 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 ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1โ boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(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 thresholdsqrt(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 thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately 1.
yeah bestie the "is ." is literally how it reads in the source ๐ญ the sentence just ends. Not me editing a manpage sentence, I would never ๐
See Lapack Working Note 165 for further details and extra cautions. ๐
ERR_BNDS_COMP
ERR_BNDS_COMP is 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 ERR_BNDS_COMP is not accessed ๐ If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1โ boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(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 thresholdsqrt(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 thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately 1.
See Lapack Working Note 165 for further details and extra cautions. ๐ (yes, same note, it means it, go read it ๐ซถ)
NPARAMS
NPARAMS is INTEGER ๐
Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. Zero effort, zero problems โจ
PARAMS
PARAMS is REAL array, dimension NPARAMS ๐๏ธ
Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters. Okay so here's the lineup ๐
PARAMS(LA_LINRX_ITREF_I = 1): Whether to perform iterative refinement or not.- Default:
1.0 = 0.0: No refinement is performed, and no error bounds are computed.= 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not supportDOUBLE PRECISION.- (other values are reserved for future use) ๐
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2): Maximum number of residual computations allowed for refinement.- Default:
10 - Aggressive: Set to
100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. ๐ฌ so like, go off but know the risk.
- Default:
PARAMS(LA_LINRX_CWISE_I = 3): Flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true,0.0is false.- Default:
1.0(attempt componentwise convergence) ๐
- Default:
WORKโWORKisREAL array, dimension (4*N)โจ (yes bestie, even in the complex*16 routine there's a real workspace chilling alongsideRWORKโ she's built different ๐ )IWORKโIWORKisINTEGER array, dimension (N)๐INFOโINFOisINTEGER, and this one is the vibe check of the whole call ๐ญ read it carefully:= 0: Successful exit. The solution to every right-hand side is guaranteed. slay ๐< 0: IfINFO = -i, the i-th argument had an illegal value ๐> 0and<= N:U(INFO,INFO)is exactly zero. The factorization has been completed, but the factorUis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned ๐= N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K withK > Jmay not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_BNDS_COMP. ๐ซถ
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Definition at line 435 of file sgbrfsx.f.
๐ฆ subroutine zgbrfsx โ same energy, complex*16 edition ๐
subroutine zgbrfsx (character trans, character equed, integer n, integer kl,
integer ku, integer nrhs, complex*16, dimension( ldab, * ) ab, integer
ldab, complex*16, dimension( ldafb, * ) afb, integer ldafb, integer,
dimension( * ) ipiv, double precision, dimension( * ) r, double
precision, dimension( * ) c, complex*16, dimension( ldb, * ) b, integer
ldb, complex*16, dimension( ldx , * ) x, integer ldx, double precision
rcond, double precision, dimension( * ) berr, integer n_err_bnds, double
precision, dimension( nrhs, * ) err_bnds_norm, double precision,
dimension( nrhs, * ) err_bnds_comp, integer nparams, double precision,
dimension( * ) params, complex*16, dimension( * ) work, double
precision, dimension( * ) rwork, integer info)
ZGBRFSX ๐
โจ Purpose โจ
Okay so ZGBRFSX improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution ๐ฏ In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. iykyk ๐
The original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED, R and C below. In this case, the solution and error bounds returned are for the original unequilibrated system ๐ธ
Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument ๐ (yes, the code literally won't touch it, iconic)
๐ Parameters ๐
TRANSโTRANSisCHARACTER*1. Specifies the form of the system of equations ๐งฎ= 'N':A * X = B(No transpose)= 'T':A**T * X = B(Transpose)= 'C':A**H * X = B(Conjugate transpose)
EQUEDโEQUEDisCHARACTER*1. Specifies the form of equilibration that was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly ๐ซถ= 'N': No equilibration= 'R': Row equilibration, i.e.,Ahas been premultiplied bydiag(R).= 'C': Column equilibration, i.e.,Ahas been postmultiplied bydiag(C).= 'B': Both row and column equilibration, i.e.,Ahas been replaced bydiag(R) * A * diag(C). The right hand sideBhas been changed accordingly.
NโNisINTEGER. The order of the matrixA.N >= 0. ๐KLโKLisINTEGER. The number of subdiagonals within the band ofA.KL >= 0.KUโKUisINTEGER. The number of superdiagonals within the band ofA.KU >= 0.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0. ๐ABโABisCOMPLEX*16 array, dimension (LDAB,N). The original band matrixA, stored in rows 1 toKL+KU+1. The j-th column ofAis stored in the j-th column of the arrayABas follows:AB(ku+1+i-j,j) = A(i,j)formax(1,j-ku)<=i<=min(n,j+kl). ๐ฅLDABโLDABisINTEGER. The leading dimension of the arrayAB.LDAB >= KL+KU+1. ๐AFBโAFBisCOMPLEX*16 array, dimension (LDAFB,N). Details of the LU factorization of the band matrixA, as computed byZGBTRF.Uis stored as an upper triangular band matrix withKL+KUsuperdiagonals in rows 1 toKL+KU+1, and the multipliers used during the factorization are stored in rowsKL+KU+2to2*KL+KU+1. ๐LDAFBโLDAFBisINTEGER. The leading dimension of the arrayAFB.LDAFB >= 2*KL*KU+1. ๐IPIVโIPIVisINTEGER array, dimension (N). The pivot indices fromZGETRF; for1<=i<=N, row i of the matrix was interchanged with rowIPIV(i). ๐RโRisDOUBLE PRECISION array, dimension (N). The row scale factors forA. IfEQUED = 'R'or'B',Ais multiplied on the left bydiag(R); ifEQUED = 'N'or'C',Ris not accessed.Ris an input argument ifFACT = 'F'; otherwise,Ris an output argument. IfFACT = 'F'andEQUED = 'R'or'B', each element ofRmust be positive. IfRis output, each element ofRis a power of the radix. IfRis input, each element ofRshould 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. ๐ฌ (that last bit is a real warning, don't sleep on it)CโCisDOUBLE PRECISION array, dimension (N). The column scale factors forA. IfEQUED = 'C'or'B',Ais multiplied on the right bydiag(C); ifEQUED = 'N'or'R',Cis not accessed.Cis an input argument ifFACT = 'F'; otherwise,Cis an output argument. IfFACT = 'F'andEQUED = 'C'or'B', each element ofCmust be positive. IfCis output, each element ofCis a power of the radix. IfCis input, each element ofCshould 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โBisCOMPLEX*16 array, dimension (LDB,NRHS). The right hand side matrixB. ๐LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). ๐XโXisCOMPLEX*16 array, dimension (LDX,NRHS). On entry, the solution matrixX, as computed byZGETRS. On exit, the improved solution matrixX. โจ (glow-up fr fr)LDXโLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,N). ๐RCONDโRCONDisDOUBLE PRECISION. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrixAafter 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. ๐ซถ (so like, tinyRCONDโ automatically disaster, read the whole sentence)BERRโBERRisDOUBLE PRECISION array, dimension (NRHS). Componentwise relative backward error. This is the componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution). ๐ฏN_ERR_BNDSโN_ERR_BNDSisINTEGER. Number of error bounds to return for each right hand side and each type (normwise or componentwise). SeeERR_BNDS_NORMandERR_BNDS_COMPbelow. ๐ERR_BNDS_NORMโ (bestie the page literally cuts off right here mid-entry ๐ญ keep scrolling, her description picks up in the next chunk ๐ซถ)
Okay so picking up right where we left off in the function docs โ we're deep in the parameter tea now, and it's lowkey a lot but we're gonna slay it ๐
So, ERR_BNDS_NORM โ it's 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 normwise relative error, which is defined as follows:
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 ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1โ boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('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 thresholdsqrt(n) * dlamch('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 thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrix Z. LetZ = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1. (The source really does end that sentence with a lone period, bestie โ no cap ๐)
See Lapack Working Note 165 for further details and extra cautions.
๐ ERR_BNDS_COMP
ERR_BNDS_COMP 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:
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 ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1โ boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('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 thresholdsqrt(n) * dlamch('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 thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is . These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrix Z. LetZ = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row ofA*diag(x)by a power of the radix so all absolute row sums of Z are approximately 1. (Again with the lone period, bestie โ we're just faithful to the source ๐ซถ)
See Lapack Working Note 165 for further details and extra cautions.
๐ NPARAMS
NPARAMS is INTEGER.
Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used.
๐ฆ PARAMS
PARAMS is a DOUBLE PRECISION array, dimension NPARAMS.
Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters.
PARAMS(LA_LINRX_ITREF_I = 1)โ Whether to perform iterative refinement or not.- Default:
1.0D+0 = 0.0: No refinement is performed, and no error bounds are computed.= 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not supportDOUBLE PRECISION.- (other values are reserved for future use)
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2)โ Maximum number of residual computations allowed for refinement.- Default:
10 - Aggressive: Set to
100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy.
- Default:
โ ๏ธ That aggressive 100 setting is giving "living dangerously" energy โ the source says those guarantees may no longer be trustworthy, so don't say we didn't warn you ๐
PARAMS(LA_LINRX_CWISE_I = 3)โ Flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true,0.0is false.- Default:
1.0(attempt componentwise convergence)
- Default:
๐ WORK
WORK is a COMPLEX*16 array, dimension (2*N).
โญ RWORK
RWORK is a DOUBLE PRECISION array, dimension (2*N).
๐ฅ INFO
INFO is INTEGER.
= 0: Successful exit. The solution to every right-hand side is guaranteed.< 0: IfINFO = -i, the i-th argument had an illegal value.> 0 and <= N:U(INFO,INFO)is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K with K > J may not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_BNDS_COMP.
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 435 of file zgbrfsx.f.
โจ Author (the Doxygen one)
Generated automatically by Doxygen for LAPACK from the source code.
And that's the whole page, bestie! Footer tea for the sign-off: this one's from LAPACK Version 3.12.0, page gbrfsx(3) โ and the date slot isn't in the footer we got, so we're not inventing one, 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