doubleSYsolve(3)
okay bestie, welcome to doubleSYsolve(3) from LAPACK โจ this is the double solve driver squad for SY matrices, and we're about to make linear algebra feel like a group chat. no cap.
NAME ๐
doubleSYsolve โ double
โจ SYNOPSIS โจ
Functions ๐ซถ
subroutine dsysv (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)โ DSYSV computes the solution to system of linear equations A * X = B for SY matricessubroutine dsysv_aa (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)โ DSYSV_AA computes the solution to system of linear equations A * X = B for SY matricessubroutine dsysv_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, WORK, LWORK, INFO)โ DSYSV_AA_2STAGE computes the solution to system of linear equations A * X = B for SY matricessubroutine dsysv_rk (UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, WORK, LWORK, INFO)โ DSYSV_RK computes the solution to system of linear equations A * X = B for SY matricessubroutine dsysv_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)โ DSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matricessubroutine dsysvx (FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, LWORK, IWORK, INFO)โ DSYSVX computes the solution to system of linear equations A * X = B for SY matricessubroutine dsysvxx (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)โDSYSVXX
๐ Detailed Description ๐
This is the group of double solve driver functions for SY matrices. that's the whole vibe, bestie. ๐
๐ Function Documentation ๐
โจ subroutine dsysv โจ
subroutine dsysv (character UPLO, integer N, integer NRHS, double precision,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double
precision, dimension( ldb, * ) B, integer LDB, double precision,
dimension( * ) WORK, integer LWORK, integer INFO)
DSYSV computes the solution to system of linear equations A * X = B for SY matrices
Purpose ๐ซ
okay so DSYSV 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โUPLOisCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NโNisINTEGERThe number of linear equations, i.e., the order of the matrix A.N >= 0.NRHSโNRHSisINTEGERThe number of right hand sides, i.e., the number of columns of the matrix B.NRHS >= 0.AโAisDOUBLE PRECISIONarray, 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 DSYTRF.
LDAโLDAisINTEGERThe leading dimension of the array A.LDA >= max(1,N).IPIVโIPIVisINTEGERarray, dimension(N)Details of the interchanges and the block structure of D, as determined byDSYTRF. 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โBisDOUBLE PRECISIONarray, 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โLDBisINTEGERThe leading dimension of the array B.LDB >= max(1,N).WORKโWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGERThe length ofWORK.LWORK >= 1, and for best performanceLWORK >= max(1,N*NB), whereNBis the optimal blocksize forDSYTRF. forLWORK < N, TRS will be done with Level BLAS 2 forLWORK >= 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โINFOisINTEGER= 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.
bestie, when INFO > 0, D is exactly singular and the solution could not be computed. that's not a slay, that's a warning. ๐
Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
โจ subroutine dsysv_aa โจ
subroutine dsysv_aa (character UPLO, integer N, integer NRHS, double
precision, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, double precision, dimension( ldb, * ) B, integer LDB, double
precision, dimension( * ) WORK, integer LWORK, integer INFO)
DSYSV_AA computes the solution to system of linear equations A * X = B for SY matrices
Purpose ๐ซ
okay so DSYSV 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โUPLOisCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NโNisINTEGERThe number of linear equations, i.e., the order of the matrix A.N >= 0.NRHSโNRHSisINTEGERThe number of right hand sides, i.e., the number of columns of the matrix B.NRHS >= 0.AโAisDOUBLE PRECISIONarray, 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 DSYTRF.
LDAโLDAisINTEGERThe leading dimension of the array A.LDA >= max(1,N).IPIVโIPIVisINTEGERarray, 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โBisDOUBLE PRECISIONarray, 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โLDBisINTEGERThe leading dimension of the array B.LDB >= max(1,N).WORKโWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGERThe length ofWORK.LWORK >= MAX(1,2*N,3*N-2), and for the best performance,LWORK >= MAX(1,N*NB), whereNBis the optimal blocksize forDSYTRF_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โINFOisINTEGER= 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 dsysv_aa_2stage โจ
subroutine dsysv_aa_2stage (character UPLO, integer N, integer NRHS, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( * ) TB, integer LTB, integer, dimension( * ) IPIV, integer,
dimension( * ) IPIV2, double precision, dimension( ldb, * ) B, integer
LDB, double precision, dimension( * ) WORK, integer LWORK, integer INFO)
๐ DSYSV_AA_2STAGE ๐
okay bestie so this one computes the solution to system of linear equations A * X = B for SY matrices โจ
๐ Purpose
DSYSV_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.
Aasen's 2-stage 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 and band. The matrix T is then LU-factored with partial pivoting. The factored form of A is then used to solve the system of equations A * X = B.
This is the blocked version of the algorithm, calling Level 3 BLAS. iconic, honestly ๐
๐ Parameters
UPLOโUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NโNisINTEGER. The order of the matrixA.N >= 0.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.AโAisDOUBLE PRECISIONarray, dimension(LDA,N).- On entry, the symmetric matrix
A. 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,
Lis stored below (or above) the subdiagonal blocks, whenUPLOis'L'(or'U').
- On entry, the symmetric matrix
LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).TBโTBisDOUBLE PRECISIONarray, dimension(LTB). On exit, details of the LU factorization of the band matrix.LTBโLTBisINTEGER. The size of the arrayTB.LTB >= 4*N, internally used to selectNBsuch 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. ๐ซ
IPIVโIPIVisINTEGERarray, dimension(N). On exit, it contains the details of the interchanges, i.e., the row and columnkofAwere interchanged with the row and columnIPIV(k).IPIV2โIPIV2isINTEGERarray, dimension(N). On exit, it contains the details of the interchanges, i.e., the row and columnkofTwere interchanged with the row and columnIPIV(k).BโBisDOUBLE PRECISIONarray, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. โจLDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).WORKโWORKisDOUBLE PRECISIONworkspace of sizeLWORK.LWORKโLWORKisINTEGER. The size ofWORK.LWORK >= N, internally used to selectNBsuch 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.
INFOโINFOisINTEGER= 0: successful exit ๐< 0: ifINFO = -i, thei-th argument had an illegal value.> 0: ifINFO = i, band LU factorization failed oni-th column ๐ญ
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ฆ subroutine dsysv_rk ๐ฆ
subroutine dsysv_rk (character UPLO, integer N, integer NRHS, double
precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( * ) E, integer, dimension( * ) IPIV, double precision,
dimension( ldb, * ) B, integer LDB, double precision, dimension( * )
WORK, integer LWORK, integer INFO)
DSYSV_RK computes the solution to system of linear equations A * X = B for SY matrices ๐ธ
๐ซ Purpose
DSYSV_RK 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 bounded Bunch-Kaufman (rook) diagonal pivoting method is used to factor A as
A = P*U*D*(U**T)*(P**T), if UPLO = 'U', or
A = P*L*D*(L**T)*(P**T), if UPLO = 'L',
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
DSYTRF_RK is called to compute the factorization of a real symmetric matrix. The factored form of A is then used to solve the system of equations A * X = B by calling BLAS3 routine DSYTRS_3. slay ๐ซถ
๐ Parameters
UPLOโUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrixAis stored:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NโNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.AโAisDOUBLE PRECISIONarray, dimension(LDA,N).- On entry, the symmetric matrix
A.- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
- If
- On exit, if
INFO = 0, diagonal of the block diagonal matrixDand factorsUorLas computed byDSYTRF_RK:- a) ONLY diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayE), and - b) If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
- For more info see the description of
DSYTRF_RKroutine.
- On entry, the symmetric matrix
LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EโEisDOUBLE PRECISIONarray, dimension(N). On exit, contains the output computed by the factorization routineDSYTRF_RK, i.e. the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks, where- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)is set to0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to0.
- If
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to0in bothUPLO = 'U'orUPLO = 'L'cases.
For more info see the description of DSYTRF_RK routine.
IPIVโIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofD, as determined byDSYTRF_RK.
For more info see the description of DSYTRF_RK routine.
BโBisDOUBLE PRECISIONarray, dimension(LDB,NRHS). On entry, theN-by-NRHSright hand side matrixB. On exit, ifINFO = 0, theN-by-NRHSsolution matrixX. ๐LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).WORKโWORKisDOUBLE PRECISIONarray, dimension( MAX(1,LWORK) ). Work array used in the factorization stage. On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGER. The length ofWORK.LWORK >= 1. For best performance of factorization stageLWORK >= max(1,N*NB), whereNBis the optimal blocksize forDSYTRF_RK.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array for factorization stage, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFOโINFOisINTEGER= 0: successful exit ๐< 0: IfINFO = -k, thek-th argument had an illegal value> 0: IfINFO = k, the matrixAis singular, because:- If
UPLO = 'U': columnkin the upper triangular part ofAcontains all zeros. - If
UPLO = 'L': columnkin the lower triangular part ofAcontains all zeros.
- If
Therefore D(k,k) is exactly zero, and superdiagonal elements of column k of U (or subdiagonal elements of column k of L) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes.
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver, NAG Ltd. โ and that's the whole author squad for that one, periodt. ๐
Contributors
- December 2016, 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 dsysv_rook ๐งฎ
subroutine dsysv_rook (character UPLO, integer N, integer NRHS, double
precision, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, double precision, dimension( ldb, * ) B, integer LDB, double
precision, dimension( * ) WORK, integer LWORK, integer INFO)
okay so DSYSV_ROOK computes the solution to a system of linear equations A * X = B for SY matrices โ bestie, it's giving "solve the whole thing for me" energy.
Purpose
DSYSV_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.
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.
DSYTRF_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 DSYTRS_ROOK. slay. โจ
Parameters
UPLOโUPLOisCHARACTER*1. Your vibe check on which triangle we're even looking at:= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.NโNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.AโAisDOUBLE PRECISIONarray, dimension(LDA,N). On entry, 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 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 DSYTRF_ROOK.
LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVโIPIVisINTEGERarray, dimension(N). The details of the interchanges and the block structure ofD, as determined byDSYTRF_ROOK. (this is the part where you gotta pay attention, bestie ๐ซถ)
If UPLO = 'U':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk-1and-IPIV(k-1)were interchanged, andD(k-1:k,k-1:k)is a 2-by-2 diagonal block.
If UPLO = 'L':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk+1and-IPIV(k+1)were interchanged, andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
BโBisDOUBLE PRECISIONarray, dimension(LDB,NRHS). On entry, theN-by-NRHSright hand side matrixB. On exit, ifINFO = 0, theN-by-NRHSsolution matrixX. glow up from B to X, we love to see it.LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).WORKโWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGER. The length ofWORK.LWORK >= 1, and for best performanceLWORK >= max(1,N*NB), whereNBis the optimal blocksize forDSYTRF_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โINFOisINTEGER. The receipts:= 0: successful exit ๐< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i,D(i,i)is exactly zero. The factorization has been completed, but the block diagonal matrixDis 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 dsysvx ๐
subroutine dsysvx (character FACT, character UPLO, integer N, integer NRHS,
double precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
double precision, dimension( ldb, * ) B, integer LDB, double precision,
dimension( ldx, * ) X, integer LDX, double precision RCOND, double
precision, dimension( * ) FERR, double precision, dimension( * ) BERR,
double precision, dimension( * ) WORK, integer LWORK, integer,
dimension( * ) IWORK, integer INFO)
DSYSVX computes the solution to a system of linear equations A * X = B for SY matrices โ and it's not just solving, it's also checking its own work, main character behaviour fr fr.
Purpose
DSYSVX 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. so thorough, so iconic โจ
Description
The following steps are performed:
- If
FACT = 'N', the diagonal pivoting method is used to factorA. 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.
- 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. 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. she does not stop, she does not rest. ๐ - 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.
Parameters
FACTโFACTisCHARACTER*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โUPLOisCHARACTER*1.= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.NโNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.AโAisDOUBLE PRECISIONarray, 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.LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโAFisDOUBLE PRECISIONarray, dimension(LDAF,N).- If
FACT = '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 byDSYTRF. - If
FACT = 'N', thenAFis an output argument and on exit returns the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**T.
- If
LDAFโLDAFisINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโ okay bestie,IPIV's whole explanation is coming in the next part โ hold that thought ๐ซถIPIVโ INTEGER array, dimension(N). Bestie, listen, this one changes job depending onFACT. ๐
If FACT = 'F', then IPIV is an input argument, and on entry it holds the deets about the interchanges and the block structure of D, exactly as determined by DSYTRF. โจ
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. ๐ธ - If
UPLO = '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. ๐ฆ - If
UPLO = '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 it contains the details of the interchanges and the block structure of D, as determined by DSYTRF. periodt. ๐
Bโ DOUBLE PRECISION array, dimension(LDB,NRHS). TheN-by-NRHSright hand side matrixB. that's the whole vibe, no notes. ๐LDBโ INTEGER. The leading dimension of the arrayB.LDB >= max(1,N). don't skimp on this one bestie ๐ซถXโ DOUBLE PRECISION array, dimension(LDX,NRHS). IfINFO = 0orINFO = N+1, this is theN-by-NRHSsolution matrixX. the moment we've all been waiting for ๐ โจLDXโ INTEGER. The leading dimension of the arrayX.LDX >= max(1,N). same energy asLDB, respect the bounds fr fr ๐RCONDโ DOUBLE PRECISION. 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. ๐ญ lowkey the vibes are off when this goes smolFERRโ DOUBLE PRECISION 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โ DOUBLE PRECISION 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โ DOUBLE PRECISION array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. the lil receipts at slot 1, iykyk ๐งLWORKโ 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 forDSYTRF. ๐ฅ
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. classic move, asking first before committing ๐
IWORKโ INTEGER array, dimension(N). that's it, that's the description, she's lowkey mysterious ๐INFOโ INTEGER. The receipts on how it went:= 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. slay, we compute anyway โจ
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ง subroutine dsysvxx ๐ง
subroutine dsysvxx (character FACT, character UPLO, integer N, integer NRHS,
double precision, dimension( lda, * ) A, integer LDA, double precision,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
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)
DSYSVXX ๐
โจ Purpose: โจ
DSYSVXX uses the diagonal pivoting factorization to compute the solution to a double precision 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. bestie it literally solves the whole thing for you ๐ซถ
If requested, both normwise and maximum componentwise error bounds are returned. DSYSVXX 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. ๐ฅ
DSYSVXX 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 DSYSVXX 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 DSYSVXX would itself produce. ๐ so like, if you bring your own factorization and it's not the one she'd make? no promises, ok?
โจ 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 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. ๐ญ she keeps going even when it's giving singular - 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. ๐
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. ngl the defaults usually eat ๐
โจ 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,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โ 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). 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. only one triangle gets to be the main character, pick a side bestie ๐
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 block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed byDSYTRF. ๐ธ
so yeah, if FACT = 'N', then AF is an output argument and on exit it 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. It's the leading dimension of the array AF, and it's gotta be LDAF >= max(1,N). no exceptions bestie ๐
IPIV
IPIV</purl> is an INTEGER array, dimension (N).
If FACT = 'F', then IPIV is an input argument, and on entry it contains details of the interchanges and the block structure of D, as determined by DSYTRF. Here's the tea:
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
UPLO = '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. - If
UPLO = '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 it contains details of the interchanges and the block structure of D, as determined by DSYTRF. ๐ฆ
EQUED
EQUED is CHARACTER*1. It 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's an output argument. she switches roles depending on the vibe, iconic honestly ๐
S
S is a DOUBLE PRECISION array, dimension (N). These are the 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. ๐ญ so like, be careful, fr fr.
B
B is a DOUBLE PRECISION array, dimension (LDB,NRHS).
On entry, it's 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.
LDB
LDB is INTEGER. It's the leading dimension of the array B, and LDB >= max(1,N). periodt โจ
X
X is a DOUBLE PRECISION array, dimension (LDX,NRHS).
If INFO = 0, this is 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 is INTEGER. Leading dimension of the array X, and LDX >= max(1,N). same energy, different letter ๐ซถ
RCOND
RCOND is DOUBLE PRECISION. It's the reciprocal scaled condition number โ 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. not me defending a tiny number ๐ญ
RPVGRW
RPVGRW is DOUBLE PRECISION. It's the reciprocal pivot growth. On exit, this contains the reciprocal pivot growth factor norm(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) matrix A could be poor. This also means that the solution X, estimated condition numbers, and error bounds could 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 a DOUBLE PRECISION array, dimension (NRHS). Componentwise relative backward error. This is 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. It's the 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 a 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:
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) * dlamch('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) * dlamch('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) * dlamch('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 matrix Z.
Let Z = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.
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 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), thenERR_BNDS_COMPis not accessed. IfN_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'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('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) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('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 matrix Z.
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.
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 <= 0, the PARAMS array is never referenced and default values are used. lowkey the chillest argument here ๐
PARAMS
PARAMS is a DOUBLE PRECISION array, dimension (NPARAMS). It specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with 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:
okay so PARAMS is where you tune the refinement vibes, and there are exactly two knobs, bestie ๐
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. ๐ญ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 DOUBLE PRECISION array, dimension (4*N). That's the whole vibe. ๐ซถ
๐ IWORK ๐
IWORK is INTEGER array, dimension (N). Slay. ๐
๐ฅ INFO ๐ฅ
INFO is INTEGER. Here's the tea:
= 0: Successful exit. The solution to every right-hand side is guaranteed. โ< 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. ๐= 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.
๐ค Author ๐ค
Generated automatically by Doxygen for LAPACK from the source code. ๐คโจ
this page is from LAPACK version 3.11.0, dated Sun Nov 27 2022, and it's doubleSYsolve(3) signing off โ bye bestie, you got this! ๐
๐ฆ
๐ฆ 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