complexHEcomputational(3)
π complexHEcomputational(3) β LAPACK, but make it the group chat π
okay so bestie, welcome to complexHEcomputational(3), brought to you by LAPACK β¨ This is the complex computational corner of the library β the HE-matrix girlies β and it's long, so buckle up. We're doing this in parts, and this is part 1. No skimming, we keep every single detail, periodt. π«Ά
π NAME π
complexHEcomputational β complex
(yeah that's literally the whole NAME section, she's mysterious, she's minimal, she's iconic π)
β¨ SYNOPSIS β¨
πΈ Functions πΈ
subroutine checon (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)β CHECONsubroutine checon_3 (UPLO, N, A, LDA, E, IPIV, ANORM, RCOND, WORK, INFO)β CHECON_3subroutine checon_rook (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)β CHECON_ROOK estimates the reciprocal of the condition number for HE matrices using factorization obtained with one of the bounded diagonal pivoting methods (max 2 interchanges)subroutine cheequb (UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO)β CHEEQUBsubroutine chegs2 (ITYPE, UPLO, N, A, LDA, B, LDB, INFO)β CHEGS2 reduces a Hermitian definite generalized eigenproblem to standard form, using the factorization results obtained fromcpotrf(unblocked algorithm).subroutine chegst (ITYPE, UPLO, N, A, LDA, B, LDB, INFO)β CHEGSTsubroutine cherfs (UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)β CHERFSsubroutine cherfsx (UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, S, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, WORK, RWORK, INFO)β CHERFSXsubroutine chetd2 (UPLO, N, A, LDA, D, E, TAU, INFO)β CHETD2 reduces a Hermitian matrix to real symmetric tridiagonal form by an unitary similarity transformation (unblocked algorithm).subroutine chetf2 (UPLO, N, A, LDA, IPIV, INFO)β CHETF2 computes the factorization of a complex Hermitian matrix, using the diagonal pivoting method (unblocked algorithm calling Level 2 BLAS).subroutine chetf2_rk (UPLO, N, A, LDA, E, IPIV, INFO)β CHETF2_RK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm).subroutine chetf2_rook (UPLO, N, A, LDA, IPIV, INFO)β CHETF2_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm).subroutine chetrd (UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO)β CHETRDsubroutine chetrd_2stage (VECT, UPLO, N, A, LDA, D, E, TAU, HOUS2, LHOUS2, WORK, LWORK, INFO)β CHETRD_2STAGEsubroutine chetrd_he2hb (UPLO, N, KD, A, LDA, AB, LDAB, TAU, WORK, LWORK, INFO)β CHETRD_HE2HBsubroutine chetrf (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β CHETRFsubroutine chetrf_aa (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β CHETRF_AAsubroutine chetrf_rk (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)β CHETRF_RK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm).subroutine chetrf_rook (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β CHETRF_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (blocked algorithm, calling Level 3 BLAS).subroutine chetri (UPLO, N, A, LDA, IPIV, WORK, INFO)β CHETRIsubroutine chetri2 (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β CHETRI2subroutine chetri2x (UPLO, N, A, LDA, IPIV, WORK, NB, INFO)β CHETRI2Xsubroutine chetri_3 (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)β CHETRI_3subroutine chetri_3x (UPLO, N, A, LDA, E, IPIV, WORK, NB, INFO)β CHETRI_3Xsubroutine chetri_rook (UPLO, N, A, LDA, IPIV, WORK, INFO)β CHETRI_ROOK computes the inverse of HE matrix using the factorization obtained with the bounded Bunch-Kaufman ('rook') diagonal pivoting method.subroutine chetrs (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)β CHETRSsubroutine chetrs2 (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO)β CHETRS2subroutine chetrs_3 (UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, INFO)β CHETRS_3subroutine chetrs_aa (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)β CHETRS_AAsubroutine chetrs_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)β CHETRS_ROOK computes the solution to a system of linear equationsA * X = Bfor HE matrices using factorization obtained with one of the bounded diagonal pivoting methods (max 2 interchanges)subroutine cla_heamv (UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)β CLA_HEAMV computes a matrix-vector product using a Hermitian indefinite matrix to calculate error bounds.real function cla_hercond_c (UPLO, N, A, LDA, AF, LDAF, IPIV, C, CAPPLY, INFO, WORK, RWORK)β CLA_HERCOND_C computes the infinity norm condition number ofop(A)*inv(diag(c))for Hermitian indefinite matrices.real function cla_hercond_x (UPLO, N, A, LDA, AF, LDAF, IPIV, X, INFO, WORK, RWORK)β CLA_HERCOND_X computes the infinity norm condition number ofop(A)*diag(x)for Hermitian indefinite matrices.subroutine cla_herfsx_extended (PREC_TYPE, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, COLEQU, C, B, LDB, Y, LDY, BERR_OUT, N_NORMS, ERR_BNDS_NORM, ERR_BNDS_COMP, RES, AYB, DY, Y_TAIL, RCOND, ITHRESH, RTHRESH, DZ_UB, IGNORE_CWISE, INFO)β CLA_HERFSX_EXTENDED improves the computed solution to a system of linear equations for Hermitian indefinite matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution.real function cla_herpvgrw (UPLO, N, INFO, A, LDA, AF, LDAF, IPIV, WORK)β CLA_HERPVGRWsubroutine clahef (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)β CLAHEF computes a partial factorization of a complex Hermitian indefinite matrix using the Bunch-Kaufman diagonal pivoting method (blocked algorithm, calling Level 3 BLAS).subroutine clahef_rk (UPLO, N, NB, KB, A, LDA, E, IPIV, W, LDW, INFO)β CLAHEF_RK computes a partial factorization of a complex Hermitian indefinite matrix using bounded Bunch-Kaufman (rook) diagonal pivoting method.subroutine clahef_rook (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)
π¦ Detailed Description π¦
This is the group of complex computational functions for HE matrices. That's the whole vibe. π
π Function Documentation π
π subroutine checon (character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real ANORM, real RCOND, complex, dimension( * ) WORK, integer INFO)
CHECON
β¨ Purpose β¨
CHECON estimates the reciprocal of the condition number of a complex Hermitian matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by CHETRF.
An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
π Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed by CHETRF.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined by CHETRF.ANORMβANORMisREAL. The 1-norm of the original matrixA.RCONDβRCONDisREAL. The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine.WORKβWORKisCOMPLEXarray, dimension(2*N)INFOβINFOisINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value
πΈ Author πΈ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine checon_3 (character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, complex, dimension( * ) E, integer, dimension( * ) IPIV, real ANORM, real RCOND, complex, dimension( * ) WORK, integer INFO)
CHECON_3
β¨ Purpose β¨
CHECON_3 estimates the reciprocal of the condition number (in the 1-norm) of a complex Hermitian matrix A using the factorization computed by CHETRF_RK or CHETRF_BK:
A = P*U*D*(U**H)*(P**T) or A = P*L*D*(L**H)*(P**T),
where U (or L) is 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.
An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))). This routine uses BLAS3 solver CHETRS_3.
π Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix:= 'U': Upper triangular, form isA = P*U*D*(U**H)*(P**T);= 'L': Lower triangular, form isA = P*L*D*(L**H)*(P**T).
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). Diagonal of the block diagonal matrixDand factorsUorLas computed by CHETRF_RK and CHETRF_BK:- ONLY diagonal elements of the Hermitian block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDshould be provided on entry in arrayE), and - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- ONLY diagonal elements of the Hermitian block diagonal matrix
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EEβEis aCOMPLEXarray, dimension(N). On entry, it's holding the superdiagonal (or subdiagonal, depends on the vibe) elements of the Hermitian block diagonal matrixD, which is made of 1-by-1 or 2-by-2 diagonal blocks, where:- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N, andE(1)is not referenced; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1, andE(N)is not referenced.
- If
NOTE: for a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced in both theUPLO = 'U'orUPLO = 'L'cases. Not me getting left on read by the algorithm π
IPIVβIPIVisINTEGERarray, dimension(N). All the deets on the interchanges and the block structure ofD, as determined byCHETRF_RKorCHETRF_BK.ANORMβANORMisREAL. The 1-norm of the original matrixA.RCONDβRCONDisREAL. The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed right here in this routine.WORKβWORKisCOMPLEXarray, dimension(2*N).INFOβINFOisINTEGER= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
June 2017, 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 checon_rook (β¦) β¨
subroutine checon_rook (character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real ANORM, real RCOND, complex, dimension( * ) WORK, integer INFO)
CHECON_ROOK estimates the reciprocal of the condition number fort HE matrices using factorization obtained with one of the bounded diagonal pivoting methods (max 2 interchanges) π
Purpose:
CHECON_ROOK estimates the reciprocal of the condition number of a complex Hermitian matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by CHETRF_ROOK.
An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))). Math girlies stay winning π
Parameters
UPLOβUPLOisCHARACTER*1. Says whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). The block diagonal matrixDplus the multipliers used to get the factorUorL, exactly as computed byCHETRF_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 byCHETRF_ROOK.ANORMβANORMisREAL. The 1-norm of the original matrixA.RCONDβRCONDisREAL. The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine.WORKβWORKisCOMPLEXarray, dimension(2*N).INFOβINFOisINTEGER= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value
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 cheequb (β¦) πΈ
subroutine cheequb (character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, real, dimension( * ) S, real SCOND, real AMAX, complex, dimension( * ) WORK, integer INFO)
CHEEQUB β she does the balancing, no notes π
Purpose:
CHEEQUB computes row and column scalings intended to equilibrate a Hermitian matrix A (with respect to the Euclidean norm) and reduce its condition number. The scale factors S are computed by the BIN algorithm (see references) so that the scaled matrix B with elements B(i,j) = S(i)*A(i,j)*S(j) has a condition number within a factor N of the smallest possible condition number over all possible diagonal scalings. That's the range, bestie π¦
Parameters
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). The N-by-N Hermitian matrix whose scaling factors are about to be computed.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).SβSisREALarray, dimension(N). IfINFO = 0,Scontains the scale factors forA.SCONDβSCONDisREAL. IfINFO = 0,Scontains the ratio of the smallestS(i)to the largestS(i). IfSCOND >= 0.1andAMAXis neither too large nor too small, it is not worth scaling byS. Like, don't bother, it's giving already-balanced πAMAXβAMAXisREAL. Largest absolute value of any matrix element. IfAMAXis very close to overflow or very close to underflow, the matrix should be scaled. Careful bestie, overflow is NOT the moment.WORKβWORKisCOMPLEXarray, dimension(2*N).INFOβINFOisINTEGER= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, the i-th diagonal element is nonpositive.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
References:
Livne, O.E. and Golub, G.H., 'Scaling by Binormalization', Numerical Algorithms, vol. 35, no. 1, pp. 97-120, January 2004. DOI 10.1023/B:NUMA.0000016606.32820.69 Tech report version: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.1679
π§ subroutine chegs2 (β¦) π§
subroutine chegs2 (integer ITYPE, character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB, integer INFO)
CHEGS2 reduces a Hermitian definite generalized eigenproblem to standard form, using the factorization results obtained from cpotrf (unblocked algorithm). Unblocked = she's doing it the long way and still slaying π
Purpose:
CHEGS2 reduces a complex Hermitian-definite generalized eigenproblem to standard form.
If ITYPE = 1, the problem is A*x = lambda*B*x, and A is overwritten by inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H)
If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or B*A*x = lambda*x, and A is overwritten by U*A*U**H or L**H *A*L.
B must have been previously factorized as U**H *U or L*L**H by ZPOTRF. No skipping steps, periodt π
Parameters
ITYPEβITYPEisINTEGER= 1: computeinv(U**H)*A*inv(U)orinv(L)*A*inv(L**H);= 2 or 3: computeU*A*U**HorL**H *A*L.
UPLOβUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrixAis stored, and howBhas been factorized.= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matricesAandB.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). On entry, 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.
On exit, if INFO = 0, the transformed matrix, stored in the same format as A. Glow-up complete β¨
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).BβBisCOMPLEXarray, dimension(LDB,N). The triangular factor from the Cholesky factorization ofB, as returned byCPOTRF.Bis modified by the routine but restored on exit. She leaves no trace, main character energy π¦LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).INFOβINFOisINTEGER= 0: successful exit. π< 0: ifINFO = -i, the i-th argument had an illegal value.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine chegst (β¦) π
subroutine chegst (integer ITYPE, character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldb, * ) B, integer LDB, integer INFO)
CHEGST β the icon herself, back for round two π
Purpose:
CHEGST reduces a complex Hermitian-definite generalized eigenproblem to standard form.
If ITYPE = 1, the problem is A*x = lambda*B*x, and A is overwritten by inv(U**H)*A*inv(U) or inv(L)*A*inv(L**H)
If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or B*A*x = lambda*x, and A is overwritten by U*A*U**H or L**H*A*L.
B must have been previously factorized as U**H*U or L*L**H by CPOTRF.
Parameters
ITYPEβITYPEisINTEGER= 1: computeinv(U**H)*A*inv(U)orinv(L)*A*inv(L**H);= 2 or 3: computeU*A*U**HorL**H*A*L.
UPLOβUPLOβ aCHARACTER*1, and honestly it's just the vibe check for which triangle we're keeping and howBgot factored, periodt:= 'U': the upper triangle ofAis stored andBis factored asU**H*U;= 'L': the lower triangle ofAis stored andBis factored asL*L**H.
Nβ anINTEGER. The order of the matricesAandB. Bestie,N >= 0, no exceptions. πAβ aCOMPLEXarray, dimension(LDA,N).
On entry, it's the Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A holds the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced (we don't even look at it, she's invisible π
). If UPLO = 'L', the leading N-by-N lower triangular part of A holds the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
On exit, if INFO = 0, this is the transformed matrix, stored in the same format as A. β¨
LDAβ anINTEGER. The leading dimension of the arrayA.LDA >= max(1,N), fr fr.Bβ aCOMPLEXarray, dimension(LDB,N).
The triangular factor from the Cholesky factorization of B, as returned by CPOTRF.
Heads up: B is modified by the routine but restored on exit. So she goes out, does her thing, and comes home looking exactly the same. π«Ά
LDBβ anINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).INFOβ anINTEGER, the little status report at the end:= 0: successful exit π< 0: ifINFO = -i, thei-th argument had an illegal value π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine cherfs (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,
dimension( * ) FERR, real, dimension( * ) BERR, complex, dimension( * )
WORK, real, dimension( * ) RWORK, integer INFO)
CHERFS πΈ
Purpose
CHERFS improves the computed solution to a system of linear equations when the coefficient matrix is Hermitian indefinite, and provides error bounds and backward error estimates for the solution. She's the glow-up routine: your answer was cute, now it's correct. π
Parameters
UPLOβ aCHARACTER*1:= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.
Nβ anINTEGER. The order of the matrixA.N >= 0.NRHSβ anINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.Aβ aCOMPLEXarray, dimension(LDA,N).
The Hermitian matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A holds 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 holds the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
LDAβ anINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβ aCOMPLEXarray, dimension(LDAF,N).
The factored form of the matrix A. AF contains 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. She's the pre-chewed version, and we're obsessed. π₯
LDAFβ anINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβ anINTEGERarray, dimension(N).
Details of the interchanges and the block structure of D as determined by CHETRF. Receipts, basically. π§Ύ
Bβ aCOMPLEXarray, dimension(LDB,NRHS). The right hand side matrixB.LDBβ anINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).Xβ aCOMPLEXarray, dimension(LDX,NRHS).
On entry, the solution matrix X, as computed by CHETRS. On exit, the improved solution matrix X. Main character arc, honestly. β¨
LDXβ anINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).FERRβ aREALarray, dimension(NRHS).
The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(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 in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error. She's dramatic, she overshoots a lil, but she's trustworthy. π
BERRβ aREALarray, dimension(NRHS).
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). Like, how much would we have to tweak the inputs before this is technically true. π
WORKβ aCOMPLEXarray, dimension(2*N).RWORKβ aREALarray, dimension(N).INFOβ anINTEGER:= 0: successful exit π< 0: ifINFO = -i, thei-th argument had an illegal value π
Internal Parameters
ITMAX is the maximum number of steps of iterative refinement. No cap on the effort, only on the steps. π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine cherfsx (character UPLO, character EQUED, integer N, integer
NRHS, complex, dimension( lda, * ) A, integer LDA, complex, dimension(
ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, real,
dimension( * ) S, complex, dimension( ldb, * ) B, integer LDB, complex,
dimension( ldx, * ) X, integer LDX, real RCOND, 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)
CHERFSX π
Purpose
CHERFSX improves the computed solution to a system of linear equations when the coefficient matrix is Hermitian indefinite, and provides error bounds and backward error estimates for the solution. In addition to the normwise error bound, the code provides a maximum componentwise error bound if possible. See the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. Two flavours of "how wrong am I" β she's thorough like that. π
The original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED and S below. In this case, the solution and error bounds returned are for the original unequilibrated system. So yes, she un-does the glow-up to report on your actual face. πͺ
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. Defaults ate, honestly. β¨
Parameters
UPLOβ aCHARACTER*1:= 'U': upper triangle ofAis stored;= 'L': lower triangle ofAis stored.
EQUEDβ aCHARACTER*1.
Specifies the form of equilibration that was done to A before calling this routine. This is needed to compute the solution and error bounds correctly.
= 'N': no equilibration;= 'Y': both row and column equilibration, i.e.,Ahas been replaced bydiag(S) * A * diag(S). The right hand sideBhas been changed accordingly.
Nβ anINTEGER. The order of the matrixA.N >= 0.NRHSβ anINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.Aβ aCOMPLEXarray, dimension(LDA,N).
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.
LDAβ anINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβ aCOMPLEXarray, dimension(LDAF,N).
The factored form of the matrix A. AF contains 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.
LDAFβ anINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβ anINTEGERarray, dimension(N).
Details of the interchanges and the block structure of D as determined by CHETRF.
Sβ aREALarray, dimension(N).
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.
Okay so this one is a lot, but the takeaway is: powers of the radix or nothing, bestie. Underflow/overflow and you're refining against a matrix that isn't even your matrix anymore, and those error estimates stop being trustworthy. π
Bβ aCOMPLEXarray, dimension(LDB,NRHS). The right hand side matrixB.LDBβLDBβLDBis INTEGER π« it's the leading dimension of the arrayB. And the rule isLDB >= max(1,N). That's it, that's the whole vibe check, and you have to pass it.XβXis COMPLEX array, dimension (LDX,NRHS) πΈ On entry, this is the solution matrixX, as computed byCHETRS. On exit? It's the improved solution matrixX. Glow-up era, honestly. β¨LDXβLDXis INTEGER. The leading dimension of the arrayX. Same deal as before, bestie:LDX >= max(1,N). πRCONDβRCONDis REAL. Reciprocal scaled condition number. It's an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if done). If this is less than the machine precision β and especially if it's literally zero β the matrix is singular to working precision π. But okay important: the error may still be small even if this number is very very small and the matrix looks ill-conditioned. So don't panic-read into it. π«ΆBERRβBERRis REAL array, dimension (NRHS). Componentwise relative backward error. Specifically, it's the componentwise relative backward error of each solution vectorX(j)β like, the smallest relative change in any element ofAorBthat makesX(j)an exact solution. Iconic little number. π₯N_ERR_BNDSβN_ERR_BNDSis INTEGER. The number of error bounds to return for each right hand side and each type (normwise or componentwise). SeeERR_BNDS_NORMandERR_BNDS_COMPbelow πERR_BNDS_NORMβERR_BNDS_NORMis 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 normwise relative error, which is defined like this:
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, described below. Right now there are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1β 'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2β 'Guaranteed' error bound: the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 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 matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately 1.
See Lapack Working Note 165 for further details and extra cautions. π
ERR_BNDS_COMPβERR_BNDS_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 ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. 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 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) * slamch('Epsilon').err = 2β 'Guaranteed' error bound: the estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 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 matrixZ. LetZ = S*(A*diag(x)), wherexis the solution for the current right-hand side andSscales each row ofA*diag(x)by a power of the radix so all absolute row sums ofZare approximately 1.
See Lapack Working Note 165 for further details and extra cautions. π
NPARAMSβNPARAMSis INTEGER. It says how many parameters are set inPARAMS. If it's<= 0, then thePARAMSarray is never referenced and default values are used. Leave it alone and it leaves you alone. π¦PARAMSβPARAMSis REAL array, dimension NPARAMS. Specifies algorithm parameters. If an entry is< 0.0, then that entry gets filled with the default value used for that parameter. Only positions up toNPARAMSare accessed; defaults are used for higher-numbered parameters.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)
PARAMS(LA_LINRX_ITHRESH_I = 2)β maximum number of residual computations allowed for refinement. Default:10. Aggressive mode: set it to100to permit convergence using approximate factorizations or factorizations other than LU. β οΈ Heads up though: 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βWORKis COMPLEX array, dimension (2*N) π§RWORKβRWORKis REAL array, dimension (2*N) π§INFOβINFOis INTEGER. Read the receipts:= 0: Successful exit. The solution to every right-hand side is guaranteed. π< 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 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 sides K with K > J may 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 smallest J such 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 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.
π¦ subroutine chetd2 (character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, real, dimension( * ) D, real, dimension( * ) E, complex, dimension( * ) TAU, integer INFO) π¦
CHETD2 reduces a Hermitian matrix to real symmetric tridiagonal form by an unitary similarity transformation (unblocked algorithm). π«Ά
π« Purpose π«
CHETD2 reduces a complex Hermitian matrix A to real symmetric tridiagonal form T by a unitary similarity transformation: Q**H * A * Q = T. β¨
π§ Parameters π§
UPLOβUPLOis CHARACTER*1. Tells us whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NβNis INTEGER. The order of the matrixA. Rule:N >= 0. πAβAβ COMPLEX 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 UPLO = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the array TAU, represent the unitary matrix Q as a product of elementary reflectors; if UPLO = 'L', the diagonal and first subdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array TAU, represent the unitary matrix Q as a product of elementary reflectors. See Further Details. β¨ (yes bestie, A does a little glow-up on the way out, keep reading) β¨
LDAβ INTEGER. The leading dimension of the array A.LDA >= max(1,N). No cap, if you get this wrong the whole thing goes feral.Dβ REAL array, dimension(N). The diagonal elements of the tridiagonal matrix T:D(i) = A(i,i).Eβ REAL array, dimension(N-1). The off-diagonal elements of the tridiagonal matrix T:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.TAUβ COMPLEX array, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details).INFOβ INTEGER.= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value. (rude! you passed something wrong)
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
πΈ Further Details
okay so this is the part where the math gets a lil fancy, but stay with me, it's giving lore.
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(n-1) . . . H(2) H(1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(n-1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U':
( d e v2 v3 v4 )
( d e v3 v4 )
( d e v4 )
( d e )
( d )
if UPLO = 'L':
( d )
( e d )
( v1 e d )
( v1 v2 e d )
( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i). look at that symmetry bestie, it's art π¨
β¨ chetf2 β¨
subroutine chetf2 (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
CHETF2 computes the factorization of a complex Hermitian matrix, using the diagonal pivoting method (unblocked algorithm calling Level 2 BLAS).
π Purpose
CHETF2 computes the factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal pivoting method:
A = U*D*U**H or A = L*D*L**H
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, U**H is the conjugate transpose of U, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS. no blocking here, she's doing it one step at a time π
π Parameters
UPLOβ CHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored:= 'U': Upper triangular= 'L': Lower triangular
Nβ INTEGER. The order of the matrix A.N >= 0.Aβ COMPLEX 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, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details).
LDAβ INTEGER. The leading dimension of the array A.LDA >= max(1,N).IPIVβ INTEGER array, dimension(N). Details of the interchanges and the block structure of D.
If UPLO = 'U':
- If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) = 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':
- If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) = 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.
INFOβ INTEGER.= 0: successful exit< 0: ifINFO = -k, the k-th argument had an illegal value> 0: ifINFO = k,D(k,k)is exactly zero. 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. β οΈ bestie, this is the "she's done but she's hollow inside" case β do NOT use her to solve anything, you'll get division by zero π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
πΈ Further Details
09-29-06 - patch from
Bobby Cheng, MathWorks
Replace l.210 and l.392
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
by
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. SISNAN(ABSAKK) ) THEN
01-01-96 - Based on modifications by
J. Lewis, Boeing Computer Services Company
A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
If UPLO = 'U', then A = U*D*U**H, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k). If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k).
If UPLO = 'L', then A = L*D*L**H, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
β¨ chetf2_rk β¨
subroutine chetf2_rk (character UPLO, integer N, complex, dimension( lda, *
) A, integer LDA, complex, dimension( * ) E, integer, dimension( * )
IPIV, integer INFO)
CHETF2_RK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm). rook method, not bishop, we don't do that here π°
π Purpose
CHETF2_RK computes the factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**H)*(P**T) or A = P*L*D*(L**H)*(P**T),
where U (or L) is 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.
This is the unblocked version of the algorithm, calling Level 2 BLAS. For more information see Further Details section.
π Parameters
UPLOβ CHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored:= 'U': Upper triangular= 'L': Lower triangular
Nβ INTEGER. The order of the matrix A.N >= 0.Aβ 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
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, contains:
- a) ONLY diagonal elements of the Hermitian block diagonal matrix D on the diagonal of A, i.e.
D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements of D are stored on exit in arrayE), and - b) If
UPLO = 'U': factor U in the superdiagonal part of A. IfUPLO = 'L': factor L in the subdiagonal part of A.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N). π
E
E is COMPLEX array, dimension (N). On exit, contains the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D with 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 to 0; If UPLO = 'L': E(i) = D(i+1,i), i=1:N-1, E(N) is set to 0.
NOTE: For 1-by-1 diagonal block D(k), where 1 <= k <= N, the element E(k) is set to 0 in both UPLO = 'U' or UPLO = 'L' cases. β¨
IPIV
IPIV is INTEGER array, dimension (N). IPIV describes the permutation matrix P in the factorization of matrix A as follows. The absolute value of IPIV(k) represents the index of row and column that were interchanged with the k-th row and column. The value of UPLO describes the order in which the interchanges were applied. Also, the sign of IPIV represents the block structure of the Hermitian block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step. For more info see Further Details section. π
If UPLO = 'U', ( in factorization order, k decreases from N to 1 ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columns k andIPIV(k)were interchanged in the matrixA(1:N,1:N); IfIPIV(k) = k, no interchange occurred. - b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columns k and-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columns k-1 and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
If UPLO = 'L', ( in factorization order, k increases from 1 to N ):
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block. IfIPIV(k) != k, rows and columns k andIPIV(k)were interchanged in the matrixA(1:N,1:N). IfIPIV(k) = k, no interchange occurred. - b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block. (NOTE: negative entries inIPIVappear ONLY in pairs).- If
-IPIV(k) != k, rows and columns k and-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columns k-1 and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k+1) = k+1, no interchange occurred.
- If
- c) In both cases a) and b), always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
INFO
INFO is INTEGER
= 0: successful exit
< 0: If INFO = -k, the k-th argument had an illegal value
> 0: If INFO = k, the matrix A is singular, because: If UPLO = 'U': column k in the upper triangular part of A contains all zeros. If UPLO = 'L': column k in the lower triangular part of A contains all zeros. 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: INFO only stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored in INFO even though the factorization always completes. π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details:
TODO: put further details
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
- 01-01-96 - Based on modifications by J. Lewis, Boeing Computer Services Company A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville abd , USA
subroutine chetf2_rook
subroutine chetf2_rook (character UPLO, integer N, complex, dimension( lda,
* ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
CHETF2_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm). π¦
Purpose:
CHETF2_ROOK computes the factorization of a complex Hermitian matrix A
using the bounded Bunch-Kaufman ('rook') diagonal pivoting method:
A = U*D*U**H or A = L*D*L**H
where U (or L) is a product of permutation and unit upper (lower)
triangular matrices, U**H is the conjugate transpose of U, and D is
Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS.
Parameters
UPLO
UPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
N
N is INTEGER. The order of the matrix A. N >= 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, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details).
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':
- If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columns k and-IPIV(k)were interchanged and rows and columns k-1 and-IPIV(k-1)were inerchaged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block.
If UPLO = 'L':
- If
IPIV(k) > 0, then rows and columns k andIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columns k and-IPIV(k)were interchanged and rows and columns k+1 and-IPIV(k+1)were inerchaged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
INFO
INFO is INTEGER
= 0: successful exit< 0: ifINFO = -k, the k-th argument had an illegal value> 0: ifINFO = k,D(k,k)is exactly zero. 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.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details:
If UPLO = 'U', then A = U*D*U**H, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to
1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1
and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as
defined by IPIV(k), and U(k) is a unit upper triangular matrix, such
that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k). If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k).
If UPLO = 'L', then A = L*D*L**H, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
π«Ά Contributors π«Ά
Like, credit where credit is due, bestie β these icons literally built this:
- 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
- 01-01-96 - Based on modifications by J. Lewis, Boeing Computer Services Company A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
subroutine chetrd
subroutine chetrd (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, real, dimension( * ) D, real, dimension( * ) E, complex,
dimension( * ) TAU, complex, dimension( * ) WORK, integer LWORK, integer
INFO)
CHETRD π
β¨ Purpose β¨
CHETRD reduces a complex Hermitian matrix A to real symmetric tridiagonal form T by a unitary similarity transformation:
Q**H * A * Q = T.
πΈ Parameters πΈ
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, 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, ifUPLO = 'U', the diagonal and first superdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements above the first superdiagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal ofAare over-written by the corresponding elements of the tridiagonal matrixT, and the elements below the first subdiagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors. See Further Details.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).DβDisREALarray, dimension(N). The diagonal elements of the tridiagonal matrixT:D(i) = A(i,i).EβEisREALarray, dimension(N-1). The off-diagonal elements of the tridiagonal matrixT:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.TAUβTAUisCOMPLEXarray, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details).WORKβWORKisCOMPLEXarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGER. The dimension of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= N*NB, whereNBis the optimal blocksize.
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
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details π¦
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(n-1) . . . H(2) H(1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(n-1).
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i).
subroutine chetrd_2stage
subroutine chetrd_2stage (character VECT, character UPLO, integer N,
complex, dimension( lda, * ) A, integer LDA, real, dimension( * ) D,
real, dimension( * ) E, complex, dimension( * ) TAU, complex, dimension(
* ) HOUS2, integer LHOUS2, complex, dimension( * ) WORK, integer LWORK,
integer INFO)
CHETRD_2STAGE π
β¨ Purpose β¨
CHETRD_2STAGE reduces a complex Hermitian matrix A to real symmetric tridiagonal form T by a unitary similarity transformation:
Q1**H Q2**H* A * Q2 * Q1 = T.
πΈ Parameters πΈ
VECTβVECTisCHARACTER*1= 'N': No need for the Housholder representation, in particular for the second stage (Band to tridiagonal) and thusLHOUS2is of sizemax(1, 4*N);= 'V': the Householder representation is needed to either generateQ1 Q2or to applyQ1 Q2, thenLHOUS2is to be queried and computed. (NOT AVAILABLE IN THIS RELEASE).
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisCOMPLEXarray, 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, ifUPLO = 'U', the band superdiagonal ofAare overwritten by the corresponding elements of the internal band-diagonal matrixAB, and the elements above theKDsuperdiagonal, with the arrayTAU, represent the unitary matrixQ1as a product of elementary reflectors; ifUPLO = 'L', the diagonal and band subdiagonal ofAare over-written by the corresponding elements of the internal band-diagonal matrixAB, and the elements below theKDsubdiagonal, with the arrayTAU, represent the unitary matrixQ1as a product of elementary reflectors. See Further Details.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).DβDisREALarray, dimension(N). The diagonal elements of the tridiagonal matrixT.EβEisREALarray, dimension(N-1). The off-diagonal elements of the tridiagonal matrixT.TAUβTAUisCOMPLEXarray, dimension(N-KD). The scalar factors of the elementary reflectors of the first stage (see Further Details).HOUS2βHOUS2isCOMPLEXarray, dimension(LHOUS2). Stores the Householder representation of the stage2 band to tridiagonal.LHOUS2βLHOUS2isINTEGER. The dimension of the arrayHOUS2. IfLWORK = -1, orLHOUS2=-1, then a query is assumed; the routine only calculates the optimal size of theHOUS2array, returns this value as the first entry of theHOUS2array, and no error message related toLHOUS2is issued byXERBLA. IfVECT='N',LHOUS2 = max(1, 4*n); ifVECT='V', option not yet available.WORKβWORKisCOMPLEXarray, dimension(LWORK)LWORKLWORKisINTEGERβ it's the dimension of the arrayWORK, and bestie,LWORK = MAX(1, dimension). Now ifLWORK = -1, orLHOUS2 = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. AndLWORK = MAX(1, dimension)where:
dimension = max(stage1,stage2) + (KD+1)*N
= N*KD + N*max(KD+1,FACTOPTNB)
+ max(2*KD*KD, KD*NTHREADS)
+ (KD+1)*N
where KD is the blocking size of the reduction, FACTOPTNB is the blocking used by the QR or LQ algorithm (usually FACTOPTNB=128 is a good choice π
) and NTHREADS is the number of threads used when openMP compilation is enabled, otherwise =1.
INFOβINFOisINTEGER:= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details π
Implemented by Azzam Haidar. π
All details are available on technical report, SC11, SC13 papers.
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8, 11 pages. http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196
subroutine chetrd_he2hb π¦
subroutine chetrd_he2hb (character UPLO, integer N, integer KD, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( ldab, * ) AB,
integer LDAB, complex, dimension( * ) TAU, complex, dimension( * ) WORK,
integer LWORK, integer INFO)
CHETRD_HE2HB π
Purpose πΈ
CHETRD_HE2HB reduces a complex Hermitian matrix A to complex Hermitian band-diagonal form AB by a unitary similarity transformation:
Q**H * A * Q = AB.
Parameters π
UPLOβUPLOisCHARACTER*1:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.KDβKDisINTEGER. The number of superdiagonals of the reduced matrix ifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0. The reduced matrix is stored in the arrayAB.AβAisCOMPLEXarray, dimension(LDA,N). On entry, 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. On exit, ifUPLO = 'U', the diagonal and first superdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements above the first superdiagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements below the first subdiagonal, with the arrayTAU, represent the unitary matrixQas a product of elementary reflectors. See Further Details. πLDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).ABβABisCOMPLEXarray, dimension(LDAB,N). On exit, the upper or lower triangle of the Hermitian band matrixA, stored in the firstKD+1rows of the array. The j-th column ofAis stored in the j-th column of the arrayABas follows:
if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
LDABβLDABisINTEGER. The leading dimension of the arrayAB.LDAB >= KD+1.TAUβTAUisCOMPLEXarray, dimension(N-KD). The scalar factors of the elementary reflectors (see Further Details). β¨WORKβWORKisCOMPLEXarray, dimension(LWORK). On exit, ifINFO = 0, or ifLWORK=-1,WORK(1)returns the size ofLWORK.LWORKβLWORKisINTEGER. The dimension of the arrayWORKwhich should be calculated by a workspace query.LWORK = MAX(1, LWORK_QUERY). IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. And:
LWORK_QUERY = N*KD + N*max(KD,FACTOPTNB) + 2*KD*KD
where FACTOPTNB is the blocking used by the QR or LQ algorithm, usually FACTOPTNB=128 is a good choice π
otherwise putting LWORK=-1 will provide the size of WORK.
INFOβINFOisINTEGER:= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details π
Implemented by Azzam Haidar. π
All details are available on technical report, SC11, SC13 papers.
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8, 11 pages. http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(k)**H . . . H(2)**H H(1)**H, where k = n-kd.
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(1:i+kd-1) = 0 and v(i+kd) = 1; conjg(v(i+kd+1:n)) is stored on exit in A(i,i+kd+1:n), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(k), where k = n-kd.
Each H(i) has the form
H(i) = I - tau * v * v**H
where tau is a complex scalar, and v is a complex vector with v(kd+1:i) = 0 and v(i+kd+1) = 1; v(i+kd+2:n) is stored on exit in A(i+kd+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( ab ab/v1 v1 v1 v1 ) ( ab )
( ab ab/v2 v2 v2 ) ( ab/v1 ab )
( ab ab/v3 v3 ) ( v1 ab/v2 ab )
( ab ab/v4 ) ( v1 v2 ab/v3 ab )
( ab ) ( v1 v2 v3 ab/v4 ab )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i).
subroutine chetrf π
subroutine chetrf (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( * )
WORK, integer LWORK, integer INFO)
CHETRF π
Purpose πΈ
CHETRF computes the factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is
A = U*D*U**H or A = L*D*L**H
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.
This is the blocked version of the algorithm, calling Level 3 BLAS. π₯
Parameters π
UPLOβUPLOisCHARACTER*1:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.Aβ
We're back in the middle of A and bestie, A is a COMPLEX array, dimension (LDA,N).
On entry, it's 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 (don't even look at it, she's not in this scene π). 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 either.
On exit, A is serving something new: the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details β the tea is down there π).
LDA
LDA is INTEGER. It's the leading dimension of the array A, and the rule is LDA >= max(1,N). No exceptions, no wiggle room. π
IPIV
IPIV is an INTEGER array, dimension (N). It holds the receipts: details of the interchanges and the block structure of D.
- 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.
WORK
WORK is a COMPLEX array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, then WORK(1) returns the optimal LWORK β she's giving you the good number. π
LWORK
LWORK is INTEGER. It's the length of WORK, and LWORK >= 1. For best performance, LWORK >= N*NB, where NB is the block size returned by ILAENV.
INFO
INFO is INTEGER:
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,D(i,i)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations. π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details:
If UPLO = 'U', then A = U*D*U**H, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k). If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k).
If UPLO = 'L', then A = L*D*L**H, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
chetrf_aa
subroutine chetrf_aa (character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( * ) WORK, integer LWORK, integer INFO)
CHETRF_AA
Purpose:
CHETRF_AA computes the factorization of a complex hermitian matrix A using the Aasen's algorithm. The form of the factorization is
A = U**H*T*U or A = L*T*L**H
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is a hermitian tridiagonal matrix.
This is the blocked version of the algorithm, calling Level 3 BLAS. She's efficient and she knows it. π₯
Parameters
UPLO
UPLO is CHARACTER*1:
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N
N is INTEGER. The order of the matrix A. N >= 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, the tridiagonal matrix is stored in the diagonals and the subdiagonals of A just below (or above) the diagonals, and L is stored below (or above) the subdiaonals, when UPLO is 'L' (or 'U').
Yes, "subdiaonals" β that's exactly how the source spells it, and we are keeping it character for character, no cap. π«Ά
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
IPIV
IPIV is INTEGER array, dimension (N). On exit, it contains the details of the interchanges, i.e., the row and column k of A were interchanged with the row and column IPIV(k).
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 >= 2*N. For optimum performance LWORK >= N*(1+NB), where NB is the optimal blocksize.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. β¨
INFO
INFO is INTEGER:
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
chetrf_rk
subroutine chetrf_rk (character UPLO, integer N, complex, dimension( lda, * ) A, integer LDA, complex, dimension( * ) E, integer, dimension( * ) IPIV, complex, dimension( * ) WORK, integer LWORK, integer INFO)
CHETRF_RK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm). Rook pivoting, bestie β she's built different. π
Purpose:
CHETRF_RK computes the factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**H)*(P**T) or A = P*L*D*(L**H)*(P**T),
where U (or L) is 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.
This is the blocked version of the algorithm, calling Level 3 BLAS. For more information see Further Details section.
Parameters
UPLO
UPLO is CHARACTER*1. Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
N
N is INTEGER. The order of the matrix A. N >= 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 ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = '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.
On exit, contains:
- a) ONLY diagonal elements of the Hermitian 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.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
E
E is COMPLEX array, dimension (N). On exit, contains the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D with 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 to 0; If UPLO = 'L': E(i) = D(i+1,i), i=1:N-1, E(N) is set to 0.
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to 0 in bothUPLO = 'U'orUPLO = 'L'cases. π«Ά
IPIV
So like, this array is INTEGER, dimension (N), and honestly? It's the receipts for the permutation matrix P in the factorization of matrix A. Here's the tea:
The absolute value of IPIV(k) = the index of the row and column that got swapped with the k-th row and column. And UPLO tells you the order those interchanges happened in. ALSO (and this is the iconic part), the sign of IPIV reveals the block structure of the Hermitian block diagonal matrix D β with 1-by-1 or 2-by-2 diagonal blocks matching up to 1 or 2 interchanges at each factorization step. More deets in the Further Details section, bestie. π
If UPLO = 'U' β and in factorization order, k decreases from N to 1:
- a) One single positive entry,
IPIV(k) > 0, means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, then rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N); - If
IPIV(k) = k, no interchange occurred. No drama. π
- b) A pair of consecutive negative entries,
IPIV(k) < 0andIPIV(k-1) < 0, means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs, periodt). - 1) If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - 2) If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- c) In both cases a) and b), always
ABS( IPIV(k) ) <= k. π«Ά - d) NOTE: Any entry
IPIV(k)is always NONZERO on output. Every. Single. One.
If UPLO = 'L' β and in factorization order, k increases from 1 to N:
- a) One single positive entry,
IPIV(k) > 0, means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the matrixA(1:N,1:N). - If
IPIV(k) = k, no interchange occurred.
- b) A pair of consecutive negative entries,
IPIV(k) < 0andIPIV(k+1) < 0, means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs). - 1) If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,1:N). If-IPIV(k) = k, no interchange occurred. - 2) If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the matrixA(1:N,1:N). If-IPIV(k+1) = k+1, no interchange occurred.
- c) In both cases a) and b), always
ABS( IPIV(k) ) >= k. β¨ - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
π WORK π
WORK is a COMPLEX array, dimension ( MAX(1,LWORK) ).
On exit, if INFO = 0, then WORK(1) returns the optimal LWORK. She's giving you the good number. π
π LWORK π
LWORK is INTEGER.
The length of WORK. LWORK >=1. For best performance, LWORK >= N*NB, where NB is the block size returned by ILAENV. (Like, she'll work either way, but bestie, feed her 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. It's a vibe check, not a computation. π
π INFO π
INFO is INTEGER.
= 0: successful exit π< 0: ifINFO = -k, the k-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 inINFO, even though the factorization always completes. She logs the first red flag and keeps it moving.
πΈ Author πΈ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ Further Details: πΈ
TODO: put correct description
(Yes, that's genuinely what it says. Leaving it exactly as is. π)
πΈ 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 chetrf_rook π
subroutine chetrf_rook (character UPLO, integer N, complex, dimension( lda,
* ) A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( *
) WORK, integer LWORK, integer INFO)
CHETRF_ROOK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (blocked algorithm, calling Level 3 BLAS). π
β¨ Purpose: β¨
CHETRF_ROOK computes the factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman ('rook') diagonal pivoting method. The form of the factorization is
A = U*D*U**T or A = L*D*L**T
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.
This is the blocked version of the algorithm, calling Level 3 BLAS. She's fast. She's blocked. She ate. π₯
β¨ Parameters β¨
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGERThe order of the matrixA.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N)On entry, 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.
On exit, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details). β¨
LDAβLDAisINTEGERThe leading dimension of the arrayA.LDA >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N)Details of the interchanges and the block structure ofD.- 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,D(k-1:k,k-1:k)is a 2-by-2 diagonal block.
- Only the last
- 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,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
- Only the first
- If
WORKβWORKisCOMPLEXarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. π«ΆLWORKβLWORKisINTEGERThe length ofWORK.LWORK >=1. For best performance,LWORK >= N*NB, whereNBis the block size returned byILAENV.
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 matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations.
β¨ Author β¨
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ Further Details: β¨
If UPLO = 'U', then A = U*D*U**T, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k).
If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and A(k,k), and v overwrites A(1:k-2,k-1:k). π
okay so if UPLO = 'L', then A = L*D*L**T, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
Contributors π«Άβ¨
- June 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 chetri π
subroutine chetri (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( * )
WORK, integer INFO)
CHETRI πΈ
Purpose π
CHETRI computes the inverse of a complex Hermitian indefinite matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by CHETRF. bestie it literally just undoes the factorization, no cap.
Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
NβNisINTEGER. The order of the matrix A.N >= 0.AβAisCOMPLEX array, dimension(LDA,N). On entry, the block diagonal matrix D and the multipliers used to obtain the factor U or L as computed byCHETRF.
On exit, if INFO = 0, the (Hermitian) inverse of the original matrix. If UPLO = 'U', the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced; if UPLO = 'L' the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced.
LDAβLDAisINTEGER. The 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 byCHETRF.WORKβWORKisCOMPLEX array, dimension(N).INFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine chetri2 π¦
subroutine chetri2 (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( * )
WORK, integer LWORK, integer INFO)
CHETRI2 β¨
Purpose π
CHETRI2 computes the inverse of a COMPLEX hermitian indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by CHETRF. CHETRI2 set the LEADING DIMENSION of the workspace before calling CHETRI2X that actually computes the inverse. so it's like the setup bestie and CHETRI2X does the actual work, periodt.
Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**T;= 'L': Lower triangular, form isA = L*D*L**T.
NβNisINTEGER. The order of the matrix A.N >= 0.AβAisCOMPLEX array, dimension(LDA,N). On entry, the block diagonal matrix D and the multipliers used to obtain the factor U or L as computed byCHETRF.
On exit, if INFO = 0, the (symmetric) inverse of the original matrix. If UPLO = 'U', the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced; if UPLO = 'L' the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced.
LDAβLDAisINTEGER. The 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 byCHETRF.WORKβWORKisCOMPLEX array, dimension(N+NB+1)*(NB+3).LWORKβLWORKisINTEGER. The dimension of the array WORK. WORK is size>= (N+NB+1)*(NB+3). IfLWORK = -1, then a workspace query is assumed; the routine 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) = 0; the matrix is singular and its inverse could not be computed.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine chetri2x π
subroutine chetri2x (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, complex, dimension(
n+nb+1,* ) WORK, integer NB, integer INFO)
CHETRI2X π«
Purpose π
CHETRI2X computes the inverse of a complex Hermitian indefinite matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by CHETRF. this one's the real main character fr.
Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
NβNisINTEGER. The order of the matrix A.N >= 0.AβAisCOMPLEX array, dimension(LDA,N). On entry, the NNB diagonal matrix D and the multipliers used to obtain the factor U or L as computed byCHETRF.
On exit, if INFO = 0, the (symmetric) inverse of the original matrix. If UPLO = 'U', the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced; if UPLO = 'L' the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced.
LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).IPIVβIPIVisINTEGER array, dimension(N). Details of the interchanges and the NNB structure of D as determined byCHETRF.WORKβWORKisCOMPLEX array, dimension(N+NB+1,NB+3).NBβNBisINTEGER. Block size.INFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine chetri_3 π
subroutine chetri_3 (character UPLO, integer N, complex, dimension( lda, * )
A, integer LDA, complex, dimension( * ) E, integer, dimension( * ) IPIV,
complex, dimension( * ) WORK, integer LWORK, integer INFO)
CHETRI_3 π
Purpose π
CHETRI_3 computes the inverse of a complex Hermitian indefinite matrix A using the factorization computed by CHETRF_RK or CHETRF_BK:
A = P*U*D*(U**H)*(P**T) or A = P*L*D*(L**H)*(P**T),
where U (or L) is 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.
CHETRI_3 sets the leading dimension of the workspace before calling CHETRI_3X that actually computes the inverse. This is the blocked version of the algorithm, calling Level 3 BLAS. blocked = it eats, honestly.
Parameters π
UPLOβUPLOisCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NβNisINTEGER. The order of the matrix A.N >= 0.AβAisCOMPLEX array, dimension(LDA,N). On entry, diagonal of the block diagonal matrix D and factors U or L as computed byCHETRF_RKandCHETRF_BK:- ONLY diagonal elements of the Hermitian block diagonal matrix D on the diagonal of A, i.e.
D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements of D should be provided on entry in array E), and - If
UPLO = 'U': factor U in the superdiagonal part of A. IfUPLO = 'L': factor L in the subdiagonal part of A.
- ONLY diagonal elements of the Hermitian block diagonal matrix D on the diagonal of A, i.e.
On exit, if INFO = 0, the Hermitian inverse of the original matrix.
If UPLO = 'U': the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced;
If UPLO = 'L': the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced.
LDAβLDAβ it's anINTEGER, bestie. It's the leading dimension of the arrayA. And the rule?LDA >= max(1,N). No exceptions, she's strict π
E
E is a COMPLEX array, dimension (N). On entry it's holding the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D, the one with 1-by-1 or 2-by-2 diagonal blocks, where:
- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N, andE(1)is not referenced; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1, andE(N)is not referenced.
NOTE π: for a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced in both theUPLO = 'U'andUPLO = 'L'cases. She said what she said.
IPIV
IPIV is an INTEGER array, dimension (N). It's holding the details of the interchanges and the block structure of D, exactly as determined by CHETRF_RK or CHETRF_BK. It's giving receipts π§Ύ
WORK
WORK is a COMPLEX array, dimension (N+NB+1)*(NB+3). On exit, if INFO = 0, then WORK(1) returns the optimal LWORK. Iconic behaviour honestly.
LWORK
LWORK is an INTEGER. It's the length of WORK, and LWORK >= (N+NB+1)*(NB+3).
If LDWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of 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 an INTEGER:
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors: β¨
- November 2017, Igor Kozachenko, Computer Science Division, University of California, Berkeley
subroutine chetri_3x π¦
subroutine chetri_3x (character UPLO, integer N, complex, dimension( lda, * ) A,
integer LDA, complex, dimension( * ) E, integer, dimension( * ) IPIV,
complex, dimension( n+nb+1, * ) WORK, integer NB, integer INFO)
CHETRI_3X
Purpose: π
CHETRI_3X computes the inverse of a complex Hermitian indefinite matrix A using the factorization computed by CHETRF_RK or CHETRF_BK:
A = P*U*D*(U**H)*(P**T) or A = P*L*D*(L**H)*(P**T),
where U (or L) is 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.
This is the blocked version of the algorithm, calling Level 3 BLAS. She's the glow-up version, periodt π₯
Parameters π«Ά
UPLO
UPLO is CHARACTER*1. It specifies whether the details of the factorization are stored as an upper or lower triangular matrix.
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N
N is INTEGER. The order of the matrix A. N >= 0.
A
A is COMPLEX array, dimension (LDA,N).
On entry, the diagonal of the block diagonal matrix D and factors U or L as computed by CHETRF_RK and CHETRF_BK:
- ONLY diagonal elements of the Hermitian block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (the superdiagonal (or subdiagonal) elements ofDshould be provided on entry in arrayE), and - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
On exit, if INFO = 0, the Hermitian inverse of the original matrix.
- If
UPLO = 'U': the upper triangular part of the inverse is formed and the part ofAbelow the diagonal is not referenced; - If
UPLO = 'L': the lower triangular part of the inverse is formed and the part ofAabove the diagonal is not referenced.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
E
E is COMPLEX array, dimension (N).
On entry, contains the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where
- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)not referenced; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)not referenced.
NOTE π: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced in bothUPLO = 'U'orUPLO = 'L'cases.
IPIV
IPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure of D as determined by CHETRF_RK or CHETRF_BK.
WORK
WORK is COMPLEX array, dimension (N+NB+1,NB+3).
NB
NB is INTEGER. Block size. Slay, she's blocked π
INFO
INFO is INTEGER:
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors: β¨
- June 2017, Igor Kozachenko, Computer Science Division, University of California, Berkeley
subroutine chetri_rook πΈ
subroutine chetri_rook (character UPLO, integer N, complex, dimension( lda,
* ) A, integer LDA, integer, dimension( * ) IPIV, complex, dimension( *
) WORK, integer INFO)
CHETRI_ROOK computes the inverse of HE matrix using the factorization obtained with the bounded Bunch-Kaufman ('rook') diagonal pivoting method.
Purpose: π
CHETRI_ROOK computes the inverse of a complex Hermitian indefinite matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by CHETRF_ROOK.
Parameters π«Ά
UPLO
UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.
= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
N
N is INTEGER. The order of the matrix A. N >= 0.
A
A is COMPLEX array, dimension (LDA,N).
On entry, the block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by CHETRF_ROOK.
On exit, if INFO = 0, the (Hermitian) inverse of the original matrix. If UPLO = 'U', the upper triangular part of the inverse is formed and the part of A below the diagonal is not referenced; if UPLO = 'L' the lower triangular part of the inverse is formed and the part of A above the diagonal is not referenced.
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 as determined by CHETRF_ROOK.
WORK
WORK is COMPLEX array, dimension (N).
INFO
INFO is INTEGER:
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors: β¨
- 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
subroutine chetrs π
subroutine chetrs (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, integer INFO)
CHETRS
Purpose: π
CHETRS solves a system of linear equations A*X = B with a complex Hermitian matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by CHETRF.
Parameters π«Ά
UPLO
UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.
= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
N
N is INTEGER. 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). The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by CHETRF.
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 as determined by CHETRF.
B
B is COMPLEX array, dimension (LDB,NRHS).
- On entry, the right hand side matrix
B. - On exit, the solution matrix
X. β¨
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
INFO
INFO is INTEGER:
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine chetrs2 (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 INFO)
π CHETRS2 π
Purpose π―
CHETRS2 solves a system of linear equations A*X = B with a complex Hermitian matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by CHETRF and converted by CSYCONV. bestie it literally takes the factorization someone else already did and just... uses it. efficiency queen. π
Parameters πΈ
UPLO
UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.
= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
N
N is INTEGER. The order of the matrix A. N >= 0. (yes zero is allowed, we don't judge π
)
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). The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by CHETRF.
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 as determined by CHETRF. it's giving "receipts from the previous function" π§Ύ
B
B is COMPLEX array, dimension (LDB,NRHS). On entry, the right hand side matrix B. On exit, the solution matrix X. glow up moment fr fr β¨
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
WORK
WORK is COMPLEX array, dimension (N).
INFO
INFO is INTEGER.
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine chetrs_3 (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( * ) E, integer,
dimension( * ) IPIV, complex, dimension( ldb, * ) B, integer LDB,
integer INFO)
π¦ CHETRS_3 π¦
Purpose π―
CHETRS_3 solves a system of linear equations A * X = B with a complex Hermitian matrix A using the factorization computed by CHETRF_RK or CHETRF_BK:
A = P*U*D*(U**H)*(P**T) or A = P*L*D*(L**H)*(P**T),
where U (or L) is 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.
This algorithm is using Level 3 BLAS. yes the fast one. we love a performance icon. π₯
Parameters πΈ
UPLO
UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix:
= 'U': Upper triangular, form isA = P*U*D*(U**H)*(P**T);= 'L': Lower triangular, form isA = P*L*D*(L**H)*(P**T).
N
N is INTEGER. 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). Diagonal of the block diagonal matrix D and factors U or L as computed by CHETRF_RK and CHETRF_BK:
a) ONLY diagonal elements of the Hermitian block diagonal matrix D on the diagonal of A, i.e. D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements of D should be provided on entry in array E), and b) If UPLO = 'U': factor U in the superdiagonal part of A. If UPLO = 'L': factor L in the subdiagonal part of A.
note the ALL CAPS "ONLY" β bestie that's not a vibe, that's a warning. the off-diagonals ofDdo NOT live inAhere, they live inE. don't mix them up π
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,N).
E
E is COMPLEX array, dimension (N). On entry, contains the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where
- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)not referenced; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)not referenced.
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced in bothUPLO = 'U'orUPLO = 'L'cases.
IPIV
IPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure of D as determined by CHETRF_RK or CHETRF_BK.
B
B is COMPLEX array, dimension (LDB,NRHS). On entry, the right hand side matrix B. On exit, the solution matrix X. π
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
INFO
INFO is INTEGER.
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors:
- June 2017, 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 chetrs_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)
β¨ CHETRS_AA β¨
Purpose π―
CHETRS_AA solves a system of linear equations A*X = B with a complex hermitian matrix A using the factorization A = U**H*T*U or A = L*T*L**H computed by CHETRF_AA. lowercase "hermitian" in the source, and honestly? iconic of it. we respect the lowercase. π«Ά
Parameters πΈ
UPLO
UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.
= 'U': Upper triangular, form isA = U**H*T*U;= 'L': Lower triangular, form isA = L*T*L**H.
N
N is INTEGER. 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). Details of factors computed by CHETRF_AA.
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 as computed by CHETRF_AA.
B
B is COMPLEX array, dimension (LDB,NRHS). On entry, the right hand side matrix B. On exit, the solution matrix X. main character transformation arc tbh π
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
WORK
WORK is COMPLEX array, dimension (MAX(1,LWORK)).
LWORK
LWORK is INTEGER. The dimension of the array WORK. LWORK >= max(1,3*N-2).
bestie this is a real requirement, not a suggestion. too small and INFO will come for you. π
INFO
INFO is INTEGER.
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine chetrs_rook (character UPLO, integer N, integer NRHS, complex,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex, dimension( ldb, * ) B, integer LDB, integer INFO)
CHETRS_ROOK computes the solution to a system of linear equations A * X = B for HE matrices using factorization obtained with one of the bounded diagonal pivoting methods (max 2 interchanges). yes "rook" like the chess piece, and yes, max 2 interchanges, that's the whole bit. βοΈ
π CHETRS_ROOK π
Purpose π―
CHETRS_ROOK solves a system of linear equations A*X = B with a complex Hermitian matrix A using the factorization A = U*D*U**H or A = L*D*L**H computed by CHETRF_ROOK.
Parameters πΈ
UPLO
UPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.
= 'U': Upper triangular, form isA = U*D*U**H;= 'L': Lower triangular, form isA = L*D*L**H.
N
N is INTEGER. 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). The block diagonal matrix D and the multipliers used to obtain the factor U or L 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 as determined by CHETRF_ROOK.
B
B is COMPLEX array, dimension (LDB,NRHS). On entry, the right hand side matrix B. On exit, the solution matrix X. π
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
INFO
INFO is INTEGER.
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors:
- 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
β¨ cla_heamv β¨
subroutine cla_heamv (integer UPLO, integer N, real ALPHA, complex,
dimension( lda, * ) A, integer LDA, complex, dimension( * ) X, integer
INCX, real BETA, real, dimension( * ) Y, integer INCY)
okay so CLA_HEAMV computes a matrix-vector product using a Hermitian indefinite matrix to calculate error bounds π
Purpose:
CLA_SYAMV performs the matrix-vector operation
y := alpha*abs(A)*abs(x) + beta*abs(y),
where alpha and beta are scalars, x and y are vectors and A is an n by n symmetric matrix.
This function is primarily used in calculating error bounds, bestie β it's the girl in the back doing the actual math while everyone else takes credit π«Ά To protect against underflow during evaluation, components in the resulting vector are perturbed away from zero by (N+1) times the underflow threshold. And to prevent unnecessarily large errors for block-structure embedded in general matrices, 'symbolically' zero components are not perturbed. A zero entry counts as 'symbolic' if all multiplications involved in computing that entry have at least one zero multiplicand. periodt.
Parameters
UPLO(INTEGER) β On entry,UPLOspecifies whether the upper or lower triangular part of the arrayAis to be referenced as follows:UPLO = BLAS_UPPERβ Only the upper triangular part ofAis to be referenced.UPLO = BLAS_LOWERβ Only the lower triangular part ofAis to be referenced. Unchanged on exit.
N(INTEGER) β On entry,Nspecifies the number of columns of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHA(REAL) β On entry,ALPHAspecifies the scalaralpha. Unchanged on exit.A(COMPLEXarray, dimension( LDA, n )) β Before entry, the leadingmbynpart of the arrayAmust contain the matrix of coefficients. Unchanged on exit.LDA(INTEGER) β On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ). Unchanged on exit.X(COMPLEXarray, dimension( 1 + ( n - 1 )*abs( INCX ) )) β Before entry, the incremented arrayXmust contain the vectorx. Unchanged on exit.INCX(INTEGER) β On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.BETA(REAL) β On entry,BETAspecifies the scalarbeta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit.Y(REALarray, dimension( 1 + ( n - 1 )*abs( INCY ) )) β Before entry withBETAnon-zero, the incremented arrayYmust contain the vectory. On exit,Yis overwritten by the updated vectory.INCY(INTEGER) β On entry,INCYspecifies the increment for the elements ofY.INCYmust not be zero. Unchanged on exit.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details:
- Level 2 Blas routine.
- -- Written on 22-October-1986. Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs.
- -- Modified for the absolute-value product, April 2006. Jason Riedy, UC Berkeley
π cla_hercond_c π
real function cla_hercond_c (character UPLO, integer N, complex, dimension(
lda, * ) A, integer LDA, complex, dimension( ldaf, * ) AF, integer LDAF,
integer, dimension( * ) IPIV, real, dimension ( * ) C, logical CAPPLY,
integer INFO, complex, dimension( * ) WORK, real, dimension( * ) RWORK)
CLA_HERCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for Hermitian indefinite matrices. it's giving β¨condition numberβ¨ energy.
Purpose:
CLA_HERCOND_C computes the infinity norm condition number of op(A) * inv(diag(C)) where C is a REAL vector.
Parameters
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.A(COMPLEXarray, dimension(LDA,N)) β On entry, theN-by-NmatrixA.LDA(INTEGER) β The leading dimension of the arrayA.LDA >= max(1,N).AF(COMPLEXarray, dimension(LDAF,N)) β The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCHETRF.LDAF(INTEGER) β The leading dimension of the arrayAF.LDAF >= max(1,N).IPIV(INTEGERarray, dimension(N)) β Details of the interchanges and the block structure ofDas determined byCHETRF.C(REALarray, dimension(N)) β The vectorCin the formulaop(A) * inv(diag(C)).CAPPLY(LOGICAL) β If.TRUE.then access the vectorCin the formula above.INFO(INTEGER) β= 0: Successful exit.i > 0: Theith argument is invalid.
WORK(COMPLEXarray, dimension(2*N)) β Workspace.RWORK(REALarray, dimension(N)) β Workspace.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ cla_hercond_x π¦
real function cla_hercond_x (character UPLO, integer N, complex, dimension(
lda, * ) A, integer LDA, complex, dimension( ldaf, * ) AF, integer LDAF,
integer, dimension( * ) IPIV, complex, dimension( * ) X, integer INFO,
complex, dimension( * ) WORK, real, dimension( * ) RWORK)
CLA_HERCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian indefinite matrices. same vibe as her sister up there, but with a COMPLEX vector this time πΈ
Purpose:
CLA_HERCOND_X computes the infinity norm condition number of op(A) * diag(X) where X is a COMPLEX vector.
Parameters
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.A(COMPLEXarray, dimension(LDA,N)) β On entry, theN-by-NmatrixA.LDA(INTEGER) β The leading dimension of the arrayA.LDA >= max(1,N).AF(COMPLEXarray, dimension(LDAF,N)) β The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCHETRF.LDAF(INTEGER) β The leading dimension of the arrayAF.LDAF >= max(1,N).IPIV(INTEGERarray, dimension(N)) β Details of the interchanges and the block structure ofDas determined byCHETRF.X(COMPLEXarray, dimension(N)) β The vectorXin the formulaop(A) * diag(X).INFO(INTEGER) β= 0: Successful exit.i > 0: Theith argument is invalid.
WORK(COMPLEXarray, dimension(2*N)) β Workspace.RWORK(REALarray, dimension(N)) β Workspace.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π₯ cla_herfsx_extended π₯
subroutine cla_herfsx_extended (integer PREC_TYPE, character UPLO, integer
N, integer NRHS, complex, dimension( lda, * ) A, integer LDA, complex,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
logical COLEQU, real, dimension( * ) C, complex, dimension( ldb, * ) B,
integer LDB, complex, dimension( ldy, * ) Y, integer LDY, real,
dimension( * ) BERR_OUT, integer N_NORMS, real, dimension( nrhs, * )
ERR_BNDS_NORM, real, dimension( nrhs, * ) ERR_BNDS_COMP, complex,
dimension( * ) RES, real, dimension( * ) AYB, complex, dimension( * )
DY, complex, dimension( * ) Y_TAIL, real RCOND, integer ITHRESH, real
RTHRESH, real DZ_UB, logical IGNORE_CWISE, integer INFO)
CLA_HERFSX_EXTENDED improves the computed solution to a system of linear equations for Hermitian indefinite matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. main character behaviour, honestly π
Purpose:
CLA_HERFSX_EXTENDED improves the computed solution to a system of linear equations by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. This subroutine is called by CHERFSX to perform iterative refinement. In addition to normwise error bound, the code provides maximum componentwise error bound if possible. See comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. Note that this subroutine is only responsible for setting the second fields of ERR_BNDS_NORM and ERR_BNDS_COMP. iykyk π
Parameters
PREC_TYPE(INTEGER) β Specifies the intermediate precision to be used in refinement. The value is defined byILAPREC(P)wherePis aCHARACTERandP= 'S': Single= 'D': Double= 'I': Indigenous= 'X'or'E': Extra
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 matrixB.Aβ (the rest of this one's description is coming right up in the next part, bestie π«Ά)
πΈ A
A is COMPLEX array, dimension (LDA,N) On entry, the N-by-N matrix A.
πΈ LDA
LDA is INTEGER The leading dimension of the array A. LDA >= max(1,N).
πΈ AF
AF is COMPLEX array, dimension (LDAF,N) The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed by CHETRF.
πΈ LDAF
LDAF is INTEGER The leading dimension of the array AF. LDAF >= max(1,N).
πΈ IPIV
IPIV is INTEGER array, dimension (N) Details of the interchanges and the block structure of D as determined by CHETRF.
πΈ COLEQU
COLEQU is LOGICAL If .TRUE. then column equilibration was done to A before calling this routine. This is needed to compute the solution and error bounds correctly. (iykyk β skip it and the numbers stop making sense π)
πΈ C
C is REAL array, dimension (N) The column scale factors for A. If COLEQU = .FALSE., C is not accessed. If C is input, each element of C 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. (bestie, respect the radix powers π)
πΈ B
B is COMPLEX array, dimension (LDB,NRHS) The right-hand-side matrix B.
πΈ LDB
LDB is INTEGER The leading dimension of the array B. LDB >= max(1,N).
πΈ Y
Y is COMPLEX array, dimension (LDY,NRHS) On entry, the solution matrix X, as computed by CHETRS. On exit, the improved solution matrix Y. β¨ glow-up arc β¨
πΈ LDY
LDY is INTEGER The leading dimension of the array Y. LDY >= max(1,N).
πΈ BERR_OUT
BERR_OUT is REAL array, dimension (NRHS) On exit, BERR_OUT(j) contains the componentwise relative backward error for right-hand-side j from the formula
max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
where abs(Z) is the componentwise absolute value of the matrix or vector Z. This is computed by CLA_LIN_BERR.
πΈ N_NORMS
N_NORMS is INTEGER Determines which error bounds to return (see ERR_BNDS_NORM and ERR_BNDS_COMP).
- If
N_NORMS >= 1return normwise error bounds. - If
N_NORMS >= 2return componentwise error bounds.
πΈ ERR_BNDS_NORM
ERR_BNDS_NORM is REAL array, dimension (NRHS, N_ERR_BNDS) For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the ith solution vector:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2'Guaranteed' error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled 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.
This subroutine is only responsible for setting the second field above.
See Lapack Working Note 165 for further details and extra cautions. π
πΈ ERR_BNDS_COMP
ERR_BNDS_COMP is REAL array, dimension (NRHS, N_ERR_BNDS) For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
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) * slamch('Epsilon').err = 2'Guaranteed' error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3Reciprocal condition number: Estimated 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.
This subroutine is only responsible for setting the second field above.
See Lapack Working Note 165 for further details and extra cautions. π
πΈ RES
RES is COMPLEX array, dimension (N) Workspace to hold the intermediate residual.
πΈ AYB
AYB is REAL array, dimension (N) Workspace. π§°
πΈ DY
DY is COMPLEX array, dimension (N) Workspace to hold the intermediate solution.
πΈ Y_TAIL
Y_TAIL is COMPLEX array, dimension (N) Workspace to hold the trailing bits of the intermediate solution. (the lil leftovers π
)
πΈ RCOND
RCOND is REAL Reciprocal scaled condition number. This is 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.
πΈ ITHRESH
ITHRESH is INTEGER The maximum number of residual computations allowed for refinement. The default is 10. For 'aggressive' set to 100 to permit convergence using approximate factorizations or factorizations other than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees in ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy.
πΈ RTHRESH
RTHRESH is REAL Determines when to stop refinement if the error estimate stops decreasing. Refinement will stop when the next solution no longer satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The default value is 0.5. For 'aggressive' set to 0.9 to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details.
πΈ DZ_UB
DZ_UB is REAL Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solution Y is stable, which we define as the relative change in each component being less than DZ_UB. The default value is 0.25, requiring the first bit to be stable. See LAWN 165 for more details.
πΈ IGNORE_CWISE
IGNORE_CWISE is LOGICAL If .TRUE. then ignore componentwise convergence. Default value is .FALSE..
πΈ INFO
INFO is INTEGER
= 0: Successful exit. π< 0: ifINFO = -i, the ith argument toCLA_HERFSX_EXTENDEDhad an illegal value
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
real function cla_herpvgrw (character*1 UPLO, integer N, integer INFO,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( ldaf, *
) AF, integer LDAF, integer, dimension( * ) IPIV, real, dimension( * )
WORK)
π CLA_HERPVGRW
β¨ Purpose:
β¦so, CLA_HERPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U). and it's using the "max absolute element" norm, in case you were wondering which norm, bestie. now the important bit: if this thing comes back much less than 1, the stability of the LU factorization of the (equilibrated) matrix A could be poor π¬. and that also means the solution X, the estimated condition numbers, and the error bounds could all be unreliable. like, do not trust them. fr fr.
Parameters
UPLOβUPLOisCHARACTER*1. which triangle are we even doing:= '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.INFOβINFOisINTEGER. the value ofINFOreturned fromSSYTRF,.i.e., the pivot in columnINFOis exactly0.AβAisCOMPLEXarray, dimension(LDA,N). on entry, the N-by-N matrixA.LDAβLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).AFβAFisCOMPLEXarray, dimension(LDAF,N). the block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byCHETRF.LDAFβLDAFisINTEGER. the leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N). the details of the interchanges and the block structure ofDas determined byCHETRF.WORKβWORKisREALarray, dimension(2*N).
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
πΈ subroutine clahef πΈ
subroutine clahef (character UPLO, integer N, integer NB, integer KB,
complex, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex, dimension( ldw, * ) W, integer LDW, integer INFO)
CLAHEF computes a partial factorization of a complex Hermitian indefinite matrix using the Bunch-Kaufman diagonal pivoting method (blocked algorithm, calling Level 3 BLAS). blocked algorithm, she's efficient like that π
Purpose:
CLAHEF computes a partial factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal pivoting method. the partial factorization has the form:
A = ( I U12 ) ( A11 0 ) ( I 0 ) if UPLO = 'U', or:
( 0 U22 ) ( 0 D ) ( U12**H U22**H )
A = ( L11 0 ) ( D 0 ) ( L11**H L21**H ) if UPLO = 'L'
( L21 I ) ( 0 A22 ) ( 0 I )
where the order of D is at most NB. the actual order is returned in the argument KB, and is either NB or NB-1, or N if N <= NB. note that U**H denotes the conjugate transpose of U π
CLAHEF is an auxiliary routine called by CHETRF. it uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L').
Parameters
UPLOβUPLOisCHARACTER*1. specifies whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': upper triangular= 'L': lower triangular
NβNisINTEGER. the order of the matrixA.N >= 0.NBβNBisINTEGER. the maximum number of columns of the matrixAthat should be factored.NBshould be at least2to allow for 2-by-2 pivot blocks.KBβKBisINTEGER. the number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.AβAisCOMPLEXarray, dimension(LDA,N). on entry, 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. on exit,Acontains details of the partial factorization.LDAβLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).IPIVβIPIVisINTEGERarray, dimension(N). details of the interchanges and the block structure ofD.- if
UPLO = 'U': only the lastKBelements 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) = 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
- if
UPLO = 'L': only the firstKBelements 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) = 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
- if
WβWisCOMPLEXarray, dimension(LDW,NB).LDWβLDWisINTEGER. the leading dimension of the arrayW.LDW >= max(1,N).INFOβINFOisINTEGER.= 0: successful exit β¨> 0: ifINFO = k,D(k,k)is exactly zero. the factorization has been completed, but the block diagonal matrixDis exactly singular π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors:
- November 2013, Igor Kozachenko, Computer Science Division, University of California, Berkeley
π¦ subroutine clahef_rk π¦
subroutine clahef_rk (character UPLO, integer N, integer NB, integer KB,
complex, dimension( lda, * ) A, integer LDA, complex, dimension( * ) E,
integer, dimension( * ) IPIV, complex, dimension( ldw, * ) W, integer
LDW, integer INFO)
CLAHEF_RK computes a partial factorization of a complex Hermitian indefinite matrix using bounded Bunch-Kaufman (rook) diagonal pivoting method. rook pivoting?? she's fancy, she's giving bounded π
Purpose:
CLAHEF_RK computes a partial factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method. the partial factorization has the form:
A = ( I U12 ) ( A11 0 ) ( I 0 ) if UPLO = 'U', or:
( 0 U22 ) ( 0 D ) ( U12**H U22**H )
A = ( L11 0 ) ( D 0 ) ( L11**H L21**H ) if UPLO = 'L',
( L21 I ) ( 0 A22 ) ( 0 I )
where the order of D is at most NB. the actual order is returned in the argument KB, and is either NB or NB-1, or N if N <= NB.
CLAHEF_RK is an auxiliary routine called by CHETRF_RK. it uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L').
Parameters
UPLOβUPLOisCHARACTER*1. specifies whether the upper or lower triangular part of the Hermitian matrixAis stored:= 'U': upper triangular= 'L': lower triangular
NβNisINTEGER. the order of the matrixA.N >= 0.NBβNBisINTEGER. the maximum number of columns of the matrixAthat should be factored.NBshould be at least2to allow for 2-by-2 pivot blocks.KBβKBisINTEGER. the number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.AβAisCOMPLEXarray, dimension(LDA,N). on entry, the Hermitian matrixA.- if
UPLO = '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. - if
UPLO = '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. - on exit, contains:
- a) ONLY diagonal elements of the Hermitian 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 Hermitian block diagonal matrix
- if
LDAβLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).EβEisCOMPLEXarray, dimension(N). on exit, contains the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks, where ifUPLO = 'U':E(i) = D(i-1,i),i=2:N,E(1)is set to0; ifUPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to0.- NOTE: for 1-by-1 diagonal block
D(k), where1 <= k <= N, the elementE(k)is set to0in bothUPLO = 'U'orUPLO = 'L'cases.
- NOTE: for 1-by-1 diagonal block
IPIVβIPIVisINTEGERarray, dimension(N).IPIVdescribes the permutation matrixPin the factorization of matrixAas follows. the absolute value ofIPIV(k)represents the index of row and column that were interchanged with the k-th row and column. the value ofUPLOdescribes the order in which the interchanges were applied. also, the sign ofIPIVrepresents the block structure of the Hermitian block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks which correspond to 1 or 2 interchanges at each factorization step.
okay so bestie, the IPIV lore is still going and it's a lot, but we're gonna get through it together π no cap.
If UPLO = 'U' β and in factorization order, k decreases from N to 1:
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the submatrixA(1:N,N-KB+1:N); - If
IPIV(k) = k, no interchange occurred.
- If
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k-1) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs).
- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the matrixA(1:N,N-KB+1:N). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k-1) != k-1, rows and columnsk-1and-IPIV(k-1)were interchanged in the submatrixA(1:N,N-KB+1:N). If-IPIV(k-1) = k-1, no interchange occurred.
- (NOTE: negative entries in
- c) In both cases a) and b) is always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
If UPLO = 'L' β and in factorization order, k increases from 1 to N:
- a) A single positive entry
IPIV(k) > 0means:D(k,k)is a 1-by-1 diagonal block.- If
IPIV(k) != k, rows and columnskandIPIV(k)were interchanged in the submatrixA(1:N,1:KB). - If
IPIV(k) = k, no interchange occurred.
- If
- b) A pair of consecutive negative entries
IPIV(k) < 0andIPIV(k+1) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block.- (NOTE: negative entries in
IPIVappear ONLY in pairs).
- If
-IPIV(k) != k, rows and columnskand-IPIV(k)were interchanged in the submatrixA(1:N,1:KB). If-IPIV(k) = k, no interchange occurred. - If
-IPIV(k+1) != k+1, rows and columnsk-1and-IPIV(k-1)were interchanged in the submatrixA(1:N,1:KB). If-IPIV(k+1) = k+1, no interchange occurred.
- (NOTE: negative entries in
- c) In both cases a) and b) is always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output.
ngl, this is a lot of tea, but you're doing amazing sweetie π
W β¨
W is COMPLEX array, dimension (LDW,NB)
LDW πΈ
LDW is INTEGER The leading dimension of the array W. LDW >= max(1,N).
INFO π
INFO is INTEGER
= 0: successful exit< 0: IfINFO = -k, the k-th argument had an illegal value> 0: IfINFO = k, the matrix A is singular, because:- If
UPLO = 'U': columnkin the upper triangular part of A contains all zeros. - If
UPLO = 'L': columnkin the lower triangular part of A contains 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: INFO only stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored in INFO even 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 clahef_rook π¦
subroutine clahef_rook (character UPLO, integer N, integer NB, integer KB,
complex, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex, dimension( ldw, * ) W, integer LDW, integer INFO)
Purpose β¨
CLAHEF_ROOK computes a partial factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman ('rook') diagonal pivoting method. The partial factorization has the form:
A = ( I U12 ) ( A11 0 ) ( I 0 ) if UPLO = 'U', or:
( 0 U22 ) ( 0 D ) ( U12**H U22**H )
A = ( L11 0 ) ( D 0 ) ( L11**H L21**H ) if UPLO = 'L'
( L21 I ) ( 0 A22 ) ( 0 I )
where the order of D is at most NB. The actual order is returned in the argument KB, and is either NB or NB-1, or N if N <= NB. Note that U**H denotes the conjugate transpose of U.
CLAHEF_ROOK is an auxiliary routine called by CHETRF_ROOK. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L').
Parameters π
UPLO
UPLO is CHARACTER*1 Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
N
N is INTEGER The order of the matrix A. N >= 0.
NB
NB is INTEGER The maximum number of columns of the matrix A that should be factored. NB should be at least 2 to allow for 2-by-2 pivot blocks.
KB
KB is INTEGER The number of columns of A that were actually factored. KB is either NB-1 or NB, or N if N <= NB.
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, A contains details of the partial factorization.
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.
W
W is COMPLEX array, dimension (LDW,NB)
LDW
LDW is INTEGER The leading dimension of the array W. LDW >= max(1,N).
INFO
INFO is INTEGER
= 0: successful exit> 0: ifINFO = k,D(k,k)is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singular.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors π
- 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
Author π»
Generated automatically by Doxygen for LAPACK from the source code.
and that's a wrap bestie! this iconic page is from LAPACK version 3.11.0, dated Sun Nov 27 2022, and it's page complexHEcomputational(3). slay π
β¨
π¦ 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