realSYsolve(3)
β¨ realSYsolve(3) β LAPACK β¨
okay so bestie, welcome to the LAPACK page for realSYsolve(3). It's giving "group of real solve driver functions for SY matrices," and we're in part 1 of 5. The vibe is very "linear algebra but make it fashion." π
πΈ NAME πΈ
realSYsolve β real
π¦ SYNOPSIS π¦
Functions
ssysv
subroutine ssysv (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK,
INFO)
SSYSV computes the solution to system of linear equations A * X = B for SY matrices
ssysv_aa
subroutine ssysv_aa (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK,
INFO)
SSYSV_AA computes the solution to system of linear equations A * X = B for SY matrices
ssysv_aa_2stage
subroutine ssysv_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2,
B, LDB, WORK, LWORK, INFO)
SSYSV_AA_2STAGE computes the solution to system of linear equations A * X = B for SY matrices
ssysv_rook
subroutine ssysv_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK,
INFO)
SSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices
ssysvx
subroutine ssysvx (FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB,
X, LDX, RCOND, FERR, BERR, WORK, LWORK, IWORK, INFO)
SSYSVX computes the solution to system of linear equations A * X = B for SY matrices
ssysvxx
subroutine ssysvxx (FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, EQUED,
S, B, LDB, X, LDX, RCOND, RPVGRW, BERR, N_ERR_BNDS, ERR_BNDS_NORM,
ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, IWORK, INFO)
SSYSVXX
π Detailed Description π
This is the group of real solve driver functions for SY matrices. No cap.
π Function Documentation π
subroutine ssysv
subroutine ssysv (character UPLO, integer N, integer NRHS, real, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real, dimension(
ldb, * ) B, integer LDB, real, dimension( * ) WORK, integer LWORK,
integer INFO)
SSYSV computes the solution to system of linear equations A * X = B for SY matrices
Purpose
SSYSV computes the solution to a real system of linear equations
A * X = B,
where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices.
The diagonal pivoting method is used to factor A as
A = U * D * U**T, if UPLO = 'U', or
A = L * D * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks. The factored form of A is then used to solve the system of equations A * X = B.
Parameters
UPLOβUPLO is CHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβN is INTEGERThe number of linear equations, i.e., the order of the matrix A.N >= 0.NRHSβNRHS is INTEGERThe number of right hand sides, i.e., the number of columns of the matrix B.NRHS >= 0.AβA is REAL array, dimension (LDA,N)On entry, the symmetric matrix A. 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.
On exit, if INFO = 0, the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by SSYTRF.
LDAβLDA is INTEGERThe leading dimension of the array A.LDA >= max(1,N).IPIVβIPIV is INTEGER array, dimension (N)Details of the interchanges and the block structure of D, as determined bySSYTRF. IfIPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged, andD(k,k)is a 1-by-1 diagonal block. IfUPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. IfUPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.BβB is REAL array, dimension (LDB,NRHS)On entry, the N-by-NRHS right hand side matrix B. On exit, ifINFO = 0, the N-by-NRHS solution matrix X.LDBβLDB is INTEGERThe leading dimension of the array B.LDB >= max(1,N).WORKβWORK is REAL array, dimension (MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORK is INTEGERThe length of WORK.LWORK >= 1, and for best performanceLWORK >= max(1,N*NB), where NB is the optimal blocksize forSSYTRF.
for LWORK < N, TRS will be done with Level BLAS 2 for LWORK >= N, TRS will be done with Level BLAS 3
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFOβINFO is INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i)is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution could not be computed.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine ssysv_aa
subroutine ssysv_aa (character UPLO, integer N, integer NRHS, real,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real,
dimension( ldb, * ) B, integer LDB, real, dimension( * ) WORK, integer
LWORK, integer INFO)
SSYSV_AA computes the solution to system of linear equations A * X = B for SY matrices
Purpose
SSYSV computes the solution to a real system of linear equations
A * X = B,
where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices.
Aasen's algorithm is used to factor A as
A = U**T * T * U, if UPLO = 'U', or
A = L * T * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is symmetric tridiagonal. The factored form of A is then used to solve the system of equations A * X = B.
Parameters
UPLOβUPLO is CHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβN is INTEGERThe number of linear equations, i.e., the order of the matrix A.N >= 0.NRHSβNRHS is INTEGERThe number of right hand sides, i.e., the number of columns of the matrix B.NRHS >= 0.AβA is REAL array, dimension (LDA,N)On entry, the symmetric matrix A. 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.
On exit, if INFO = 0, the tridiagonal matrix T and the multipliers used to obtain the factor U or L from the factorization A = U**T*T*U or A = L*T*L**T as computed by SSYTRF.
LDAβLDA is INTEGERThe leading dimension of the array A.LDA >= max(1,N).IPIVβIPIV is INTEGER array, dimension (N)On exit, it contains the details of the interchanges, i.e., the row and column k of A were interchanged with the row and columnIPIV(k).BβB is REAL array, dimension (LDB,NRHS)On entry, the N-by-NRHS right hand side matrix B. On exit, ifINFO = 0, the N-by-NRHS solution matrix X.LDBβLDB is INTEGERThe leading dimension of the array B.LDB >= max(1,N).WORKβWORK is REAL array, dimension (MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORK is INTEGERThe length of WORK.LWORK >= MAX(1,2*N,3*N-2), and for the best performance,LWORK >= MAX(1,N*NB), where NB is the optimal blocksize forSSYTRF_AA.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFOβINFO is INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i)is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution could not be computed.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine ssysv_aa_2stage
subroutine ssysv_aa_2stage (character UPLO, integer N, integer NRHS, real,
dimension( lda, * ) A, integer LDA, real, dimension( * ) TB, integer
LTB, integer, dimension( * ) IPIV, integer, dimension( * ) IPIV2, real,
dimension( ldb, * ) B, integer LDB, real, dimension( * ) WORK, integer
LWORK, integer INFO)
SSYSV_AA_2STAGE computes the solution to system of linear equations A * X = B for SY matrices
Purpose
SSYSV_AA_2STAGE computes the solution to a real system of linear equations
A * X = B,
where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices.
Okay bestie, so Aasen's 2-stage algorithm is the whole moment here β it factors A as
A = U**T * T * U, if UPLO = 'U', or
A = L * T * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is symmetric and band. Then T itself gets LU-factored with partial pivoting. And then the factored form of A is what actually solves the system of equations A * X = B. π
And lowkey the best bit: this is the blocked version of the algorithm, and it calls Level 3 BLAS. Fast. Iconic. Periodt. π
β¨ Parameters β¨
UPLOβUPLO is CHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβN is INTEGER. The order of the matrix A. Constraint:N >= 0.NRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrix B. Constraint:NRHS >= 0.AβA is REAL array, dimension (LDA,N)- On entry, the symmetric matrix A. 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. 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. - On exit, L is stored below (or above) the subdiaonal blocks, when UPLO is
'L'(or'U').
- On entry, the symmetric matrix A. If
LDAβLDA is INTEGER. The leading dimension of the array A. Constraint:LDA >= max(1,N).TBβTB is REAL array, dimension (LTB). On exit, it holds the details of the LU factorization of the band matrix.LTBβLTB is INTEGER. The size of the array TB.LTB >= 4*N, and it's internally used to select NB such thatLTB >= (3*NB+1)*N.- If
LTB = -1, then a workspace query is assumed; the routine only calculates the optimal size of LTB, returns this value as the first entry of TB, and no error message related to LTB is issued by XERBLA. β¨
- If
IPIVβIPIV is INTEGER array, dimension (N). On exit, it contains the details of the interchanges, i.e., the row and column k of A were interchanged with the row and columnIPIV(k).IPIV2βIPIV2 is INTEGER array, dimension (N). On exit, it contains the details of the interchanges, i.e., the row and column k of T were interchanged with the row and columnIPIV(k).BβB is REAL array, dimension (LDB,NRHS). On entry, the right hand side matrix B. On exit, the solution matrix X. πLDBβLDB is INTEGER. The leading dimension of the array B. Constraint:LDB >= max(1,N).WORKβWORK is REAL workspace of size LWORKLWORKβLWORK is INTEGER. The size of WORK.LWORK >= N, internally used to select NB such thatLWORK >= N*NB.- If
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. π«Ά
- If
INFOβINFO is INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: ifINFO = i, band LU factorization failed on i-th column
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ subroutine ssysv_rook
subroutine ssysv_rook (character UPLO, integer N, integer NRHS, real,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real,
dimension( ldb, * ) B, integer LDB, real, dimension( * ) WORK, integer
LWORK, integer INFO)
SSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices π
π Purpose
SSYSV_ROOK computes the solution to a real system of linear equations
A * X = B,
where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices. No cap. π
The diagonal pivoting method is used to factor A as
A = U * D * U**T, if UPLO = 'U', or
A = L * D * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
SSYTRF_ROOK is called to compute the factorization of a real symmetric matrix A using the bounded Bunch-Kaufman ('rook') diagonal pivoting method.
The factored form of A is then used to solve the system of equations A * X = B by calling SSYTRS_ROOK. Bestie, the pipeline is real. β¨
πΈ Parameters
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. Constraint:N >= 0.NRHSβNRHS is INTEGER. The number of right hand sides, i.e., the number of columns of the matrix B. Constraint:NRHS >= 0.AβA is REAL array, dimension (LDA,N)- On entry, the symmetric matrix A. 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. 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. - On exit, if
INFO = 0, the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorizationA = U*D*U**TorA = L*D*L**Tas computed bySSYTRF_ROOK.
- On entry, the symmetric matrix A. If
LDAβLDA is INTEGER. The leading dimension of the array A. Constraint:LDA >= max(1,N).IPIVβIPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure of D, as determined bySSYTRF_ROOK. π- If
UPLO = 'U':- If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columns k and-IPIV(k)were interchanged and rows and columns k-1 and-IPIV(k-1)were inerchaged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block.
- If
- If
UPLO = 'L':- If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columns k and-IPIV(k)were interchanged and rows and columns k+1 and-IPIV(k+1)were inerchaged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- If
- If
BβB is REAL array, dimension (LDB,NRHS). On entry, the N-by-NRHS right hand side matrix B. On exit, ifINFO = 0, the N-by-NRHS solution matrix X. πLDBβLDB is INTEGER. The leading dimension of the array B. Constraint:LDB >= max(1,N).WORKβWORK is REAL array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimal LWORK.LWORKβLWORK is INTEGER. The length of WORK.LWORK >= 1, and for best performanceLWORK >= max(1,N*NB), where NB is the optimal blocksize forSSYTRF_ROOK.- TRS will be done with Level 2 BLAS
- If
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. π«§
INFOβINFO is INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i)is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular, so the solution could not be computed. π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors:
- April 2012, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
π subroutine ssysvx
subroutine ssysvx (character FACT, character UPLO, integer N, integer NRHS,
real, dimension( lda, * ) A, integer LDA, real, dimension( ldaf, * ) AF,
integer LDAF, integer, dimension( * ) IPIV, real, dimension( ldb, * ) B,
integer LDB, real, dimension( ldx, * ) X, integer LDX, real RCOND, real,
dimension( * ) FERR, real, dimension( * ) BERR, real, dimension( * )
WORK, integer LWORK, integer, dimension( * ) IWORK, integer INFO)
SSYSVX computes the solution to system of linear equations A * X = B for SY matrices π¦
π Purpose
SSYSVX uses the diagonal pivoting factorization to compute the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided. Yeah, she does extra. π
β¨ Description
The following steps are performed:
- If
FACT = 'N', the diagonal pivoting method is used to factor A. The form of the factorization is
A = U * D * U**T, if UPLO = 'U', or
A = L * D * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
- So like, if some
D(i,i)=0β meaningDis exactly singular β the routine dips out and 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 bestie, the routine still goes on to solve forXand compute error bounds as described below. No cap. - The system of equations is solved for
Xusing the factored form ofA. Slay. - Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it. It's giving glow-up for your solution.
β¨ Parameters β¨
FACTβFACT is CHARACTER*1. Specifies whether or not the factored form ofAhas been supplied on entry.= 'F': On entry,AFandIPIVcontain the factored form ofA.AFandIPIVwill not be modified.= 'N': The matrixAwill be 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 REAL array, dimension (LDA,N). The symmetric matrixA. 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.LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβAF is REAL array, dimension (LDAF,N). IfFACT = 'F', thenAFis an input argument and on entry contains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed bySSYTRF.
If FACT = 'N', then AF is an output argument and on exit returns the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T.
LDAFβLDAF is INTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβIPIV is INTEGER array, dimension (N). IfFACT = 'F', thenIPIVis an input argument and on entry contains details of the interchanges and the block structure ofD, as determined bySSYTRF.
If IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal block.
If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and -IPIV(k) were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If UPLO = 'L' and IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
If FACT = 'N', then IPIV is an output argument and on exit contains details of the interchanges and the block structure of D, as determined by SSYTRF.
BβB is REAL array, dimension (LDB,NRHS). The N-by-NRHS right hand side matrixB.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, the N-by-NRHS solution matrixX.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 matrixA. 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)(the j-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 (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORK is INTEGER. The length ofWORK.LWORK >= max(1,3*N), and for best performance, whenFACT = 'N',LWORK >= max(1,3*N,N*NB), whereNBis the optimal blocksize forSSYTRF.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
IWORKβIWORK is INTEGER array, dimension (N).INFOβINFO is INTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, andiis<= N:D(i,i)is exactly zero. The factorization has been completed but the factorDis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+1:Dis 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 π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine ssysvxx (character FACT, character UPLO, integer N, integer NRHS,
real, dimension( lda, * ) A, integer LDA, real, dimension( ldaf, * ) AF,
integer LDAF, integer, dimension( * ) IPIV, 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)
π SSYSVXX π
β¨ Purpose: β¨
SSYSVXX uses the diagonal pivoting factorization to compute the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices.
If requested, both normwise and maximum componentwise error bounds are returned. SSYSVXX 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.
SSYSVXX 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 SSYSVXX 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 SSYSVXX would itself produce.
π 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 LU decomposition is used to factor the matrixA(after equilibration ifFACT = 'E') as
A = U * D * U**T, if UPLO = 'U', or
A = L * D * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
- If some
D(i,i)=0, so thatDis exactly singular, 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(R)so that it solves the original system before equilibration. π no cap, that's the whole vibe right there.
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. β¨ iykyk.
β¨ 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,AFandIPIVcontain the factored form ofA. IfEQUEDis not'N', the matrixAhas been equilibrated with scaling factors given byS.A,AF, andIPIVare 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 REAL array, dimension (LDA,N). The symmetric matrixA. 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.
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 arrayA.LDA >= max(1,N).AFβAF is REAL array, dimension (LDAF,N). IfFACT = 'F', thenAFis an input argument and on entry contains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed bySSYTRF.
If FACT = 'N', then AF is an output argument and on exit returns the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T.
LDAFβLDAF is INTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβIPIV is INTEGER array, dimension (N). IfFACT = 'F', thenIPIVis an input argument and on entry contains details of the interchanges and the block structure ofD, as determined bySSYTRF. IfIPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. IfUPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. IfUPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
If FACT = 'N', then IPIV is an output argument and on exit contains details of the interchanges and the block structure of D, as determined by SSYTRF.
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 REAL array, dimension (N). The 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 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 = 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 REAL. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned.RPVGRWβRPVGRW is REAL. Reciprocal pivot growth. On exit, this contains the reciprocal pivot growth factornorm(A)/norm(U). The'max absolute element'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βBERR is REAL array, dimension (NRHS). Componentwise relative backward error. This is the componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution).N_ERR_BNDSβ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 REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the ith solution vector:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1'Trust/don't trust'boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2'Guaranteed'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 = 3Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is'guaranteed'. 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βERR_BNDS_COMP is REAL array, dimension (NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
ok bestie so the second index in ERR_BNDS_COMP(:,err) is carrying three whole fields, and they are everything β here's the tea:
err = 1β the 'trust/don't trust' boolean π Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2β the 'Guaranteed' error bound π That's the estimated forward error, almost certainly within a factor of10of the true error β but ONLY so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). Also? This error bound should only be trusted if the previous boolean istrue. No cap.err = 3β the Reciprocal condition number πΈ Estimated componentwise reciprocal condition number. It gets compared with the thresholdsqrt(n) * slamch('Epsilon')to figure out if the error estimate is'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ.
And what even is Z, you ask? Periodt, let's define it:
Let Z = S*(A*diag(x)), where x is the solution for the
current right-hand side and S scales each row of
A*diag(x) by a power of the radix so all absolute row
sums of Z are approximately 1.
β οΈ heads up: See Lapack Working Note 165 for further details and extra cautions. It's giving "read the extra reading," fr fr.
β¨ NPARAMS β¨
NPARAMS is INTEGER π
It specifies the number of parameters set in PARAMS. And listen β if it's <= 0, the PARAMS array is never referenced and default values are used. So it just vibes on defaults, iconic.
β¨ PARAMS β¨
PARAMS is REAL array, dimension NPARAMS π¦
It specifies algorithm parameters. And here's the cute part: if an entry is < 0.0, then that entry gets filled with the default value used for that parameter. Only positions up to NPARAMS are accessed β defaults are used for higher-numbered parameters. iykyk.
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:10Aggressive: Set to100to permit convergence using approximate factorizations or factorizations other than LU. But wait β 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 bestie π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 istrue,0.0isfalse. πΈ Default:1.0(attempt componentwise convergence)
β¨ WORK β¨
WORK is REAL array, dimension (4*N) β¨
β¨ IWORK β¨
IWORK is INTEGER array, dimension (N) π
β¨ INFO β¨
INFO is INTEGER π
= 0: Successful exit. The solution to every right-hand side is guaranteed. slay.< 0: IfINFO = -i, the i-th argument had an illegal value.> 0 and <= N:U(INFO,INFO)is exactly zero. The factorization has been completed, but the factorUis exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned. π not the singular factor.= 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. obsessed with the detail here honestly.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. π€β¨
and that's a wrap on realSYsolve(3), bestie!! π«Ά This whole thing is Version 3.11.0, dated Sun Nov 27 2022 β so if you're citing it or checking against your local copy, that's the receipt π§ Go forth and solve those systems, you absolute main character π
β
π¦ where this page comes from
- debian bookworm: liblapack-doc 3.11.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms