SPPSVX(3)
okay so bestie, we're opening SPPSVX(3) from the Library Functions Manual, and she is giving very much "LAPACK source file main character" energy. π
β¨
πΈ NAME πΈ
the source file for this function is literally:
/home/abuild/rpmbuild/BUILD/lapack-
static-3.12.0-build/lapack-3.12.0/SRC/sppsvx.f
no cap, that's the whole NAME moment. π
β¨ SYNOPSIS β¨
π§ Functions/Subroutines π§
here's the subroutine in all her signature glory:
subroutine SPPSVX (fact, uplo, n, nrhs, ap, afp, equed, s, b, ldb, x,
ldx, rcond, ferr, berr, work, iwork, info)
and what does she do? she computes the solution to system of linear equations A * X = B for OTHER matrices. like, that's the vibe: SPPSVX computes the solution to system of linear equations A * X = B for OTHER matrices. π«Άπ
π Function/Subroutine Documentation π
okay bestie, hereβs the actual subroutine signature β copy it exactly, no vibes-based edits:
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)
And the one-liner? SPPSVX computes the solution to system of linear equations A * X = B for OTHER matrices β yes, it really says OTHER, and we love a mysterious icon. π
β¨ Purpose β¨
So 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.
It also hands you error bounds on the solution and a condition estimate. Iconic behavior, honestly. π«Ά
π¦ 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. - 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.
- If equilibration was used, the matrix
Xis premultiplied bydiag(S)so that it solves the original system before equilibration.
π Parameters π
Parameters time, bestie. Every type, dimension, and constraint is staying right here β no skips, no βweβll circle back.β β¨
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,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) for 1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=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.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.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.
π Author
okay so plot twist: nobody actually wrote this page, bestie. It was generated automatically by Doxygen for LAPACK, straight from the source code β¨ so if you're about to come for the formatting, direct all complaints to the robot π
Literally it's machine-made, no cap β the docs got built from the actual source, so the words match the code and that's the whole vibe π«Ά
and that's the page, bestie!! π you made it all the way through SPPSVX and honestly? iconic behavior π this whole thing is LAPACK Version 3.12.0, living at /home/abui...RC/sppsvx.f(3), generated from the source code, and now it lives rent-free in your brain π¦ go forth and solve those packed symmetric systems, mwah π
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms