sgltglyap(3)
π sgltglyap π
okay bestie, welcome to sgltglyap(3) from the MEPACK manual, section 3 β single precision edition, and no cap, this page is a whole vibe. sit down, hydrate, we're doing math. π«Ά
πΈ NAME πΈ
sgltglyap β Single Precision
- Single precision solvers for generalized Lyapunov and Stein equations with triangular coefficient matrices.
β¨ SYNOPSIS β¨
π Functions π
- ```fortran subroutine sla_tglyap_dag (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation with DAG scheduling.
- ```fortran
subroutine sla_tgstein_dag (trans, m, a, lda, b, ldb, x, ldx, scale,
work, info)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation with DAG scheduling.
- ```fortran subroutine sla_tglyap_l2 (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
- ```fortran
subroutine sla_tglyap_l2_unopt (trans, m, a, lda, b, ldb, x, ldx, scale,
work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation (Unoptimized)
- ```fortran subroutine sla_tgstein_l2 (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Stein equation.
- ```fortran
subroutine sla_tglyap_l3 (trans, m, a, lda, b, ldb, x, ldx, scale, work,
info)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
- ```fortran subroutine sla_tglyap_l3_2s (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation two stage.
- ```fortran
subroutine sla_tgstein_l3 (trans, m, a, lda, b, ldb, x, ldx, scale, work,
info)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation.
- ```fortran subroutine sla_tgstein_l3_2s (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation (Two Stage)
- ```fortran
recursive subroutine sla_tglyap_recursive (trans, m, a, lda, b, ldb, x,
ldx, scale, work, info)
Recursive Blocking Algorithm for the generalized Lyapunov equation.
- ```fortran recursive subroutine sla_tgstein_recursive (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Recursive Blocking Algorithm for the generalized Stein equation.
- ```fortran
subroutine sla_ggstein_refine (trans, guess, m, a, lda, b, ldb, x, ldx,
y, ldy, as, ldas, bs, ldbs, q, ldq, z, ldz, maxit, tau, convlog,
work, ldwork, info)
Iterative Refinement for the Generalized Lyapunov Equations.
π Detailed Description π
Single precision solvers for generalized Lyapunov and Stein equations with triangular coefficient matrices.
π¦ Function Documentation π¦
β¨ subroutine sla_ggstein_refine β¨
subroutine sla_ggstein_refine (character, dimension(1) trans, character,
dimension(1) guess, integer m, real, dimension(lda, *) a, integer lda,
real, dimension(ldb, *) b, integer ldb, real, dimension( ldx, *) x,
integer ldx, real, dimension(ldy,*) y, integer ldy, real,
dimension(ldas, *) as, integer ldas, real, dimension(ldbs,*) bs, integer
ldbs, real, dimension(ldq, *) q, integer ldq, real, dimension(ldz, *) z,
integer ldz, integer maxit, real tau, real, dimension(*) convlog, real,
dimension(*) work, integer ldwork, integer info)
Iterative Refinement for the Generalized Lyapunov Equations.
π Purpose π
SLA_GGSTEIN solves a generalized Stein equation of the following forms:
A * X * A^T - B * X * B^T = SCALE * Y (1)
or
A^T * X * A - B^T * X * B = SCALE * Y (2)
where (A,B) is a M-by-M matrix pencil using iterative refinement. The right hand side Y and the solution X are M-by-M matrices. The matrix pencil (A,B) needs to provide as the original data as well as in generalized Schur decomposition since both are required in the iterative refinement process. π
π Parameters π
- TRANS β TRANS is CHARACTER. Specifies the form of the system of equations with respect to A:
== 'N': Equation (1) is solved== 'T': Equation (2) is solved
- GUESS β GUESS is CHARACTER. Specifies whether X contains an initial guess or nor not.
= 'I': X contains an initial guess= 'N': No initial guess, X is set to zero at the begin of the iteration.
- M β M is INTEGER. The order of the matrices A and B.
M >= 0. - A β A is REAL array, dimension
(LDA,M). The array A contains the original matrix A defining the equation. - LDA β LDA is INTEGER. The leading dimension of the array A.
LDA >= max(1,M). - B β B is REAL array, dimension
(LDB,M). The array B contains the original matrix B defining the equation. - LDB β LDB is INTEGER. The leading dimension of the array B.
LDB >= max(1,M). - X β X is REAL array, dimension
(LDX,M). On input, the array X contains the initial guess, ifGUESS = 'I'. On output, the array X contains the solution X. - LDX β LDX is INTEGER. The leading dimension of the array X.
LDX >= max(1,M). - Y β Y is REAL array, dimension
(LDY,M). On input, the array Y contains the right hand side Y. The array stays unchanged during the iteration. - LDY β LDY is INTEGER. The leading dimension of the array Y.
LDY >= max(1,M). - AS β AS is REAL array, dimension
(LDAS,M). The array AS contains the generalized Schur decomposition of the A. - LDAS β LDAS is INTEGER. The leading dimension of the array AS.
LDAS >= max(1,M). - BS β BS is REAL array, dimension
(LDBS,M). The array AS contains the generalized Schur decomposition of the B. - LDBS β LDBS is INTEGER. The leading dimension of the array BS.
LDBS >= max(1,M). - Q β Q is REAL array, dimension
(LDQ,M). The array Q contains the left generalized Schur vectors for(A,B)as returned bySGGES. - LDQ β LDQ is INTEGER. The leading dimension of the array Q.
LDQ >= max(1,M). - Z β Z is REAL array, dimension
(LDZ,M). The array Z contains the right generalized Schur vectors for(A,B)as returned bySGGES. - LDZ β LDZ is INTEGER. The leading dimension of the array Z.
LDZ >= max(1,M). - MAXIT β MAXIT is INTEGER. On input, MAXIT contains the maximum number of iteration that are performed,
MAXIT <= 100. On exit, MAXIT contains the number of iteration steps taken by the algorithm. - TAU β TAU is REAL. On input, TAU contains the additional security factor for the stopping criterion, typical values are
0.1. On exit, TAU contains the last relative residual when the stopping criterion got valid. - CONVLOG β CONVLOG is REAL array, dimension
(MAXIT). The CONVLOG array contains the convergence history of the iterative refinement.CONVLOG(I)contains the maximum relative residual before it is solved for the I-th time. - WORK β WORK is REAL array, dimension
(MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace is returned in LDWORK, ifLDWORK == -1on input. In this case no computations are performed. - LDWORK β LDWORK is INTEGER. If
LDWORK == -1the subroutine will return the required size of the workspace in LDWORK on exit. No computations are performed and none of the arrays are referenced. - INFO β INFO is INTEGER.
== 0: Success> 0: Iteration failed in step INFO< 0: ifINFO = -i, the i-th argument had an illegal value= -50: Some of the internal settings likeNB,...are incorrect.
π See also π
SLA_TGSTEIN_L3SLA_TGSTEIN_L2SLA_TGSTEIN_L3_2SSLA_TGSTEIN_DAGSLA_TGSTEIN_RECURSIVE
π Author π
Martin Koehler, MPI Magdeburg
ποΈ Date ποΈ
October 2025
π Definition π
Definition at line 243 of file sla_ggstein_refine.f90.
π¦ subroutine sla_tglyap_dag π¦
subroutine sla_tglyap_dag (character, dimension(1) trans, integer m, real,
dimension(lda, *) a, integer lda, real, dimension(ldb,*) b, integer ldb,
real, dimension(ldx, *) x, integer ldx, real scale, real, dimension(*)
work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation with DAG scheduling.
π Purpose π
SLA_TGLYAP_DAG solves a generalized Lyapunov equation of the following forms:
A * X * B^T + A * X * B^T = SCALE * Y (2)
or
A^T * X * B + A^T * X * B = SCALE * Y (1)
where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. π
β οΈ Attention β οΈ
The algorithm is implemented using BLAS level 3 operations and DAG.
π Parameters π
- TRANS β TRANS is CHARACTER. Specifies the form of the system of equations with respect to A and B:
== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
- M β M is INTEGER. The order of the matrices A and B.
M >= 0. - A β A is REAL array, dimension
(LDA,M). The matrix A must be (quasi-) upper triangular. - LDA β LDA is INTEGER. The leading dimension of the array A.
LDA >= max(1,M). - B β B
Bβ REAL array, dimension(LDB,M). Bestie,Bhas to be upper triangular. That's the vibe, that's the rule. π¦LDBβ INTEGER, the leading dimension of the arrayB. Constraint check:LDB >= max(1,M). No notes. πXβ REAL array, dimension(LDX,N). On input,Xis holding the right hand sideYlike it's carrying your iced coffee β. On output,Xhas the solution of Equation (1) or (2), whichever one you picked withTRANSA,TRANSB, andSGN. Both the right hand sideYand the solutionXare M-by-N matrices. M-by-N. Say it with me. πLDXβ INTEGER, leading dimension of the arrayX. Constraint:LDX >= max(1,M). Iconic behavior, no drama. β¨SCALEβ REAL. This is the scaling factor whose whole job is to stop the result from overflowing π₯. IfINFO == 0thenSCALEis1.0. Otherwise, if one of the inner systems couldn't be solved correctly, then0 < SCALE <= 1holds true. Respect the bounds, she's doing her best.WORKβ REAL array, dimensionLWORK. It's the workspace for the algorithm, and ngl you have to query it before you run the computation β don't just send it. You do the query by calling the subroutine withINFO == -1on input, and then the required workspace comes back to you inINFO. It's giving "ask before you assume." πINFOβ INTEGER. Okay so this one has layers, keep up:- On input:
== -1β Perform a workspace query<> -1β normal operation
- On exit, workspace query:
< 0β ifINFO = -i, the i-th argument had an illegal value>= 0β The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0β successful exit π< 0β ifINFO = -i, the i-th argument had an illegal value> 0β The equation is not solved correctly. One of the arising inner system got singular. π
- On input:
βοΈ Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
π Definition
Definition at line 154 of file sla_tglyap_dag.f90.
π sla_tglyap_l2
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
subroutine sla_tglyap_l2 (character, dimension(1) trans, integer m, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
π― Purpose
!>
!> SLA_TGLYAP_L2 solves a generalized Lyapunov equation of the following forms
!>
!> A * X * B^T + B * X * A^T = SCALE * Y (1)
!>
!> or
!>
!> A^T * X * B + B^T * X * A = SCALE * Y (2)
!>
!> where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular,
!> and X and Y are symmetric M-by-M matrices.
!> Typically the matrix pencil (A,B) is created by SGGES from LAPACK.
!>
π Attention
The algorithm is implemented using BLAS level 2 operations. That's it, that's the note. π
π§© Parameters
TRANSβ CHARACTER. Specifies the form of the system of equations with respect toAandB:== 'N'β Equation (1) is solved.== 'T'β Equation (2) is solved.
Mβ INTEGER. The order of the matricesAandB.M >= 0. πΈAβ REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. Yes, quasi, that hyphen is load-bearing. π«ΆLDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bβ REAL array, dimension(LDB,M). The matrixBmust be upper triangular. Periodt. πLDBβ INTEGER. The leading dimension of the arrayB.LDB >= max(1,M).Xβ REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANS. Right hand sideYand the solutionXare M-by-N matrices. π¦LDXβ INTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβ REAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. β¨WORKβ REAL array, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. (Yes bestie, you literally must ask first. π₯)INFOβ INTEGER.- On input:
== -1β Perform a workspace query<> -1β normal operation
- On exit, workspace query:
< 0β ifINFO = -i, the i-th argument had an illegal value>= 0β The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0β successful exit π< 0β ifINFO = -i, the i-th argument had an illegal value> 0β The equation is not solved correctly. One of the arising inner system got singular. π
- On input:
βοΈ Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
π Definition
Definition at line 155 of file sla_tglyap_l2.f90.
π sla_tglyap_l2_unopt
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation (Unoptimized)
subroutine sla_tglyap_l2_unopt (character, dimension(1) trans, integer m,
real, dimension(lda, *) a, integer lda, real, dimension(ldb, *) b,
integer ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
π― Purpose
!>
!> SLA_TGLYAP_L2 solves a generalized Lyapunov equation of the following forms
!>
!> A * X * B^T + B * X * A^T = SCALE * Y (1)
!>
!> or
!>
!> A^T * X * B + B^T * X * A = SCALE * Y (2)
!>
!> where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular,
!> and X and Y are symmetric M-by-M matrices.
!> Typically the matrix pencil (A,B) is created by SGGES from LAPACK.
!>
π Attention
The algorithm is implemented using BLAS level 2 operations but works with inefficient SSYR2 calls in the case TRANS="T". Yeah, she's the unoptimized one, she said what she said. π
π§© Parameters
TRANSβ CHARACTER. Specifies the form of the system of equations with respect toAandB:== 'N'β Equation (1) is solved.== 'T'β Equation (2) is solved.
Mβ INTEGER. The order of the matricesAandB.M >= 0. πΈAβ REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bβ REAL array, dimension(LDB,M). The matrixBmust be upper triangular. πLDBβ INTEGER. The leading dimension of the arrayB.LDB >= max(1,M).Xβ REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANS. Right hand sideYand the solutionXare M-by-N matrices. π¦LDXβ INTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβ REAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. β¨WORKβ REAL array, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. π«ΆINFOβ INTEGER.- On input:
== -1β Perform a workspace query<> -1β normal operation
- On exit, workspace query:
< 0β ifINFO = -i, the i-th argument had an illegal value>= 0β The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0β successful exit π< 0β ifINFO = -i, the i-th argument had an illegal value> 0β The equation is not solved correctly. One of the arising inner system got singular. π
- On input:
βοΈ Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
π Definition
Definition at line 156 of file sla_tglyap_l2_unopt.f90.
π₯ sla_tglyap_l3
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
subroutine sla_tglyap_l3 (character, dimension(1) trans, integer m, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
π― Purpose
Okay so real talk, here's the whole situation this routine is solving, bestie π
A * X * B^T + B * X * A^T = SCALE * Y (1)
or
A^T * X * B + B^T * X * A = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular matrix, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. iykyk π
Attention π«Ά
The algorithm is implemented using BLAS level 3 operations. no cap, it's fast.
Parameters β¨
TRANSβTRANSisCHARACTER. It says which form of the system of equations we're doing, with respect toAandB:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMisINTEGER. The order of the matricesAandB.M >= 0. (yes bestie, it can be zero, and that's valid πΈ)AβAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. That's the vibe it needs to serve, okay?LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,M). The matrixBmust be upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,M).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisREAL. It's a scaling factor to prevent the overflow in the result π«£. IfINFO == 0thenSCALEis1.0; otherwise, if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. And listen: the workspace needs to be queried before running the computation. You do the query by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. not me forgetting to query the workspaceβ¦ couldn't be me πINFOβINFOisINTEGER. Here's the whole saga:- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO = -i, the i-th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
- On input:
Author π
Martin Koehler, MPI Magdeburg
Date ποΈ
October 2025
Definition at line 154 of file sla_tglyap_l3.f90.
π subroutine sla_tglyap_l3_2s π
subroutine sla_tglyap_l3_2s (character, dimension(1) trans, integer m, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation two stage. it's giving β¨organized chaosβ¨
Purpose π¦
SLA_TGLYAP_L3_2S solves a generalized Lyapunov equation of the following forms
A * X * B^T + B * X * A^T = SCALE * Y (1)
or
A^T * X * B + B^T * X * A = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular,
and X and Y are symmetric M-by-M matrices.
Typically the matrix pencil (A,B) is created by SGGES from LAPACK.
Attention π«Ά
The algorithm is implemented using BLAS level 3 operations with two stage blocking (DAG inner solves). obsessed, honestly π₯
Parameters β¨
TRANSβTRANSisCHARACTER. It specifies the form of the system of equations with respect toAandB:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMisINTEGER. The order of the matricesAandB.M >= 0.AβAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,M). The matrixBmust be upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,M).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisREAL. A scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0; otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to be queried before running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. π«ΆINFOβINFOisINTEGER. The lore:- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO = -i, the i-th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- On input:
Author π
Martin Koehler, MPI Magdeburg
Date ποΈ
October 2025
Definition at line 153 of file sla_tglyap_l3_2stage.f90.
π recursive subroutine sla_tglyap_recursive π
recursive subroutine sla_tglyap_recursive (character, dimension(1) trans,
integer m, real, dimension(lda, *) a, integer lda, real,
dimension(ldb,*) b, integer ldb, real, dimension(ldx, *) x, integer ldx,
real scale, real, dimension(*) work, integer info)
Recursive Blocking Algorithm for the generalized Lyapunov equation. she recurses, she blocks, she slays π
Purpose π¦
SLA_TGLYAP_RECURSIVE solves a generalized Lyapunov equation of the following forms
A * X * B^T + B * X * A^T = SCALE * Y (1)
or
A^T * X * B + B^T * X * A = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular,
and X and Y are symmetric M-by-M matrices.
Typically the matrix pencil (A,B) is created by SGGES from LAPACK.
Attention π«Ά
The algorithm is implemented using recursive blocking. it's giving main character energy β¨
Parameters β¨
TRANSβTRANSisCHARACTER(1). It specifies the form of the system of equations with respect toAandB:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMisINTEGER. The order of the matricesAandB.M >= 0.AβAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,M). The matrixBmust be upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,M).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisREAL. A scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0; otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREALarray, dimensionM*M. Workspace for the algorithm. πINFOβINFOisINTEGER.== 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
- Author β Martin Koehler, MPI Magdeburg
- Date β October 2025
- Definition at line 140 of file
sla_tglyap_recursive.f90.
π¦ subroutine sla_tgstein_dag
subroutine sla_tgstein_dag (character, dimension(1) trans, integer m, real,
dimension(lda, *) a, integer lda, real, dimension(ldb,*) b, integer ldb,
real, dimension(ldx, *) x, integer ldx, real scale, real, dimension(*)
work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation, but make it scheduled β with DAG energy. β¨
π Purpose
okay bestie, SLA_TGSTEIN_DAG solves a generalized Lyapunov equation of one of these two forms:
A * X * A^T - B * X * B^T = SCALE * Y (1)
or
A^T * X * A - B^T * X * B = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular matrix, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. iykyk π
π Attention
The algorithm is implemented using BLAS level 3 operations and DAG . no cap.
πΈ Parameters
TRANSβTRANSisCHARACTER(1). Specifies the form of the system of equations with respect toA,B, andC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMisINTEGER. The order of the matricesAandC.M >= 0. π«ΆAβAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,M). The matrixBmust be upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,M).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXareM-by-Nmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. protect the vibes from overflow fr.WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. β¨INFOβINFOisINTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO = -i, thei-th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
- On input:
- Author β Martin Koehler, MPI Magdeburg
- Date β October 2025
- Definition at line 152 of file
sla_tgstein_dag.f90.
π subroutine sla_tgstein_l2
subroutine sla_tgstein_l2 (character, dimension(1) trans, integer m, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the generalized Stein equation. the l2 era, iconic. π
π Purpose
okay so SLA_TGSTEIN_L2 solves a generalized Lyapunov equation of one of these two forms:
A * X * A^T - B * X * B^T = SCALE * Y (1)
or
A^T * X * A - B^T * X * B = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular matrix, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. π¦
π Attention
The algorithm is implemented using BLAS level 2 operations. periodt.
πΈ Parameters
TRANSβTRANSisCHARACTER(1). Specifies the form of the system of equations with respect toA,B, andC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMisINTEGER. The order of the matricesAandC.M >= 0. πAβAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,M). The matrixBmust be upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,M).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXareM-by-Nmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. overflow really said not today π .WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. βINFOβINFOisINTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO = -i, thei-th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
- On input:
- Author β Martin Koehler, MPI Magdeburg
- Date β October 2025
- Definition at line 154 of file
sla_tgstein_l2.f90.
β subroutine sla_tgstein_l3
subroutine sla_tgstein_l3 (character, dimension(1) trans, integer m, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation. l3 said main character energy only. π
π Purpose
bestie, SLA_TGSTEIN_L3 solves a generalized Lyapunov equation of one of these two forms:
A * X * A^T - B * X * B^T = SCALE * Y (1)
or
A^T * X * A - B^T * X * B = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular matrix, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. π§
π Attention
The algorithm is implemented using BLAS level 3 operations. no DAG, just pure level-3 slay.
πΈ Parameters
TRANSβTRANSisCHARACTER(1). Specifies the form of the system of equations with respect toA,B, andC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMisINTEGER. The order of the matricesAandC.M >= 0. πAβAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,M). The matrixBmust be upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,M).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXareM-by-Nmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. the overflow shield fr fr.WORKWORKβ REAL array, dimensionLWORK. It's the β¨workspaceβ¨ bestie. And no cap: you gotta query it before you run the computation. How? Call the subroutine withINFO == -1on input, and the required workspace comes back to you inINFO. It's giving "ask first, then do the math" πINFOβ INTEGER. She's the receipts-holder, so listen up π
On input:
== -1: perform a workspace query π<> -1: normal operation, business as usual π
On exit, workspace query:
< 0: ifINFO = -i, the i-th argument had an illegal value π>= 0: the value ofINFOis the required number of elements in the workspace. That's your number bestie, go get it π
On exit, normal operation:
== 0: successful exit, slay π< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: the equation is not solved correctly. One of the arising inner system got singular π (not the cute kind of singular, the sad kind)
Author: Martin Koehler, MPI Magdeburg πΈ
Date: October 2025 π¦
Definition at line 153 of file sla_tgstein_l3.f90.
π sla_tgstein_l3_2s β the two-stage level-3 icon
subroutine sla_tgstein_l3_2s (character, dimension(1) trans, integer m,
real, dimension(lda, *) a, integer lda, real, dimension(ldb, *) b,
integer ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation (Two Stage) β¨
Purpose:
okay so, SLA_TGSTEIN_L3_2S solves a generalized Lyapunov equation of the following forms:
A * X * A^T - B * X * B^T = SCALE * Y (1)
or
A^T * X * A - B^T * X * B = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. iykyk π
Attention:
The algorithm is implemented using BLAS level 3 operations with two level blocking. Highkey fancy, lowkey fast π₯
Parameters:
TRANSβTRANSisCHARACTER(1). Specifies the form of the system of equations with respect toA,B, andC:== 'N': Equation (1) is solved π== 'T': Equation (2) is solved π
MβMis INTEGER. The order of the matricesAandC.M >= 0. β¨AβAis REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. She has structure, respect it πLDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M). πBβBis REAL array, dimension(LDB,M). The matrixBmust be upper triangular. πLDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,M). πXβXis REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices. She literally transforms in front of you, main character energy π¦LDXβLDXis INTEGER. The leading dimension of the arrayX.LDX >= max(1,M). πSCALEβSCALEis REAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. She's the seatbelt π«ΆWORKβWORKis REAL array, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. (yes, "to queried" β we said what we said, bestie π)INFOβINFOis INTEGER.
On input:
== -1: perform a workspace query π<> -1: normal operation π
On exit, workspace query:
< 0: ifINFO = -i, the i-th argument had an illegal value π>= 0: the value ofINFOis the required number of elements in the workspace π
On exit, normal operation:
== 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: the equation is not solved correctly. One of the arising inner system got singular π
Author: Martin Koehler, MPI Magdeburg πΈ
Date: October 2025 π¦
Definition at line 153 of file sla_tgstein_l3_2stage.f90.
π§ sla_tgstein_recursive β recursion, but make it fashion
recursive subroutine sla_tgstein_recursive (character, dimension(1) trans,
integer m, real, dimension(lda, *) a, integer lda, real, dimension(ldb,
*) b, integer ldb, real, dimension(ldx, *) x, integer ldx, real scale,
real, dimension(*) work, integer info)
Recursive Blocking Algorithm for the generalized Stein equation. β¨
Purpose:
SLA_TGSTEIN_RECURSIVE solves a generalized Lyapunov equation of the following forms:
A * X * A^T - B * X * B^T = SCALE * Y (1)
or
A^T * X * A - B^T * X * B = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. Same equation, different blocking strategy, we contain multitudes π
Attention:
The algorithm is implemented using recursive blocking. It's giving "she calls herself" π
Parameters:
TRANSβTRANSisCHARACTER(1). Specifies the form of the system of equations with respect toA,B, andC:== 'N': Equation (1) is solved π== 'T': Equation (2) is solved π
MβMis INTEGER. The order of the matricesAandC.M >= 0. β¨AβAis REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. πLDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M). πBβBis REAL array, dimension(LDB,M). The matrixBmust be upper triangular. πLDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,M). πXβXis REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices. π¦LDXβLDXis INTEGER. The leading dimension of the arrayX.LDX >= max(1,M). πSCALEβSCALEis REAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. π«ΆWORKβWORKis REAL array, dimensionM*M. Workspace for the algorithm. And heads up bestie: this one is justM*M, no fancyINFO == -1query ritual here πINFOβINFOis INTEGER.== 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π> 0: the equation is not solved correctly. One of the arising inner system got singular π
Author: Martin Koehler, MPI Magdeburg πΈ
Date: October 2025 π¦
Definition at line 140 of file sla_tgstein_recursive.f90.
π Author
Generated automatically by Doxygen for MEPACK from the source code. Not me writing this by hand at 2am, the robots did it π€β¨
and that's a wrap on sgltglyap(3), bestie!! MEPACK Version 1.1.2, dated Thu Oct 9 2025 00:00:00 β she's stamped, dated, and absolutely iconic. go solve some Stein equations, you've got this π
ππ
π¦ where this page comes from
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms