complexHEsolve(3)
๐ complexHEsolve(3) โ LAPACK ๐
โจ NAME โจ
complexHEsolve - complex
Okay so bestie, the name is literallycomplexHEsolveand the one-word vibe iscomplex. That's the whole NAME section, no cap. ๐
๐ SYNOPSIS ๐
โจ Functions โจ
chesvโ CHESV computes the solution to system of linear equations A * X = B for HE matrices
subroutine chesv (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK,
INFO)
chesv_aaโ CHESV_AA computes the solution to system of linear equations A * X = B for HE matrices
subroutine chesv_aa (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK,
INFO)
chesv_rkโ CHESV_RK computes the solution to system of linear equations A * X = B for SY matrices
subroutine chesv_rk (UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, WORK,
LWORK, INFO)
chesv_rookโ CHESV_ROOK computes the solution to a system of linear equations A * X = B for HE matrices using the bounded Bunch-Kaufman ('rook') diagonal pivoting method
subroutine chesv_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK,
INFO)
chesvxโ CHESVX computes the solution to system of linear equations A * X = B for HE matrices
subroutine chesvx (FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB,
X, LDX, RCOND, FERR, BERR, WORK, LWORK, RWORK, INFO)
chesvxxโ CHESVXX computes the solution to system of linear equations A * X = B for HE matrices
subroutine chesvxx (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, RWORK, INFO)
๐ Detailed Description ๐
This is the group of complex solve driver functions for HE matrices. Periodt โ it's giving linear algebra royalty. ๐
๐ Function Documentation ๐
๐ subroutine chesv ๐
subroutine chesv (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, complex, dimension( * )
WORK, integer LWORK, integer INFO)
CHESV computes the solution to system of linear equations A * X = B for HE matrices.
๐ฆ Purpose ๐ฆ
CHESV computes the solution to a complex system of linear equations
A * X = B,
where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS matrices.
The diagonal pivoting method is used to factor A as
A = U * D * U**H, if UPLO = 'U', or
A = L * D * L**H, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is Hermitian 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โAisCOMPLEX array, dimension (LDA,N)On entry, the Hermitian 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**H or A = L*D*L**H as computed by CHETRF.
LDAโLDAisINTEGERThe leading dimension of the array A.LDA >= max(1,N).IPIVโIPIVisINTEGER array, dimension (N)Details of the interchanges and the block structure of D, as determined by CHETRF.- If
IPIV(k) > 0, then rows and columns k andIPIV(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 columns k-1 and-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 columns k+1 and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- If
BโBisCOMPLEX 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โLDBisINTEGERThe leading dimension of the array B.LDB >= max(1,N).WORKโWORKisCOMPLEX array, dimension (MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGERThe length of WORK.LWORK >= 1, and for best performanceLWORK >= max(1,N*NB), where NB is the optimal blocksize for CHETRF. 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: if INFO = -i, the i-th argument had an illegal value> 0: if INFO = 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 chesv_aa ๐
subroutine chesv_aa (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, complex, dimension( * )
WORK, integer LWORK, integer INFO)
CHESV_AA computes the solution to system of linear equations A * X = B for HE matrices.
๐ฆ Purpose ๐ฆ
CHESV_AA computes the solution to a complex system of linear equations
A * X = B,
where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS matrices.
Aasen's algorithm is used to factor A as
A = U**H * T * U, if UPLO = 'U', or
A = L * T * L**H, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is Hermitian and 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โAisCOMPLEX array, dimension (LDA,N)On entry, the Hermitian 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**H*T*U or A = L*T*L**H as computed by CHETRF_AA.
LDAโLDAisINTEGERThe leading dimension of the array A.LDA >= max(1,N).IPIVโIPIVisINTEGER 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โBisCOMPLEX 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โLDBisINTEGERThe leading dimension of the array B.LDB >= max(1,N).WORKโWORKisCOMPLEX array, dimension (MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGERThe length of WORK.LWORK >= MAX(1,2*N,3*N-2), and for best performanceLWORK >= MAX(1,N*NB), where NB is the optimal blocksize for CHETRF.
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: if INFO = -i, the i-th argument had an illegal value> 0: if INFO = 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 chesv_rk ๐
subroutine chesv_rk (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( * ) E, integer,
dimension( * ) IPIV, complex, dimension( ldb, * ) B, integer LDB,
complex, dimension( * ) WORK, integer LWORK, integer INFO)
CHESV_RK computes the solution to system of linear equations A * X = B for SY matrices.
๐ฆ Purpose ๐ฆ
CHESV_RK computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS matrices.
okay so bestie, the bounded Bunch-Kaufman (rook) diagonal pivoting method is literally the moment ๐
it factors A like this:
A = P*U*D*(U**H)*(P**T), if UPLO = 'U', or
A = P*L*D*(L**H)*(P**T), if UPLO = 'L',
where U (or L) is a unit upper (or lower) triangular matrix, U**H (or L**H) is the conjugate of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks. โจ
CHETRF_RK gets called to compute the factorization of a complex Hermitian matrix. Then the factored form of A is used to solve the system of equations A * X = B by calling the BLAS3 routine CHETRS_3. no cap.
โจ Parameters โจ
UPLOโUPLOisCHARACTER*1. It tells you whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NโNisINTEGER. The number of linear equations, aka 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โAisCOMPLEX array, dimension(LDA,N). On entry, it's the Hermitian matrixA. Here's the tea:- 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. On exit, ifINFO = 0, the diagonal of the block diagonal matrixDand factorsUorLas computed byCHETRF_RK: a) ONLY diagonal elements of the Hermitian block diagonal matrixDon the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayE), and b) IfUPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA. For more info see the description ofCHETRF_RKroutine.
- If
LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EโEisCOMPLEX array, dimension(N). On exit, it contains the output computed by the factorization routineCHETRF_RK, i.e. the superdiagonal (or subdiagonal) elements of the Hermitian 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 CHETRF_RK routine.
IPIVโIPIVisINTEGER array, dimension(N). Details of the interchanges and the block structure ofD, as determined byCHETRF_RK. For more info see the description ofCHETRF_RKroutine.BโBisCOMPLEX array, 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โWORKisCOMPLEX array, 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 forCHETRF_RK. IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray for factorization stage, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.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. ThereforeD(k,k)is exactly zero, and superdiagonal elements of columnkofU(or subdiagonal elements of columnkofL) are all zeros. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations.
- If
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.
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 chesv_rook ๐
subroutine chesv_rook (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, complex, dimension( * )
WORK, integer LWORK, integer INFO)
CHESV_ROOK computes the solution to a system of linear equations A * X = B for HE matrices using the bounded Bunch-Kaufman ('rook') diagonal pivoting method.
Purpose โจ
CHESV_ROOK computes the solution to a complex system of linear equations
A * X = B,
where A is an N-by-N Hermitian 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 = 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 Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
CHETRF_ROOK is called to compute the factorization of a complex Hermition 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 CHETRS_ROOK (uses BLAS 2).
Parameters
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 matrixB.NRHS >= 0.AโAisCOMPLEX array, dimension(LDA,N). On entry, the Hermitian 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, ifINFO = 0, the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**HorA = L*D*L**Has computed byCHETRF_ROOK.LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVโIPIVisINTEGER array, dimension(N). Details of the interchanges and the block structure ofD. IfUPLO = 'U':- Only the last
KBelements ofIPIVare set. - 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 inerchaged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block. IfUPLO = 'L': - Only the first
KBelements ofIPIVare set. - 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 inerchaged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- Only the last
BโBisCOMPLEX array, 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โWORKisCOMPLEX array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKโ okay soLWORKis anINTEGER. Itโs the length ofWORK. You wantLWORK >= 1, and for best performance you wantLWORK >= max(1,N*NB), whereNBis the optimal blocksize forCHETRF_ROOK. 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โINFOis anINTEGER.= 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 matrixDis exactly singular, so the solution could not be computed. ๐ญ thatโs a no-solution vibe, bestie
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
November 2013, Igor Kozachenko, Computer Science Division, University of California, Berkeley
September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester.fi
๐งฎ subroutine chesvx
subroutine chesvx (character FACT, character UPLO, integer N, integer NRHS,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldaf, *
) AF, integer LDAF, integer, dimension( * ) IPIV, complex, dimension(
ldb, * ) B, integer LDB, complex, dimension( ldx, * ) X, integer LDX,
real RCOND, real, dimension( * ) FERR, real, dimension( * ) BERR,
complex, dimension( * ) WORK, integer LWORK, real, dimension( * ) RWORK,
integer INFO)
CHESVX computes the solution to system of linear equations A * X = B for HE matrices. โจ iconic behavior โจ
๐ก Purpose
CHESVX uses the diagonal pivoting factorization to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS matrices.
Error bounds on the solution and a condition estimate are also provided. very thorough, very main character
๐ 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**H, if UPLO = 'U', or
A = L * D * L**H, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is Hermitian 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. โ ๏ธ warning but still slaying - 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.A,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โAisCOMPLEX array, dimension (LDA,N). The Hermitian 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โLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโAFisCOMPLEX 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**HorA = L*D*L**Has computed byCHETRF.
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**H or A = L*D*L**H.
LDAFโLDAFisINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโIPIVisINTEGER array, dimension (N). IfFACT = 'F', thenIPIVis an input argument and on entry contains details of the interchanges and the block structure ofD, as determined byCHETRF.
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 CHETRF.
BโBisCOMPLEX array, dimension (LDB,NRHS). The N-by-NRHS right hand side matrixB.LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XโXisCOMPLEX array, dimension (LDX,NRHS). IfINFO = 0orINFO = N+1, the N-by-NRHS solution matrixX.LDXโLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDโRCONDisREAL. 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. sheโs fragile, handle with careFERRโFERRisREAL 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โBERRisREAL 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โWORKisCOMPLEX array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGER. The length ofWORK.LWORK >= max(1,2*N), and for best performance, whenFACT = 'N',LWORK >= max(1,2*N,N*NB), whereNBis the optimal blocksize forCHETRF.
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.
RWORKโRWORKisREAL array, dimension (N).INFOโINFOisINTEGER.= 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. the math said โtrust me bestieโ
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine chesvxx (character FACT, character UPLO, integer N, integer NRHS,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldaf, *
) AF, integer LDAF, integer, dimension( * ) IPIV, character EQUED, real,
dimension( * ) S, complex, dimension( ldb, * ) B, integer LDB, complex,
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, complex, dimension( * ) WORK,
real, dimension( * ) RWORK, integer INFO)
CHESVXX computes the solution to system of linear equations A * X = B for HE matrices
Purpose โจ
CHESVXX uses the diagonal pivoting factorization to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS matrices.
If requested, both normwise and maximum componentwise error bounds are returned. CHESVXX 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.
CHESVXX 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 CHESVXX 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 CHESVXX 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 Hermitian 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.
Some optional parameters are bundled in thePARAMSarray. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can passNPARAMS = 0which prevents the source code from accessing thePARAMSargument.
Parameters ๐
FACTโFACTis aCHARACTER*1. It tells us if the factored form ofAis already supplied, and if not, whetherAshould 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โUPLOis aCHARACTER*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. So like, how many equations are we solving? That many.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.AโAisCOMPLEXarray, dimension(LDA,N). The Hermitian 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, ifFACT = 'E'andEQUED = 'Y',Ais overwritten bydiag(S)*A*diag(S).LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโAFisCOMPLEXarray, 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**HorA = L*D*L**Has computed byCHETRF. IfFACT = '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**HorA = L*D*L**H.LDAFโLDAFisINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโIPIVisINTEGERarray, dimension(N). IfFACT = 'F', thenIPIVis an input argument and on entry contains details of the interchanges and the block structure ofD, as determined byCHETRF. 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. IfFACT = 'N', thenIPIVis an output argument and on exit contains details of the interchanges and the block structure ofD, as determined byCHETRF.EQUEDโEQUEDisCHARACTER*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โSisREALarray, 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โBisCOMPLEXarray, 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โLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XโXisCOMPLEXarray, 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โLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDโRCONDisREAL. 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โRPVGRWisREAL. 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โBERRisREALarray, 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_BNDSN_ERR_BNDSis INTEGER โ it's literally the number of error bounds we're handing back for each right hand side, and for each type (normwise or componentwise, bestie, we do both ๐ ). Go look atERR_BNDS_NORMandERR_BNDS_COMPright below for the deets.
๐ฆ ERR_BNDS_NORM
ERR_BNDS_NORMis REAL array, dimension(NRHS, N_ERR_BNDS)
For each right-hand side, this array is packed with info about all the error bounds and condition numbers for the normwise relative error, which is defined like this:
Normwise relative error in the *i*th 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 info, described below. Currently there are up to three pieces of info returned. three little gifts ๐
The first index in ERR_BNDS_NORM(i,:) corresponds to the *i*th right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains these three fields:
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: 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 = 3โ Reciprocal 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 matrix Z. LetZ = 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_COMPis REAL array, dimension(NRHS, N_ERR_BNDS)
For each right-hand side, this array holds info about various error bounds and condition numbers corresponding to the componentwise relative error, defined like so:
Componentwise relative error in the *i*th 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 (because the componentwise relative error depends on it, periodt) and by the type of error info described below. There are currently up to three pieces of info returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. And if N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the *i*th right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains these three fields:
err = 1โ 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: 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 = 3โ Reciprocal condition number: estimated componentwise 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 matrix Z. LetZ = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row ofA*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. (yes, same note, it's that important ๐โจ)
๐ NPARAMS
NPARAMSis INTEGER
Specifies how many parameters are set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. no PARAMS, no problems.
๐ PARAMS
PARAMSis REAL array, dimensionNPARAMS
Specifies algorithm parameters. If an entry is < 0.0, then that entry gets filled in with the default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters. Slay, defaults always got your back ๐ซถ
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 support DOUBLE PRECISION.- (other values are reserved for future use)
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2)โ Maximum number of residual computations allowed for refinement.- Default:
10 - Aggressive: Set to
100to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. โ ๏ธ like, proceed with caution bestie
- Default:
PARAMS(LA_LINRX_CWISE_I = 3)โ Flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true,0.0is false.- Default:
1.0(attempt componentwise convergence)
- Default:
๐ WORK
WORKis COMPLEX array, dimension(5*N)
๐ RWORK
RWORKis REAL array, dimension(2*N)
๐ INFO
INFOis INTEGER= 0: Successful exit. The solution to every right-hand side is guaranteed. ๐ iconic, we love a clean exit< 0: IfINFO = -i, the *i*th argument had an illegal value.> 0and<= N:U(INFO,INFO)is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned. ๐= N+J: The solution corresponding to the *J*th right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K withK > Jmay not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the *J*th right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the *J*th right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such 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.
and that's a wrap on complexHEsolve(3), bestie!! ๐ This gorgeous lil doc is from LAPACK Version 3.11.0, dated Sun Nov 27 2022 โ like, it's giving vintage but make it timeless. โจ๐
Go forth and solve those Hermitian systems responsibly, mwah ๐
๐ฆ
๐ฆ 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