hesv_rook(3)
β¨ hesv_rook β¨
okay so bestie, we're in the Library Functions Manual and this page is called hesv_rook(3). it's giving "big LAPACK energy", it's giving "your linear algebra assignment but make it fashion". buckle up π
πΈ NAME πΈ
hesv_rook β {he,sy}sv_rook: rook (v2) π
π¦ SYNOPSIS π¦
β¨ Functions β¨
subroutine chesv_rook (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)βCHESV_ROOKcomputes the solution to a system of linear equationsA * X = BforHEmatrices using the bounded Bunch-Kaufman (rook")diagonalpivotingmethod(yes the manpage really does mash it together like that, no cap, i'm not fixing it, that's canon π)subroutine csysv_rook (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)βCSYSV_ROOKcomputes the solution to system of linear equationsA * X = BforSYmatricessubroutine dsysv_rook (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)βDSYSV_ROOKcomputes the solution to system of linear equationsA * X = BforSYmatricessubroutine ssysv_rook (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)βSSYSV_ROOKcomputes the solution to system of linear equationsA * X = BforSYmatricessubroutine zhesv_rook (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)βZHESV_ROOKcomputes the solution to a system of linear equationsA * X = BforHEmatrices using the bounded Bunch-Kaufman (rook")diagonalpivotingmethodsubroutine zsysv_rook (uplo, n, nrhs, a, lda, ipiv, b, ldb, work, lwork, info)βZSYSV_ROOKcomputes the solution to system of linear equationsA * X = BforSYmatrices
π Detailed Description π
so this section exists. it has a title. it has a vibe. it hasβ¦ literally no content under it. we stan a mysterious queen who says nothing and leaves π«Ά
π Function Documentation π
π 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 () 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 () 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).
!>
not the empty () twice and "Hermition" β bestie the source has typos and we are NOT touching them, they're part of the lore now π
π 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. N >= 0.
!>
NRHS
!> NRHS is INTEGER
!> The number of right hand sides, i.e., the number of columns
!> of the matrix B. NRHS >= 0.
!>
A
!> A is COMPLEX array, dimension (LDA,N)
!> On entry, the Hermitian 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. If UPLO = '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_ROOK.
!>
LDA
!> LDA is INTEGER
!> The 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.
!>
!> If UPLO = 'U':
!> Only the last KB elements of IPIV are set.
!>
!> 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 IPIV(k) < 0 and IPIV(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 UPLO = 'L':
!> Only the first KB elements of IPIV are set.
!>
!> 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 IPIV(k) < 0 and IPIV(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.
!>
again: "inerchaged". twice. it's a whole aesthetic. leave her alone π
B
!> B is COMPLEX array, dimension (LDB,NRHS)
!> On entry, the N-by-NRHS right hand side matrix B.
!> On exit, if INFO = 0, the N-by-NRHS solution matrix X.
!>
LDB
!> LDB is INTEGER
!> The leading dimension of the array B. LDB >= max(1,N).
!>
WORK
!> WORK is COMPLEX array, dimension (MAX(1,LWORK))
!> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
!>
LWORK
!> LWORK is INTEGER
!> The length of WORK. LWORK >= 1, and for best performance
!> LWORK >= max(1,N*NB), where NB is the optimal blocksize for
!> CHETRF_ROOK.
!> 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.
!>
πLWORK = -1is the "just tell me how much space you need" move β it reports the optimal size back inWORK(1)andXERBLAstays quiet aboutLWORK. no drama, no error message. π§
INFO
!> INFO is INTEGER
!> = 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.
!>
heads up babes: INFO > 0 means D(i,i) is exactly zero β the factorization finished but D is exactly singular, so the solution could not be computed. the math said "no" and there's nothing to do about it. π
π§ 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
Definition at line 203 of file chesv_rook.f.
π subroutine csysv_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) π
CSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices
π₯ Purpose: π₯
!>
!> CSYSV_ROOK computes the solution to a complex 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.
!>
!> CSYTRF_ROOK is called to compute the factorization of a complex
!> symmetric matrix A using the bounded Bunch-Kaufman () diagonal
!> pivoting method.
!>
!> The factored form of A is then used to solve the system
!> of equations A * X = B by calling CSYTRS_ROOK.
!>
π 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. N >= 0.
!>
NRHS
!> NRHS is INTEGER
!> The number of right hand sides, i.e., the number of columns
!> of the matrix B. NRHS >= 0.
!>
A
!> A is COMPLEX 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. If UPLO = '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
!> CSYTRF_ROOK.
!>
LDA
!> LDA is INTEGER
!> The leading dimension of the array A. LDA >= max(1,N).
!>
IPIV
β¨ β¦and that's literally where we're stopping β IPIV just showed up and the page dips. she's making an entrance and we'll get her whole speech in the next part, i promise π«Ά
IPIVβIPIV is INTEGER array, dimension (N). This is the whole swap-and-block receipt forD, exactly asCSYTRF_ROOKhanded it over. π
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βB is COMPLEX array, dimension (LDB,NRHS). On entry, it's theN-by-NRHSright hand side matrixB. On exit, ifINFO = 0, it's theN-by-NRHSsolution matrixX. β¨LDBβLDB is INTEGER. It's the leading dimension of the arrayB, and bestie,LDB >= max(1,N). No cap. π«ΆWORKβWORK is COMPLEX array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. πLWORKβLWORK is INTEGER. It's the length ofWORK.LWORK >= 1, and for best performanceLWORK >= max(1,N*NB), whereNBis the optimal blocksize forCSYTRF_ROOK. π₯
Also: TRS will be done with Level 2 BLAS β that's a whole sentence in the page, so it stays. π«
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. slay.< 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
Definition at line 202 of file csysv_rook.f.
π¦ 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)
DSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices. π
β¨ 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 () diagonal pivoting method. (Yes, the parentheses are empty in the page. We respect the iconique emptiness. π
)
The factored form of A is then used to solve the system of equations A * X = B by calling DSYTRS_ROOK. β¨
πΈ Parameters πΈ
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 matrixB.NRHS >= 0. πAβA is DOUBLE PRECISION array, 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βLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N). πIPIVβIPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure ofD, as determined byDSYTRF_ROOK. π
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βB is DOUBLE PRECISION array, dimension (LDB,NRHS). On entry, theN-by-NRHSright hand side matrixB. On exit, ifINFO = 0, theN-by-NRHSsolution matrixX. πLDBβLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N). π«ΆWORKβWORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. βLWORKβLWORK is INTEGER. 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 β noted, bestie. π«
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, 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
Definition at line 202 of file dsysv_rook.f.
π¦ 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. π
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 () diagonal pivoting method. π
The factored form of A is then used to solve the system of equations A * X = B by calling SSYTRS_ROOK. β¨
πΈ Parameters πΈ
UPLOβUPLO is CHARACTER*1.= 'U': Upper triangle ofAis stored.= 'L': Lower triangle ofAis stored.
N
NβINTEGER, and it's the number of linear equations, aka the order of the matrixA. Constraint:N >= 0. (Zero is allowed bestie, the math just vibes with nothing in it β¨)NRHSβINTEGER, the number of right hand sides, i.e. how many columns the matrixBhas. Constraint:NRHS >= 0. Same deal, zero is legal πAβREALarray, dimension(LDA,N). Okay so on entry: this is your symmetric matrixA. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAholds the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced (don't even worry about it, nobody's reading that half π). IfUPLO = 'L', it flips: the leadingN-by-Nlower triangular part ofAholds the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
On exit, if INFO = 0, A contains 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_ROOK. Slay π₯
LDAβINTEGER, the leading dimension of the arrayA. Constraint:LDA >= max(1,N). Respect the leading dimension or perish fr fr.IPIVβINTEGERarray, dimension(N). The receipts for all the interchanges and the block structure ofD, as determined bySSYTRF_ROOK. Bestie, this is the tea π΅:
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. Two-for-one deal π«
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.
Notice the -1 vs +1 there β that's not a typo, that's the whole point of the UPLO split. Do not mix them up π
BβREALarray, dimension(LDB,NRHS). On entry: theN-by-NRHSright hand side matrixB. On exit, ifINFO = 0: theN-by-NRHSsolution matrixX. Glow-up arc complete πLDBβINTEGER, the leading dimension of the arrayB. Constraint:LDB >= max(1,N).WORKβREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. She's telling you what she needs πLWORKβINTEGER, the length ofWORK. Constraint:LWORK >= 1, and for best performanceLWORK >= max(1,N*NB), whereNBis the optimal blocksize forSSYTRF_ROOK.
Heads up: TRS will be done with Level 2 BLAS. That's the slower lane, so size your workspace if you care about speed π
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. It's the "just asking, not doing" mode π
INFOβINTEGER. The vibe report:= 0: successful exit β¨< 0: ifINFO = -i, thei-th argument had an illegal value (you fed her something cursed π)> 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. Translation: the math is unsolvable, no cap. Don't try to use the answer πΈ
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
Definition at line 202 of file ssysv_rook.f.
π subroutine zhesv_rook
subroutine zhesv_rook (character uplo, integer n, integer nrhs, complex*16,
dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv,
complex*16, dimension( ldb, * ) b, integer ldb, complex*16, dimension( *
) work, integer lwork, integer info)
ZHESV_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. Same energy as the real one, but make it complex π
Purpose:
ZHESV_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 () 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. Iconic structure honestly π
ZHETRF_ROOK is called to compute the factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman () diagonal pivoting method.
The factored form of A is then used to solve the system of equations A * X = B by calling ZHETRS_ROOK (uses BLAS 2). It's a whole tag-team situation π«Ά
Parameters
UPLOβCHARACTER*1. Which triangle are we working with:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβINTEGER. The number of linear equations, i.e., the order of the matrixA. Constraint:N >= 0.NRHSβINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB. Constraint:NRHS >= 0.AβCOMPLEX*16array, 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, 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 ZHETRF_ROOK. Note the **H bestie, we're in conjugate-transpose territory now π¦
LDAβINTEGER. The leading dimension of the arrayA. Constraint:LDA >= max(1,N).IPIVβINTEGERarray, dimension(N). Details of the interchanges and the block structure ofD. β οΈ Read this part carefully, it's different from the real version:
If UPLO = '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 interchanged, andD(k-1:k,k-1:k)is a 2-by-2 diagonal block.
If UPLO = '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 interchanged, andD(k:k+1,k:k+1)is a 2-by-2 diagonal block.
Not me stressing the "only last / only firstKBelements are set" thing β the rest ofIPIVis not filled in, so don't go reading it like it means something π
BβCOMPLEX*16array, dimension(LDB,NRHS). On entry: theN-by-NRHSright hand side matrixB. On exit, ifINFO = 0: theN-by-NRHSsolution matrixX. πLDBβINTEGER. The leading dimension of the arrayB. Constraint:LDB >= max(1,N).WORKβCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβINTEGER. The length ofWORK. Constraint:LWORK >= 1, and for best performanceLWORK >= max(1,N*NB), whereNBis the optimal blocksize forZHETRF_ROOK.
Here's the fun part:for LWORK < N, TRS will be done with Level BLAS 2β andfor LWORK >= N, TRS will be done with Level BLAS 3. So a bigger workspace literally levels you up β MoreWORK, more speed, iykyk π₯
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βINTEGER. The status check-in:= 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. She tried, she really did π
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
That's the tail of the zhesv_rook writeup β Definition at line 203 of file zhesv_rook.f. β¨ And now, bestie, the very next thing in this file is a whole other queen.
π¦ zsysv_rook β the symmetric solve, rook edition π
subroutine zsysv_rook (character uplo, integer n, integer nrhs, complex*16, dimension( lda, * ) a, integer lda, integer, dimension( * ) ipiv, complex*16, dimension( ldb, * ) b, integer ldb, complex*16, dimension( * ) work, integer lwork, integer info)
One-liner so you know what you're walking into: ZSYSV_ROOK computes the solution to system of linear equations A * X = B for SY matrices. π
π Purpose
Okay so the whole point of ZSYSV_ROOK is that it solves a complex 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. Cute, simple, standard. π«Ά
It does it with the diagonal pivoting method, factoring 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. D is honestly giving main character energy in this whole story.
So then ZSYTRF_ROOK gets called to compute the factorization of a complex symmetric matrix A using the bounded Bunch-Kaufman () diagonal pivoting method. (Yes, those parentheses are empty in the original β we don't gatekeep, we just report. π)
And then the factored form of A is used to solve the system of equations A * X = B by calling ZSYTRS_ROOK. Two-step slay, no cap. β¨
π Parameters
UPLO β is CHARACTER*1
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
Only one of them, bestie, pick a side.
N β is INTEGER. The number of linear equations, i.e., the order of the matrix A. N >= 0. (Negative dimensions are not the vibe.)
NRHS β is INTEGER. The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.
A β is COMPLEX*16 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. If UPLO = '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 ZSYTRF_ROOK.
LDA β is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
IPIV β is INTEGER array, dimension (N). Details of the interchanges and the block structure of D, as determined by ZSYTRF_ROOK.
- 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,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 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,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- If
Notice which neighbour the negative case reaches for: k-1 when you're upper, k+1 when you're lower. That's the whole β¨ thing β¨ β don't mix them up.
B β is COMPLEX*16 array, dimension (LDB,NRHS). On entry, the N-by-NRHS right hand side matrix B. On exit, if INFO = 0, the N-by-NRHS solution matrix X. It literally transforms in place, an icon. π
LDB β is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
WORK β is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK β is INTEGER. The length of WORK. LWORK >= 1, and for best performance LWORK >= max(1,N*NB), where NB is the optimal blocksize for ZSYTRF_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.
π§ Pro tip straight from the page, no inventing: for best performance, sizeLWORKasmax(1,N*NB). AndLWORK = -1is the "just tell me how much room I need" mode β it won't even yell at you viaXERBLA.
INFO β is INTEGER
= 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.
π¨ Bestie, listen to this one:INFO > 0means the factorization finished butDis exactly singular, so the solution could not be computed. It's not a crash, but it is definitely not the outcome you were manifesting. π
π 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
And that's the roundup for this routine: Definition at line 202 of file zsysv_rook.f. π«Ά
π Author (yes, again β the Doxygen kind)
Generated automatically by Doxygen for LAPACK from the source code. So nobody hand-wrote that last bit, it's just the machine doing its little thing. π
Okay that's the whole hesv_rook(3) page, bestie β we made it to the end and you ate. π This one's from LAPACK Version 3.12.0, and the hesv_rook(3) page you've been reading is the whole thing, from NAME all the way down to this little wave goodbye. Go solve something symmetric. π¦π
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms