posvxx(3)
โจ NAME โจ
posvxx โ posvxx: factor and solve, extra precise ๐
๐ฆ SYNOPSIS ๐ฆ
Functions
subroutine cposvxx (fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)CPOSVXX computes the solution to system of linear equationsA * X = Bfor PO matricessubroutine dposvxx (fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info)DPOSVXX computes the solution to system of linear equationsA * X = Bfor PO matricessubroutine sposvxx (fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, iwork, info)SPOSVXX computes the solution to system of linear equationsA * X = Bfor PO matricessubroutine zposvxx (fact, uplo, n, nrhs, a, lda, af, ldaf, equed, s, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)ZPOSVXX computes the solution to system of linear equationsA * X = Bfor PO matrices
๐ธ DETAILED DESCRIPTION ๐ธ
(okay bestie there's literally nothing else here, it just goes straight to the function docs, keep scrolling ๐)
๐ Function Documentation ๐
subroutine cposvxx
subroutine cposvxx (character fact, character uplo, integer n, integer nrhs,
complex, dimension( lda, * ) a, integer lda, complex, dimension( ldaf, * )
af, integer ldaf, character equed, real, dimension( * ) s, complex,
dimension( ldb, * ) b, integer ldb, complex, dimension( ldx, * ) x,
integer ldx, real rcond, real rpvgrw, 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)
CPOSVXX computes the solution to system of linear equations A * X = B for PO matrices
๐ Purpose:
so basically ๐
CPOSVXX uses the Cholesky factorization A = U**T*U or A = L*L**T to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices. no cap.
If requested, both normwise and maximum componentwise error bounds are returned. CPOSVXX will return a solution with a tiny guaranteed error (O(eps) where eps is the working machine precision) unless the matrix is very ill-conditioned, in which case a warning is returned ๐จ. Relevant condition numbers also are calculated and returned.
CPOSVXX accepts user-provided factorizations and equilibration factors; see the definitions of the FACT and EQUED options. Solving with refinement and using a factorization from a previous CPOSVXX call will also produce a solution with either O(eps) errors or warnings, but we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from what CPOSVXX would itself produce. (translation: if you hand it your own random factorization, that's on you bestie ๐)
๐ฆ Description:
the way this routine just does all this for you, iconic. here's the play-by-play โจ
The following steps are performed:
- If
FACT = 'E', real scaling factors are computed to equilibrate the system:
diag(S)*A*diag(S) *inv(diag(S))*X = diag(S)*B
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(S)*A*diag(S) and B by diag(S)*B.
- If
FACT = 'N'or'E', the Cholesky decomposition is used to factor the matrixA(after equilibration ifFACT = 'E') as
A = U**T* U, if UPLO = 'U', or
A = L * L**T, if UPLO = 'L',
where U is an upper triangular matrix and L is a lower triangular matrix.
- If the leading principal minor of order
iis not positive, then the routine returns withINFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA(see argumentRCOND). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve forXand compute error bounds as described below ๐. - The system of equations is solved for
Xusing the factored form ofA. - By default (unless
PARAMS(LA_LINRX_ITREF_I)is set to zero), the routine will use iterative refinement to try to get a small error and error bounds. Refinement calculates the residual to at least twice the working precision ๐ฅ. - If equilibration was used, the matrix
Xis premultiplied bydiag(S)so that it solves the original system before equilibration.
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. (lazy girl math: pass 0 and dip ๐)
Parameters
FACT
FACT is CHARACTER*1
Specifies whether or not the factored form of the matrix A is supplied on entry, and if not, whether the matrix A should be equilibrated before it is factored.
= 'F': On entry,AFcontains the factored form ofA. IfEQUEDis not'N', the matrixAhas been equilibrated with scaling factors given byS.AandAFare not modified.= 'N': The matrixAwill be copied toAFand factored.= 'E': The matrixAwill be equilibrated if necessary, then copied toAFand factored.
UPLO
UPLO is CHARACTER*1
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N
N is INTEGER
The number of linear equations, i.e., the order of the matrix A. N >= 0.
NRHS
NRHS is INTEGER
The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.
A
A is COMPLEX array, dimension (LDA,N)
On entry, the Hermitian matrix A, except if FACT = 'F' and EQUED = 'Y', then A must contain the equilibrated matrix diag(S)*A*diag(S). If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. A is not modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.
On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by diag(S)*A*diag(S).
LDA
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,N).
AF
AF is COMPLEX array, dimension (LDAF,N)
If FACT = 'F', then AF is an input argument and on entry contains the triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, in the same storage format as A. If EQUED .ne. 'N', then AF is the factored form of the equilibrated matrix diag(S)*A*diag(S).
If FACT = 'N', then AF is an output argument and on exit returns the triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T of the original matrix A.
If FACT = 'E', then AF is an output argument and on exit returns the triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T of the equilibrated matrix A (see the description of A for the form of the equilibrated matrix).
LDAF
LDAF is INTEGER
The leading dimension of the array AF. LDAF >= max(1,N).
EQUED
EQUED is CHARACTER*1
Specifies the form of equilibration that was done.
= 'N': No equilibration (always true ifFACT = 'N').= 'Y': Both row and column equilibration, i.e.,Ahas been replaced bydiag(S) * A * diag(S).
EQUED is an input argument if FACT = 'F'; otherwise, it is an output argument.
S
S is REAL array, dimension (N)
The row scale factors for A. If EQUED = 'Y', A is multiplied on the left and right by diag(S). S is an input argument if FACT = 'F'; otherwise, S is an output argument. If FACT = 'F' and EQUED = 'Y', each element of S must be positive. If S is output, each element of S is a power of the radix. If S is input, each element of S 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
B is COMPLEX array, dimension (LDB,NRHS)
On entry, the N-by-NRHS right hand side matrix B.
On exit, if EQUED = 'N', B is not modified; if EQUED = 'Y', B is overwritten by diag(S)*B;
LDB
LDB is INTEGER
The leading dimension of the array B. LDB >= max(1,N).
X
X is COMPLEX array, dimension (LDX,NRHS)
If INFO = 0, the N-by-NRHS solution matrix X to the original system of equations. Note that A and B are modified on exit if EQUED .ne. 'N', and the solution to the equilibrated system is inv(diag(S))*X.
LDX
LDX โ INTEGER
Leading dimension of the array X, bestie. Constraint: LDX >= max(1,N). That's it, that's the whole vibe check. ๐ซถ
RCOND โ REAL
Reciprocal scaled condition number โจ โ an estimate of the reciprocal Skeel condition number of the matrix A after equilibration (if that got done).
If this is less than machine precision (and especially if it's literally zero), the matrix is singular to working precision. ๐
Big caveat, don't skip it: the error may still be small even when this number is tiny and the matrix looks ill-conditioned. So don't panic-read this one number in isolation, ok?
RPVGRW โ REAL
Reciprocal pivot growth ๐ฑ. On exit, this holds the reciprocal pivot growth factor norm(A)/norm(U) โ the norm is what's used.
If this is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor ๐ญ. Which also means the solution X, the estimated condition numbers, and the error bounds could all be unreliable. Rude, but that's the tea.
If factorization fails with 0<INFO<=N, then this contains the reciprocal pivot growth factor for the leading INFO columns of A.
BERR โ REAL array, dimension (NRHS)
Componentwise relative backward error ๐. Specifically, 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. Iconic little overachiever.
N_ERR_BNDS โ INTEGER
The number of error bounds to return for each right hand side and each type (normwise or componentwise). Go peep ERR_BNDS_NORM and ERR_BNDS_COMP below ๐
ERR_BNDS_NORM โ REAL array, dimension (NRHS, N_ERR_BNDS)
For each right-hand side, this array carries info about the various error bounds and condition numbers 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))
That's the normwise relative error of the ith solution vector, no cap ๐งฎ.
The array is indexed by the type of error information as described below. There are currently up to three pieces of info returned.
- First index in
ERR_BNDS_NORM(i,:)โ the ith right-hand side. - Second index in
ERR_BNDS_NORM(:,err)โ one of the following three fields:
The three err fields, in order:
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 of10of 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: the estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is trusted. 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 โ REAL array, dimension (NRHS, N_ERR_BNDS)
Same deal, but for the componentwise relative error ๐ . 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))
That's the componentwise relative error of the ith solution vector.
The array is indexed by the right-hand side i (which the componentwise relative error depends on) and by the type of error information described below. There are currently up to three pieces of info returned for each right-hand side.
Heads up ๐จ: if componentwise accuracy isn't requested (PARAMS(3) = 0.0), thenERR_BNDS_COMPis not accessed. And ifN_ERR_BNDS < 3, then at most the first(:,N_ERR_BNDS)entries are returned.
- First index in
ERR_BNDS_COMP(i,:)โ the ith right-hand side. - Second index in
ERR_BNDS_COMP(:,err)โ one of the 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 of10of 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: the estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is trusted. 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.
Also: see Lapack Working Note 165 for further details and extra cautions ๐.
NPARAMS โ INTEGER
Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used ๐.
PARAMS โ REAL array, dimension NPARAMS
Specifies algorithm parameters ๐๏ธ. If an entry is < 0.0, then that entry gets filled in 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 do 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 doesn't 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. โ ๏ธ But if the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. So like, know what you're doing.
- 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 โ COMPLEX array, dimension (2*N)
Scratch space, that's the whole description bestie ๐ซง
RWORK โ REAL array, dimension (2*N)
Scratch space but real this time ๐ธ
INFO โ INTEGER
The receipts ๐:
= 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 for other right-hand sidesKwithK > Jmay not be guaranteed either, 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 isn't 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 a componentwise error bound that isn't guaranteed (the smallestJsuch that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). - See the definition of
ERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get info about all of the right-hand sides, checkERR_BNDS_NORMorERR_BNDS_COMP๐
- If a small componentwise error is not requested (
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ฆ Definition
Definition at line 492 of file cposvxx.f.
subroutine dposvxx (character fact, character uplo, integer n, integer nrhs,
double precision, dimension( lda, * ) a, integer lda, double precision,
dimension( ldaf, * ) af, integer ldaf, character equed, double
precision, dimension( * ) s, double precision, dimension( ldb, * ) b,
integer ldb, double precision, dimension( ldx, * ) x, integer ldx,
double precision rcond, double precision rpvgrw, 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)
okay so DPOSVXX computes the solution to the system of linear equations A * X = B for PO matrices. periodt. ๐
โจ Purpose โจ
DPOSVXX uses the Cholesky factorization A = U**T*U or A = L*L**T to compute the solution to a double precision system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices. ๐ซถ
If requested, both normwise and maximum componentwise error bounds are returned. DPOSVXX will return a solution with a tiny guaranteed error (O(eps) where eps is the working machine precision) unless the matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers also are calculated and returned. ๐ธ
DPOSVXX accepts user-provided factorizations and equilibration factors; see the definitions of the FACT and EQUED options. Solving with refinement and using a factorization from a previous DPOSVXX call will also produce a solution with either O(eps) errors or warnings, but we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from what DPOSVXX would itself produce. ๐
๐ Description ๐
The following steps are performed:
- If
FACT = 'E', double precision scaling factors are computed to equilibrate the system:
diag(S)*A*diag(S) *inv(diag(S))*X = diag(S)*B
Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(S)*A*diag(S) and B by diag(S)*B. ๐ฆ
- If
FACT = 'N'or'E', the Cholesky decomposition is used to factor the matrixA(after equilibration ifFACT = 'E') as
A = U**T* U, if UPLO = 'U', or
A = L * L**T, if UPLO = 'L',
where U is an upper triangular matrix and L is a lower triangular matrix. ๐
- If the leading principal minor of order
iis not positive, then the routine returns withINFO = i. Otherwise, the factored form ofAis used to estimate the condition number of the matrixA(see argumentRCOND). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve forXand compute error bounds as described below. ๐ญ - The system of equations is solved for
Xusing the factored form ofA. โจ - By default (unless
PARAMS(LA_LINRX_ITREF_I)is set to zero), the routine will use iterative refinement to try to get a small error and error bounds. Refinement calculates the residual to at least twice the working precision. ๐ฅ - If equilibration was used, the matrix
Xis premultiplied bydiag(S)so that it solves the original system before equilibration. ๐
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 ๐ธ
FACTโCHARACTER*1. Specifies whether or not the factored form of the matrixAis supplied on entry, and if not, whether the matrixAshould be equilibrated before it is factored. ๐= 'F': On entry,AFcontains the factored form ofA. IfEQUEDis not'N', the matrixAhas been equilibrated with scaling factors given byS.AandAFare not modified.= 'N': The matrixAwill be copied toAFand factored.= 'E': The matrixAwill be equilibrated if necessary, then copied toAFand factored.
UPLOโCHARACTER*1.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored. ๐ฆ
NโINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0. ๐NRHSโINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0. ๐AโDOUBLE PRECISION array, dimension (LDA,N). On entry, the symmetric matrixA, except ifFACT = 'F'andEQUED = 'Y', thenAmust contain the equilibrated matrixdiag(S)*A*diag(S). IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.Ais not modified ifFACT = 'F'or'N', or ifFACT = 'E'andEQUED = 'N'on exit. ๐ซถ
On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by diag(S)*A*diag(S). ๐
LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). โญAFโDOUBLE PRECISION array, dimension (LDAF,N). IfFACT = 'F', thenAFis an input argument and on entry contains the triangular factorUorLfrom the Cholesky factorizationA = U**T*UorA = L*L**T, in the same storage format asA. IfEQUED .ne. 'N', thenAFis the factored form of the equilibrated matrixdiag(S)*A*diag(S). ๐
If FACT = 'N', then AF is an output argument and on exit returns the triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T of the original matrix A. ๐ธ
If FACT = 'E', then AF is an output argument and on exit returns the triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T of the equilibrated matrix A (see the description of A for the form of the equilibrated matrix). โจ
LDAFโINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N). ๐EQUEDโCHARACTER*1. Specifies the form of equilibration that was done.= 'N': No equilibration (always true ifFACT = 'N').= 'Y': Both row and column equilibration, i.e.,Ahas been replaced bydiag(S) * A * diag(S).
EQUED is an input argument if FACT = 'F'; otherwise, it is an output argument. ๐
SโDOUBLE PRECISION array, dimension (N). The row scale factors forA. IfEQUED = 'Y',Ais multiplied on the left and right bydiag(S).Sis an input argument ifFACT = 'F'; otherwise,Sis an output argument. IfFACT = 'F'andEQUED = 'Y', each element ofSmust be positive. IfSis output, each element ofSis a power of the radix. IfSis input, each element ofSshould 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โDOUBLE PRECISION array, dimension (LDB,NRHS). On entry, theN-by-NRHSright hand side matrixB. On exit, ifEQUED = 'N',Bis not modified; ifEQUED = 'Y',Bis overwritten bydiag(S)*B. ๐ฆLDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). ๐XโDOUBLE PRECISION array, dimension (LDX,NRHS). IfINFO = 0, theN-by-NRHSsolution matrixXto the original system of equations. Note thatAandBare modified on exit ifEQUED .ne. 'N', and the solution to the equilibrated system isinv(diag(S))*X. ๐ฅLDXโINTEGER. The leading dimension of the arrayX.LDX >= max(1,N). โญRCONDโDOUBLE 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. ๐RPVGRW
RPVGRW
RPVGRW is DOUBLE PRECISION โ it's the reciprocal pivot growth, bestie. ๐
On exit this contains the reciprocal pivot growth factor norm(A)/norm(U). The norm is used. If this is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor ๐ญ โ which also means that the solution X, the estimated condition numbers, and the error bounds could all be unreliable. If factorization fails with 0<INFO<=N, then this contains the reciprocal pivot growth factor for the leading INFO columns of A. ๐ซถ
BERR
BERR is DOUBLE PRECISION array, dimension (NRHS) โ the componentwise relative backward error. Fr fr 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. โจ
N_ERR_BNDS
N_ERR_BNDS is 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
ERR_BNDS_NORM 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:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
Normwise relative error in the ith solution vector โ that's the vibe. ๐ฆ
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. ๐ง
Okay so that sentence genuinely cuts off at "is ." in the original โ not me being sloppy, that's literally how it's written ๐ญ๐
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 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))
Componentwise relative error in the ith solution vector โ periodt. ๐
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 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 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. ๐ง
Same truncated "is ." situation here, bestie โ it's in the source, I'm just the messenger ๐
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 DOUBLE PRECISION array, dimension NPARAMS โ 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.0D+0 = 0.0: no refinement is performed, and no error bounds are computed.= 1.0: use the extra-precise refinement algorithm.- (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 DOUBLE PRECISION array, dimension (4*N). Scratch space, do not perceive her ๐ซถ
IWORK
IWORK is INTEGER array, dimension (N). Integer scratch space, also not for perceiving ๐ง
INFO
INFO is INTEGER โ the receipts, basically:
= 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 490 of file dposvxx.f. โจ
๐ฆ subroutine sposvxx ๐ฆ
subroutine sposvxx (character fact, character uplo, integer n, integer nrhs,
real, dimension( lda, * ) a, integer lda, real, dimension( ldaf, * ) af,
integer ldaf, character equed, real, dimension( * ) s, real, dimension(
ldb, * ) b, integer ldb, real, dimension( ldx, * ) x, integer ldx, real
rcond, real rpvgrw, 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)
SPOSVXX computes the solution to system of linear equations A * X = B for PO matrices. ๐ฅ
Purpose
okay so bestie, SPOSVXX is out here using the Cholesky factorization A = U**T*U or A = L*L**T to compute the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric positive definite matrix and X and B are N-by-NRHS matrices. ๐
if you ask nicely, it returns both normwise and maximum componentwise error bounds. SPOSVXX will give you a solution with a tiny guaranteed error (O(eps) where eps is the working machine precision) unless the matrix is very ill-conditioned โ in which case it throws a warning. relevant condition numbers also get calculated and returned. no cap. โจ
SPOSVXX also accepts user-provided factorizations and equilibration factors (peep the definitions of the FACT and EQUED options). solving with refinement and using a factorization from a previous SPOSVXX call will also produce a solution with either O(eps) errors or warnings โ but we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from what SPOSVXX would itself produce. periodt. ๐
๐ซ Description ๐ซ
here's the tea, the routine does these steps in order: โ
- if
FACT = 'E', real scaling factors are computed to equilibrate the system:
diag(S)*A*diag(S) *inv(diag(S))*X = diag(S)*B
whether or not the system gets equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(S)*A*diag(S) and B by diag(S)*B. ๐ฆ
- if
FACT = 'N'or'E', the Cholesky decomposition factors the matrixA(after equilibration ifFACT = 'E') like so:
A = U**T* U, if UPLO = 'U', or
A = L * L**T, if UPLO = 'L',
where U is an upper triangular matrix and L is a lower triangular matrix. slay. ๐
- if the leading principal minor of order
iis not positive, the routine bails withINFO = i. otherwise, the factored form ofAis used to estimate the condition number of the matrixA(see argumentRCOND). if the reciprocal of the condition number is less than machine precision, the routine still goes on to solve forXand compute error bounds as described below. it's giving resilient. ๐ช - the system of equations is solved for
Xusing the factored form ofA. easy peasy. โจ - by default (unless
PARAMS(LA_LINRX_ITREF_I)is set to zero), the routine uses iterative refinement to try to get a small error and error bounds. refinement calculates the residual to at least twice the working precision. highkey obsessed with that. ๐ฅ - if equilibration was used, the matrix
Xis premultiplied bydiag(S)so that it solves the original system before equilibration. and that's the whole glow-up. ๐
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, you can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument. iykyk. ๐
๐ธ Parameters ๐ธ
FACTโ isCHARACTER*1. specifies whether or not the factored form of the matrixAis supplied on entry, and if not, whether the matrixAshould be equilibrated before it is factored.= 'F': on entry,AFcontains the factored form ofA. ifEQUEDis not'N', the matrixAhas been equilibrated with scaling factors given byS.AandAFare not modified.= 'N': the matrixAwill be copied toAFand factored.= 'E': the matrixAwill be equilibrated if necessary, then copied toAFand factored.
UPLOโ isCHARACTER*1.= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.
Nโ isINTEGER. the number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSโ isINTEGER. the number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.Aโ isREAL array, dimension (LDA,N). on entry, the symmetric matrixA, except ifFACT = 'F'andEQUED = 'Y', thenAmust contain the equilibrated matrixdiag(S)*A*diag(S). ifUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. ifUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.Ais not modified ifFACT = 'F'or'N', or ifFACT = 'E'andEQUED = 'N'on exit.- on exit, if
FACT = 'E'andEQUED = 'Y',Ais overwritten bydiag(S)*A*diag(S).
- on exit, if
LDAโ isINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).AFโ isREAL array, dimension (LDAF,N). ifFACT = 'F', thenAFis an input argument and on entry contains the triangular factorUorLfrom the Cholesky factorizationA = U**T*UorA = L*L**T, in the same storage format asA. ifEQUED .ne. 'N', thenAFis the factored form of the equilibrated matrixdiag(S)*A*diag(S).- if
FACT = 'N', thenAFis an output argument and on exit returns the triangular factorUorLfrom the Cholesky factorizationA = U**T*UorA = L*L**Tof the original matrixA. - if
FACT = 'E', thenAFis an output argument and on exit returns the triangular factorUorLfrom the Cholesky factorizationA = U**T*UorA = L*L**Tof the equilibrated matrixA(see the description ofAfor the form of the equilibrated matrix).
- if
LDAFโ isINTEGER. the leading dimension of the arrayAF.LDAF >= max(1,N).EQUEDโ isCHARACTER*1. specifies the form of equilibration that was done.= 'N': no equilibration (always true ifFACT = 'N').= 'Y': both row and column equilibration, i.e.,Ahas been replaced bydiag(S) * A * diag(S).EQUEDis an input argument ifFACT = 'F'; otherwise, it is an output argument.
Sโ isREAL array, dimension (N). the row scale factors forA. ifEQUED = 'Y',Ais multiplied on the left and right bydiag(S).Sis an input argument ifFACT = 'F'; otherwise,Sis an output argument. ifFACT = 'F'andEQUED = 'Y', each element ofSmust be positive. ifSis output, each element ofSis a power of the radix. ifSis input, each element ofSshould 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โ isREAL array, dimension (LDB,NRHS). on entry, the N-by-NRHS right hand side matrixB. on exit,- if
EQUED = 'N',Bis not modified; - if
EQUED = 'Y',Bis overwritten bydiag(S)*B;
- if
LDBโ isINTEGER. the leading dimension of the arrayB.LDB >= max(1,N).Xโ isREAL array, dimension (LDX,NRHS). ifINFO = 0, the N-by-NRHS solution matrixXto the original system of equations. note thatAandBare modified on exit ifEQUED .ne. 'N', and the solution to the equilibrated system isinv(diag(S))*X.LDXโ isINTEGER. the leading dimension of the arrayX.LDX >= max(1,N).RCONDโ isREAL. 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.RPVGRWโ isREAL. reciprocal pivot growth. on exit, this contains the reciprocal pivot growth factornorm(A)/norm(U). the norm is used. if this is much less than 1, then the stability of the LU factorization of the (equilibrated) matrixAcould be poor. this also means that the solutionX, estimated condition numbers, and error bounds could be unreliable. if factorization fails with0<INFO<=N, then this contains the reciprocal pivot growth factor for the leadingINFOcolumns ofA.BERRโ isREAL 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โ isINTEGER. 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 is a REAL array, dimension (NRHS, N_ERR_BNDS), and bestie, it's the receipts for your answer ๐
For every right-hand side it holds error bounds and condition numbers 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 gets indexed by the type of error info, as described below. Right now there are up to three pieces of info coming back at you.
The first index in ERR_BNDS_NORM(i,:) is the i-th right-hand side, periodt.
The second index in ERR_BNDS_NORM(:,err) holds these three fields:
err = 1โ a boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2โ the 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, no cap.err = 3โ the reciprocal condition number: estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is . (yes, the source just trails off there ๐ not me editing it, it's literally like that). 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.
See Lapack Working Note 165 for further details and extra cautions. Fr fr, there are cautions in there.
ERR_BNDS_COMP is a REAL array, dimension (NRHS, N_ERR_BNDS) โ same energy, but this one tracks the componentwise relative error for each right-hand side, 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 (the componentwise relative error depends on it, iykyk) and by the type of error information 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 at all ๐ซถ 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 i-th right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains these three fields:
err = 1โ a boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2โ the 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โ the reciprocal condition number: estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is . (same trailing-off situation as above, iconic honestly). 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.
NPARAMS is INTEGER and it's giving "how many settings did you actually bring." It specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. Lowkey chill of it.
PARAMS is a REAL array, dimension NPARAMS and 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. Slay, lazy-friendly โจ
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)
PARAMS(LA_LINRX_ITHRESH_I = 2): maximum number of residual computations allowed for refinement. Default:10. Aggressive: 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 ๐ so like, proceed with awareness.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 is a REAL array, dimension (4*N). That's the scratch space, don't @ it.
IWORK is an INTEGER array, dimension (N). Integer scratch, same vibe.
INFO is INTEGER and it's the main character of the return values ๐ Here's the whole mood ring:
= 0: successful exit. The solution to every right-hand side is guaranteed. We love a clean win ๐< 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. Not the vibe ๐ญ= N+J: the solution corresponding to the J-th 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 J-th 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 J-th 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. Detective work, but make it linear algebra ๐
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Definition at line 493 of file sposvxx.f.
๐ธ subroutine zposvxx
Like, the complex*16 sibling walked in and ate ๐
Same energy, double precision error bounds, complex*16 everything else:
subroutine zposvxx (character fact, character uplo, integer n, integer nrhs,
complex*16, dimension( lda, * ) a, integer lda, complex*16, dimension(
ldaf, * ) af, integer ldaf, character equed, double precision,
dimension( * ) s, complex*16, dimension( ldb, * ) b, integer ldb,
complex*16, dimension( ldx, * ) x, integer ldx, double precision rcond,
double precision rpvgrw, 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)
ZPOSVXX computes the solution to system of linear equations A * X = B for PO matrices โจ
๐ฅ Purpose:
ZPOSVXX uses the Cholesky factorization A = U**T*U or A = L*L**T to compute the solution to a complex*16 system of linear equations A * X = B, where A is an N-by-N Hermitian positive definite matrix and X and B are N-by-NRHS matrices. Obsessed with a factorization that just works ๐ง
If requested, both normwise and maximum componentwise error bounds are returned. ZPOSVXX will return a solution with a tiny guaranteed error (O(eps) where eps is the working machine precision) unless the matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers also are calculated and returned. It's giving overachiever, and we respect it.
ZPOSVXX accepts user-provided factorizations and equilibration factors; see the definitions of the FACT and EQUED options. Solving with refinement and using a factorization from a previous ZPOSVXX call will also produce a solution with either O(eps) errors or warnings, but we cannot make that claim for general user-provided factorizations and equilibration factors if they differ from what ZPOSVXX would itself produce. Translation: DIY factorizations are on you, bestie ๐
๐ Description:
โฆand that's where this part dips โ more coming, don't go anywhere ๐ฆ
- Equilibration era โ if
FACT = 'E', double precision scaling factors are computed to equilibrate the system:
diag(S)*A*diag(S) *inv(diag(S))*X = diag(S)*B
Whether or not the system actually gets equilibrated depends on the scaling of the matrix A (vibe check on the matrix, basically), but if equilibration is used, A is overwritten by diag(S)*A*diag(S) and B by diag(S)*B. Not a drill, they get overwritten fr.
- Cholesky o'clock โ if
FACT = 'N'or'E', the Cholesky decomposition is used to factor the matrix A (after equilibration ifFACT = 'E') as
A = U**T* U, if UPLO = 'U', or
A = L * L**T, if UPLO = 'L',
where U is an upper triangular matrix and L is a lower triangular matrix. Slay, triangular representation.
- The minor situation โ if the leading principal minor of order i is not positive, then the routine returns with
INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A (see theRCONDglow-up below). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve for X and compute error bounds as described below. It's giving "we ball" energy but in a numerically responsible way. - Solving for X โ the system of equations is solved for X using the factored form of A. Easy, iconic, done.
- Iterative refinement arc โ by default (unless
PARAMS(LA_LINRX_ITREF_I)is set to zero), the routine will use iterative refinement to try to get a small error and error bounds. Refinement calculates the residual to at least twice the working precision. Lowkey overachiever behaviour and we love that for us. - Un-equilibrating โ if equilibration was used, the matrix X is premultiplied by
diag(S)so that it solves the original system before equilibration. Putting the outfit back on after the fitting, iykyk.
Some optional parameters are bundled in thePARAMSarray. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can passNPARAMS = 0which prevents the source code from accessing thePARAMSargument. No cap,NPARAMS = 0is the "leave me and my defaults alone" button.
๐ Parameters ๐
FACTโFACT is CHARACTER*1. Specifies whether or not the factored form of the matrix A is supplied on entry, and if not, whether the matrix A should be equilibrated before it is factored.= 'F': On entry,AFcontains the factored form of A. IfEQUEDis not'N', the matrix A has been equilibrated with scaling factors given byS.AandAFare not modified.= 'N': The matrix A will be copied toAFand factored.= 'E': The matrix A will be equilibrated if necessary, then copied toAFand factored.
UPLOโUPLO is CHARACTER*1.= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NโN is INTEGER. The number of linear equations, i.e., the order of the matrix A.N >= 0. Bestie, N is literally the size of the whole situation.NRHSโNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrices B and X.NRHS >= 0.AโA is COMPLEX*16 array, dimension (LDA,N). On entry, the Hermitian matrix A, except ifFACT = 'F'andEQUED = 'Y', then A must contain the equilibrated matrixdiag(S)*A*diag(S). IfUPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. A is not modified ifFACT = 'F'or'N', or ifFACT = 'E'andEQUED = 'N'on exit.
On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by diag(S)*A*diag(S). ๐ซถ
LDAโLDA is INTEGER. The leading dimension of the array A.LDA >= max(1,N).AFโAF is COMPLEX*16 array, dimension (LDAF,N).- If
FACT = 'F', then AF is an input argument and on entry contains the triangular factor U or L from the Cholesky factorizationA = U**T*UorA = L*L**T, in the same storage format as A. IfEQUED .ne. 'N', then AF is the factored form of the equilibrated matrixdiag(S)*A*diag(S). - If
FACT = 'N', then AF is an output argument and on exit returns the triangular factor U or L from the Cholesky factorizationA = U**T*UorA = L*L**Tof the original matrix A. - If
FACT = 'E', then AF is an output argument and on exit returns the triangular factor U or L from the Cholesky factorizationA = U**T*UorA = L*L**Tof the equilibrated matrix A (see the description of A for the form of the equilibrated matrix).
- If
So it's input sometimes and output sometimes โ main character with range. ๐
LDAFโLDAF is INTEGER. The leading dimension of the array AF.LDAF >= max(1,N).EQUEDโEQUED is CHARACTER*1. Specifies the form of equilibration that was done.= 'N': No equilibration (always true ifFACT = 'N').= 'Y': Both row and column equilibration, i.e., A has been replaced bydiag(S) * A * diag(S).
EQUED is an input argument if FACT = 'F'; otherwise, it is an output argument.
SโS is DOUBLE PRECISION array, dimension (N). The row scale factors for A. IfEQUED = 'Y', A is multiplied on the left and right bydiag(S).Sis an input argument ifFACT = 'F'; otherwise,Sis an output argument. IfFACT = 'F'andEQUED = 'Y', each element ofSmust be positive. IfSis output, each element ofSis a power of the radix. IfSis input, each element ofSshould 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. Yeah. That part. Don't skip it. ๐
BโB is COMPLEX*16 array, dimension (LDB,NRHS). On entry, the N-by-NRHS right hand side matrix B. On exit,- if
EQUED = 'N', B is not modified; - if
EQUED = 'Y', B is overwritten bydiag(S)*B.
- if
LDBโLDB is INTEGER. The leading dimension of the array B.LDB >= max(1,N).XโX is COMPLEX*16 array, dimension (LDX,NRHS). IfINFO = 0, the N-by-NRHS solution matrix X to the original system of equations. Note that A and B are modified on exit ifEQUED .ne. 'N', and the solution to the equilibrated system isinv(diag(S))*X. The actual answer is the one to the original system though โ remember that plot twist. ๐ฆLDXโLDX is INTEGER. The leading dimension of the array X.LDX >= max(1,N).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. So a tinyRCONDis not automatically a disaster โ it's giving "don't panic, but do pay attention". ๐ญRPVGRWโRPVGRW is DOUBLE PRECISION. Reciprocal pivot growth. On exit, this contains the reciprocal pivot growth factornorm(A)/norm(U). The norm is used. If this is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor. This also means that the solution X, estimated condition numbers, and error bounds could be unreliable. If factorization fails with0<INFO<=N, then this contains the reciprocal pivot growth factor for the leadingINFOcolumns of A. IfRPVGRWis acting suspicious, the whole answer is suspect โ periodt.BERRโBERR is DOUBLE 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 of A or B that makesX(j)an exact solution). SmallBERR= good vibes, certified.N_ERR_BNDSโN_ERR_BNDS is 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 is a DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS) โ and bestie, this thing is packed with lore. For every right-hand side, it holds info about the various error bounds and condition numbers that go with 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, and right now there are up to three pieces of info returned. Slay.
The first index in ERR_BNDS_NORM(i,:) corresponds to the *i*th right-hand side. Simple as that.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1โ a boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon').err = 2โ the 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. (Yeah, it's giving two-step verification โ you need both or the whole thing is a vibe and not a fact.)err = 3โ the reciprocal condition number: estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is . [not me staring at the source โ it literally trails off there, that's how it shipped ๐] 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 DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this one carries info about the various error bounds and condition numbers corresponding to the componentwise relative error, defined like so:
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 the componentwise relative error depends on it, iykyk) and by the type of error information 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 at all โ she stays home. And 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 *i*th right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1โ a boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon').err = 2โ the 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โ the reciprocal condition number: estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is . [again, the source just โจendsโจ there, iconic behaviour honestly] 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 it's <= 0, the PARAMS array is never even referenced and default values are used โ she's not nosy like that.
๐ PARAMS
PARAMS is a DOUBLE PRECISION array, dimension NPARAMS. It specifies the algorithm parameters. If an entry is < 0.0, then that entry will be filled in with the default value used for that parameter (the manpage equivalent of "you decide, bestie"). 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 extra-precise refinement algorithm.- (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. So likeโฆ proceed with caution, babe.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
WORK is a COMPLEX*16 array, dimension (2*N). That's it, that's the whole vibe.
๐ RWORK
RWORK is a DOUBLE PRECISION array, dimension (2*N). Also just existing, unbothered.
๐ฅ INFO
INFO is INTEGER, and this is the one you actually read:
= 0: successful exit. The solution to every right-hand side is guaranteed. we love a clean run โจ< 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 *J*th 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 *J*th 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 *J*th 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 489 of file zposvxx.f.
โจ Author
Generated automatically by Doxygen for LAPACK from the source code. (so if the grammar is weird, blame the robot, not me ๐ญ)
and that's the whole page bestie, you ate that ๐ โ this masterpiece is from LAPACK, Version 3.12.0, and the page itself is posvxx(3). go forth and condition your numbers ๐
๐ฆ 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