realSYcomputational(3)
okay bestie, sit down, hydrate, because we're doing realSYcomputational(3) from the LAPACK fam and it's a LOT π this is part 1 of 15 so buckle up, we're not even close to done. no cap.
β¨ NAME β¨
realSYcomputational β real
π SYNOPSIS π
Functions
subroutine sla_syamv (UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)β SLA_SYAMV computes a matrix-vector product using a symmetric indefinite matrix to calculate error bounds.real function sla_syrcond (UPLO, N, A, LDA, AF, LDAF, IPIV, CMODE, C, INFO, WORK, IWORK)β SLA_SYRCOND estimates the Skeel condition number for a symmetric indefinite matrix.subroutine sla_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)β SLA_SYRFSX_EXTENDED 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.real function sla_syrpvgrw (UPLO, N, INFO, A, LDA, AF, LDAF, IPIV, WORK)β SLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite matrix.subroutine slasyf (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)β SLASYF computes a partial factorization of a real symmetric matrix using the Bunch-Kaufman diagonal pivoting method.subroutine slasyf_aa (UPLO, J1, M, NB, A, LDA, IPIV, H, LDH, WORK)β SLASYF_AAsubroutine slasyf_rook (UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO)β SLASYF_ROOK computes a partial factorization of a real symmetric matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method.subroutine ssycon (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, IWORK, INFO)β SSYCONsubroutine ssycon_rook (UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, IWORK, INFO)β SSYCON_ROOKsubroutine ssyconv (UPLO, WAY, N, A, LDA, IPIV, E, INFO)β SSYCONVsubroutine ssyequb (UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO)β SSYEQUBsubroutine ssygs2 (ITYPE, UPLO, N, A, LDA, B, LDB, INFO)β SSYGS2 reduces a symmetric definite generalized eigenproblem to standard form, using the factorization results obtained from spotrf (unblocked algorithm).subroutine ssygst (ITYPE, UPLO, N, A, LDA, B, LDB, INFO)β SSYGSTsubroutine ssyrfs (UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, LDB, X, LDX, FERR, BERR, WORK, IWORK, INFO)β SSYRFSsubroutine ssyrfsx (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, IWORK, INFO)β SSYRFSXsubroutine ssytd2 (UPLO, N, A, LDA, D, E, TAU, INFO)β SSYTD2 reduces a symmetric matrix to real symmetric tridiagonal form by an orthogonal similarity transformation (unblocked algorithm).subroutine ssytf2 (UPLO, N, A, LDA, IPIV, INFO)β SSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm).subroutine ssytf2_rook (UPLO, N, A, LDA, IPIV, INFO)β SSYTF2_ROOK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm).subroutine ssytrd (UPLO, N, A, LDA, D, E, TAU, WORK, LWORK, INFO)β SSYTRDsubroutine ssytrd_2stage (VECT, UPLO, N, A, LDA, D, E, TAU, HOUS2, LHOUS2, WORK, LWORK, INFO)β SSYTRD_2STAGEsubroutine ssytrd_sy2sb (UPLO, N, KD, A, LDA, AB, LDAB, TAU, WORK, LWORK, INFO)β SSYTRD_SY2SBsubroutine ssytrf (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β SSYTRFsubroutine ssytrf_aa (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β SSYTRF_AAsubroutine ssytrf_aa_2stage (UPLO, N, A, LDA, TB, LTB, IPIV, IPIV2, WORK, LWORK, INFO)β SSYTRF_AA_2STAGEsubroutine ssytrf_rook (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β SSYTRF_ROOKsubroutine ssytri (UPLO, N, A, LDA, IPIV, WORK, INFO)β SSYTRIsubroutine ssytri2 (UPLO, N, A, LDA, IPIV, WORK, LWORK, INFO)β SSYTRI2subroutine ssytri2x (UPLO, N, A, LDA, IPIV, WORK, NB, INFO)β SSYTRI2Xsubroutine ssytri_rook (UPLO, N, A, LDA, IPIV, WORK, INFO)β SSYTRI_ROOKsubroutine ssytrs (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)β SSYTRSsubroutine ssytrs2 (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, INFO)β SSYTRS2subroutine ssytrs_aa (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO)β SSYTRS_AAsubroutine ssytrs_aa_2stage (UPLO, N, NRHS, A, LDA, TB, LTB, IPIV, IPIV2, B, LDB, INFO)β SSYTRS_AA_2STAGEsubroutine ssytrs_rook (UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)β SSYTRS_ROOKsubroutine stgsyl (TRANS, IJOB, M, N, A, LDA, B, LDB, C, LDC, D, LDD, E, LDE, F, LDF, SCALE, DIF, WORK, LWORK, IWORK, INFO)β STGSYLsubroutine strsyl (TRANA, TRANB, ISGN, M, N, A, LDA, B, LDB, C, LDC, SCALE, INFO)β STRSYL
π Detailed Description π
This is the group of real computational functions for SY matrices. that's the whole vibe. that's the assignment. π«Ά
π₯ Function Documentation π₯
π subroutine sla_syamv π
subroutine sla_syamv (integer UPLO, integer N, real ALPHA, real, dimension( lda, * ) A, integer LDA, real, dimension( * ) X, integer INCX, real BETA, real, dimension( * ) Y, integer INCY)
SLA_SYAMV computes a matrix-vector product using a symmetric indefinite matrix to calculate error bounds. error bounds girlie π
Purpose:
SLA_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.
okay so this one is primarily used in calculating error bounds. and here's the tea β to protect against underflow during evaluation, components in the resulting vector are perturbed away from zero by (N+1) times the underflow threshold. but 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. iykyk π§
Parameters
UPLOβUPLOisINTEGER. On entry,UPLOspecifies whether the upper or lower triangular part of the arrayAis to be referenced as follows:UPLO = BLAS_UPPERβ Only the upper triangular part ofAis to be referenced.UPLO = BLAS_LOWERβ Only the lower triangular part ofAis to be referenced.
Unchanged on exit.
NβNisINTEGER. On entry,Nspecifies the number of columns of the matrixA.Nmust be at least zero. Unchanged on exit.ALPHAβALPHAisREAL. On entry,ALPHAspecifies the scalaralpha. Unchanged on exit.AβAisREALarray, dimension( LDA, n ). Before entry, the leadingmbynpart of the arrayAmust contain the matrix of coefficients. Unchanged on exit.LDAβLDAisINTEGER. On entry,LDAspecifies the first dimension ofAas declared in the calling (sub) program.LDAmust be at leastmax( 1, n ). Unchanged on exit.XβXisREALarray, dimension( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremented arrayXmust contain the vectorx. Unchanged on exit.INCXβINCXisINTEGER. On entry,INCXspecifies the increment for the elements ofX.INCXmust not be zero. Unchanged on exit.BETAβBETAisREAL. On entry,BETAspecifies the scalarbeta. WhenBETAis supplied as zero thenYneed not be set on input. Unchanged on exit.YβYisREALarray, dimension( 1 + ( n - 1 )*abs( INCY ) ). Before entry withBETAnon-zero, the incremented arrayYmust contain the vectory. On exit,Yis overwritten by the updated vectory.INCYβINCYisINTEGER. 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
π real function sla_syrcond π
real function sla_syrcond (character UPLO, integer N, real, dimension( lda, * ) A, integer LDA, real, dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV, integer CMODE, real, dimension( * ) C, integer INFO, real, dimension( * ) WORK, integer, dimension( * ) IWORK)
SLA_SYRCOND estimates the Skeel condition number for a symmetric indefinite matrix. she's fancy, she's measuring things, we love her π
Purpose:
SLA_SYRCOND estimates the Skeel condition number of op(A) * op2(C)
where op2 is determined by CMODE as follows
CMODE = 1 op2(C) = C
CMODE = 0 op2(C) = I
CMODE = -1 op2(C) = inv(C)
The Skeel condition number cond(A) = norminf( |inv(A)||A| )
is computed by computing scaling factors R such that
diag(R)*A*op2(C) is row equilibrated and computing the standard
infinity-norm condition number.
so basically: she's out here computing scaling factors R so that diag(R)*A*op2(C) is row equilibrated, then she computes the standard infinity-norm condition number. periodt. β¨
Parameters
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The number of linear equations, i.e., the order of the matrixA.N >= 0.AβAisREALarray, dimension(LDA,N). On entry, theN-by-NmatrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβAFisREALarray, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF.LDAFLDAFβ INTEGER</p>, bestie, and it's the leading dimension of the arrayAF. Rules are rules:LDAF >= max(1,N). πIPIVβINTEGERarray, dimension(N). It's holding all the deets about the interchanges and the block structure ofD, exactly asSSYTRFfigured them out. β¨CMODEβINTEGER. This one decides whatop2(C)is in the formulaop(A) * op2(C), and the vibes are:
CMODE = 1 op2(C) = C
CMODE = 0 op2(C) = I
CMODE = -1 op2(C) = inv(C)
CβREALarray, dimension(N). It's literally the vectorCin the formulaop(A) * op2(C). πINFOβINTEGER, the little status report we all wait for:
= 0: Successful exit.
i > 0: The ith argument is invalid.
WORKβREALarray, dimension(3*N). Workspace. It's giving "background character but essential". π«ΆIWORKβINTEGERarray, dimension(N). Also workspace. Respect the grind. β¨
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ subroutine sla_syrfsx_extended
Okay bestie, deep breath, because this signature is a lot. Here it is, character for character, no notes:
subroutine sla_syrfsx_extended (integer PREC_TYPE, character UPLO, integer
N, integer NRHS, real, dimension( lda, * ) A, integer LDA, real,
dimension( ldaf, * ) AF, integer LDAF, integer, dimension( * ) IPIV,
logical COLEQU, real, dimension( * ) C, real, dimension( ldb, * ) B,
integer LDB, real, dimension( ldy, * ) Y, integer LDY, real, dimension(
* ) BERR_OUT, integer N_NORMS, real, dimension( nrhs, * ) ERR_BNDS_NORM,
real, dimension( nrhs, * ) ERR_BNDS_COMP, real, dimension( * ) RES,
real, dimension( * ) AYB, real, dimension( * ) DY, real, dimension( * )
Y_TAIL, real RCOND, integer ITHRESH, real RTHRESH, real DZ_UB, logical
IGNORE_CWISE, integer INFO)
SLA_SYRFSX_EXTENDED 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. π€ Iconic behaviour, honestly.
β¨ Purpose β¨
SLA_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 SSYRFSX 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. That's the whole assignment, bestie, don't do extra. π―
πΈ Parameters πΈ
PREC_TYPEβINTEGER. Says which intermediate precision we're using in refinement. The value comes fromILAPREC(P)wherePis aCHARACTER, and:
P = 'S': Single
= 'D': Double
= 'I': Indigenous
= 'X' or 'E': Extra
UPLOβCHARACTER*1, and it's a pick-your-triangle moment:
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
NβINTEGER. The number of linear equations, aka the order of the matrixA. AndN >= 0, obviously. πNRHSβINTEGER. The number of right-hand-sides, i.e. the number of columns of the matrixB. So many sides, so little time. πAβREALarray, dimension(LDA,N). On entry, theN-by-NmatrixA. It's the main character. πLDAβINTEGER. Leading dimension of the arrayA.LDA >= max(1,N). πAFβREALarray, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF. It did its lil factorization arc and now it's here. β¨LDAFβINTEGER. Leading dimension of the arrayAF.LDAF >= max(1,N). Periodt.IPIVβINTEGERarray, dimension(N). All the deets on the interchanges and the block structure ofD, as determined bySSYTRF. π«ΆCOLEQUβLOGICAL. If.TRUE.then column equilibration was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly. So don't be sloppy with it. πCβREALarray, dimension(N). The column scale factors forA. IfCOLEQU = .FALSE.,Cis not accessed. IfCis input, each element ofCshould be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable. Okay so that's a whole warning, noted and respected. β οΈBβREALarray, dimension(LDB,NRHS). The right-hand-side matrixB. Slay. πLDBβINTEGER. Leading dimension of the arrayB.LDB >= max(1,N). β¨YβREALarray, dimension(LDY,NRHS). On entry, the solution matrixX, as computed bySSYTRS. On exit, the improved solution matrixY. Glow-up arc, literally. π¦LDYβINTEGER. Leading dimension of the arrayY.LDY >= max(1,N). πBERR_OUTβREALarray, dimension(NRHS). On exit,BERR_OUT(j)contains the componentwise relative backward error for right-hand-sidejfrom 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 SLA_LIN_BERR. Give credit where it's due. π
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. More norms, more knowledge. πERR_BNDS_NORMβREALarray, 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 threshold
sqrt(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 threshold
sqrt(n) * slamch('Epsilon'). This error bound should only
be trusted if the previous boolean is true.
err = 3 Reciprocal condition number: Estimated normwise
reciprocal condition number. Compared with the threshold
sqrt(n) * slamch('Epsilon') to determine if the error
estimate is 'guaranteed'. These reciprocal condition
numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some
appropriately scaled matrix Z.
Let Z = S*A, where S scales each row by a power of the
radix so all absolute row sums of Z are approximately 1.
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βREALarray, 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 threshold
sqrt(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 threshold
sqrt(n) * slamch('Epsilon'). This error bound should only
be trusted if the previous boolean is true.
err = 3 Reciprocal condition number: Estimated componentwise
reciprocal condition number. Compared with the threshold
sqrt(n) * slamch('Epsilon') to determine if the error
estimate is 'guaranteed'. These reciprocal condition
numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some
appropriately scaled matrix Z.
Let Z = S*(A*diag(x)), where x is the solution for the
current right-hand side and S scales each row of
A*diag(x) by a power of the radix so all absolute row
sums of Z are approximately 1.
okay so this next bit is the tail end of the SLA_SYRFSX_EXTENDED parameter squad β keep scrolling bestie, we're almost at the next function π
This subroutine is only responsible for setting the second field above. See Lapack Working Note 165 for further details and extra cautions. π
RESβREALarray, dimension(N). It's the workspace that holds the intermediate residual. π«§AYBβREALarray, dimension(N). Workspace! And here's the tea: this can literally be the same workspace you passed forY_TAIL. Reuse queen β»οΈDYβREALarray, dimension(N). Workspace to hold the intermediate solution.Y_TAILβREALarray, dimension(N). Workspace to hold the trailing bits of the intermediate solution. It's giving leftovers but make it fashion πRCONDβREAL. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if that even happened). If this is less than the machine precision β and yes, especially if it's straight-up zero β the matrix is singular to working precision. BUT note this: the error may still be small even if this number is very small and the matrix appears ill-conditioned. Plot twist πITHRESHβINTEGER. The maximum number of residual computations allowed for refinement. The default is10. For'aggressive'set it to100to permit convergence using approximate factorizations or factorizations other than LU. Heads up though: if the factorization uses a technique other than Gaussian elimination, the guarantees inERR_BNDS_NORMandERR_BNDS_COMPmay no longer be trustworthy. no cap β οΈRTHRESHβREAL. Determines when to stop refinement if the error estimate stops decreasing. Refinement will stop when the next solution no longer satisfiesnorm(dx_{i+1}) < RTHRESH * norm(dx_i)wherenorm(Z)is the infinity norm ofZ. AndRTHRESHsatisfies0 < RTHRESH <= 1. The default value is0.5. For'aggressive'set it to0.9to permit convergence on extremely ill-conditioned matrices. See LAWN 165 for more details πDZ_UBβREAL. Determines when to start considering componentwise convergence. Componentwise convergence is only considered after each component of the solutionYis stable, and "stable" here means the relative change in each component is less thanDZ_UB. The default value is0.25, which requires the first bit to be stable. See LAWN 165 for more details π¦IGNORE_CWISEβLOGICAL. If.TRUE.then ignore componentwise convergence. Default value is.FALSE.. She's a simple girl, she doesn't want the extra math πINFOβINTEGER.= 0: Successful exit. π< 0: ifINFO = -i, the ith argument toSLA_SYRFSX_EXTENDEDhad an illegal value π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π sla_syrpvgrw π
real function sla_syrpvgrw (character*1 UPLO, integer N, integer INFO, real,
dimension( lda, * ) A, integer LDA, real, dimension( ldaf, * ) AF,
integer LDAF, integer, dimension( * ) IPIV, real, dimension( * ) WORK)
SLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite matrix.
Purpose:
SLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U). The 'max absolute element' norm is the one being used here. And if this comes out much less than 1, the stability of the LU factorization of the (equilibrated) matrix A could be poor. Which also means the solution X, the estimated condition numbers, and the error bounds could all be unreliable. Red flag, 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 fromSSYTRF,.i.e., the pivot in columnINFOis exactly0. (Not me leaving that punctuation exactly how I found it β)AβREALarray, dimension(LDA,N). On entry, theN-by-NmatrixA.LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβREALarray, dimension(LDAF,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF.LDAFβINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβINTEGERarray, dimension(N). Details of the interchanges and the block structure ofDas determined bySSYTRF.WORKβREALarray, dimension(2*N).
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π§ slasyf π§
subroutine slasyf (character UPLO, integer N, integer NB, integer KB, real,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real,
dimension( ldw, * ) W, integer LDW, integer INFO)
SLASYF computes a partial factorization of a real symmetric matrix using the Bunch-Kaufman diagonal pivoting method.
Purpose:
SLASYF computes a partial factorization of a real 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.
SLASYF is an auxiliary routine called by SSYTRF. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L'). Blocked code is the moment, honestly π₯
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βREALarray, 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βINTEGERarray, 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.
- Only the last
- If
UPLO = 'L':- Only the first
KBelements ofIPIVare set. - If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a 1-by-1 diagonal block. - If
IPIV(k) = 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.
- Only the first
- If
WβREALarray, 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 π«Ά
π slasyf_aa π
subroutine slasyf_aa (character UPLO, integer J1, integer M, integer NB,
real, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV,
real, dimension( ldh, * ) H, integer LDH, real, dimension( * ) WORK)
SLASYF_AA
Purpose:
DLATRF_AA factorizes a panel of a real 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. (yes, it says DLATRF_AA in there β that's what the page says, and I am not touching it π
)
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. Girl is borrowing from the panel before her, it's giving hand-me-downs but make it linear algebra π
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. Overwrite core β¨
Parameters
UPLOβCHARACTER*1.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
J1J1isINTEGERβ bestie, this is the location of the first row (or column) of the panel inside the submatrix ofAthat gets passed to this routine. Like, whenSSYTRF_AAcalls it, for the first panelJ1is1, while for the remaining panelsJ1is2. iykyk πMisINTEGERβ the dimension of the submatrix.M >= 0. periodt.NBisINTEGERβ the dimension of the panel to be facotorized. (their spelling, not mine π«Ά)AisREALarray, dimension(LDA,M)for the first panel, while dimension(LDA,M+1)for the remaining panels.
On entry, A contains the last row, or column, of the previous panel, and the trailing submatrix of A to be factorized, except for the first panel, only the panel is passed.
On exit, the leading panel is factorized.
LDAisINTEGERβ the leading dimension of the arrayA.LDA >= max(1,M).IPIVisINTEGERarray, dimension(M)β details of the row and column interchanges, the row and columnkwere interchanged with the row and columnIPIV(k).HisREALworkspace, dimension(LDH,NB).LDHisINTEGERβ the leading dimension of the workspaceH.LDH >= max(1,M).WORKisREALworkspace, dimension(M).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine slasyf_rook (character UPLO, integer N, integer NB, integer KB, real, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real, dimension( ldw, * ) W, integer LDW, integer INFO)
SLASYF_ROOK computes a partial factorization of a real symmetric matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method.
Purpose:
SLASYF_ROOK computes a partial factorization of a real 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.
SLASYF_ROOK is an auxiliary routine called by SSYTRF_ROOK. It uses blocked code (calling Level 3 BLAS) to update the submatrix A11 (if UPLO = 'U') or A22 (if UPLO = 'L').
Parameters:
UPLOisCHARACTER*1β Specifies whether the upper or lower triangular part of the symmetric matrixAis stored:= 'U': Upper triangular= 'L': Lower triangular
NisINTEGERβ The order of the matrixA.N >= 0.NBisINTEGERβ The maximum number of columns of the matrixAthat should be factored.NBshould be at least2to allow for 2-by-2 pivot blocks.KBisINTEGERβ The number of columns ofAthat were actually factored.KBis eitherNB-1orNB, orNifN <= NB.AisREALarray, 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.LDAisINTEGERβ The leading dimension of the arrayA.LDA >= max(1,N).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.
WisREALarray, dimension(LDW,NB).LDWisINTEGERβ The leading dimension of the arrayW.LDW >= max(1,N).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 ssycon (character UPLO, integer N, real, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real ANORM, real RCOND, real, dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
SSYCON
Purpose:
SSYCON estimates the reciprocal of the condition number (in the 1-norm) of a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by SSYTRF.
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:
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.
NisINTEGERβ The order of the matrixA.N >= 0.AisREALarray, dimension(LDA,N)β The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF.LDAisINTEGERβ The leading dimension of the arrayA.LDA >= max(1,N).IPIVisINTEGERarray, dimension(N)β Details of the interchanges and the block structure ofDas determined bySSYTRF.ANORMisREALβ The 1-norm of the original matrixA.RCONDisREALβ The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine.WORKisREALarray, dimension(2*N).IWORKisINTEGERarray, dimension(N).INFOisINTEGERβ= 0: successful exit.< 0: ifINFO = -i, thei-th argument had an illegal value.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine ssycon_rook (character UPLO, integer N, real, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real ANORM, real RCOND, real, dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
SSYCON_ROOK
Purpose:
SSYCON_ROOK estimates the reciprocal of the condition number (in the 1-norm) of a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by SSYTRF_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:
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.
NisINTEGERβ The order of the matrixA.N >= 0.AisREALarray, dimension(LDA,N)β The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF_ROOK.LDAisINTEGERβ The leading dimension of the arrayA.LDA >= max(1,N).IPIVisINTEGERarray, dimension(N)β Details of the interchanges and the block structure ofDas determined bySSYTRF_ROOK.ANORMisREALβ The 1-norm of the original matrixA.RCONDisREALβ The reciprocal of the condition number of the matrixA, computed asRCOND = 1/(ANORM * AINVNM), whereAINVNMis an estimate of the 1-norm ofinv(A)computed in this routine.WORKisREALarray, dimension(2*N).IWORKisINTEGERarray, dimension(N).INFOisINTEGERβ= 0: successful exit.< 0: ifINFO = -i, thei-th argument had an illegal value.
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
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 ssyconv π«Ά
subroutine ssyconv (character UPLO, character WAY, integer N, real,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real,
dimension( * ) E, integer INFO)
SSYCONV
Purpose:
SSYCONV convert A given by TRF into L and D and vice-versa. Get Non-diag elements of D (returned in workspace) and apply or reverse permutation done in TRF.
So basically: you already ran TRF and got a factorization, and now you need it to hop between the L-and-D form and back, bestie. It grabs the off-diagonal bits of D (they get handed back to you in the workspace), and it either applies or undoes the permutation that TRF did. β¨
Parameters
UPLOβCHARACTER*1. Tells you 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βCHARACTER*1.= 'C': Convert;= 'R': Revert. That's it, that's the whole direction situation. πNβINTEGER. The order of the matrixA.N >= 0.AβREALarray, dimension(LDA,N). It's the block diagonal matrixDand the multipliers used to obtain the factorUorL, exactly as computed bySSYTRF. Iconic little package deal.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 bySSYTRF.EβREALarray, dimension(N).Estores the supdiagonal/subdiagonal of the symmetric 1-by-1 or 2-by-2 block diagonal matrixDin LDLT.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 ssyequb π¦
subroutine ssyequb (character UPLO, integer N, real, dimension( lda, * ) A,
integer LDA, real, dimension( * ) S, real SCOND, real AMAX, real,
dimension( * ) WORK, integer INFO)
SSYEQUB
Purpose:
SSYEQUB 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.
tl;dr it's the glow-up routine for your matrix π₯ β it finds row/column scalings that balance a symmetric matrix out (Euclidean-norm style) and calm its condition number down. The scale factorsScome from the BIN algorithm (peep the references below), and the scaled matrixBlands with elementsB(i,j) = S(i)*A(i,j)*S(j), whose condition number is within a factorNof the smallest possible one across all diagonal scalings. Fr fr, that's the guarantee.
Parameters
UPLOβCHARACTER*1.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.NβINTEGER. The order of the matrixA.N >= 0.AβREALarray, dimension(LDA,N). The N-by-N symmetric matrix whose scaling factors are to be computed.LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).SβREALarray, dimension(N). IfINFO = 0,Scontains the scale factors forA.SCONDβREAL. 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βREAL. Largest absolute value of any matrix element. IfAMAXis very close to overflow or very close to underflow, the matrix should be scaled.WORKβREALarray, dimension(2*N).INFOβINTEGER.= 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 ssygs2 πΈ
subroutine ssygs2 (integer ITYPE, character UPLO, integer N, real,
dimension( lda, * ) A, integer LDA, real, dimension( ldb, * ) B, integer
LDB, integer INFO)
SSYGS2 reduces a symmetric definite generalized eigenproblem to standard form, using the factorization results obtained from spotrf (unblocked algorithm).
Unblocked algorithm β meaning no blocking, no fancy tricks, just the straightforward path. Respect it. π
Purpose:
SSYGS2 reduces a real symmetric-definite generalized eigenproblem to standard form.
If ITYPE = 1, the problem is A*x = lambda*B*x, and A is overwritten by inv(U**T)*A*inv(U) or inv(L)*A*inv(L**T)
If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or B*A*x = lambda*x, and A is overwritten by U*A*U**T or L**T *A*L.
B must have been previously factorized as U**T *U or L*L**T by SPOTRF.
Parameters
ITYPEβINTEGER.= 1: computeinv(U**T)*A*inv(U)orinv(L)*A*inv(L**T);= 2or3: computeU*A*U**TorL**T *A*L.UPLOβCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrixAis stored, and howBhas been factorized.= 'U': Upper triangular;= 'L': Lower triangular.NβINTEGER. The order of the matricesAandB.N >= 0.AβREALarray, 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, ifINFO = 0, the transformed matrix, stored in the same format asA.LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).BβREALarray, dimension(LDB,N). The triangular factor from the Cholesky factorization ofB, as returned bySPOTRF.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.
π§ subroutine ssygst π§
subroutine ssygst (integer ITYPE, character UPLO, integer N, real,
dimension( lda, * ) A, integer LDA, real, dimension( ldb, * ) B, integer
LDB, integer INFO)
SSYGST
Purpose:
SSYGST reduces a real symmetric-definite generalized eigenproblem to standard form.
If ITYPE = 1, the problem is A*x = lambda*B*x, and A is overwritten by inv(U**T)*A*inv(U) or inv(L)*A*inv(L**T)
If ITYPE = 2 or 3, the problem is A*B*x = lambda*x or B*A*x = lambda*x, and A is overwritten by U*A*U**T or L**T*A*L.
B must have been previously factorized as U**T*U or L*L**T by SPOTRF.
Sibling energy with SSYGS2, except this one is the blocked version. Same goal, more efficient execution. π
Parameters
ITYPEβINTEGER.= 1: computeinv(U**T)*A*inv(U)orinv(L)*A*inv(L**T);= 2or3: computeU*A*U**TorL**T*A*L.UPLOβCHARACTER*1.= 'U': Upper triangle ofAis stored andBis factored asU**T*U;= 'L': Lower triangle ofAis stored andBis factored asL*L**T.NβINTEGER. The order of the matricesAandB.N >= 0.AβREALarray, 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, ifINFO = 0, the transformed matrix, stored in the same format asA.LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).BβREALarray, dimension(LDB,N). The triangular factor from the Cholesky factorization ofB, as returned bySPOTRF.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.
π subroutine ssyrfs π
subroutine ssyrfs (character UPLO, integer N, integer NRHS, real, dimension(
lda, * ) A, integer LDA, real, dimension( ldaf, * ) AF, integer LDAF,
integer, dimension( * ) IPIV, real, dimension( ldb, * ) B, integer LDB,
real, dimension( ldx, * ) X, integer LDX, real, dimension( * ) FERR,
real, dimension( * ) BERR, real, dimension( * ) WORK, integer,
dimension( * ) IWORK, integer INFO)
SSYRFS
Purpose:
SSYRFS 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.
Bestie this is the vibe check routine π β you already solved the system, and now SSYRFS comes in to polish that solution up when the coefficient matrix is symmetric indefinite. Plus it hands you error bounds and backward error estimates, so you actually know how much to trust the answer. Periodt.
Parameters
UPLOUPLOβ bestie,UPLOisCHARACTER*1and it tells us which half ofAwe're even looking at:
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
NβNisINTEGER, and it's the order of the matrixA. So like, how big is she.N >= 0. No negative sizes in this house πNRHSβNRHSisINTEGER, the number of right hand sides, i.e. the number of columns of the matricesBandX.NRHS >= 0.AβAis aREAL array, dimension(LDA,N), and it's the symmetric matrixAitself π«Ά IfUPLO = 'U', then 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 (we literally don't look at it, she's not invited). 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 side, commit to the bit.LDAβLDAisINTEGER, the leading dimension of the arrayA.LDA >= max(1,N). It's giving "please allocate enough rows" energy.AFβAFis aREAL 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 bySSYTRF. So like,SSYTRFalready did the hard part and leftAFhere for us πLDAFβLDAFisINTEGER, the leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβIPIVis anINTEGER array, dimension(N). It's got the details of the interchanges and the block structure ofDas determined bySSYTRF. Receipts, basically π§ΎBβBis aREAL array, dimension(LDB,NRHS). It's the right hand side matrixB. The other side of the equation, the bestie toA's main character.LDBβLDBisINTEGER, the leading dimension of the arrayB.LDB >= max(1,N).XβXis aREAL array, dimension(LDX,NRHS). On entry, the solution matrixX, as computed bySSYTRS. On exit, the improved solution matrixX. Glow-up arc β¨LDXβLDXisINTEGER, the leading dimension of the arrayX.LDX >= max(1,N).FERRβFERRis aREAL array, dimension(NRHS), the estimated forward error bound for each solution vectorX(j)(that's the j-th column of the solution matrixX). IfXTRUEis the true solution corresponding toX(j), thenFERR(j)is an estimated upper bound for the magnitude of the largest element in(X(j) - XTRUE)divided by the magnitude of the largest element inX(j). And ngl, the estimate is as reliable as the estimate forRCOND, and is almost always a slight overestimate of the true error. She's dramatic like that.BERRβBERRis aREAL array, dimension(NRHS), the componentwise relative backward error of each solution vectorX(j)β i.e., the smallest relative change in any element ofAorBthat makesX(j)an exact solution. Periodt.WORKβWORKis aREAL array, dimension(3*N). Scratch space, do not perceive her.IWORKβIWORKis anINTEGER array, dimension(N). More scratch. Also not for perceiving.INFOβINFOisINTEGER, and she's the vibe check at the end:
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
β¨ Internal Parameters β¨
ITMAX is the maximum number of steps of iterative refinement. That's it, that's the whole tea π΅
π Author π
Absolute legends, all of them:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine ssyrfsx (character UPLO, character EQUED, integer N, integer
NRHS, real, dimension( lda, * ) A, integer LDA, real, dimension( ldaf, *
) AF, integer LDAF, integer, dimension( * ) IPIV, real, dimension( * )
S, real, dimension( ldb, * ) B, integer LDB, real, dimension( ldx, * )
X, integer LDX, real RCOND, real, dimension( * ) BERR, integer
N_ERR_BNDS, real, dimension( nrhs, * ) ERR_BNDS_NORM, real, dimension(
nrhs, * ) ERR_BNDS_COMP, integer NPARAMS, real, dimension( * ) PARAMS,
real, dimension( * ) WORK, integer, dimension( * ) IWORK, integer INFO)
SSYRFSX
π SSYRFSX π
π Purpose π
Okay so SSYRFSX 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. In addition to the normwise error bound, the code provides the maximum componentwise error bound if possible. See the comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds β they spill the whole story there.
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. Important distinction, bestie π¨
Some optional parameters are bundled in the PARAMS array. These settings determine how refinement is performed, but often the defaults are acceptable. If the defaults are acceptable, users can pass NPARAMS = 0 which prevents the source code from accessing the PARAMS argument. Lowkey the move when you just want the default vibe π
β¨ Parameters β¨
UPLOβUPLOisCHARACTER*1:
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
EQUEDβEQUEDisCHARACTER*1. Specifies the form of equilibration that was done toAbefore calling this routine. This is needed to compute the solution and error bounds correctly β you can't skip this step, she needs to know what happened before she got here:
= 'N': No equilibration
= 'Y': Both row and column equilibration, i.e., A has been
replaced by diag(S) * A * diag(S).
The right hand side B has been changed accordingly.
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βAis aREAL 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. Same deal as before, no notes πΈLDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).AFβAFis aREAL 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 bySSYTRF.LDAFβLDAFisINTEGER. The leading dimension of the arrayAF.LDAF >= max(1,N).IPIVβIPIVis anINTEGER array, dimension(N). Details of the interchanges and the block structure ofDas determined bySSYTRF.SβSis aREAL 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.
Okay this next bit matters, so listen up π«Ά Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable.
BβBis aREAL array, dimension(LDB,NRHS). The right hand side matrixB.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXis aREAL array, dimension(LDX,NRHS). On entry, the solution matrixX, as computed bySGETRS. On exit, the improved solution matrixX. Another glow-up β¨LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,N).RCONDβRCONDisREAL. Reciprocal scaled condition number. This is an estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if done). If this is less than the machine precision (in particular, if it is zero), the matrix is singular to working precision.
Note that the error may still be small even if this number is very small and the matrix appears ill-conditioned. So don't panic-spiral just because RCOND is tiny, bestie π
BERRβBERRis aREAL 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_BNDSisINTEGER. Number of error bounds to return for each right hand side and each type (normwise or componentwise). SeeERR_BNDS_NORMandERR_BNDS_COMPbelow. Yes, both, she does both πERR_BNDS_NORMβERR_BNDS_NORMis aREAL 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 = 3β Reciprocal condition number: Estimated normwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrix Z. LetZ = S*A, where S scales each row by a power of the radix so all absolute row sums of Z are approximately 1.
See Lapack Working Note 165 for further details and extra cautions. π (yes bestie, there's homework, and it's actually worth reading)
ERR_BNDS_COMP π
ERR_BNDS_COMP is REAL array, dimension (NRHS, N_ERR_BNDS)
For each right-hand side, this array contains information about various error bounds and condition numbers corresponding to the componentwise relative error, which is defined as follows:
Componentwise relative error in the ith solution vector:
abs(XTRUE(j,i) - X(j,i))
max_j ----------------------
abs(X(j,i))
The array is indexed by the right-hand side i (on which the componentwise relative error depends), and the type of error information as described below. There currently are up to three pieces of information returned for each right-hand side. If componentwise accuracy is not requested (PARAMS(3) = 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.
The first index in ERR_BNDS_COMP(i,:) corresponds to the ith right-hand side.
The second index in ERR_BNDS_COMP(:,err) contains the following three fields:
err = 1β'Trust/don't trust'boolean. Trust the answer if the reciprocal condition number is less than the thresholdsqrt(n) * slamch('Epsilon').err = 2β'Guaranteed'error bound: The estimated forward error, almost certainly within a factor of 10 of the true error so long as the next entry is greater than the thresholdsqrt(n) * slamch('Epsilon'). This error bound should only be trusted if the previous boolean is true.err = 3β Reciprocal condition number: Estimated componentwise reciprocal condition number. Compared with the thresholdsqrt(n) * slamch('Epsilon')to determine if the error estimate is'guaranteed'. These reciprocal condition numbers are1 / (norm(Z^{-1},inf) * norm(Z,inf))for some appropriately scaled matrix Z. LetZ = S*(A*diag(x)), where x is the solution for the current right-hand side and S scales each row ofA*diag(x)by a power of the radix so all absolute row sums of Z are approximately 1.
See Lapack Working Note 165 for further details and extra cautions. π¦
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. Iconic "no thoughts, just defaults" behaviour, honestly. β¨
PARAMS π
PARAMS is REAL array, dimension NPARAMS
Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters.
PARAMS(LA_LINRX_ITREF_I = 1): Whether to perform iterative refinement or not.- Default:
1.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 than LU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy.
- Default:
β οΈ Bestie, that "may no longer be trustworthy" is not a drill. Going aggressive here means the guarantees stop guaranteeing. π«
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 REAL array, dimension (4*N) β it's giving "bring your own scratch space" π
IWORK
IWORK is INTEGER array, dimension (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 factor U is exactly singular, so the solution and error bounds could not be computed.RCOND = 0is returned.= N+J: The solution corresponding to the Jth 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 Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such thatERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that eitherERR_BNDS_NORM(J,1) = 0.0orERR_BNDS_COMP(J,1) = 0.0). See the definition ofERR_BNDS_NORM(:,1)andERR_BNDS_COMP(:,1). To get information about all of the right-hand sides checkERR_BNDS_NORMorERR_BNDS_COMP.
Author π«Ά
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine ssytd2 (character UPLO, integer N, real, dimension( lda, * ) A, integer LDA, real, dimension( * ) D, real, dimension( * ) E, real, dimension( * ) TAU, integer INFO)
subroutine ssytd2 (character UPLO, integer N, real, dimension( lda, * ) A,
integer LDA, real, dimension( * ) D, real, dimension( * ) E, real,
dimension( * ) TAU, integer INFO)
SSYTD2 reduces a symmetric matrix to real symmetric tridiagonal form by an orthogonal similarity transformation (unblocked algorithm). Unblocked, so it's the slow-and-steady version β but she gets the job DONE. π
Purpose: β¨
SSYTD2 reduces a real symmetric matrix A to symmetric tridiagonal form T by an orthogonal similarity transformation: Q**T * A * Q = T.
Parameters
UPLOβUPLOisCHARACTER*1. Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:= 'U': Upper triangular= 'L': Lower triangular
NβNisINTEGER. The order of the matrix A.N >= 0.AβAisREAL array, dimension(LDA,N).
On entry, the symmetric matrix A. If UPLO = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading n-by-n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
On exit, if UPLO = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors; if UPLO = 'L', the diagonal and first subdiagonal of A are over-written by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details.
LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).DβDisREAL array, dimension(N). The diagonal elements of the tridiagonal matrix T:D(i) = A(i,i).EβEisREAL array, dimension(N-1). The off-diagonal elements of the tridiagonal matrix T:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.TAUβTAUisREAL array, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details).INFOβINFOisINTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value.
Author π«Ά
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details: π§
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(n-1) . . . H(2) H(1).
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stashed on exit in A(1:i-1,i+1), and tau lives in TAU(i). bestie, that's just where the pieces go, no cap.
If UPLO = 'L', then the matrix Q is a product of elementary reflectors, like:
Q = H(1) H(2) . . . H(n-1).
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i). iykyk π
The contents of A on exit are illustrated by these examples, with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i). literally the receipts of your factorization, right there in the array π
β¨ subroutine ssytf2 β¨
subroutine ssytf2 (character UPLO, integer N, real, dimension( lda, * ) A,
integer LDA, integer, dimension( * ) IPIV, integer INFO)
SSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting method (unblocked algorithm). iconic behavior honestly π
Purpose:
SSYTF2 computes the factorization of a real 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. so like, the low-key version, still ate tho π₯
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.AβAisREALarray, 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, 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. the tea on who swapped with who π«
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) = 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':
- 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.
INFOβINFOisINTEGER.= 0: successful exit πΈ< 0: ifINFO = -k, thek-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. π like bestie, do not pass go, do not solve that system.
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:
09-29-06 - patch from
Bobby Cheng, MathWorks
Replace l.204 and l.372
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
by
IF( (MAX( ABSAKK, COLMAX ).EQ.ZERO) .OR. SISNAN(ABSAKK) ) THEN
01-01-96 - Based on modifications by
J. Lewis, Boeing Computer Services Company
A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
1-96 - Based on modifications by J. Lewis, Boeing Computer Services
Company
the lore β¨ the history β¨ the receipts π
β¨ subroutine ssytf2_rook β¨
subroutine ssytf2_rook (character UPLO, integer N, real, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, integer INFO)
SSYTF2_ROOK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Kaufman ('rook') diagonal pivoting method (unblocked algorithm). same energy, different pivot strategy π
Purpose:
SSYTF2_ROOK computes the factorization of a real 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.AβAisREALarray, 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, 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 interchanged,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 interchanged,D(k:k+1,k:k+1)is a 2-by-2 diagonal block.
INFOβINFOisINTEGER.= 0: successful exit πΈ< 0: ifINFO = -k, thek-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. π
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 ssytrd β¨
subroutine ssytrd (character UPLO, integer N, real, dimension( lda, * ) A,
integer LDA, real, dimension( * ) D, real, dimension( * ) E, real,
dimension( * ) TAU, real, dimension( * ) WORK, integer LWORK, integer
INFO)
SSYTRD
π Purpose π
SSYTRD reduces a real symmetric matrix A to real symmetric tridiagonal form T by an orthogonal similarity transformation: Q**T * A * Q = T.
πΈ Parameters πΈ
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisREALarray, 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, ifUPLO = 'U', the diagonal and first superdiagonal ofAare overwritten by the corresponding elements of the tridiagonal matrixT, and the elements above the first superdiagonal, with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors; ifUPLO = 'L', the diagonal and first subdiagonal ofAare over-written by the corresponding elements of the tridiagonal matrixT, and the elements below the first subdiagonal, with the arrayTAU, represent the orthogonal matrixQas a product of elementary reflectors. See Further Details.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).DβDisREALarray, dimension(N). The diagonal elements of the tridiagonal matrixT:D(i) = A(i,i).EβEisREALarray, dimension(N-1). The off-diagonal elements of the tridiagonal matrixT:E(i) = A(i,i+1)ifUPLO = 'U',E(i) = A(i+1,i)ifUPLO = 'L'.TAUβTAUisREALarray, dimension(N-1). The scalar factors of the elementary reflectors (see Further Details).WORKβWORKisREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORKisINTEGER. The dimension of the arrayWORK.LWORK >= 1. For optimum performanceLWORK >= N*NB, whereNBis the optimal blocksize. 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.INFOβINFOisINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details π¦
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors
Q = H(n-1) . . . H(2) H(1).
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in A(1:i-1,i+1), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(n-1).
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in A(i+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( d e v2 v3 v4 ) ( d )
( d e v3 v4 ) ( e d )
( d e v4 ) ( v1 e d )
( d e ) ( v1 v2 e d )
( d ) ( v1 v2 v3 e d )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i).
β¨ subroutine ssytrd_2stage β¨
subroutine ssytrd_2stage (character VECT, character UPLO, integer N, real,
dimension( lda, * ) A, integer LDA, real, dimension( * ) D, real,
dimension( * ) E, real, dimension( * ) TAU, real, dimension( * ) HOUS2,
integer LHOUS2, real, dimension( * ) WORK, integer LWORK, integer INFO)
SSYTRD_2STAGE
π Purpose π
SSYTRD_2STAGE reduces a real symmetric matrix A to real symmetric tridiagonal form T by a orthogonal similarity transformation: Q1**T Q2**T* A * Q2 * Q1 = T.
πΈ Parameters πΈ
VECTβVECTisCHARACTER*1= 'N': No need for the Housholder representation, in particular for the second stage (Band to tridiagonal) and thusLHOUS2is of sizemax(1, 4*N);= 'V': the Householder representation is needed to either generateQ1 Q2or to applyQ1 Q2, thenLHOUS2is to be queried and computed. (NOT AVAILABLE IN THIS RELEASE).
UPLOβUPLOisCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAisREALarray, 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, ifUPLO = 'U', the band superdiagonal ofAare overwritten by the corresponding elements of the internal band-diagonal matrixAB, and the elements above theKDsuperdiagonal, with the arrayTAU, represent the orthogonal matrixQ1as a product of elementary reflectors; ifUPLO = 'L', the diagonal and band subdiagonal ofAare over-written by the corresponding elements of the internal band-diagonal matrixAB, and the elements below theKDsubdiagonal, with the arrayTAU, represent the orthogonal matrixQ1as a product of elementary reflectors. See Further Details.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).DβDisREALarray, dimension(N). The diagonal elements of the tridiagonal matrixT.EβEisREALarray, dimension(N-1). The off-diagonal elements of the tridiagonal matrixT.TAUβTAUisREALarray, dimension(N-KD). The scalar factors of the elementary reflectors of the first stage (see Further Details).HOUS2βHOUS2isREALarray, dimension(LHOUS2). Stores the Householder representation of the stage2 band to tridiagonal.LHOUS2βLHOUS2isINTEGER. The dimension of the arrayHOUS2. IfLWORK = -1, orLHOUS2 = -1, then a query is assumed; the routine only calculates the optimal size of theHOUS2array, returns this value as the first entry of theHOUS2array, and no error message related toLHOUS2is issued byXERBLA. IfVECT='N',LHOUS2 = max(1, 4*n); ifVECT='V', option not yet available.WORKβWORKisREALarray, dimension(LWORK)LWORKLWORKβ INTEGER, the dimension of the arrayWORK.LWORK = MAX(1, dimension)
And listen β if LWORK = -1, or LHOUS2=-1, bestie, then we're in workspace query mode π΅οΈββοΈ. The routine only calculates the optimal size of the WORK array, hands that value back as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. Iconic behaviour, honestly.
LWORK = MAX(1, dimension) where
dimension = max(stage1,stage2) + (KD+1)*N
= N*KD + N*max(KD+1,FACTOPTNB)
+ max(2*KD*KD, KD*NTHREADS)
+ (KD+1)*N
where KD is the blocking size of the reduction, FACTOPTNB is the blocking used by the QR or LQ algorithm β usually FACTOPTNB=128 is a good choice π
β and NTHREADS is the number of threads used when openMP compilation is enabled, otherwise =1.
INFOβ INTEGER, the receipts π
INFO is INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π₯ Further Details
Implemented by Azzam Haidar. β¨
All details are available on technical report, SC11, SC13 papers. Like, go read them, they ate:
Azzam Haidar, Hatem Ltaief, and Jack Dongarra.
Parallel reduction to condensed forms for symmetric eigenvalue problems
using aggregated fine-grained and memory-aware kernels. In Proceedings
of 2011 International Conference for High Performance Computing,
Networking, Storage and Analysis (SC '11), New York, NY, USA,
Article 8 , 11 pages.
http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013.
An improved parallel singular value algorithm and its implementation
for multicore hardware, In Proceedings of 2013 International Conference
for High Performance Computing, Networking, Storage and Analysis (SC '13).
Denver, Colorado, USA, 2013.
Article 90, 12 pages.
http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra.
A novel hybrid CPU-GPU generalized eigensolver for electronic structure
calculations based on fine-grained memory aware tasks.
International Journal of High Performance Computing Applications.
Volume 28 Issue 2, Pages 196-209, May 2014.
http://hpc.sagepub.com/content/28/2/196
π¦ subroutine ssytrd_sy2sb
Ok new function bestie, get comfy ποΈ
subroutine ssytrd_sy2sb (character UPLO, integer N, integer KD, real,
dimension( lda, * ) A, integer LDA, real, dimension( ldab, * ) AB,
integer LDAB, real, dimension( * ) TAU, real, dimension( * ) WORK,
integer LWORK, integer INFO)
SSYTRD_SY2SB
β¨ Purpose
SSYTRD_SY2SB reduces a real symmetric matrix A to real symmetric band-diagonal form AB by a orthogonal similarity transformation:
Q**T * A * Q = AB.
the way that it just... transforms ur whole matrix. obsessed π
π Parameters
UPLOβUPLOisCHARACTER*1πΈ
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
NβNisINTEGER. The order of the matrixA.N >= 0.KDβKDisINTEGER. The number of superdiagonals of the reduced matrix ifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0. The reduced matrix is stored in the arrayAB. πAβAisREALarray, dimension(LDA,N).
On entry, the symmetric matrix A. If UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
On exit, if UPLO = 'U', the diagonal and first superdiagonal of A are overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors; if UPLO = 'L', the diagonal and first subdiagonal of A are over-written by the corresponding elements of the tridiagonal matrix T, and the elements below the first subdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details. π
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).ABβABisREALarray, dimension(LDAB,N).
On exit, the upper or lower triangle of the symmetric band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
no cap, this indexing is a whole vibe check π«
LDABβLDABisINTEGER. The leading dimension of the arrayAB.LDAB >= KD+1.TAUβTAUisREALarray, dimension(N-KD). The scalar factors of the elementary reflectors (see Further Details). πWORKβWORKisREALarray, dimension(LWORK). On exit, ifINFO = 0, or ifLWORK=-1,WORK(1)returns the size ofLWORK. π§LWORKβLWORKisINTEGER. The dimension of the arrayWORKwhich should be calculated by a workspace query.LWORK = MAX(1, LWORK_QUERY)
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
LWORK_QUERY = N*KD + N*max(KD,FACTOPTNB) + 2*KD*KD
where FACTOPTNB is the blocking used by the QR or LQ algorithm, usually FACTOPTNB=128 is a good choice otherwise putting LWORK=-1 will provide the size of WORK.
INFOβINFOisINTEGERπ
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π₯ Further Details
Implemented by Azzam Haidar. β¨
All details are available on technical report, SC11, SC13 papers.
Azzam Haidar, Hatem Ltaief, and Jack Dongarra.
Parallel reduction to condensed forms for symmetric eigenvalue problems
using aggregated fine-grained and memory-aware kernels. In Proceedings
of 2011 International Conference for High Performance Computing,
Networking, Storage and Analysis (SC '11), New York, NY, USA,
Article 8 , 11 pages.
http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013.
An improved parallel singular value algorithm and its implementation
for multicore hardware, In Proceedings of 2013 International Conference
for High Performance Computing, Networking, Storage and Analysis (SC '13).
Denver, Colorado, USA, 2013.
Article 90, 12 pages.
http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra.
A novel hybrid CPU-GPU generalized eigensolver for electronic structure
calculations based on fine-grained memory aware tasks.
International Journal of High Performance Computing Applications.
Volume 28 Issue 2, Pages 196-209, May 2014.
http://hpc.sagepub.com/content/28/2/196
If UPLO = 'U', the matrix Q is represented as a product of elementary reflectors πͺ
Q = H(k)**T . . . H(2)**T H(1)**T, where k = n-kd.
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(1:i+kd-1) = 0 and v(i+kd) = 1; conjg(v(i+kd+1:n)) is stored on exit in A(i,i+kd+1:n), and tau in TAU(i).
If UPLO = 'L', the matrix Q is represented as a product of elementary reflectors
Q = H(1) H(2) . . . H(k), where k = n-kd.
Each H(i) has the form
H(i) = I - tau * v * v**T
where tau is a real scalar, and v is a real vector with v(kd+1:i) = 0 and v(i+kd+1) = 1; v(i+kd+2:n) is stored on exit in A(i+kd+2:n,i), and tau in TAU(i).
The contents of A on exit are illustrated by the following examples with n = 5:
if UPLO = 'U': if UPLO = 'L':
( ab ab/v1 v1 v1 v1 ) ( ab )
( ab ab/v2 v2 v2 ) ( ab/v1 ab )
( ab ab/v3 v3 ) ( v1 ab/v2 ab )
( ab ab/v4 ) ( v1 v2 ab/v3 ab )
( ab ) ( v1 v2 v3 ab/v4 ab )
where d and e denote diagonal and off-diagonal elements of T, and vi denotes an element of the vector defining H(i)..fi
π subroutine ssytrf
ok ANOTHER one, we're on a roll bestie π’
subroutine ssytrf (character UPLO, integer N, real, dimension( lda, * ) A,
integer LDA, integer, dimension( * ) IPIV, real, dimension( * ) WORK,
integer LWORK, integer INFO)
SSYTRF
β¨ Purpose
SSYTRF computes the factorization of a real symmetric matrix A using the Bunch-Kaufman diagonal pivoting method. The form of the factorization is
A = U**T*D*U 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. she's fast, she's blocked, she's serving π₯
π Parameters
UPLOβUPLOisCHARACTER*1πΈ
= 'U': Upper triangle of A is stored;
= 'L': Lower triangle of A is stored.
NβNisINTEGER. The order of the matrixA.N >= 0.AβAβ is a REAL array, dimension(LDA,N). On entry, it's 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β is INTEGER. It's the leading dimension of the arrayA. So like,LDA >= max(1,N), no cap. πIPIVβ is an INTEGER array, dimension(N). It's got the details of the interchanges and the block structure ofD. So 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β is a REAL array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0, thenWORK(1)returns the optimalLWORK. π οΈLWORKβ is INTEGER. It's the length ofWORK. SoLWORK >= 1. For best performance,LWORK >= N*NB, whereNBis the block size returned byILAENV. 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. πINFOβ is INTEGER. It's giving:= 0: successful exit. π< 0: ifINFO = -i, the i-th argument had an illegal value. π«> 0: ifINFO = i,D(i,i)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations. π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Further Details π
Okay so here's the tea on the factorization:
If UPLO = 'U', then A = U**T*D*U, 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 ssytrf_aa (character UPLO, integer N, real, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real, dimension( * ) WORK, integer LWORK, integer INFO)
SSYTRF_AA
Purpose π―
SSYTRF_AA computes the factorization of a real 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 symmetric tridiagonal matrix.
This is the blocked version of the algorithm, calling Level 3 BLAS.
Parameters π
UPLOβ isCHARACTER*1.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored. πNβ is INTEGER. The order of the matrixA.N >= 0.Aβ is a REAL 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, the tridiagonal matrix is stored in the diagonals and the subdiagonals ofAjust below (or above) the diagonals, andLis stored below (or above) the subdiaonals, whenUPLOis'L'(or'U'). β¨LDAβ is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβ is INTEGER array, dimension(N). On exit, it contains the details of the interchanges, i.e., the row and columnkofAwere interchanged with the row and columnIPIV(k). πWORKβ is REAL array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. π οΈLWORKβ is INTEGER. The length ofWORK.LWORK >= MAX(1,2*N). For optimum performanceLWORK >= N*(1+NB), whereNBis the optimal blocksize. 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. πINFOβ is INTEGER.= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value. π«
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine ssytrf_aa_2stage (character UPLO, integer N, real, dimension( lda, * ) A, integer LDA, real, dimension( * ) TB, integer LTB, integer, dimension( * ) IPIV, integer, dimension( * ) IPIV2, real, dimension( * ) WORK, integer LWORK, integer INFO)
SSYTRF_AA_2STAGE
Purpose π―
SSYTRF_AA_2STAGE computes the factorization of a real 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 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.
Parameters π
UPLOβ isCHARACTER*1.= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored. πNβ is INTEGER. The order of the matrixA.N >= 0.Aβ is a REAL 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,Lis stored below (or above) the subdiaonal blocks, whenUPLOis'L'(or'U'). β¨LDAβ is INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).TBβ is REAL array, dimension(LTB). On exit, details of the LU factorization of the band matrix. π¦LTBβ is INTEGER. The size of the arrayTB.LTB >= 4*N, internally used to selectNBsuch thatLTB >= (3*NB+1)*N. IfLTB = -1, then a workspace query is assumed; the routine only calculates the optimal size ofLTB, returns this value as the first entry ofTB, and no error message related toLTBis issued byXERBLA. πIPIVβ is INTEGER array, 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β is INTEGER array, 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β is REAL workspace of sizeLWORK. π οΈLWORKβ is INTEGER. The size ofWORK.LWORK >= N, internally used to selectNBsuch thatLWORK >= N*NB. 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. π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 ssytrf_rook π¦
subroutine ssytrf_rook (character UPLO, integer N, real, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real, dimension( * ) WORK, integer LWORK, integer INFO)
SSYTRF_ROOK
Purpose π
SSYTRF_ROOK computes the factorization of a real 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. slay β¨
Parameters π
UPLOβ isCHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
Nβ isINTEGER- The order of the matrix
A.N >= 0.
- The order of the matrix
Aβ isREALarray, dimension(LDA,N)- On entry, the symmetric matrix
A. IfUPLO = 'U', the leadingN-by-Nupper triangular part ofAcontains the upper triangular part of the matrixA, and the strictly lower triangular part ofAis not referenced. IfUPLO = 'L', the leadingN-by-Nlower triangular part ofAcontains the lower triangular part of the matrixA, and the strictly upper triangular part ofAis not referenced. - On exit, the block diagonal matrix
Dand the multipliers used to obtain the factorUorL(see below for further details).
- On entry, the symmetric matrix
LDAβ isINTEGER- The leading dimension of the array
A.LDA >= max(1,N).
- The leading dimension of the array
IPIVβ isINTEGERarray, dimension(N)- Details of the interchanges and the block structure of
D. π
- Details of the interchanges and the block structure of
If UPLO = 'U':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a1-by-1diagonal block. - If
IPIV(k) < 0andIPIV(k-1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk-1and-IPIV(k-1)were interchanged,D(k-1:k,k-1:k)is a2-by-2diagonal block.
If UPLO = 'L':
- If
IPIV(k) > 0, then rows and columnskandIPIV(k)were interchanged andD(k,k)is a1-by-1diagonal block. - If
IPIV(k) < 0andIPIV(k+1) < 0, then rows and columnskand-IPIV(k)were interchanged and rows and columnsk+1and-IPIV(k+1)were interchanged,D(k:k+1,k:k+1)is a2-by-2diagonal block.
WORKβ isREALarray, dimension(MAX(1,LWORK)).- On exit, if
INFO = 0,WORK(1)returns the optimalLWORK.
- On exit, if
LWORKβ isINTEGER- The length of
WORK.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 theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.
- The length of
INFOβ isINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i)is exactly zero. The factorization has been completed, but the block diagonal matrixDis exactly singular, and division by zero will occur if it is used to solve a system of equations.
bestie listen β thatINFO > 0case is not a cute lil warning, it's a real one. The factorization did finish, butDis singular, and the moment you try to solve a system with it, you're dividing by zero. π«
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
π¦ subroutine ssytri π¦
subroutine ssytri (character UPLO, integer N, real, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real, dimension( * ) WORK, integer INFO)
SSYTRI
Purpose π
SSYTRI computes the inverse of a real symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by SSYTRF.
Parameters π
UPLOβ isCHARACTER*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β isINTEGER- The order of the matrix
A.N >= 0.
- The order of the matrix
Aβ isREALarray, dimension(LDA,N)- On entry, the block diagonal matrix
Dand the multipliers used to obtain the factorUorLas computed bySSYTRF. - On exit, if
INFO = 0, the (symmetric) inverse of the original matrix. IfUPLO = 'U', the upper triangular part of the inverse is formed and the part ofAbelow the diagonal is not referenced; ifUPLO = 'L'the lower triangular part of the inverse is formed and the part ofAabove the diagonal is not referenced.
- On entry, the block diagonal matrix
LDAβ isINTEGER- The leading dimension of the array
A.LDA >= max(1,N).
- The leading dimension of the array
IPIVβ isINTEGERarray, dimension(N)- Details of the interchanges and the block structure of
Das determined bySSYTRF.
- Details of the interchanges and the block structure of
WORKβ isREALarray, dimension(N)INFOβ isINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed.
Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ subroutine ssytri2 π¦
subroutine ssytri2 (character UPLO, integer N, real, dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real, dimension( * ) WORK, integer LWORK, integer INFO)
SSYTRI2
Purpose π
SSYTRI2 computes the inverse of a REAL symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by SSYTRF. SSYTRI2 sets the LEADING DIMENSION of the workspace before calling SSYTRI2X that actually computes the inverse.
Parameters π
UPLOβ isCHARACTER*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β isINTEGER- The order of the matrix
A.N >= 0.
- The order of the matrix
Aβ isREALarray, dimension(LDA,N)- On entry, the block diagonal matrix
Dand the multipliers used to obtain the factorUorLas computed bySSYTRF. - On exit, if
INFO = 0, the (symmetric) inverse of the original matrix. IfUPLO = 'U', the upper triangular part of the inverse is formed and the part ofAbelow the diagonal is not referenced; ifUPLO = 'L'the lower triangular part of the inverse is formed and the part ofAabove the diagonal is not referenced.
- On entry, the block diagonal matrix
LDAβ isINTEGER- The leading dimension of the array
A.LDA >= max(1,N).
- The leading dimension of the array
IPIVβ isINTEGERarray, dimension(N)- Details of the interchanges and the block structure of
Das determined bySSYTRF.
- Details of the interchanges and the block structure of
WORKβ isREALarray, dimension(N+NB+1)*(NB+3)LWORKLWORKβINTEGER, and it's literally just the dimension of the arrayWORK. Size check, bestie:WORKis size >=(N+NB+1)*(NB+3). And ifLWORK = -1, we're in a workspace query situation β the routine then calculates:- the optimal size of the
WORKarray, and returns this value as the first entry of theWORKarray, - and no error message related to
LWORKis issued byXERBLA. π«Ά
- the optimal size of the
INFOβINTEGER, the receipts:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i,D(i,i) = 0; the matrix is singular and its inverse could not be computed π
π«Ά Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
β¨ subroutine ssytri2x β¨
subroutine ssytri2x (character UPLO, integer N, real, dimension( lda, * ) A,
integer LDA, integer, dimension( * ) IPIV, real, dimension( n+nb+1,* )
WORK, integer NB, integer INFO)
SSYTRI2X β yes that's the whole name, no notes.
π― Purpose
SSYTRI2X computes the inverse of a real symmetric indefinite matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by SSYTRF. It's giving "we already did the hard part, now we flip it." π
π 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.
NβINTEGER. The order of the matrixA.N >= 0.AβREALarray, dimension(LDA,N). On entry, theNNBdiagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF. On exit, ifINFO = 0, the (symmetric) inverse of the original matrix. IfUPLO = 'U', the upper triangular part of the inverse is formed and the part ofAbelow the diagonal is not referenced; ifUPLO = 'L'the lower triangular part of the inverse is formed and the part ofAabove the diagonal is not referenced. (Half of this array is basically just vibing in the background, unbothered. π)LDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).IPIVβINTEGERarray, dimension(N). Details of the interchanges and theNNBstructure ofDas determined bySSYTRF.WORKβREALarray, dimension(N+NB+1,NB+3).NBβINTEGER. Block size.INFOβ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.
πΈ subroutine ssytri_rook πΈ
subroutine ssytri_rook (character UPLO, integer N, real, dimension( lda, * )
A, integer LDA, integer, dimension( * ) IPIV, real, dimension( * ) WORK,
integer INFO)
SSYTRI_ROOK β iconic name, no cap.
π― Purpose
SSYTRI_ROOK computes the inverse of a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by SSYTRF_ROOK. π¦
π 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.
NβINTEGER. The order of the matrixA.N >= 0.AβREALarray, dimension(LDA,N). On entry, the block diagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF_ROOK. On exit, ifINFO = 0, the (symmetric) inverse of the original matrix. IfUPLO = 'U', the upper triangular part of the inverse is formed and the part ofAbelow the diagonal is not referenced; ifUPLO = 'L'the lower triangular part of the inverse is formed and the part ofAabove the diagonal is not referenced.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 bySSYTRF_ROOK.WORKβREALarray, dimension(N).INFOβ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
- April 2012, Igor Kozachenko, Computer Science Division, University of California, Berkeley
- September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
π subroutine ssytrs π
subroutine ssytrs (character UPLO, integer N, integer NRHS, real, dimension(
lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real, dimension(
ldb, * ) B, integer LDB, integer INFO)
SSYTRS β the solver era begins. β¨
π― Purpose
SSYTRS solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by SSYTRF. Found the X, periodt. π₯
π 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.
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βREALarray, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF.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 bySSYTRF.BβREALarray, 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).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 ssytrs2 π
subroutine ssytrs2 (character UPLO, integer N, integer NRHS, real,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real,
dimension( ldb, * ) B, integer LDB, real, dimension( * ) WORK, integer
INFO)
SSYTRS2 β the sequel, and honestly it ate. π
π― Purpose
SSYTRS2 solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by SSYTRF and converted by SSYCONV.
π 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.
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βREALarray, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF.
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. (It's giving "she left, she came back, she's still her." π¦)
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 bySSYTRF.BβREALarray, 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βREALarray, dimension(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.
β subroutine ssytrs_aa β
subroutine ssytrs_aa (character UPLO, integer N, integer NRHS, real,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real,
dimension( ldb, * ) B, integer LDB, real, dimension( * ) WORK, integer
LWORK, integer INFO)
SSYTRS_AA β the _AA girlies always have the most β¨interestingβ¨ factorizations.
π― Purpose
SSYTRS_AA solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U**T*T*U or A = L*T*L**T computed by SSYTRF_AA. πΈ
π Parameters
UPLOβUPLOβ CHARACTER*1, bestie. Tells us whether the factorization details are chilling as an upper or a lower triangular matrix.
= 'U': Upper triangular, form is A = U**T*T*U;
= 'L': Lower triangular, form is A = L*T*L**T.
Nβ INTEGER. The order of the matrixA. Rules areN >= 0, no exceptions, periodt.NRHSβ INTEGER. How many right hand sides we're serving, aka the number of columns of the matrixB.NRHS >= 0.Aβ REAL array, dimension(LDA,N). It's holding the details of the factors thatSSYTRF_AAcomputed. iconic behavior tbh.LDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,N), don't play with it.IPIVβ INTEGER array, dimension(N). All the deets of the interchanges, exactly asSSYTRF_AAcomputed them.Bβ REAL array, dimension(LDB,NRHS). On entry, it's the right hand side matrixB. On exit? It's the solution matrixX. glow-up arc β¨LDBβ INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).WORKβ REAL array, dimension(MAX(1,LWORK)). It's the workspace, it does the vibes behind the scenes π«ΆLWORKβ INTEGER. The dimension of the arrayWORK. And the rule isLWORK >= max(1,3*N-2). write that down bestie.INFOβ INTEGER. The receipts:
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ subroutine ssytrs_aa_2stage
subroutine ssytrs_aa_2stage (character UPLO, integer N, integer NRHS, real,
dimension( lda, * ) A, integer LDA, real, dimension( * ) TB, integer
LTB, integer, dimension( * ) IPIV, integer, dimension( * ) IPIV2, real,
dimension( ldb, * ) B, integer LDB, integer INFO)
SSYTRS_AA_2STAGE β the two-stage girlie π
β¨ Purpose
SSYTRS_AA_2STAGE solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U**T*T*U or A = L*T*L**T computed by SSYTRF_AA_2STAGE.
πΈ Parameters
UPLOβ CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.
= 'U': Upper triangular, form is A = U**T*T*U;
= 'L': Lower triangular, form is A = 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β REAL array, dimension(LDA,N). Details of factors computed bySSYTRF_AA_2STAGE.LDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).TBβ REAL array, dimension(LTB). Details of factors computed bySSYTRF_AA_2STAGE.LTBβ INTEGER. The size of the arrayTB.LTB >= 4*N.IPIVβ INTEGER array, dimension(N). Details of the interchanges as computed bySSYTRF_AA_2STAGE.IPIV2β INTEGER array, dimension(N). Details of the interchanges as computed bySSYTRF_AA_2STAGE. yes there are two of them, she contains multitudes π«ΆBβ REAL array, 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: if INFO = -i, the i-th argument had an illegal value
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine ssytrs_rook
subroutine ssytrs_rook (character UPLO, integer N, integer NRHS, real,
dimension( lda, * ) A, integer LDA, integer, dimension( * ) IPIV, real,
dimension( ldb, * ) B, integer LDB, integer INFO)
SSYTRS_ROOK β she's serving rook pivoting energy π
β¨ Purpose
SSYTRS_ROOK solves a system of linear equations A*X = B with a real symmetric matrix A using the factorization A = U*D*U**T or A = L*D*L**T computed by SSYTRF_ROOK.
πΈ Parameters
UPLOβ CHARACTER*1. Specifies whether the details of the factorization are stored as an upper or lower triangular matrix.
= 'U': Upper triangular, form is A = U*D*U**T;
= 'L': Lower triangular, form is A = L*D*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β REAL array, dimension(LDA,N). The block diagonal matrixDand the multipliers used to obtain the factorUorLas computed bySSYTRF_ROOK.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 ofDas determined bySSYTRF_ROOK.Bβ REAL array, 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: if INFO = -i, the i-th argument had an illegal value
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Contributors:
April 2012, Igor Kozachenko, Computer Science Division, University of California, Berkeley
September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas, School of Mathematics, University of Manchester
β subroutine stgsyl
subroutine stgsyl (character TRANS, integer IJOB, integer M, integer N,
real, dimension( lda, * ) A, integer LDA, real, dimension( ldb, * ) B,
integer LDB, real, dimension( ldc, * ) C, integer LDC, real, dimension(
ldd, * ) D, integer LDD, real, dimension( lde, * ) E, integer LDE, real,
dimension( ldf, * ) F, integer LDF, real SCALE, real DIF, real,
dimension( * ) WORK, integer LWORK, integer, dimension( * ) IWORK,
integer INFO)
STGSYL β generalized Sylvester equation hours, and honestly? she ate π₯
β¨ Purpose
STGSYL 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 real entries. (A, D) and (B, E) must be in generalized (real) Schur canonical form, i.e. A, B are upper quasi triangular and D, E are upper triangular.
The solution (R, L) overwrites (C, F). 0 <= SCALE <= 1 is an output scaling factor chosen to avoid overflow.
In matrix notation (1) is equivalent to solve Zx = scale b, where Z is defined as
Z = [ kron(In, A) -kron(B**T, Im) ] (2)
[ kron(In, D) -kron(E**T, Im) ].
Here Ik is the identity matrix of size k and X**T is the transpose of X. kron(X, Y) is the Kronecker product between the matrices X and Y.
If TRANS = 'T', STGSYL solves the transposed system Z**T*y = scale*b, which is equivalent to solve for R and L in
A**T * R + D**T * L = scale * C (3)
R * B**T + L * E**T = scale * -F
This case (TRANS = 'T') 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 SLACON.
If IJOB >= 1, STGSYL 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. See [1-2] for more information.
This is a level 3 BLAS algorithm. flex but make it linear algebra π
πΈ Parameters
TRANSβ CHARACTER*1.
= 'N': solve the generalized Sylvester equation (1).
= 'T': solve the 'transposed' system (3).
IJOBβ INTEGER. 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 of Dif[(A,D), (B,E)] is computed.
(look ahead strategy IJOB = 1 is used).
= 4: Only an estimate of Dif[(A,D), (B,E)] is computed.
( SGECON on sub-systems is used ).
Not referenced if TRANS = 'T'. so don't even worry about it in that case bestie
Mβ INTEGER. The order of the matricesAandD, and the row dimension of the matricesC,F,RandL.Nβ INTEGER. The order of the matricesBandE, and the column dimension of the matricesC,F,RandL.Aβ REAL array, dimension(LDA, M). The upper quasi triangular matrixA.LDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1, M).Bβ REAL array, dimension(LDB, N). The upper quasi triangular matrixB.LDBβ INTEGER. The leading dimension of the arrayB.LDB >= max(1, N).Cβ REAL array, dimension(LDC, N). On entry,Ccontains the right-hand-side of the first matrix equation in (1) or (3). On exit, ifIJOB = 0,1or2,Chas been overwritten by the solutionR. IfIJOB = 3or4andTRANS = 'N',CholdsR, the solution achieved during the computation of the Dif-estimate. she's doing double duty and she's not even complaining π«ΆLDCβ INTEGER. The leading dimension of the arrayC.LDC >= max(1, M).DβDβREAL array, dimension(LDD, M). The upper triangular matrixD. πLDDβINTEGER. The leading dimension of the arrayD.LDD >= max(1, M).EβREAL array, dimension(LDE, N). The upper triangular matrixE. β¨LDEβINTEGER. The leading dimension of the arrayE.LDE >= max(1, N).FβREAL array, 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βINTEGER. The leading dimension of the arrayF.LDF >= max(1, M).DIFβREAL. 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 = 'T',DIFis not touched. πSCALEβREAL. 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,CandFhold the solutionsRandL, respectively, to the homogeneous system withC = F = 0. Normally,SCALE = 1.WORKβREAL array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβINTEGER. 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βINTEGER array, dimension(M+N+6).INFOβINTEGER.=0: successful exit<0: IfINFO = -i, the i-th argument had an illegal value.>0:(A, D)and(B, E)have common or close eigenvalues.
β¨ 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 strsyl π¦
subroutine strsyl (character TRANA, character TRANB, integer ISGN, integer
M, integer N, real, dimension( lda, * ) A, integer LDA, real, dimension(
ldb, * ) B, integer LDB, real, dimension( ldc, * ) C, integer LDC, real
SCALE, integer INFO)
STRSYL
β¨ Purpose: β¨
STRSYL solves the real 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**T, and A and B are both upper quasi-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.
A and B must be in Schur canonical form (as returned by SHSEQR), that is, block upper triangular with 1-by-1 and 2-by-2 diagonal blocks; each 2-by-2 diagonal block has its diagonal elements equal and its off-diagonal elements of opposite sign.
π Parameters π
TRANAβTRANA is CHARACTER*1. Specifies the optionop(A):= 'N':op(A) = A(No transpose)= 'T':op(A) = A**T(Transpose)= 'C':op(A) = A**H(Conjugate transpose = Transpose)
TRANBβTRANB is CHARACTER*1. Specifies the optionop(B):= 'N':op(B) = B(No transpose)= 'T':op(B) = B**T(Transpose)= 'C':op(B) = B**H(Conjugate transpose = Transpose)
ISGNβISGN is INTEGER. Specifies the sign in the equation:= +1: solveop(A)*X + X*op(B) = scale*C= -1: solveop(A)*X - X*op(B) = scale*C
MβM is INTEGER. The order of the matrixA, and the number of rows in the matricesXandC.M >= 0.NβN is INTEGER. The order of the matrixB, and the number of columns in the matricesXandC.N >= 0.AβA is REAL array, dimension(LDA,M). The upper quasi-triangular matrixA, in Schur canonical form.LDAβLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβB is REAL array, dimension(LDB,N). The upper quasi-triangular matrixB, in Schur canonical form.LDBβLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CβC is REAL array, dimension(LDC,N). On entry, the M-by-N right hand side matrixC. On exit,Cis overwritten by the solution matrixX.LDCβLDC is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).SCALEβSCALE is REAL. The scale factor,scale, set<= 1to avoid overflow inX.INFOβINFO is INTEGER.= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value= 1:AandBhave common or very close eigenvalues; perturbed values were used to solve the equation (but the matricesAandBare unchanged).
β¨ Author β¨
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
That's the whole vibe, bestie. This was LAPACK Version 3.11.0, dated Sun Nov 27 2022, from realSYcomputational(3). Slay. π β¨
π¦ where this page comes from
- debian bookworm: liblapack-doc 3.11.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms