complex16SYcomputational(3)
๐ complex16SYcomputational โ the complex16 girlies of LAPACK (manual page complex16SYcomputational(3)) ๐
okay bestie, sit DOWN, because this is the group chat of complex16 computational functions for SY matrices and it is long. like, 19-parts long. we're doing part 1 right now, so hydrate, grab a snack, and let's get into it. ๐ซถ
โจ NAME โจ
complex16SYcomputational โ literally just complex16, that's the whole name, no cap. ๐
โจ SYNOPSIS โจ
๐ธ Functions ๐ธ
the roster, in order, exactly as it is. no skipping, no summarising, we're listing everyone:
subroutine zhetrf_aa_2stage (UPLO, N, A, LDA, TB, LTB, IPIV, IPIV2, WORK, LWORK, INFO)ZHETRF_AA_2STAGEsubroutine zhetrs_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, INFO)ZHETRS_AA_2STAGEsubroutine zla_syamv (UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)ZLA_SYAMVcomputes a matrix-vector product using a symmetric indefinite matrix to calculate error bounds.double precision function zla_syrcond_c (UPLO, N, A, LDA, AF, LDAF, IPIV, C, CAPPLY, INFO, WORK, RWORK)ZLA_SYRCOND_Ccomputes the infinity norm condition number ofop(A)*inv(diag(c))for symmetric indefinite matrices.double precision function zla_syrcond_x (UPLO, N, A, LDA, AF, LDAF, IPIV, X, INFO, WORK, RWORK)ZLA_SYRCOND_Xcomputes the infinity norm condition number ofop(A)*diag(x)for symmetric indefinite matrices.subroutine zla_syrfsx_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)ZLA_SYRFSX_EXTENDEDimproves the computed solution to a system of linear equations for symmetric indefinite matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution.double precision function zla_syrpvgrw (UPLO, N, INFO, A, LDA, AF, LDAF, IPIV, WORK)ZLA_SYRPVGRWcomputes the reciprocal pivot growth factornorm(A)/norm(U)for a symmetric indefinite matrix.subroutine zlasyf (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)ZLASYFcomputes a partial factorization of a complex symmetric matrix using the Bunch-Kaufman diagonal pivoting method.subroutine zlasyf_aa (UPLO, J1, M, NB, A, LDA, IPIV, H, LDH, WORK)ZLASYF_AAsubroutine zlasyf_rk (UPLO, N, NB, KB, A, LDA, E, IPIV, W, LDW, INFO)ZLASYF_RKcomputes a partial factorization of a complex symmetric indefinite matrix using bounded Bunch-Kaufman (rook) diagonal pivoting method.subroutine zlasyf_rook (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)ZLASYF_ROOKcomputes a partial factorization of a complex symmetric matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method.subroutine zsycon (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)ZSYCONsubroutine zsycon_3 (UPLO, N, A, LDA, E, IPIV, ANORM, RCOND, WORK, INFO)ZSYCON_3subroutine zsycon_rook (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, INFO)ZSYCON_ROOKsubroutine zsyconv (UPLO, WAY, N, A, LDA, IPIV, E, INFO)ZSYCONVsubroutine zsyconvf (UPLO, WAY, N, A, LDA, E, IPIV, INFO)ZSYCONVFsubroutine zsyconvf_rook (UPLO, WAY, N, A, LDA, E, IPIV, INFO)ZSYCONVF_ROOKsubroutine zsyequb (UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO)ZSYEQUBsubroutine zsyrfs (UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, RWORK, INFO)ZSYRFSsubroutine zsyrfsx (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)ZSYRFSXsubroutine zsysv_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, WORK, LWORK, INFO)ZSYSV_AA_2STAGEcomputes the solution to system of linear equationsA * X = Bfor SY matricessubroutine zsytf2 (UPLO, N, A, LDA, IPIV, INFO)ZSYTF2computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).subroutine zsytf2_rk (UPLO, N, A, LDA, E, IPIV, INFO)ZSYTF2_RKcomputes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm).subroutine zsytf2_rook (UPLO, N, A, LDA, IPIV, INFO)ZSYTF2_ROOKcomputes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm).subroutine zsytrf (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)ZSYTRFsubroutine zsytrf_aa (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)ZSYTRF_AAsubroutine zsytrf_aa_2stage (UPLO, N, A, LDA, TB, LTB, IPIV, IPIV2, WORK, LWORK, INFO)ZSYTRF_AA_2STAGEsubroutine zsytrf_rk (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)ZSYTRF_RKcomputes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm).subroutine zsytrf_rook (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)ZSYTRF_ROOKsubroutine zsytri (UPLO, N, A, LDA, IPIV, WORK, INFO)ZSYTRIsubroutine zsytri2 (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)ZSYTRI2subroutine zsytri2x (UPLO, N, A, LDA, IPIV, WORK, NB, INFO)ZSYTRI2Xsubroutine zsytri_3 (UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)ZSYTRI_3subroutine zsytri_3x (UPLO, N, A, LDA, E, IPIV, WORK, NB, INFO)ZSYTRI_3Xsubroutine zsytri_rook (UPLO, N, A, LDA, IPIV, WORK, INFO)ZSYTRI_ROOKsubroutine zsytrs (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)ZSYTRSsubroutine zsytrs2 (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO)ZSYTRS2subroutine zsytrs_3 (UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, INFO)ZSYTRS_3subroutine zsytrs_aa (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)ZSYTRS_AAsubroutine zsytrs_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, INFO)ZSYTRS_AA_2STAGEsubroutine zsytrs_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)ZSYTRS_ROOKsubroutine ztgsyl (TRANS, IJOB, M, N, A, LDA, B, LDB, C, LDC, D, LDD, E, LDE, F, LDF, SCALE, DIF, WORK, LWORK, IWORK, INFO)ZTGSYLsubroutine ztrsyl (TRANA, TRANB, ISGN, M, N, A, LDA, B, LDB, C, LDC, SCALE, INFO)ZTRSYLsubroutine ztrsyl3 (TRANA, TRANB, ISGN, M, N, A, LDA, B, LDB, C, LDC, SCALE, SWORK, LDSWORK, INFO)ZTRSYL3
likeโฆ look at all those Zs. it's giving alphabet soup, but make it linear algebra. ๐ญ๐ฅ
โจ Detailed Description โจ
This is the group of complex16 computational functions for SY matrices.
that's it. that's the whole vibe. a whole little family of routines that do computational things to SY matrices and they all live together under one manual page. ๐
โจ Function Documentation โจ
๐ฆ subroutine zhetrf_aa_2stage ๐ฆ
subroutine zhetrf_aa_2stage (character UPLO, integer N, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) TB,
integer LTB, integer, dimension( * ) IPIV, integer, dimension( * )
IPIV2, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZHETRF_AA_2STAGE
๐ซ Purpose:
ZHETRF_AA_2STAGE computes the factorization of a double 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 band matrix with the bandwidth of NB (NB is internally selected and stored in TB( 1 ), and T is LU factorized with partial pivoting).
this is the blocked version of the algorithm, calling Level 3 BLAS. iconic behaviour tbh. ๐
๐ธ Parameters
UPLOโUPLOisCHARACTER*1= 'U':Upper triangle ofAis stored;= 'L':Lower triangle ofAis stored.
NโNisINTEGERThe order of the matrixA.N >= 0.AโAisCOMPLEX*16array, 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, L is stored below (or above) the subdiaonal blocks, when UPLO is 'L' (or 'U').
LDAโLDAisINTEGERThe leading dimension of the arrayA.LDA >= max(1,N).TBโTBisCOMPLEX*16array, dimension(LTB)On exit, details of the LU factorization of the band matrix.LTBโLTBisINTEGERThe size of the arrayTB.LTB >= 4*N, internally used to selectNBsuch thatLTB >= (3*NB+1)*N.
If LTB = -1, then a workspace query is assumed; the routine only calculates the optimal size of LTB, returns this value as the first entry of TB, and no error message related to LTB is issued by XERBLA.
IPIVโIPIVisINTEGERarray, dimension(N)On exit, it contains the details of the interchanges, i.e., the row and columnkofAwere interchanged with the row and columnIPIV(k).IPIV2โIPIV2isINTEGERarray, dimension(N)On exit, it contains the details of the interchanges, i.e., the row and columnkofTwere interchanged with the row and columnIPIV(k).WORKโWORKisCOMPLEX*16workspace of sizeLWORKLWORKโLWORKisINTEGERThe size ofWORK.LWORK >= N, internally used to selectNBsuch thatLWORK >= N*NB.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFOโINFOisINTEGER= 0:successful exit< 0:ifINFO = -i, the i-th argument had an illegal value.> 0:ifINFO = i, band LU factorization failed on i-th column
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ฆ subroutine zhetrs_aa_2stage ๐ฆ
subroutine zhetrs_aa_2stage (character UPLO, integer N, integer NRHS,
complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( *
) TB, integer LTB, integer, dimension( * ) IPIV, integer, dimension( * )
IPIV2, complex*16, dimension( ldb, * ) B, integer LDB, integer INFO)
ZHETRS_AA_2STAGE
๐ซ Purpose:
ZHETRS_AA_2STAGE solves a system of linear equations A*X = B with a hermitian matrix A using the factorization A = U**H*T*U or A = L*T*L**H computed by ZHETRF_AA_2STAGE.
๐ธ Parameters
UPLO
(and bestie, that's exactly where part 1 runs out โ UPLO is just sitting there waiting for part 2, so don't go anywhere ๐)
UPLOโ bestie this one's aCHARACTER*1and it's literally just telling us where the factorization details are chilling, like is it an upper or lower triangular matrix situation ๐= 'U':upper triangular, and the form isA = U**H*T*U;= 'L':lower triangular, and the form isA = L*T*L**H.
Nโ anINTEGER, the order of the matrixA, and you needN >= 0fr fr.NRHSโINTEGER, the number of right hand sides, aka how many columns the matrixBhas, andNRHS >= 0periodt.Aโ aCOMPLEX*16array, dimension(LDA,N). These are the details of the factors, computed byZHETRF_AA_2STAGEโจLDAโINTEGER, the leading dimension of the arrayA, andLDA >= max(1,N)no cap.TBโ aCOMPLEX*16array, dimension(LTB). More details of the factors, computed byZHETRF_AA_2STAGE๐LTBโINTEGER, the size of the arrayTB, andLTB >= 4*Nbestie, don't skip this one.IPIVโ anINTEGERarray, dimension(N). The details of the interchanges, as computed byZHETRF_AA_2STAGE๐IPIV2โ anINTEGERarray, dimension(N). Also the details of the interchanges, as computed byZHETRF_AA_2STAGE(yes bestie there's two of them, iconic).Bโ aCOMPLEX*16array, dimension(LDB,NRHS). On entry it's the right hand side matrixB, and on exit it's the solution matrixX๐ฆLDBโINTEGER, the leading dimension of the arrayB, andLDB >= max(1,N).INFOโINTEGER, the vibe check on how it all went:= 0:successful exit, we ate ๐< 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 zla_syamv (integer UPLO, integer N, double precision ALPHA, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) X, integer INCX, double precision BETA, double precision, dimension( * ) Y, integer INCY)
OK so ZLA_SYAMV computes a matrix-vector product using a symmetric indefinite matrix to calculate error bounds ๐ซ
Purpose:
ZLA_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.
To protect against underflow during evaluation, components in
the resulting vector are perturbed away from zero by (N+1)
times the underflow threshold. To prevent unnecessarily large
errors for block-structure embedded in general matrices,
'symbolically' zero components are not perturbed. A zero
entry is considered 'symbolic' if all multiplications involved
in computing that entry have at least one zero multiplicand.
Parameters
UPLOโ anINTEGER. On entry,UPLOspecifies whether the upper or lower triangular part of the arrayAis to be referenced, like so: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โ anINTEGER. On entry,Nspecifies the number of columns of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHAโ aDOUBLE PRECISION. On entry,ALPHAspecifies the scalar alpha. Unchanged on exit.Aโ aCOMPLEX*16array, dimension( LDA, n ). Before entry, the leading m by n part of the arrayAmust contain the matrix of coefficients. Unchanged on exit.LDAโ anINTEGER. On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ). Unchanged on exit.Xโ aCOMPLEX*16array, dimension at least( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain the vector x. Unchanged on exit.INCXโ anINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.BETAโ aDOUBLE PRECISION. On entry,BETAspecifies the scalar beta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit.Yโ aDOUBLE PRECISIONarray, dimension( 1 + ( n - 1 )*abs( INCY ) ). Before entry withBETAnon-zero, the incremented arrayYmust contain the vector y. On exit,Yis overwritten by the updated vector y ๐INCYโ anINTEGER. 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
double precision function zla_syrcond_c (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, double precision, dimension( * ) C, logical CAPPLY, integer INFO, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK)
ZLA_SYRCOND_C computes the infinity norm condition number of op(A)*inv(diag(c)) for symmetric indefinite matrices ๐ธ
Purpose:
ZLA_SYRCOND_C Computes the infinity norm condition number of
op(A) * inv(diag(C)) where C is a DOUBLE PRECISION vector.
Parameters
UPLOโ aCHARACTER*1.= 'U':upper triangle ofAis stored;= 'L':lower triangle ofAis stored.
Nโ anINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.Aโ aCOMPLEX*16array, dimension(LDA,N). On entry, the N-by-N matrixA.LDAโ anINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโ aCOMPLEX*16array, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF.LDAFโ anINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโ anINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSYTRF.Cโ aDOUBLE PRECISIONarray, dimension(N). The vectorCin the formulaop(A) * inv(diag(C)).CAPPLYโ aLOGICAL. If.TRUE.then access the vectorCin the formula above.INFOโ anINTEGER.= 0:successful exit.i > 0:the ith argument is invalid ๐ญ
WORKโ aCOMPLEX*16array, dimension(2*N). Workspace.RWORKโ aDOUBLE PRECISIONarray, dimension(N). Workspace.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
double precision function zla_syrcond_x (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, complex*16, dimension( * ) X, integer INFO, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK)
ZLA_SYRCOND_X computes the infinity norm condition number of op(A)*diag(x) for symmetric indefinite matrices ๐ฆ
Purpose:
ZLA_SYRCOND_X Computes the infinity norm condition number of
op(A) * diag(X) where X is a COMPLEX*16 vector.
Parameters
UPLOโ aCHARACTER*1.= 'U':upper triangle ofAis stored;= 'L':lower triangle ofAis stored.
Nโ anINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.Aโ aCOMPLEX*16array, dimension(LDA,N). On entry, the N-by-N matrixA.LDAโ anINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโ aCOMPLEX*16array, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF.LDAFโ anINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโ anINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSYTRF.Xโ aCOMPLEX*16array, dimension(N). The vectorXin the formulaop(A) * diag(X).INFOโ anINTEGER.= 0:successful exit.i > 0:the ith argument is invalid ๐ญ
WORKโ aCOMPLEX*16array, dimension(2*N). Workspace.RWORKโ aDOUBLE PRECISIONarray, dimension(N). Workspace.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine zla_syrfsx_extended (integer PREC_TYPE, character UPLO, integer
N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA,
complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( *
) IPIV, logical COLEQU, double precision, dimension( * ) C, complex*16,
dimension( ldb, * ) B, integer LDB, complex*16, dimension( ldy, * ) Y,
integer LDY, double precision, dimension( * ) BERR_OUT, integer N_NORMS,
double precision, dimension( nrhs, * ) ERR_BNDS_NORM, double precision,
dimension( nrhs, * ) ERR_BNDS_COMP, complex*16, dimension( * ) RES,
double precision, dimension( * ) AYB, complex*16, dimension( * ) DY,
complex*16, dimension( * ) Y_TAIL, double precision RCOND, integer
ITHRESH, double precision RTHRESH, double precision DZ_UB, logical
IGNORE_CWISE, integer INFO)
okay bestie ๐ say hi to ZLA_SYRFSX_EXTENDED โ it's the glow-up your solution needs. It improves the computed solution to a system of linear equations for symmetric indefinite matrices by performing extra-precise iterative refinement and provides error bounds and backward error estimates for the solution. periodt
Purpose โจ
ZLA_SYRFSX_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 ZSYRFSX 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.
Parameters ๐
PREC_TYPEโ INTEGER. It specifies the intermediate precision to use in refinement. The value is defined byILAPREC(P)wherePis a CHARACTER andP = 'S': Single,P = 'D': Double,P = 'I': Indigenous,P = 'X'or'E': Extra. โจUPLOโ CHARACTER*1.= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored. ๐ฆNโ INTEGER. The number of linear equations, i.e., the order of the matrix A.N >= 0. ๐NRHSโ INTEGER. The number of right-hand-sides, i.e., the number of columns of the matrix B. ๐ธAโ COMPLEX*16 array, dimension(LDA,N). On entry, the N-by-N matrix A. ๐LDAโ INTEGER. The leading dimension of the array A.LDA >= max(1,N). ๐ฅAFโ COMPLEX*16 array, dimension(LDAF,N). The block diagonal matrix D and the multipliers used to obtain the factor U or L as computed byZSYTRF. ๐LDAFโ INTEGER. The leading dimension of the array AF.LDAF >= max(1,N). โจIPIVโ INTEGER array, dimension(N). Details of the interchanges and the block structure of D as determined byZSYTRF. ๐COLEQUโ 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. ๐ซถCโ DOUBLE PRECISION array, dimension(N). The column scale factors for A. IfCOLEQU = .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. ๐ญ (that's a warning, bestie โ take it seriously)Bโ COMPLEX*16 array, dimension(LDB,NRHS). The right-hand-side matrix B. ๐LDBโ INTEGER. The leading dimension of the array B.LDB >= max(1,N). โญYโ COMPLEX*16 array, dimension(LDY,NRHS). On entry, the solution matrix X, as computed byZSYTRS. On exit, the improved solution matrix Y. ๐LDYโ INTEGER. The leading dimension of the array Y.LDY >= max(1,N). ๐BERR_OUTโ DOUBLE PRECISION 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 ZLA_LIN_BERR. ๐ฅ
N_NORMSโ INTEGER. Determines which error bounds to return (seeERR_BNDS_NORMandERR_BNDS_COMP). IfN_NORMS >= 1return normwise error bounds. IfN_NORMS >= 2return componentwise error bounds. ๐ERR_BNDS_NORMโ DOUBLE PRECISION array, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the normwise relative error, which is defined as follows:
Normwise relative error in the ith solution vector:
max_j (abs(XTRUE(j,i) - X(j,i)))
------------------------------
max_j abs(X(j,i))
The array is indexed by the type of error information as described below. There currently are up to three pieces of information returned.
The first index in ERR_BNDS_NORM(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1'Trust/don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * 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โ DOUBLE PRECISION array, dimension(NRHS, N_ERR_BNDS). For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), 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โ COMPLEX*16 array, dimension(N). Workspace to hold the intermediate residual. ๐งAYBโ DOUBLE PRECISION array, dimension(N). Workspace. ๐ธDYโ COMPLEX*16 array, dimension(N). Workspace to hold the intermediate solution. ๐Y_TAILโ COMPLEX*16 array, dimension(N). Workspace to hold the trailing bits of the intermediate solution. โจRCONDโRCONDโ DOUBLE PRECISION. bestie this is the reciprocal scaled condition number ๐ it's an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if equilibration was done, okurr). if this is less than the machine precision (and especially if it's literally zero), then the matrix is singular to working precision ๐ญ and likeโฆ no cap. but note: the error can still be small even when this number is super tiny and the matrix is giving ill-conditioned ๐ITHRESHโ INTEGER. the max number of residual computations allowed for refinement. default is10. for 'aggressive' set it to100so it can converge using approximate factorizations or factorizations that aren't LU. โ ๏ธ if the factorization uses a technique other than Gaussian elimination, the guarantees inERR_BNDS_NORMandERR_BNDS_COMPmay no longer be trustworthy โ fr fr, don't trust them then.RTHRESHโ DOUBLE PRECISION. decides when to stop refining if the error estimate stops decreasing. refinement stops when the next solution no longer satisfiesnorm(dx_{i+1}) < RTHRESH * norm(dx_i)wherenorm(Z)is the infinity norm ofZ.RTHRESHsatisfies0 < RTHRESH <= 1. default is0.5. for 'aggressive' set it to0.9to let it converge on extremely ill-conditioned matrices ๐ฎโ๐จ see LAWN 165 for the deets.DZ_UBโ DOUBLE PRECISION. decides when to start considering componentwise convergence. componentwise convergence only gets considered after each component of the solutionYis stable, which we define as the relative change in each component being less thanDZ_UB. default is0.25, which requires the first bit to be stable โจ see LAWN 165 for more.IGNORE_CWISEโ LOGICAL. if.TRUE.then ignore componentwise convergence. default value is.FALSE.๐ซถINFOโ INTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument toZLA_HERFSX_EXTENDEDhad an illegal value ๐ฌ
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ฆ double precision function zla_syrpvgrw (character*1 UPLO, integer N, integer INFO, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, double precision, dimension( * ) WORK)
ZLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite matrix ๐
iconic behaviour honestly.
โจ Purpose:
ZLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U). the 'max absolute element' norm is used. if this is way less than 1, the stability of the LU factorization of the (equilibrated) matrix A could be poor ๐ญ. this also means the solution X, the estimated condition numbers, and the error bounds could be unreliable. so likeโฆ keep an eye on it bestie.
๐ธ 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.INFOโ INTEGER. the value ofINFOreturned fromZSYTRF, i.e., the pivot in columnINFOis exactly0.Aโ COMPLEX*16 array, dimension (LDA,N). on entry, theN-by-NmatrixA.LDAโ INTEGER. the leading dimension of the arrayA.LDA >= max(1,N).AFโ COMPLEX*16 array, dimension (LDAF,N). the block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF.LDAFโ INTEGER. the leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโ INTEGER array, dimension (N). details of the interchanges and the block structure ofDas determined byZSYTRF.WORKโ DOUBLE PRECISION array, dimension (2*N).
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ง subroutine zlasyf (character UPLO, integer N, integer NB, integer KB, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( ldw, * ) W, integer LDW, integer INFO)
ZLASYF computes a partial factorization of a complex symmetric matrix using the Bunch-Kaufman diagonal pivoting method ๐
the way it justโฆ does that. periodt.
โจ Purpose:
ZLASYF computes a partial factorization of a complex symmetric 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**T U22**T )
A = ( L11 0 ) ( D 0 ) ( L11**T L21**T ) 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**T denotes the transpose of U ๐ซถ
ZLASYF is an auxiliary routine called by ZSYTRF. it uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L'). lowkey a little helper icon โจ
๐ธ Parameters
UPLOโ CHARACTER*1. specifies whether the upper or lower triangular part of the symmetric matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
Nโ INTEGER. the order of the matrixA.N >= 0.NBโ INTEGER. the maximum number of columns of the matrixAthat should be factored.NBshould be at least2to allow for 2-by-2 pivot blocks ๐KBโ INTEGER. the number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.Aโ COMPLEX*16 array, dimension (LDA,N). on entry, the symmetric matrixA. ifUPLO = 'U', the leading n-by-n upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. ifUPLO = 'L', the leading n-by-n lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. on exit,Acontains details of the partial factorization.LDAโ INTEGER. the leading dimension of the arrayA.LDA >= max(1,N).IPIVโ INTEGER array, 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) = 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':
- 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) = 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.
Wโ COMPLEX*16 array, dimension (LDW,NB)LDWโ INTEGER. the leading dimension of the arrayW.LDW >= max(1,N).INFOโ INTEGER= 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 zlasyf_aa (character UPLO, integer J1, integer M, integer NB, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( ldh, * ) H, integer LDH, complex*16, dimension( * ) WORK)
ZLASYF_AA โ that's it, that's the whole vibe check ๐
โจ Purpose:
DLATRF_AA factorizes a panel of a complex symmetric matrix A using the Aasen's algorithm. the panel consists of a set of NB rows of A when UPLO is U, or a set of NB columns when UPLO is L ๐
in order to factorize the panel, the Aasen's algorithm requires the last row, or column, of the previous panel. the first row, or column, of A is set to be the first row, or column, of an identity matrix, which is used to factorize the first panel โจ
the resulting J-th row of U, or J-th column of L, is stored in the (J-1)-th row, or column, of A (without the unit diagonals), while the diagonal and subdiagonal of A are overwritten by those of T. no cap.
๐ธ Parameters
UPLOโ CHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
J1โ INTEGER. the location of the first row, or column, of the panel within the submatrix ofA, passed to this routine, e.g., when called byZSYTRF_AA, for the first panel,J1is1, while for the remaining panels,J1is2.Mโ INTEGER. the dimension of the submatrix.M >= 0.NBโ INTEGER. the dimension of the panel to be facotorized.Aโ COMPLEX*16 array, dimension (LDA,M) for the first panel, while dimension (LDA,M+1) for the remaining panels.
On entry, A is holding the last row โ or column, depending which triangle we're living in ๐
โ of the previous panel, plus the trailing submatrix of A that still needs to get factorized. One lil exception tho: for the very first panel, only the panel itself gets passed in. No extras. ๐
On exit? The leading panel is factorized. Done. Slayed. โจ
LDA
LDA is INTEGER โ it's the leading dimension of the array A. And the rule is LDA >= max(1,M). Respect it, bestie. ๐ซถ
IPIV
IPIV is an INTEGER array, dimension (M). It's carrying all the deets of the row and column interchanges: the row and column k were interchanged with the row and column IPIV(k). That's it, that's the tea. ๐
H
H is COMPLEX*16 workspace, dimension (LDH,NB). It's just here to help. ๐ง
LDH
LDH is INTEGER โ the leading dimension of the workspace H. And: LDH >= max(1,M). โจ
WORK
WORK is COMPLEX*16 workspace, dimension (M). Grab a snack, do your lil job, exit. ๐
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ subroutine zlasyf_rk ๐
subroutine zlasyf_rk (character UPLO, integer N, integer NB, integer KB,
complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( *
) E, integer, dimension( * ) IPIV, complex*16, dimension( ldw, * ) W,
integer LDW, integer INFO)
ZLASYF_RK computes a partial factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method. Say that five times fast, I dare you. ๐ญ
๐ฆ Purpose ๐ฆ
ZLASYF_RK computes a partial factorization of a complex symmetric 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**T U22**T )
A = ( L11 0 ) ( D 0 ) ( L11**T L21**T ) 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. Okay so it's giving "I'll tell you how much I actually did." ๐
ZLASYF_RK is an auxiliary routine called by ZSYTRF_RK. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L'). Level 3 BLAS? Highkey iconic behavior. ๐ฅ
โจ Parameters โจ
UPLO
UPLO is CHARACTER*1. It specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
= 'U': Upper triangular= 'L': Lower triangular
Pick a side, babe. ๐
N
N is INTEGER โ the order of the matrix A. And N >= 0. Zero is allowed, negativity is not. ๐ซ
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. Like, at least 2, or the whole 2-by-2 pivot situation just can't happen. ๐ซถ
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. It's the receipts of how much work actually got done. ๐
A
A is COMPLEX*16 array, dimension (LDA,N).
On entry, the symmetric matrix A:
- If
UPLO = 'U': the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. - If
UPLO = 'L': the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
On exit, it contains:
- ONLY diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k). (The superdiagonal โ or subdiagonal โ elements ofDare stored on exit in arrayE.) And - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
So like, A gets completely repurposed. Glow up, honestly. ๐
LDA
LDA is INTEGER โ the leading dimension of the array A. LDA >= max(1,N). Periodt. โจ
E
E is COMPLEX*16 array, dimension (N).
On exit, it contains the superdiagonal (or subdiagonal) elements of the symmetric 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 to0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to0.
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to0in bothUPLO = 'U'orUPLO = 'L'cases. Bestie, it's zeroed out either way. Don't come for me. ๐ซถ
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 symmetric 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.
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 columnskandIPIV(k)were interchanged in the submatrixA(1:N,N-KB+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 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.
- If
- c) In both cases a) and b) is always
ABS( IPIV(k) ) <= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output. No sneaky zeros, ever. ๐
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 columnskandIPIV(k)were interchanged in the submatrixA(1:N,1:KB). 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 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.
- If
- c) In both cases a) and b) is always
ABS( IPIV(k) ) >= k. - d) NOTE: Any entry
IPIV(k)is always NONZERO on output. Same energy, different direction. ๐ธ
W
W is COMPLEX*16 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, thek-th argument had an illegal value. Oops. ๐> 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. Bestie, I am BEGGING you, do not use it to solve anything. ๐ญ
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes. One warning per girl, that's the policy. ๐
๐ 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 zlasyf_rook ๐ฅ
subroutine zlasyf_rook (character UPLO, integer N, integer NB, integer KB,
complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * )
IPIV, complex*16, dimension( ldw, * ) W, integer LDW, integer INFO)
ZLASYF_ROOK computes a partial factorization of a complex symmetric matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method. Yes, it's the rook variant. Very chess. Very main character. ๐
๐ฆ Purpose ๐ฆ
ZLASYF_ROOK computes a partial factorization of a complex symmetric 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**T U22**T )
A = ( L11 0 ) ( D 0 ) ( L11**T L21**T ) 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. Same deal as before, just a different pivoting flavor. โจ
okay so ZLASYF_ROOK is an auxiliary routine called by ZSYTRF_ROOK. 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 symmetric 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 least 2 to allow for 2-by-2 pivot blocks.KBโKBisINTEGER. The number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.AโAisCOMPLEX*16array, dimension(LDA,N). On entry, the symmetric matrixA. IfUPLO = 'U', the leadingn-by-nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingn-by-nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. On exit,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 last
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk-1and-IPIV(k-1)were inerchaged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block.
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 inerchaged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
WโWisCOMPLEX*16array, 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
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
subroutine zsycon ๐
subroutine zsycon (character UPLO, integer N, complex*16, dimension( lda, *
) A, integer LDA, integer, dimension( * ) IPIV, double precision ANORM,
double precision RCOND, complex*16, dimension( * ) WORK, integer INFO)
ZSYCON โ okay bestie, here's the tea. โจ
Purpose ๐ธ
ZSYCON estimates the reciprocal of the condition number (in the 1-norm) of a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZSYTRF.
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**T;= 'L': Lower triangular, form isA = L*D*L**T.
NโNisINTEGER. The order of the matrixA.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF.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 byZSYTRF.ANORMโANORMisDOUBLE PRECISION. The 1-norm of the original matrixA.RCONDโRCONDisDOUBLE PRECISION. 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โWORKisCOMPLEX*16array, 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 zsycon_3 ๐ฆ
subroutine zsycon_3 (character UPLO, integer N, complex*16, dimension( lda,
* ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( *
) IPIV, double precision ANORM, double precision RCOND, complex*16,
dimension( * ) WORK, integer INFO)
ZSYCON_3 โ another one, and she's iconic. ๐
Purpose โจ
ZSYCON_3 estimates the reciprocal of the condition number (in the 1-norm) of a complex symmetric matrix A using the factorization computed by ZSYTRF_RK or ZSYTRF_BK:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
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 ZSYTRS_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**T)*(P**T);= 'L': Lower triangular, form isA = P*L*D*(L**T)*(P**T).
NโNisINTEGER. The order of the matrixA.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N). Diagonal of the block diagonal matrixDand factorsUorLas computed byZSYTRF_RKandZSYTRF_BK:- a) ONLY diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDshould be provided on entry in arrayE), and - b) If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
- a) ONLY diagonal elements of the symmetric block diagonal matrix
LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EโEisCOMPLEX*16array, dimension(N). On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrixDwith 1-by-1 or 2-by-2 diagonal blocks, where- If
UPLO = 'U':E(i) = D(i-1,i),i=2:N, E(1) not referenced; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1, E(N) not referenced.
- If
NOTE: For 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is not referenced in bothUPLO = 'U'orUPLO = 'L'cases.
IPIVโIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSYTRF_RKorZSYTRF_BK.ANORMโANORMisDOUBLE PRECISION. The 1-norm of the original matrixA.RCONDโRCONDisDOUBLE PRECISION. 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โWORKisCOMPLEX*16array, 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 zsycon_rook ๐ฅ
subroutine zsycon_rook (character UPLO, integer N, complex*16, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, double precision
ANORM, double precision RCOND, complex*16, dimension( * ) WORK, integer
INFO)
ZSYCON_ROOK โ periodt. ๐
Purpose ๐
ZSYCON_ROOK estimates the reciprocal of the condition number (in the 1-norm) of a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZSYTRF_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))).
Parameters ๐
UPLOโUPLOโ okay soUPLO is CHARACTER*1. It 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โN is INTEGER. The order of the matrixA.N >= 0.AโA is COMPLEX*16 array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF_ROOK. slay ๐LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVโIPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byZSYTRF_ROOK.ANORMโANORM is DOUBLE PRECISION. The 1-norm of the original matrixA.RCONDโRCOND is DOUBLE PRECISION. 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โWORK is COMPLEX*16 array, dimension (2*N)INFOโINFO is INTEGER= 0:successful exit< 0:ifINFO = -i, thei-th argument had an illegal value
๐ Author ๐
Univ. of TennesseeUniv. of California BerkeleyUniv. of Colorado DenverNAG 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 zsyconv (character UPLO, character WAY, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( * ) E, integer INFO) ๐
ZSYCONV
๐ Purpose ๐
ZSYCONV converts A given by ZHETRF into L and D or vice-versa. It gets nondiagonal elements of D (returned in workspace) and applies or reverses permutation done in TRF.
โจ 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**T;= 'L':Lower triangular, form isA = L*D*L**T.
WAYโWAY is CHARACTER*1= 'C':Convert= 'R':Revert
NโN is INTEGER. The order of the matrixA.N >= 0.AโA is COMPLEX*16 array, dimension (LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF.LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVโIPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byZSYTRF.EโE is COMPLEX*16 array, dimension (N).Estores the supdiagonal/subdiagonal of the symmetric 1-by-1 or 2-by-2 block diagonal matrixDinLDLT.INFOโINFO is INTEGER= 0:successful exit< 0:ifINFO = -i, thei-th argument had an illegal value
๐ Author ๐
Univ. of TennesseeUniv. of California BerkeleyUniv. of Colorado DenverNAG Ltd.
๐ subroutine zsyconvf (character UPLO, character WAY, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( * ) IPIV, integer INFO) ๐
ZSYCONVF
๐ Purpose ๐
If parameter WAY = 'C': ZSYCONVF converts the factorization output format used in ZSYTRF provided on entry in parameter A into the factorization output format used in ZSYTRF_RK (or ZSYTRF_BK) that is stored on exit in parameters A and E. It also converts in place details of the interchanges stored in IPIV from the format used in ZSYTRF into the format used in ZSYTRF_RK (or ZSYTRF_BK).
If parameter WAY = 'R': ZSYCONVF performs the conversion in reverse direction, i.e. converts the factorization output format used in ZSYTRF_RK (or ZSYTRF_BK) provided on entry in parameters A and E into the factorization output format used in ZSYTRF that is stored on exit in parameter A. It also converts in place details of the interchanges stored in IPIV from the format used in ZSYTRF_RK (or ZSYTRF_BK) into the format used in ZSYTRF.
ZSYCONVF can also convert in Hermitian matrix case, i.e. between formats used in ZHETRF and ZHETRF_RK (or ZHETRF_BK).
โจ Parameters โจ
UPLOโUPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrixA.= 'U':Upper triangular= 'L':Lower triangular
WAYโWAY is CHARACTER*1= 'C':Convert= 'R':Revert
NโN is INTEGER. The order of the matrixA.N >= 0.AโA is COMPLEX*16 array, dimension (LDA,N)- If
WAY ='C':
- If
On entry, contains factorization details in format used in ZSYTRF:
- a) all elements of the symmetric block diagonal matrix
Don the diagonal ofAand on superdiagonal (or subdiagonal) ofA, and - b) If
UPLO = 'U':multipliers used to obtain factorUin the superdiagonal part ofA. IfUPLO = 'L':multipliers used to obtain factorLin the superdiagonal part ofA.
On exit, contains factorization details in format used in ZSYTRF_RK or ZSYTRF_BK:
- a) ONLY diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k);(superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayE), and - b) If
UPLO = 'U':factorUin the superdiagonal part ofA. IfUPLO = 'L':factorLin the subdiagonal part ofA.
- If
WAY = 'R':
On entry, contains factorization details in format used in ZSYTRF_RK or ZSYTRF_BK:
- a) ONLY diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k);(superdiagonal (or subdiagonal) elements ofDare stored on exit in arrayE), and - b) If
UPLO = 'U':factorUin the superdiagonal part ofA. IfUPLO = 'L':factorLin the subdiagonal part ofA.
On exit, contains factorization details in format used in ZSYTRF:
- a) all elements of the symmetric block diagonal matrix
Don the diagonal ofAand on superdiagonal (or subdiagonal) ofA, and - b) If
UPLO = 'U':multipliers used to obtain factorUin the superdiagonal part ofA. IfUPLO = 'L':multipliers used to obtain factorLin the superdiagonal part ofA.
LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).EโE is COMPLEX*16 array, dimension (N)- If
WAY ='C':
- If
On entry, just a workspace.
On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric 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.
- If
WAY = 'R':
On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric 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.
On exit, is not changed
IPIVโIPIV is INTEGER array, dimension (N)- If
WAY ='C':On entry, details of the interchanges and the block structure ofDin the format used inZSYTRF. On exit, details of the interchanges and the block structure ofDin the format used inZSYTRF_RK( orZSYTRF_BK). - If
WAY ='R':On entry, details of the interchanges and the block structure ofDin the format used inZSYTRF_RK( orZSYTRF_BK). On exit, details of the interchanges and the block structure ofDin the format used inZSYTRF.
- If
INFOโINFO is INTEGER= 0:successful exit< 0:ifINFO = -i, thei-th argument had an illegal value
๐ Author ๐
Univ. of TennesseeUniv. of California BerkeleyUniv. of Colorado DenverNAG Ltd.
๐ซถ Contributors ๐ซถ
- November 2017, Igor Kozachenko, Computer Science Division, University of California, Berkeley
๐ฆ subroutine zsyconvf_rook (character UPLO, character WAY, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( * ) IPIV, integer INFO) ๐ฆ
ZSYCONVF_ROOK
๐ Purpose ๐
If parameter WAY = 'C': ZSYCONVF_ROOK converts the factorization output format used in ZSYTRF_ROOK provided on entry in parameter A into the factorization output format used in ZSYTRF_RK (or ZSYTRF_BK) that is stored on exit in parameters A and E. IPIV format for ZSYTRF_ROOK and ZSYTRF_RK (or ZSYTRF_BK) is the same and is not converted.
If parameter WAY = 'R':
ZSYCONVF_ROOK performs the conversion in reverse direction, i.e. it converts the factorization output format used in ZSYTRF_RK (or ZSYTRF_BK) provided on entry in parameters A and E into the factorization output format used in ZSYTRF_ROOK that is stored on exit in parameter A. ๐ซ and the IPIV format for ZSYTRF_ROOK and ZSYTRF_RK (or ZSYTRF_BK) is literally the same and is not converted, no cap.
ZSYCONVF_ROOK can also convert in the Hermitian matrix case, i.e. between formats used in ZHETRF_ROOK and ZHETRF_RK (or ZHETRF_BK). she's versatile like that ๐
Parameters
UPLOโUPLOisCHARACTER*1. it tells you whether the details of the factorization are stored as an upper or lower triangular matrixA.'U': Upper triangular'L': Lower triangular
WAYโWAYisCHARACTER*1.'C': Convert'R': Revert
NโNisINTEGER. the order of the matrixA.N >= 0.AโAisCOMPLEX*16 array, dimension (LDA,N). bestie she's carrying the whole plot, so read carefully:- 1) If
WAY ='C':- On entry, contains factorization details in format used in
ZSYTRF_ROOK:- a) all elements of the symmetric block diagonal matrix D on the diagonal of
Aand on superdiagonal (or subdiagonal) ofA, and - b) If
UPLO = 'U': multipliers used to obtain factor U in the superdiagonal part ofA. IfUPLO = 'L': multipliers used to obtain factor L in the superdiagonal part ofA.
- a) all elements of the symmetric block diagonal matrix D on the diagonal of
- On exit, contains factorization details in format used in
ZSYTRF_RKorZSYTRF_BK:- a) ONLY diagonal elements of the symmetric block diagonal matrix D on the diagonal of
A, i.e.D(k,k) = A(k,k); (the superdiagonal (or subdiagonal) elements of D are stored on exit in arrayE), and - b) If
UPLO = 'U': factor U in the superdiagonal part ofA. IfUPLO = 'L': factor L in the subdiagonal part ofA.
- a) ONLY diagonal elements of the symmetric block diagonal matrix D on the diagonal of
- On entry, contains factorization details in format used in
- 2) If
WAY = 'R':- On entry, contains factorization details in format used in
ZSYTRF_RKorZSYTRF_BK:- a) ONLY diagonal elements of the symmetric block diagonal matrix D on the diagonal of
A, i.e.D(k,k) = A(k,k); (the superdiagonal (or subdiagonal) elements of D are stored on exit in arrayE), and - b) If
UPLO = 'U': factor U in the superdiagonal part ofA. IfUPLO = 'L': factor L in the subdiagonal part ofA.
- a) ONLY diagonal elements of the symmetric block diagonal matrix D on the diagonal of
- On exit, contains factorization details in format used in
ZSYTRF_ROOK:- a) all elements of the symmetric block diagonal matrix D on the diagonal of
Aand on superdiagonal (or subdiagonal) ofA, and - b) If
UPLO = 'U': multipliers used to obtain factor U in the superdiagonal part ofA. IfUPLO = 'L': multipliers used to obtain factor L in the superdiagonal part ofA.
- a) all elements of the symmetric block diagonal matrix D on the diagonal of
- On entry, contains factorization details in format used in
- 1) If
LDAโLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,N).EโEisCOMPLEX*16 array, dimension (N). she switches jobs depending on the way you're going โจ- 1) If
WAY ='C':- On entry, just a workspace.
- On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric 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; IfUPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)is set to 0.
- 2) If
WAY = 'R':- On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric 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; IfUPLO = 'L':E(i) = D(i+1,i),i=1:N-1,E(N)not referenced. - On exit, is not changed
- On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where If
- 1) If
IPIVโIPIVisINTEGER array, dimension (N). On entry, details of the interchanges and the block structure of D as determined:- 1) by
ZSYTRF_ROOK, ifWAY ='C'; - 2) by
ZSYTRF_RK(orZSYTRF_BK), ifWAY ='R'.
- 1) by
The IPIV format is the same for all these routines.
On exit, is not changed.
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:
November 2017, Igor Kozachenko,
Computer Science Division,
University of California, Berkeley
subroutine zsyequb (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, double precision, dimension( * ) S, double precision SCOND, double precision AMAX, complex*16, dimension( * ) WORK, integer INFO)
ZSYEQUB โ the glow-up queen of matrices ๐
Purpose:
ZSYEQUB computes row and column scalings intended to equilibrate a symmetric 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. it's giving "make your matrix less dramatic" ๐ธ
Parameters
UPLOโUPLOisCHARACTER*1.'U': Upper triangle ofAis stored;'L': Lower triangle ofAis stored.
NโNisINTEGER. The order of the matrixA.N >= 0.AโAisCOMPLEX*16 array, dimension (LDA,N). The N-by-N symmetric matrix whose scaling factors are to be computed.LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).SโSisDOUBLE PRECISION array, dimension (N). IfINFO = 0,Scontains the scale factors forA.SCONDโSCONDisDOUBLE PRECISION. 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.AMAXโAMAXisDOUBLE PRECISION. Largest absolute value of any matrix element. IfAMAXis very close to overflow or very close to underflow, the matrix should be scaled.WORKโWORKisCOMPLEX*16 array, 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 zsyrfs (character UPLO, integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension( ldx, * ) X, integer LDX, double precision, dimension( * ) FERR, double precision, dimension( * ) BERR, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK, integer INFO)
ZSYRFS โ the solver's personal trainer fr fr ๐ช
Purpose:
ZSYRFS improves the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite, and provides error bounds and backward error estimates for the solution. it takes your answer and is like "bestie we can do better" ๐ฆ
Parameters
UPLOโUPLOisCHARACTER*1.'U': Upper triangle ofAis stored;'L': Lower triangle ofAis stored.
NโNisINTEGER. The order of the matrixA.N >= 0.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0.AโAisCOMPLEX*16 array, dimension (LDA,N). The symmetric matrixA. IfUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFโAFisCOMPLEX*16 array, dimension (LDAF,N). The factored form of the matrixA.AFcontains the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorizationA = U*D*U**TorA = L*D*L**Tas computed byZSYTRF.LDAFโLDAFisINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVโIPIVisINTEGER array, dimension (N). Details of the interchanges and the block structure of D as determined byZSYTRF.BโBisCOMPLEX*16 array, dimension (LDB,NRHS). The right hand side matrixB.LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XโXisCOMPLEX*16 array, dimension (LDX,NRHS). On entry, the solution matrixX, as computed byZSYTRS. On exit, the improved solution matrixX. โจ the glow-up happens here โจLDXโLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).FERRโFERRโ DOUBLE PRECISION array, dimension (NRHS). bestie this is the estimated forward error bound for each solution vectorX(j)(aka the j-th column of the solution matrixX). so ifXTRUEis the true solution that goes withX(j), thenFERR(j)is an estimated upper bound for the magnitude of the biggest element in(X(j) - XTRUE)divided by the magnitude of the biggest element inX(j). is it trustworthy? it's exactly as reliable as the estimate forRCOND, and it's almost always a slight overestimate of the true error. slay, but also, it's giving "close enough". โจBERRโ DOUBLE PRECISION array, dimension (NRHS). the componentwise relative backward error of each solution vectorX(j). translation: the smallest relative change in any element ofAorBthat makesX(j)an exact solution. ๐WORKโ COMPLEX*16 array, dimension (2*N). scratch space, no thoughts, just vibes. ๐ซถRWORKโ DOUBLE PRECISION array, dimension (N). more scratch space, but make it real. ๐ธINFOโ INTEGER. the receipts:= 0: successful exit, we ate. ๐< 0: ifINFO = -i, the i-th argument had an illegal value. ๐ญ
๐ง Internal Parameters
ITMAXis the maximum number of steps of iterative refinement. that's the whole tea. โ
๐ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zsyrfsx ๐ฆ
okay so this is a whole new routine, and she is highkey the main character of error bounds. here's her full signature, verbatim, no edits, periodt:
subroutine zsyrfsx (character UPLO, character EQUED, integer N, integer
NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
double precision, dimension( * ) S, complex*16, dimension( ldb, * ) B,
integer LDB, complex*16, dimension( ldx, * ) X, integer LDX, double
precision RCOND, double precision, dimension( * ) BERR, integer
N_ERR_BNDS, double precision, dimension( nrhs, * ) ERR_BNDS_NORM, double
precision, dimension( nrhs, * ) ERR_BNDS_COMP, integer NPARAMS, double
precision, dimension( * ) PARAMS, complex*16, dimension( * ) WORK,
double precision, dimension( * ) RWORK, integer INFO)
๐ฏ Purpose:
ZSYRFSX improves the computed solution to a system of linear equations when the coefficient matrix is symmetric indefinite, and provides error bounds and backward error estimates for the solution. and not just normwise error bound โ the code also provides the maximum componentwise error bound if possible. ๐ see the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for the deets on those error bounds.
the original system of linear equations may have been equilibrated before calling this routine, as described by arguments EQUED and S below. in that case, the solution and error bounds returned are for the original unequilibrated system. iykyk. ๐
some optional parameters are bundled in the PARAMS array. these settings determine how refinement is performed, but honestly? often the defaults are acceptable. and if the defaults are acceptable, users can pass NPARAMS = 0, which prevents the source code from accessing the PARAMS argument. no cap, that's a whole shortcut. โจ
๐ Parameters
UPLOโ UPLO is CHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
EQUEDโ EQUED is CHARACTER*1. specifies the form of equilibration that was done toAbefore calling this routine. this is needed to compute the solution and error bounds correctly, so don't be skipping it bestie:= '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โ N is INTEGER. the order of the matrixA.N >= 0. ๐NRHSโ NRHS is INTEGER. the number of right hand sides, i.e., the number of columns of the matricesBandX.NRHS >= 0. ๐Aโ A is COMPLEX*16 array, dimension (LDA,N). the symmetric matrixA. ifUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. ifUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. pick a lane, she only reads one half. ๐LDAโ LDA is INTEGER. the leading dimension of the arrayA.LDA >= max(1,N). โญAFโ AF is COMPLEX*16 array, dimension (LDAF,N). the factored form of the matrixA.AFcontains the block diagonal matrixDand the multipliers used to obtain the factorUorLfrom the factorizationA = U*D*U**TorA = L*D*L**Tas computed byZSYTRF. ๐งLDAFโ LDAF is INTEGER. the leading dimension of the arrayAF.LDAF >= max(1,N). ๐IPIVโ IPIV is INTEGER array, dimension (N). details of the interchanges and the block structure ofDas determined byZSYTRF. the lore. ๐Sโ S is DOUBLE PRECISION array, dimension (N). the scale factors forA. ifEQUED = 'Y',Ais multiplied on the left and right bydiag(S).Sis an input argument ifFACT = 'F'; otherwise,Sis an output argument. ifFACT = 'F'andEQUED = 'Y', each element ofSmust be positive. ifSis output, each element ofSis a power of the radix. ifSis input, each element ofSshould be a power of the radix to ensure a reliable solution and error estimates. scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. and here's the warning bestie: rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. ๐ญBโ B is COMPLEX*16 array, dimension (LDB,NRHS). the right hand side matrixB. ๐LDBโ LDB is INTEGER. the leading dimension of the arrayB.LDB >= max(1,N). ๐ธXโ X is COMPLEX*16 array, dimension (LDX,NRHS). on entry, the solution matrixX, as computed byZGETRS. on exit, the improved solution matrixX. glow-up era. โจLDXโ LDX is INTEGER. the leading dimension of the arrayX.LDX >= max(1,N). ๐RCONDโ RCOND is DOUBLE PRECISION. reciprocal scaled condition number. this is an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if done). if this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision. but note: the error may still be small even if this number is very small and the matrix appears ill-conditioned. the vibes are bad but the math might still be fine, we love a plot twist. ๐ญBERRโ BERR is DOUBLE PRECISION array, dimension (NRHS). componentwise relative backward error. this is the componentwise relative backward error of each solution vectorX(j)(i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution). ๐N_ERR_BNDSโ N_ERR_BNDS is INTEGER. number of error bounds to return for each right hand side and each type (normwise or componentwise). seeERR_BNDS_NORMandERR_BNDS_COMPbelow. ๐ERR_BNDS_NORMโ ERR_BNDS_NORM is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). for each right-hand side, this array contains info 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 i-th right-hand side.
the second index in ERR_BNDS_NORM(:,err) contains the following three fields:
err = 1โ'Trust/don't trust'boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon').err = 2โ'Guaranteed'error bound: The estimated forward error, almost certainly within a factor of10of the true error so long as the next entry is greater than the thresholdsqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3โ Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrixZ. LetZ = S*A, whereSscales each row by a power of the radix so all absolute row sums ofZare approximately1.
see Lapack Working Note 165 for further details and extra cautions. ๐
ERR_BNDS_COMPโ ERR_BNDS_COMP is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS). for each right-hand side, this array contains info 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 i-th right-hand side. ๐
The second index in ERR_BNDS_COMP(:,err) holds these three fields:
err = 1โ the 'trust / don't trust' boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * dlamch('Epsilon'). ๐ซถerr = 2โ the 'Guaranteed' error bound: the estimated forward error, almost certainly within a factor of10of the true error so long as the next entry is greater than the thresholdsqrt(n) * dlamch('Epsilon'). This error bound should only be trusted if the previous boolean is true. ๐จerr = 3โ the reciprocal condition number: the estimated componentwise reciprocal condition number. It's compared with the thresholdsqrt(n) * dlamch('Epsilon')to determine if the error estimate is 'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled 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 approximately1. โจ
See Lapack Working Note 165 for further details and extra cautions. ๐ (no cap, go read it)
NPARAMS
NPARAMS is INTEGER
Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used. ๐
PARAMS
PARAMS is DOUBLE PRECISION array, dimension NPARAMS
Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with the default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters. iykyk ๐ฆ
PARAMS(LA_LINRX_ITREF_I = 1)โ whether to perform iterative refinement or not.- Default:
1.0D+0 = 0.0: no refinement is performed, and no error bounds are computed.= 1.0: use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not supportDOUBLE PRECISION.- (other values are reserved for future use) ๐
- Default:
PARAMS(LA_LINRX_ITHRESH_I = 2)โ maximum number of residual computations allowed for refinement.- Default:
10 - Aggressive: set to
100to permit convergence using approximate factorizations or factorizations other thanLU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy. ๐
- Default:
PARAMS(LA_LINRX_CWISE_I = 3)โ flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true,0.0is false.- Default:
1.0(attempt componentwise convergence) ๐ฅ
- Default:
WORK
WORK is COMPLEX*16 array, dimension (2*N)
RWORK
RWORK is DOUBLE PRECISION array, dimension (2*N)
INFO
INFO is INTEGER
= 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 J-th right-hand side is not guaranteed. The solutions corresponding to other right-hand sides K withK > Jmay not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the J-th right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the J-th right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_BNDS_COMP. ๐
Author ๐ซถ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine zsysv_aa_2stage (character UPLO, integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) TB, integer LTB, integer, dimension( * ) IPIV, integer, dimension( * ) IPIV2, complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZSYSV_AA_2STAGE computes the solution to system of linear equations A * X = B for SY matrices ๐
Purpose: โจ
ZSYSV_AA_2STAGE computes the solution to a complex system of linear equations
A * X = B,
where A is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices. ๐
Aasen's 2-stage algorithm is used to factor A as
A = U**T * T * U, if UPLO = 'U', or
A = L * T * L**T, if UPLO = 'L',
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is symmetric and band. The matrix T is then LU-factored with partial pivoting. The factored form of A is then used to solve the system of equations A * X = B. ๐ง
This is the blocked version of the algorithm, calling Level 3 BLAS. ๐ฅ
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. ๐
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*16 array, dimension (LDA,N)
On entry, the symmetric matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
On exit, L is stored below (or above) the subdiagonal blocks, when UPLO is 'L' (or 'U'). ๐
LDA
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,N). ๐ซถ
TB
TB is COMPLEX*16 array, dimension (LTB)
On exit, details of the LU factorization of the band matrix. ๐
LTB
LTB is INTEGER
The size of the array TB. LTB >= 4*N, internally used to select NB such that LTB >= (3*NB+1)*N.
If LTB = -1, then a workspace query is assumed; the routine only calculates the optimal size of LTB, returns this value as the first entry of TB, and no error message related to LTB is issued by XERBLA. ๐
IPIV
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). ๐
IPIV2
IPIV2 is INTEGER array, dimension (N)
On exit, it contains the details of the interchanges, i.e., the row and column k of T were interchanged with the row and column IPIV(k). ๐
B
B is COMPLEX*16 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). ๐
WORK
WORK is COMPLEX*16 workspace of size LWORK
LWORK
LWORK is INTEGER
The size of WORK. LWORK >= N, internally used to select NB such that LWORK >= N*NB.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. ๐
INFO
INFO is INTEGER
= 0: successful exit โ< 0: ifINFO = -i, the i-th argument had an illegal value. ๐> 0: ifINFO = i, band LU factorization failed on i-th column ๐
Author ๐ซถ
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine zsytf2 (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
ZSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm). ๐
Purpose: โจ
ZSYTF2 computes the factorization of a complex symmetric matrix A using the Bunch-Kaufman diagonal pivoting method:
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, U**T is the transpose of U, and D is symmetric 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โ okay bestie, this is aCHARACTER*1. It specifies whether the upper or lower triangular part of the symmetric matrix A is stored:= 'U': Upper triangular= 'L': Lower triangular
NโINTEGER. The order of the matrix A.N >= 0. no cap.AโCOMPLEX*16array, dimension(LDA,N). On entry, the symmetric matrix A. IfUPLO = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. IfUPLO = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
On exit, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details). iconic.
LDAโINTEGER. The leading dimension of the array A.LDA >= max(1,N).IPIVโINTEGERarray, 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.
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the real ones who made this happen ๐
๐ 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).
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 ๐
the lore ๐
- 09-29-06 - patch from
- Bobby Cheng, MathWorks
Replace l.209 and l.377
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
by
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. DISNAN(ABSAKK) ) THEN
- 1-96 - Based on modifications by J. Lewis, Boeing Computer Services Company
๐ง zsytf2_rk ๐ง
subroutine zsytf2_rk (character UPLO, integer N, complex*16, dimension( lda,
* ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( *
) IPIV, integer INFO)
ZSYTF2_RK computes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS2 unblocked algorithm).
๐ฏ Purpose ๐ฏ
ZSYTF2_RK computes the factorization of a complex symmetric matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
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 symmetric matrix A is stored:= 'U': Upper triangular= 'L': Lower triangular
NโINTEGER. The order of the matrix A.N >= 0.AโCOMPLEX*16array, dimension(LDA,N). On entry, the symmetric matrix A.- If
UPLO = 'U': the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. - If
UPLO = 'L': the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
- If
On exit, contains:
- ONLY diagonal elements of the symmetric 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 array E), and - If
UPLO = 'U': factor U in the superdiagonal part of A. IfUPLO = 'L': factor L in the subdiagonal part of A.
LDAโINTEGER. The leading dimension of the array A.LDA >= max(1,N).EโCOMPLEX*16array, dimension(N). On exit, contains the superdiagonal (or subdiagonal) elements of the symmetric 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.
- If
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โINTEGERarray, dimension(N). IPIV describes the permutation matrix P in the factorization of matrix A as 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 of UPLO describes the order in which the interchanges were applied. Also, the sign of IPIV represents the block structure of the symmetric 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.- If
IPIV(k) != k, rows and columns k andIPIV(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) < 0means:D(k-1:k,k-1:k)is a 2-by-2 diagonal block.- (NOTE: negative entries in IPIV appear ONLY in pairs).
- 1) 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. - 2) 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.
- 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.- If
IPIV(k) != k, rows and columns k andIPIV(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) < 0means:D(k:k+1,k:k+1)is a 2-by-2 diagonal block.- (NOTE: negative entries in IPIV appear ONLY in pairs).
- 1) 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. - 2) 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.
- c) in both case a) and case b), it's always
ABS( IPIV(k) ) >= k. always. no exceptions bestie ๐ - d) and ok this one is IMPORTANT: any entry
IPIV(k)is alwaysNONZEROon output. like, always always. โจ
INFO ๐
INFO is INTEGER, and here's the tea:
= 0: successful exit, we ate and left no crumbs ๐< 0: ifINFO = -k, the k-th argument had an illegal value ๐ญ (you passed something cursed, it's not us, it's you)> 0: ifINFO = k, the matrixAis singular, because:- if
UPLO = 'U': column k in the upper triangular part ofAcontains all zeros. - if
UPLO = 'L': column k in the lower triangular part ofAcontains all zeros.
- if
So D(k,k) is exactly zero, and superdiagonal elements of column k of U (or subdiagonal elements of column k of L) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐ซ
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes. so yeah, it tells you about the first red flag and then minds its business ๐ฉ
Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details: ๐ธ
TODO: put further details
(not me reading a literal TODO in the docs ๐ it's giving "we'll finish this later" and honestly? relatable)
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 zsytf2_rook โจ
subroutine zsytf2_rook (character UPLO, integer N, complex*16, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
ZSYTF2_ROOK computes the factorization of a complex symmetric indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm). ๐
Purpose: ๐
ZSYTF2_ROOK computes the factorization of a complex symmetric matrix A using the bounded Bunch-Kaufman ('rook') diagonal pivoting method:
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, U**T is the transpose of U, and D is symmetric 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โUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NโNisINTEGER. The order of the matrixA.N >= 0. (zero is fine bestie, negative is not ๐)AโAisCOMPLEX*16array, dimension(LDA,N). On entry, the symmetric matrixA. IfUPLO = 'U', the leading n-by-n upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading n-by-n lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
On exit, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details). ๐ฅ
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':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk-1and-IPIV(k-1)were inerchaged,D(k-1:k,k-1:k)is a 2-by-2 diagonal block.
If UPLO = 'L':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk+1and-IPIV(k+1)were inerchaged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
INFOโINFOisINTEGER:= 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 matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations. danger danger ๐จ
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). ๐
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: ๐
- 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 abd , USA
subroutine zsytrf โจ
subroutine zsytrf (character UPLO, integer N, complex*16, dimension( lda, *
) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( *
) WORK, integer LWORK, integer INFO)
ZSYTRF ๐
Purpose: ๐
ZSYTRF computes the factorization of a complex symmetric matrix A using the Bunch-Kaufman 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 symmetric 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. ๐๏ธ๐จ (yes queen, blocked = faster, we love efficiency)
Parameters ๐ธ
UPLOโUPLOisCHARACTER*1:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NโNisINTEGER. The order of the matrixA.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N). On entry, the symmetric matrixA. IfUPLO = 'U', the leading N-by-N upper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced.
On exit, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details). ๐ฅ
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. IfIPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. IfUPLO = 'U'andIPIV(k) = IPIV(k-1) < 0, then rows and columnsk-1and-IPIV(k)were interchanged andD(k-1:k,k-1:k)is a 2-by-2 diagonal block. IfUPLO = 'L'andIPIV(k) = IPIV(k+1) < 0, then rows and columnsk+1and-IPIV(k)were interchanged andD(k:k+1,k:k+1)is a 2-by-2 diagonal block. ๐WORKโWORKisCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. โจLWORKโLWORKisINTEGER. The length ofWORK.LWORK >= 1. For best performanceLWORK >= 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. ๐ (peak "just tell me how much room you need" energy)
INFOโINFOโ INTEGER, the final vibe check ๐= 0: successful exit (we ate, no crumbs ๐ )< 0: ifINFO = -i, the i-th argument had an illegal value (bestie, one of your args is not giving)> 0: ifINFO = i,D(i,i)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. โ ๏ธ That's the "do NOT proceed to solve" warning, fr fr.
๐ซถ Author ๐ซถ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
โจ Further Details โจ
Okay so here's the lore on how this factorization is actually constructed ๐
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).
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).
๐ subroutine zsytrf_aa ๐
subroutine zsytrf_aa (character UPLO, integer N, complex*16, dimension( lda,
* ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension(
* ) WORK, integer LWORK, integer INFO)
ZSYTRF_AA
Purpose:
ZSYTRF_AA computes the factorization of a complex symmetric matrix A using the Aasen's algorithm. The form of the factorization is
A = U**T*T*U or A = L*T*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is a complex symmetric tridiagonal matrix.
This is the blocked version of the algorithm, calling Level 3 BLAS. Blocked = it goes fast, periodt ๐ฅ
Parameters
UPLOโUPLOisCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NโNisINTEGERThe order of the matrix A.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N)On entry, the symmetric matrix A. IfUPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. IfUPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
On exit, 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').
LDAโLDAisINTEGERThe leading dimension of the array A.LDA >= max(1,N).IPIVโIPIVisINTEGERarray, dimension(N)On exit, it contains the details of the interchanges, i.e., the row and column k of A were interchanged with the row and columnIPIV(k). (swaps! so many swaps ๐ซ)WORKโWORKisCOMPLEX*16array, dimension(MAX(1,LWORK))On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGERThe length ofWORK.LWORK >=MAX(1,2*N). For optimum performanceLWORK >= N*(1+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, the i-th argument had an illegal value.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ฆ subroutine zsytrf_aa_2stage ๐ฆ
subroutine zsytrf_aa_2stage (character UPLO, integer N, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) TB,
integer LTB, integer, dimension( * ) IPIV, integer, dimension( * )
IPIV2, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZSYTRF_AA_2STAGE
Purpose:
ZSYTRF_AA_2STAGE computes the factorization of a complex symmetric matrix A using the Aasen's algorithm. The form of the factorization is
A = U**T*T*U or A = L*T*L**T
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and T is a complex symmetric band matrix with the bandwidth of NB (NB is internally selected and stored in TB( 1 ), and T is LU factorized with partial pivoting).
This is the blocked version of the algorithm, calling Level 3 BLAS. two stages, twice the slay โจ
Parameters
UPLOโUPLOisCHARACTER*1= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
NโNisINTEGERThe order of the matrix A.N >= 0.AโAisCOMPLEX*16array, 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, L is stored below (or above) the subdiaonal blocks, when UPLO is 'L' (or 'U').
LDAโLDAisINTEGERThe leading dimension of the array A.LDA >= max(1,N).TBโTBisCOMPLEX*16array, dimension(LTB)On exit, details of the LU factorization of the band matrix.LTBโLTBisINTEGERThe size of the arrayTB.LTB >= 4*N, internally used to selectNBsuch thatLTB >= (3*NB+1)*N.
If LTB = -1, then a workspace query is assumed; the routine only calculates the optimal size of LTB, returns this value as the first entry of TB, and no error message related to LTB is issued by XERBLA.
IPIVโIPIVisINTEGERarray, dimension(N)On exit, it contains the details of the interchanges, i.e., the row and column k of A were interchanged with the row and columnIPIV(k).IPIV2โIPIV2isINTEGERarray, dimension(N)On exit, it contains the details of the interchanges, i.e., the row and column k of T were interchanged with the row and columnIPIV(k). (yes bestie, that's what the original says โIPIV(k), notIPIV2(k)๐)WORKโWORKisCOMPLEX*16workspace of sizeLWORKLWORKโLWORKisINTEGERThe size ofWORK.LWORK >= N, internally used to selectNBsuch thatLWORK >= N*NB.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFOโINFOisINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: ifINFO = i, band LU factorization failed on i-th column. ๐ that column said no.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ subroutine zsytrf_rk ๐
subroutine zsytrf_rk (character UPLO, integer N, complex*16, dimension( lda,
* ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( *
) IPIV, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZSYTRF_RK computes the factorization of a complex symmetric indefinite
matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method
(BLAS3 blocked algorithm).
Purpose:
ZSYTRF_RK computes the factorization of a complex symmetric matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the blocked version of the algorithm, calling Level 3 BLAS. For more information see Further Details section. rook pivoting my beloved ๐ฆโโฌ
Parameters
UPLOโUPLOisCHARACTER*1Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:= 'U': Upper triangular= 'L': Lower triangular
NโNisINTEGERThe order of the matrix A.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N)On entry, the symmetric matrix A. IfUPLO = 'U': the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced.- If
UPLO = 'L': the leading N-by-N lower triangular part ofAholds the lower triangular part of the matrix A, and the strictly upper triangular part ofA? bestie we literally do not look at it. not once. it's not referenced. ๐
On exit, A contains: a) ONLY the diagonal elements of the symmetric block diagonal matrix D, sitting right on the diagonal of A, i.e. D(k,k) = A(k,k); (the superdiagonal (or subdiagonal) elements of D get parked on exit in the 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.
LDA
LDA is INTEGER
The leading dimension of the array A. Constraint: LDA >= max(1,N). no cap.
E
E is COMPLEX*16 array, dimension (N)
On exit, it holds the superdiagonal (or subdiagonal) elements of the symmetric 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, andE(1)is set to 0; - If
UPLO = 'L':E(i) = D(i+1,i),i=1:N-1, andE(N)is set to 0.
NOTE: for a 1-by-1 diagonal blockD(k), where1 <= k <= N, the elementE(k)is set to 0 in both theUPLO = 'U'andUPLO = 'L'cases. ๐
IPIV
IPIV is INTEGER array, dimension (N)
IPIV describes the permutation matrix P in the factorization of matrix A, and honestly it's giving lore. Here's the tea: the absolute value of IPIV(k) is the index of the row and column that got interchanged with the k-th row and column. The value of UPLO tells you the order in which those interchanges were applied. Also, the sign of IPIV encodes the block structure of the symmetric block diagonal matrix D with its 1-by-1 or 2-by-2 diagonal blocks โ those correspond to 1 or 2 interchanges at each factorization step. For more info see the Further Details section. โจ
If UPLO = 'U', ( in factorization order, k decreases from N to 1 ): a) A single positive entry IPIV(k) > 0 means: D(k,k) is a 1-by-1 diagonal block. If IPIV(k) != k, rows and columns k and IPIV(k) were interchanged in the matrix A(1:N,1:N); If IPIV(k) = k, no interchange occurred.
b) A pair of consecutive negative entries IPIV(k) < 0 and IPIV(k-1) < 0 means: D(k-1:k,k-1:k) is a 2-by-2 diagonal block. (NOTE: negative entries in IPIV appear 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.
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) > 0 means: D(k,k) is a 1-by-1 diagonal block. If IPIV(k) != k, rows and columns k and IPIV(k) were interchanged in the matrix A(1:N,1:N). If IPIV(k) = k, no interchange occurred.
b) A pair of consecutive negative entries IPIV(k) < 0 and IPIV(k+1) < 0 means: D(k:k+1,k:k+1) is a 2-by-2 diagonal block. (NOTE: negative entries in IPIV appear 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.
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 COMPLEX*16 array, dimension ( MAX(1,LWORK) ).
On exit, if INFO = 0, WORK(1) returns the optimal LWORK. ๐ซถ
LWORK
LWORK is INTEGER
The length of WORK. LWORK >= 1. For best performance, LWORK >= N*NB, where NB is the block size returned by ILAENV. ๐
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 = -k, the k-th argument had an illegal value ๐ญ> 0: IfINFO = 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.
- If
Therefore D(k,k) is exactly zero, and superdiagonal elements of column k of U (or subdiagonal elements of column k of L) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations. ๐
NOTE:INFOonly stores the first occurrence of a singularity, any subsequent occurrence of singularity is not stored inINFOeven though the factorization always completes. (the algorithm is a completionist,INFOis not ๐)
๐ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ Further Details:
TODO: put correct description
๐ซถ 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 zsytrf_rook
subroutine zsytrf_rook (character UPLO, integer N, complex*16, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16,
dimension( * ) WORK, integer LWORK, integer INFO)
ZSYTRF_ROOK โ ok this one is the rook variant and she is iconic. ๐
๐ฆ Purpose:
ZSYTRF_ROOK computes the factorization of a complex symmetric 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 symmetric 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. (blocked version = she's efficient, she's not doing this one element at a time, periodt.)
๐ธ Parameters
UPLO
UPLO is CHARACTER*1
= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
N
N is INTEGER
The order of the matrix A. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N)
On entry, the symmetric matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced. ๐
On exit, 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. Constraint: 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 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': 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.
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)).
On exit, if INFO = 0, WORK(1) returns the optimal LWORK. ๐
LWORK
LWORK is INTEGER
The length of WORK. LWORK >= 1. For best performance LWORK >= N*NB, where NB is the block size returned by ILAENV.
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, and bestie, here's exactly what it's telling you:
= 0: successful exit โจ slay, we're done< 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. ๐จ like, do NOT proceed
๐ 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).
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
๐ฅ ZSYTRI ๐ฅ
subroutine zsytri (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer INFO)
๐ฏ Purpose ๐ฏ
ZSYTRI computes the inverse of a complex symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZSYTRF. โจ
๐ 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 matrixA.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N). On entry, the block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF.
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 arrayA.LDA >= max(1,N).IPIVโIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSYTRF.WORKโWORKisCOMPLEX*16array, dimension(2*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.
๐ธ ZSYTRI2 ๐ธ
subroutine zsytri2 (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
๐ฏ Purpose ๐ฏ
ZSYTRI2 computes the inverse of a COMPLEX*16 symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZSYTRF. ZSYTRI2 sets the LEADING DIMENSION of the workspace before calling ZSYTRI2X that actually computes the inverse. ๐ฆ
๐ 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 matrixA.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N). On entry, the block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF.
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 arrayA.LDA >= max(1,N).IPIVโIPIVisINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSYTRF.WORKโWORKisCOMPLEX*16array, dimension(N+NB+1)*(NB+3)LWORKโLWORKisINTEGER. The dimension of the arrayWORK.WORKis size>= (N+NB+1)*(NB+3). IfLDWORK = -1, then a workspace query is assumed; the routine calculates:- the optimal size of the
WORKarray, returns this value as the first entry of theWORKarray, - and no error message related to
LDWORKis issued byXERBLA.
- the optimal size of the
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.
๐ ZSYTRI2X ๐
subroutine zsytri2x (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( n+nb+1,* ) WORK, integer NB, integer INFO)
๐ฏ Purpose ๐ฏ
ZSYTRI2X computes the inverse of a complex symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZSYTRF. ๐ฅ
๐ 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 matrixA.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,N). On entry, the NNB diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF.
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 arrayA.LDA >= max(1,N).IPIVโIPIVisINTEGERarray, dimension(N). Details of the interchanges and the NNB structure ofDas determined byZSYTRF.WORKโWORKisCOMPLEX*16array, dimension(N+NB+1,NB+3)NBโNBisINTEGER. Block sizeINFOโ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.
๐ ZSYTRI_3 ๐
subroutine zsytri_3 (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
๐ฏ Purpose ๐ฏ
ZSYTRI_3 computes the inverse of a complex symmetric indefinite matrix A using the factorization computed by ZSYTRF_RK or ZSYTRF_BK:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks. ๐
ZSYTRI_3 sets the leading dimension of the workspace before calling ZSYTRI_3X that actually computes the inverse. This is the blocked version of the algorithm, calling Level 3 BLAS. โจ
๐ Parameters ๐
UPLOUPLOโ this isUPLO is CHARACTER*1and it tells the routine whether the factorization details are chillin' in an upper or lower triangular matrix, okay?= 'U': the upper triangle ofAis stored;= 'L': the lower triangle ofAis stored.
NโN is INTEGER, the order of the matrixA. bestie it must beN >= 0.AโA is COMPLEX*16 array, dimension (LDA,N).
On entry, this is the diagonal of the block diagonal matrix D plus the factors U or L exactly as computed by ZSYTRF_RK and ZSYTRF_BK:
- ONLY the diagonal elements of the symmetric block diagonal matrix
Dlive on the diagonal ofA, i.e.D(k,k) = A(k,k); and the superdiagonal (or subdiagonal) elements ofDshould be handed over on entry in arrayE, iykyk. - If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA.
On exit, if INFO = 0, you get the symmetric 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 arrayA. Gotta beLDA >= max(1,N). no cap.EโE is COMPLEX*16 array, dimension (N).
On entry it holds the superdiagonal (or subdiagonal) elements of the symmetric 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, andE(1)not referenced; - If
UPLO = 'L':E(i) = D(i+1,i), i=1:N-1, andE(N)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's just not invited to that one ๐ซถ
IPIVโIPIV is INTEGER array, dimension (N). This carries the details of the interchanges and the block structure ofDas determined byZSYTRF_RKorZSYTRF_BK. ๐WORKโWORK is COMPLEX*16 array, dimension (N+NB+1)*(NB+3). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. iconic behaviour tbh.LWORKโLWORK is INTEGER, the length ofWORK.LWORK >= (N+NB+1)*(NB+3).
If LDWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. โจ
INFOโINFO is INTEGER.= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐ญ> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed. she's singular bestie, it's giving undefined ๐
๐ 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
๐ฆ zsytri_3x
subroutine zsytri_3x (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( * ) IPIV, complex*16, dimension( n+nb+1, * ) WORK, integer NB, integer INFO)
ZSYTRI_3X ๐ธ
๐ซ Purpose
ZSYTRI_3X computes the inverse of a complex symmetric indefinite matrix A using the factorization computed by ZSYTRF_RK or ZSYTRF_BK:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the blocked version of the algorithm, calling Level 3 BLAS. she's the main character of the blocked algorithm, fr fr ๐ฅ
๐ Parameters
UPLOโUPLO is CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': the upper triangle ofAis stored;= 'L': the lower triangle ofAis stored.
NโN is INTEGER, the order of the matrixA.N >= 0.AโA is COMPLEX*16 array, dimension (LDA,N).
On entry, diagonal of the block diagonal matrix D and factors U or L as computed by ZSYTRF_RK and ZSYTRF_BK:
- ONLY diagonal elements of the symmetric 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 symmetric 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 arrayA.LDA >= max(1,N).EโE is COMPLEX*16 array, dimension (N).
On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric 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 ofDas determined byZSYTRF_RKorZSYTRF_BK.WORKโWORK is COMPLEX*16 array, dimension (N+NB+1,NB+3).NBโNB is INTEGER. Block size. ๐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
๐ฆ zsytri_rook
subroutine zsytri_rook (character UPLO, integer N, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( * ) WORK, integer INFO)
ZSYTRI_ROOK ๐
๐ซ Purpose
ZSYTRI_ROOK computes the inverse of a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZSYTRF_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**T;= 'L': Lower triangular, form isA = L*D*L**T.
NโN is INTEGER, the order of the matrixA.N >= 0.AโA is COMPLEX*16 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 ZSYTRF_ROOK.
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โLDA is INTEGER, the leading dimension of the arrayA.LDA >= max(1,N).IPIVโIPIV is INTEGER array, dimension (N). Details of the interchanges and the block structure ofDas determined byZSYTRF_ROOK.WORKโWORK is COMPLEX*16 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
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
๐ฆ zsytrs
subroutine zsytrs (character UPLO, integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( ldb, * ) B, integer LDB, integer INFO)
ZSYTRS ๐
๐ซ Purpose
ZSYTRS solves a system of linear equations A*X = B with a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZSYTRF. โจ
๐ 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**T;= 'L': Lower triangular, form isA = L*D*L**T.
NโN is INTEGER, the order of the matrixA.N >= 0.NRHSNRHSโ it's anINTEGER, bestie. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0. ๐Aโ aCOMPLEX*16array, dimension(LDA,N). It's the block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF. โจLDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). Periodt. ๐IPIVโINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSYTRF. ๐ซถBโCOMPLEX*16array, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. It literally transforms, main character energy. ๐LDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). No cap. ๐งINFOโINTEGER.= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value. So if it's negative, check your args, bestie. ๐ญ
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zsytrs2 (character UPLO, integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension( * ) WORK, integer INFO)
subroutine zsytrs2 (character UPLO, integer N, integer NRHS, complex*16,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension( *
) WORK, integer INFO)
ZSYTRS2
Purpose
ZSYTRS2 solves a system of linear equations A*X = B with a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZSYTRF and converted by ZSYCONV. Slay. ๐
Parameters
UPLOโ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**T;= 'L': Lower triangular, form isA = L*D*L**T. Pick your fighter. โจNโINTEGER. The order of the matrixA.N >= 0. ๐NRHSโINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0. ๐ซถAโCOMPLEX*16array, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF. Note thatAis input / output. This might be counter-intuitive, and one may think thatAis input only.Ais input / output. This is because, at the start of the subroutine, we permuteAin a 'better' form and then we permuteAback to its original form at the end. So don't freak out, bestie, it's giving transformation. ๐ฅLDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). ๐IPIVโINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSYTRF. ๐ธBโCOMPLEX*16array, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. Glow-up. ๐LDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). ๐งWORKโCOMPLEX*16array, dimension(N). Just vibes. ๐INFOโ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 zsytrs_3 (character UPLO, integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E, integer, dimension( * ) IPIV, complex*16, dimension( ldb, * ) B, integer LDB, integer INFO)
subroutine zsytrs_3 (character UPLO, integer N, integer NRHS, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) E,
integer, dimension( * ) IPIV, complex*16, dimension( ldb, * ) B, integer
LDB, integer INFO)
ZSYTRS_3
Purpose
ZSYTRS_3 solves a system of linear equations A * X = B with a complex symmetric matrix A using the factorization computed by ZSYTRF_RK or ZSYTRF_BK:
A = P*U*D*(U**T)*(P**T) or A = P*L*D*(L**T)*(P**T),
where U (or L) is unit upper (or lower) triangular matrix, U**T (or L**T) is the transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks. This algorithm is using Level 3 BLAS. Highkey iconic. โจ
Parameters
UPLOโ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**T)*(P**T);= 'L': Lower triangular, form isA = P*L*D*(L**T)*(P**T). ๐NโINTEGER. The order of the matrixA.N >= 0. ๐NRHSโINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0. ๐ซถAโCOMPLEX*16array, dimension(LDA,N). Diagonal of the block diagonal matrixDand factorsUorLas computed byZSYTRF_RKandZSYTRF_BK:- a) ONLY diagonal elements of the symmetric block diagonal matrix
Don the diagonal ofA, i.e.D(k,k) = A(k,k); (superdiagonal (or subdiagonal) elements ofDshould be provided on entry in arrayE), and - b) If
UPLO = 'U': factorUin the superdiagonal part ofA. IfUPLO = 'L': factorLin the subdiagonal part ofA. So specific. ๐
- a) ONLY diagonal elements of the symmetric block diagonal matrix
LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). ๐EโCOMPLEX*16array, dimension(N). On entry, contains the superdiagonal (or subdiagonal) elements of the symmetric 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)not referenced; IfUPLO = '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. So don't come forE(k)in that case, it's not invited. ๐
IPIVโINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSYTRF_RKorZSYTRF_BK. ๐ธBโCOMPLEX*16array, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. ๐LDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). ๐งINFOโ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 zsytrs_aa (character UPLO, integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
subroutine zsytrs_aa (character UPLO, integer N, integer NRHS, complex*16,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension( *
) WORK, integer LWORK, integer INFO)
ZSYTRS_AA
Purpose
ZSYTRS_AA solves a system of linear equations A*X = B with a complex symmetric matrix A using the factorization A = U**T*T*U or A = L*T*L**T computed by ZSYTRF_AA. We love a specialized solver. ๐
Parameters
UPLOโCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U**T*T*U;= 'L': Lower triangular, form isA = L*T*L**T. โจNโINTEGER. The order of the matrixA.N >= 0. ๐NRHSโINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0. ๐ซถAโCOMPLEX*16array, dimension(LDA,N). Details of factors computed byZSYTRF_AA. ๐LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). ๐ธIPIVโINTEGERarray, dimension(N). Details of the interchanges as computed byZSYTRF_AA. ๐งBโCOMPLEX*16array, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. ๐LDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). ๐WORKโCOMPLEX*16array, dimension(MAX(1,LWORK)). ๐ฅLWORKโINTEGER. The dimension of the arrayWORK.LWORK >= max(1,3*N-2). Don't skimp. ๐ญINFOโ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 zsytrs_aa_2stage (character UPLO, integer N, integer NRHS, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) TB, integer LTB, integer, dimension( * ) IPIV, integer, dimension( * ) IPIV2, complex*16, dimension( ldb, * ) B, integer LDB, integer INFO)
subroutine zsytrs_aa_2stage (character UPLO, integer N, integer NRHS,
complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( *
) TB, integer LTB, integer, dimension( * ) IPIV, integer, dimension( * )
IPIV2, complex*16, dimension( ldb, * ) B, integer LDB, integer INFO)
ZSYTRS_AA_2STAGE
Purpose
ZSYTRS_AA_2STAGE solves a system of linear equations A*X = B with a complex symmetric matrix A using the factorization A = U**T*T*U or A = L*T*L**T computed by ZSYTRF_AA_2STAGE. Two-stage? We love an upgrade. ๐
Parameters
UPLOโCHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.= 'U': Upper triangular, form isA = U**T*T*U;= 'L': Lower triangular, form isA = L*T*L**T. โจNโINTEGER. The order of the matrixA.N >= 0. ๐NRHSโNRHSโ bestie,NRHSisINTEGER, and it's literally the number of right hand sides, aka the number of columns of the matrixB. So like,NRHS >= 0, no negative vibes allowed. ๐AโAis aCOMPLEX*16array, dimension(LDA,N). It's giving details of factors computed byZSYTRF_AA_2STAGE. โจLDAโLDAisINTEGER. It's the leading dimension of the arrayA. You gotta haveLDA >= max(1,N), okay? ๐TBโTBis aCOMPLEX*16array, dimension(LTB). More details of factors computed byZSYTRF_AA_2STAGE. ๐ซถLTBโLTBisINTEGER. It's the size of the arrayTB. And it's givingLTB >= 4*N. No cap. ๐ฏIPIVโIPIVis anINTEGERarray, dimension(N). Details of the interchanges as computed byZSYTRF_AA_2STAGE. ๐IPIV2โIPIV2is anINTEGERarray, dimension(N). Also details of the interchanges as computed byZSYTRF_AA_2STAGE. Like, twin energy. ๐ฏBโBis aCOMPLEX*16array, dimension(LDB,NRHS). On entry, it's the right hand side matrixB. On exit, it's the solution matrixX. So it literally transforms. Main character energy. ๐ฆLDBโLDBisINTEGER. The leading dimension of the arrayB. You needLDB >= max(1,N). Periodt. ๐INFOโINFOisINTEGER.= 0: successful exit, we love to see it.< 0: ifINFO = -i, the i-th argument had an illegal value. So like, something went wrong. ๐ญ
Author:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zsytrs_rook
subroutine zsytrs_rook (character UPLO, integer N, integer NRHS, complex*16,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
complex*16, dimension( ldb, * ) B, integer LDB, integer INFO)
ZSYTRS_ROOK
Purpose:
ZSYTRS_ROOK solves a system of linear equations A*X = B with a complex symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by ZSYTRF_ROOK. So like, it's solving the whole thing for you. Slay. โจ
Parameters:
UPLOโUPLOisCHARACTER*1. It 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 matrixA.N >= 0. No negative orders, bestie.NRHSโNRHSisINTEGER. The number of right hand sides, i.e., the number of columns of the matrixB.NRHS >= 0.AโAis aCOMPLEX*16array, dimension(LDA,N). It's the block diagonal matrixDand the multipliers used to obtain the factorUorLas computed byZSYTRF_ROOK. So it's carrying all the tea. โLDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N). Don't forget.IPIVโIPIVis anINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined byZSYTRF_ROOK. ๐BโBis aCOMPLEX*16array, dimension(LDB,NRHS). On entry, the right hand side matrixB. On exit, the solution matrixX. Glow up. ๐LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). Period.INFOโINFOisINTEGER.= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value. So check your args, bestie. ๐ญ
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 ztgsyl
subroutine ztgsyl (character TRANS, integer IJOB, integer M, integer N,
complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension(
ldb, * ) B, integer LDB, complex*16, dimension( ldc, * ) C, integer LDC,
complex*16, dimension( ldd, * ) D, integer LDD, complex*16, dimension(
lde, * ) E, integer LDE, complex*16, dimension( ldf, * ) F, integer LDF,
double precision SCALE, double precision DIF, complex*16, dimension( * )
WORK, integer LWORK, integer, dimension( * ) IWORK, integer INFO)
ZTGSYL
Purpose:
okay so ZTGSYL solves the generalized Sylvester equation:
A * R - L * B = scale * C (1)
D * R - L * E = scale * F
where R and L are unknown m-by-n matrices, (A, D), (B, E) and (C, F) are given matrix pairs of size m-by-m, n-by-n and m-by-n, respectively, with complex entries. A, B, D and E are upper triangular (i.e., (A,D) and (B,E) in generalized Schur form).
The solution (R, L) overwrites (C, F). 0 <= SCALE <= 1 is an output scaling factor chosen to avoid overflow. No cap.
In matrix notation (1) is equivalent to solve Zx = scale*b, where Z is defined as
Z = [ kron(In, A) -kron(B**H, Im) ] (2)
[ kron(In, D) -kron(E**H, Im) ],
Here Ix is the identity matrix of size x and X**H is the conjugate transpose of X. Kron(X, Y) is the Kronecker product between the matrices X and Y. It's giving math. ๐งฎ
If TRANS = 'C', y in the conjugate transposed system Z**H *y = scale*b is solved for, which is equivalent to solve for R and L in
A**H * R + D**H * L = scale * C (3)
R * B**H + L * E**H = scale * -F
This case (TRANS = 'C') is used to compute an one-norm-based estimate of Dif[(A,D), (B,E)], the separation between the matrix pairs (A,D) and (B,E), using ZLACON.
If IJOB >= 1, ZTGSYL computes a Frobenius norm-based estimate of Dif[(A,D),(B,E)]. That is, the reciprocal of a lower bound on the reciprocal of the smallest singular value of Z.
This is a level-3 BLAS algorithm. Slay. ๐ฅ
Parameters:
TRANSโTRANSisCHARACTER*1.= 'N': solve the generalized sylvester equation (1).= 'C': solve the 'conjugate transposed' system (3).
IJOBโIJOBisINTEGER. Specifies what kind of functionality to be performed.=0: solve (1) only.=1: The functionality of 0 and 3.=2: The functionality of 0 and 4.=3: Only an estimate ofDif[(A,D), (B,E)]is computed. (look ahead strategy is used).=4: Only an estimate ofDif[(A,D), (B,E)]is computed. (ZGECONon sub-systems is used).- Not referenced if
TRANS = 'C'.
MโMisINTEGER. The order of the matricesAandD, and the row dimension of the matricesC,F,RandL.NโNisINTEGER. The order of the matricesBandE, and the column dimension of the matricesC,F,RandL.AโAis aCOMPLEX*16array, dimension(LDA, M). The upper triangular matrixA.LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1, M).BโBis aCOMPLEX*16array, dimension(LDB, N). The upper triangular matrixB.LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1, N).CโCis aCOMPLEX*16array, dimension(LDC, N). On entry,Ccontains the right-hand-side of the first matrix equation in (1) or (3). On exit, ifIJOB = 0, 1 or 2,Chas been overwritten by the solutionR. IfIJOB = 3 or 4andTRANS = 'N',CholdsR, the solution achieved during the computation of the Dif-estimate.LDCโLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1, M).DโDis aCOMPLEX*16array, dimension(LDD, M). The upper triangular matrixD.LDDโLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1, M).EโEis aCOMPLEX*16array, dimension(LDE, N). The upper triangular matrixE.LDEโLDEisINTEGER. The leading dimension of the arrayE.LDE >= max(1, N).FโFis aCOMPLEX*16array, dimension(LDF, N). On entry,Fcontains the right-hand-side of the second matrix equation in (1) or (3). On exit, ifIJOB = 0, 1 or 2,Fhas been overwritten by the solutionL. IfIJOB = 3 or 4andTRANS = 'N',FholdsL, the solution achieved during the computation of the Dif-estimate.LDFโLDFisINTEGER. The leading dimension of the arrayF.LDF >= max(1, M).DIFโDIFisDOUBLE PRECISION. On exitDIFis the reciprocal of a lower bound of the reciprocal of the Dif-function, i.e.DIFis an upper bound ofDif[(A,D), (B,E)] = sigma-min(Z), whereZas in (2). IFIJOB = 0orTRANS = 'C',DIFis not referenced.SCALEโSCALEisDOUBLE PRECISION. On exitSCALEis the scaling factor in (1) or (3). If0 < SCALE < 1,CandFhold the solutionsRandL, resp., to a slightly perturbed system but the input matricesA,B,DandEhave not been changed. IfSCALE = 0,RandLwill hold the solutions to the homogeneous system withC = F = 0.WORKโWORKis aCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGER. The dimension of the arrayWORK.LWORK > = 1. IfIJOB = 1 or 2andTRANS = 'N',LWORK >= max(1,2*M*N). 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.IWORKโIWORKis anINTEGERarray, dimension(M+N+2).INFOโINFOisINTEGER=0: successful exit, we love that for us ๐<0: IfINFO = -i, the i-th argument had an illegal value. Rude. Someone passed you a bad argument bestie ๐ญ>0:(A, D)and(B, E)have common or very close eigenvalues. They're too close, it's giving codependency ngl ๐
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ซถ Contributors:
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
๐ References:
- B. Kagstrom and P. Poromaa, LAPACK-Style Algorithms and Software for Solving the Generalized Sylvester Equation and Estimating the Separation between Regular Matrix Pairs, Report UMINF - 93.23, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, December 1993, Revised April 1994, Also as LAPACK Working Note 75. To appear in ACM Trans. on Math. Software, Vol 22, No 1, 1996.
- B. Kagstrom, A Perturbation Analysis of the Generalized Sylvester Equation (AR - LB, DR - LE ) = (C, F), SIAM J. Matrix Anal. Appl., 15(4):1045-1060, 1994.
- B. Kagstrom and L. Westin, Generalized Schur Methods with Condition Estimators for Solving the Generalized Sylvester Equation, IEEE Transactions on Automatic Control, Vol. 34, No. 7, July 1989, pp 745-751.
๐ฆ subroutine ztrsyl ๐ฆ
subroutine ztrsyl (character TRANA, character TRANB, integer ISGN, integer
M, integer N, complex*16, dimension( lda, * ) A, integer LDA,
complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension(
ldc, * ) C, integer LDC, double precision SCALE, integer INFO)
ZTRSYL โ say hi to the icon โจ
๐ Purpose:
ZTRSYL solves the complex Sylvester matrix equation:
op(A)*X + X*op(B) = scale*C or
op(A)*X - X*op(B) = scale*C,
where op(A) = A or A**H, and A and B are both upper triangular. A is M-by-M and B is N-by-N; the right hand side C and the solution X are M-by-N; and scale is an output scale factor, set <= 1 to avoid overflow in X. (Yes bestie, overflow is the villain of this story ๐ค)
๐ Parameters ๐
TRANAโTRANAisCHARACTER*1. It picks the optionop(A):= 'N':op(A) = A(No transpose)= 'C':op(A) = A**H(Conjugate transpose)
TRANBโTRANBisCHARACTER*1. It picks the optionop(B):= 'N':op(B) = B(No transpose)= 'C':op(B) = B**H(Conjugate transpose)
ISGNโISGNisINTEGER. It sets the sign in the equation:= +1: solveop(A)*X + X*op(B) = scale*C= -1: solveop(A)*X - X*op(B) = scale*C
MโMisINTEGER. The order of the matrix A, and the number of rows in the matrices X and C.M >= 0.NโNisINTEGER. The order of the matrix B, and the number of columns in the matrices X and C.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,M). The upper triangular matrix A.LDAโLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BโBisCOMPLEX*16array, dimension(LDB,N). The upper triangular matrix B.LDBโLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).CโCisCOMPLEX*16array, dimension(LDC,N). On entry, theM-by-Nright hand side matrix C. On exit, C is overwritten by the solution matrix X. glow up moment ๐LDCโLDCisINTEGER. The leading dimension of the array C.LDC >= max(1,M)SCALEโSCALEisDOUBLE PRECISION. The scale factor,scale, set<= 1to avoid overflow in X.INFOโINFOisINTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value= 1: A and B have common or very close eigenvalues; perturbed values were used to solve the equation (but the matrices A and B are unchanged).
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ฅ subroutine ztrsyl3 ๐ฅ
subroutine ztrsyl3 (character TRANA, character TRANB, integer ISGN, integer
M, integer N, complex*16, dimension( lda, * ) A, integer LDA,
complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension(
ldc, * ) C, integer LDC, double precision SCALE, double precision,
dimension( ldswork, * ) SWORK, integer LDSWORK, integer INFO)
ZTRSYL3 โ the block version, the sequel, the main character returns ๐
๐ Purpose
ZTRSYL3 solves the complex Sylvester matrix equation:
op(A)*X + X*op(B) = scale*C or
op(A)*X - X*op(B) = scale*C,
where op(A) = A or A**H, and A and B are both upper triangular. A is M-by-M and B is N-by-N; the right hand side C and the solution X are M-by-N; and scale is an output scale factor, set <= 1 to avoid overflow in X.
This is the block version of the algorithm. Lowkey iconic ๐ง
๐ Parameters ๐
TRANAโTRANAisCHARACTER*1. It picks the optionop(A):= 'N':op(A) = A(No transpose)= 'C':op(A) = A**H(Conjugate transpose)
TRANBโTRANBisCHARACTER*1. It picks the optionop(B):= 'N':op(B) = B(No transpose)= 'C':op(B) = B**H(Conjugate transpose)
ISGNโISGNisINTEGER. It sets the sign in the equation:= +1: solveop(A)*X + X*op(B) = scale*C= -1: solveop(A)*X - X*op(B) = scale*C
MโMisINTEGER. The order of the matrix A, and the number of rows in the matrices X and C.M >= 0.NโNisINTEGER. The order of the matrix B, and the number of columns in the matrices X and C.N >= 0.AโAisCOMPLEX*16array, dimension(LDA,M). The upper triangular matrix A.LDAโLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BโBisCOMPLEX*16array, dimension(LDB,N). The upper triangular matrix B.LDBโLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).CโCisCOMPLEX*16array, dimension(LDC,N). On entry, theM-by-Nright hand side matrix C. On exit, C is overwritten by the solution matrix X.LDCโLDCisINTEGER. The leading dimension of the array C.LDC >= max(1,M)SCALEโSCALEisDOUBLE PRECISION. The scale factor,scale, set<= 1to avoid overflow in X.SWORKโSWORKisDOUBLE PRECISIONarray, dimension(MAX(2, ROWS), MAX(1,COLS)). On exit, ifINFO = 0,SWORK(1)returns the optimal valueROWSandSWORK(2)returns the optimalCOLS.LDSWORKโLDSWORKisINTEGER.LDSWORK >= MAX(2,ROWS), whereROWS = ((M + NB - 1) / NB + 1)andNBis the optimal block size.
If LDSWORK = -1, then a workspace query is assumed; the routine only calculates the optimal dimensions of the SWORK matrix, returns these values as the first and second entry of the SWORK matrix, and no error message related LWORK is issued by XERBLA. (Yes, it's a sneak peek before the actual work โ reconnaissance era ๐)
INFOโINFOisINTEGER= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value= 1: A and B have common or very close eigenvalues; perturbed values were used to solve the equation (but the matrices A and B are unchanged).
This whole thing was generated automatically by Doxygen for LAPACK from the source code. Not a human typing it out with a strawberry matcha in hand, unfortunately ๐
Version 3.11.0 ยท Sun Nov 27 2022 ยท complex16SYcomputational(3)
And that's a wrap on all 19 parts bestie, you made it to the end, no cap, absolutely ate ๐ โจ๐๐ฆ๐ธ๐ซถ๐๐
๐ฆ 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