SRC/zposvxx.f(3)
πΈ NAME πΈ
SRC/zposvxx.f β bestie, this is the zposvxx.f(3) page from the Library Functions Manual, and itβs literally the ZPOSVXX routine. Buckle up. π
β¨ SYNOPSIS β¨
π§ Functions/Subroutines π§
subroutine 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)βZPOSVXXcomputes the solution to system of linear equationsA * X = BforPOmatrices π
subroutine 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 equations A * X =
B for PO matrices
π¦ Function/Subroutine Documentation π¦
π subroutine zposvxx π
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 πΈ
Okay so 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. β¨
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. π
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. π«Ά
π§ 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βFACT is 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β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 matrixA.N >= 0.NRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.AβA is COMPLEX*16 array, dimension (LDA,N). On entry, the Hermitian 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, ifFACT = 'E'andEQUED = 'Y',Ais overwritten bydiag(S)*A*diag(S).LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβAF is COMPLEX*16 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). IfFACT = 'N', thenAFis an output argument and on exit returns the triangular factorUorLfrom the Cholesky factorizationA = U**T*UorA = L*L**Tof the original matrixA. IfFACT = '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).LDAFβLDAF is INTEGER. The leading dimension of the arrayAF.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).EQUEDis an input argument ifFACT = 'F'; otherwise, it is an output argument.
SβS is 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βB is COMPLEX*16 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βLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβX is COMPLEX*16 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βLDX is INTEGER. The leading dimension of the arrayX.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 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. πRPVGRWRPVGRWβ like,DOUBLE PRECISION, and it's the reciprocal pivot growth π . On exit it holds the reciprocal pivot growth factornorm(A)/norm(U). The norm is used. If this comes back much less than 1, then the stability of the LU factorization of the (equilibrated) matrixAcould be poor β and honestly the whole vibe gets shaky, because it also means the solutionX, the estimated condition numbers, and the error bounds could all be unreliable π. If the factorization fails with0<INFO<=N, then this bad boy holds the reciprocal pivot growth factor for the leadingINFOcolumns ofA. Periodt.BERRβDOUBLE PRECISIONarray, dimension(NRHS). The 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. Iconic little measurement π.N_ERR_BNDSβINTEGER. The number of error bounds to return for each right hand side and each type (normwise or componentwise). The cuties in question areERR_BNDS_NORMandERR_BNDS_COMP, defined right below β¬οΈ.ERR_BNDS_NORMβDOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array is literally stuffed with info about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
So that's the normwise relative error in the *i*th solution vector. The array is indexed by the type of error information as described below β there are currently up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the *i*th right-hand side. No cap.
The second index in ERR_BNDS_NORM(:,err) contains these three fields:
err = 1β a 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, bestie, only then π.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 approximately 1.
See Lapack Working Note 165 for further details and extra cautions π.
ERR_BNDS_COMPβDOUBLE PRECISIONarray, dimension(NRHS, N_ERR_BNDS). Same deal, but for the componentwise relative error. For each right-hand side this array holds info about various error bounds and condition numbers corresponding to it, defined as:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
That's the componentwise relative error in the *i*th solution vector β¨. The array is indexed by the right-hand side i (the componentwise relative error depends on it, so yeah) 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 at all π«. 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 these three fields:
err = 1β a 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 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βINTEGER. Specifies the number of parameters set inPARAMS. If<= 0, thePARAMSarray is never referenced and default values are used. Leaving it alone is valid, bestie π«Ά.PARAMSβDOUBLE PRECISIONarray, dimensionNPARAMS. Specifies algorithm parameters. If an entry is< 0.0, then that entry gets filled with the default value used for that parameter. Only positions up toNPARAMSare accessed; defaults are used for higher-numbered parameters. Very "fill in the blanks" of it all π.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βCOMPLEX*16array, dimension(2*N). That's it, that's the whole description π¦.RWORKβDOUBLE PRECISIONarray, dimension(2*N). Same energy β.INFOβINTEGER, and this one's the whole plot:= 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 *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. Not a human, just vibes and a script π .
Ok that's the whole page bestie, go forth and call zposvxx responsibly π§π. This was LAPACK, Version 3.12.0, SRC/zposvxx.f(3) β mwah, logged off, kiss kiss π
π¦ 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