SRC/sppsvx.f(3)
π
sppsvx.f β Library Functions Manual β¨
okay so bestie, this is SRC/sppsvx.f(3) from the Library Functions Manual π β and yes, weβre keeping every crumb. No cap. π«Ά
πΈ NAME πΈ
SRC/sppsvx.f
β¨ SYNOPSIS β¨
π§ Functions/Subroutines
subroutine sppsvxβ SPPSVX computes the solution to system of linear equationsA * X = Bfor OTHER matrices π. The full signature is:
subroutine sppsvx (fact, uplo, n, nrhs, ap, afp, equed, s, b, ldb, x,
ldx, rcond, ferr, berr, work, iwork, info)
π Function/Subroutine Documentation π
subroutine sppsvx (character fact, character uplo, integer n, integer nrhs,
real, dimension( * ) ap, real, dimension( * ) afp, character equed,
real, dimension( * ) s, real, dimension( ldb, * ) b, integer ldb, real,
dimension( ldx, * ) x, integer ldx, real rcond, real, dimension( * )
ferr, real, dimension( * ) berr, real, dimension( * ) work, integer,
dimension( * ) iwork, integer info)
Okay bestie, so SPPSVX computes the solution to a system of linear equations A * X = B for OTHER matrices. Iconic. π
β¨ Purpose β¨
SPPSVX uses 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 stored in packed format and X and B are N-by-NRHS matrices. No cap, it also gives you error bounds on the solution and a condition estimate. β¨
π Description π
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. If the reciprocal of the condition number is less than machine precision,INFO = N+1is returned as a warning, but the routine still goes on to solve forXand compute error bounds as described below. Periodt. - The system of equations is solved for
Xusing the factored form ofA. - Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it. Obsessed with the accuracy glow-up. β¨
- If equilibration was used, the matrix
Xis premultiplied bydiag(S)so that it solves the original system before equilibration.
πΈ 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. The values are giving:= 'F': On entry,AFPcontains the factored form ofA. IfEQUED = 'Y', the matrixAhas been equilibrated with scaling factors given byS.APandAFPwill not be modified.= 'N': The matrixAwill be copied toAFPand factored.= 'E': The matrixAwill be equilibrated if necessary, then copied toAFPand 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.APβAP is REAL array, dimension (N*(N+1)/2). On entry, the upper or lower triangle of the symmetric matrixA, packed columnwise in a linear array, except ifFACT = 'F'andEQUED = 'Y', thenAmust contain the equilibrated matrixdiag(S)*A*diag(S). Thej-th column ofAis stored in the arrayAPas follows:- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2n-j)/2) = A(i,j)forj<=i<=n.
- if
See below for further details. 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).
AFPβAFP is REAL array, dimension (N*(N+1)/2). IfFACT = 'F', thenAFPis 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', thenAFPis the factored form of the equilibrated matrixA.
If FACT = 'N', then AFP 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 AFP 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 AP for the form of the equilibrated matrix).
EQUEDβEQUED is CHARACTER*1. Specifies the form of equilibration that was done.= 'N': No equilibration (always true ifFACT = 'N').= 'Y': Equilibration was done, 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 scale factors forA; not accessed ifEQUED = 'N'.Sis an input argument ifFACT = 'F'; otherwise,Sis an output argument. IfFACT = 'F'andEQUED = 'Y', each element ofSmust be positive. Positive vibes only, literally.BβB is REAL 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 REAL array, dimension (LDX,NRHS). IfINFO = 0orINFO = N+1, theN-by-NRHSsolution matrixXto the original system of equations. Note that ifEQUED = 'Y',AandBare modified on exit, 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 REAL. The estimate of the reciprocal condition number of the matrixAafter equilibration (if done). IfRCONDis less than the machine precision (in particular, ifRCOND = 0), the matrix is singular to working precision. This condition is indicated by a return code ofINFO > 0. Big yikes if that happens, but the routine tells you.FERRβFERR is REAL array, dimension (NRHS). The estimated forward error bound for each solution vectorX(j)(thej-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j),FERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). The estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error.BERRβBERR is REAL array, dimension (NRHS). 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).WORKβWORK is REAL array, dimension (3*N).IWORKβIWORK is INTEGER array, dimension (N).INFOβINFO is INTEGER.= 0: successful exit.< 0: ifINFO = -i, thei-th argument had an illegal value.> 0: ifINFO = i, andiis<= N: the leading principal minor of orderiofAis not positive, so the factorization could not be completed, and the solution has not been computed.RCOND = 0is returned.= N+1:Uis nonsingular, butRCONDis less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value ofRCONDwould suggest. iykyk, sometimes the estimate is just not the whole story.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§ Further Details π§
The packed storage scheme is illustrated by the following example when N = 4, UPLO = 'U':
Two-dimensional storage of the symmetric matrix A:
a11 a12 a13 a14
a22 a23 a24
a33 a34 (aij = conjg(aji))
a44
Packed storage of the upper triangle of A:
AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
Definition at line 309 of file sppsvx.f.
π AUTHOR π
Okay bestie, real talk β nobody wrote this one by hand, and I need you to know that up front π
Generated automatically by Doxygen for LAPACK from the source code.β that's it, that's the whole author section. Doxygen did the typing, LAPACK provided the source code, and the rest is history β¨
So if you're out here trying to @ someone about a typo in this page, the culprit is a documentation generator doing its little automated thing π«Ά The actual brains behind the code live in the LAPACK source, not in this here rendering.
and that's a wrap on sppsvx.f(3), bestie! π
This iconic little artifact came to you courtesy of LAPACK, Version 3.12.0, from the source file SRC/sppsvx.f(3) πΈ She's documented, she's factored, she's slaying. Go forth and solve those systems ππ¦
π¦ 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