dbltglyap(3)
๐ dbltglyap โ Double Precision ๐
okay bestie, gather round, because this is dbltglyap(3) from MEPACK and it is a lot in the best way. It's the whole double precision family for generalized Lyapunov and Stein equations, but specifically the ones where your coefficient matrices are triangular. ๐
โจ NAME โจ
dbltglyap โ Double Precision
Double precision solvers for generalized Lyapunov and Stein equations with triangular coefficient matrices. that's the whole vibe. ๐
๐ธ SYNOPSIS ๐ธ
๐ Functions
okay so here's the full cast, no one gets left out:
dla_tglyap_dagโ Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation with DAG scheduling.
subroutine dla_tglyap_dag (trans, m, a, lda, b, ldb, x, ldx, scale,
work, info)
dla_tgstein_dagโ Level-3 Bartels-Stewart Algorithm for the generalized Stein equation with DAG scheduling.
subroutine dla_tgstein_dag (trans, m, a, lda, b, ldb, x, ldx, scale,
work, info)
dla_tglyap_l2โ Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
subroutine dla_tglyap_l2 (trans, m, a, lda, b, ldb, x, ldx, scale, work,
info)
dla_tglyap_l2_unoptโ Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation (Unoptimized)
subroutine dla_tglyap_l2_unopt (trans, m, a, lda, b, ldb, x, ldx, scale,
work, info)
dla_tgstein_l2โ Level-2 Bartels-Stewart Algorithm for the generalized Stein equation.
subroutine dla_tgstein_l2 (trans, m, a, lda, b, ldb, x, ldx, scale,
work, info)
dla_tglyap_l3โ Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
subroutine dla_tglyap_l3 (trans, m, a, lda, b, ldb, x, ldx, scale, work,
info)
dla_tglyap_l3_2sโ Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation two stage.
subroutine dla_tglyap_l3_2s (trans, m, a, lda, b, ldb, x, ldx, scale,
work, info)
dla_tgstein_l3โ Level-3 Bartels-Stewart Algorithm for the generalized Stein equation.
subroutine dla_tgstein_l3 (trans, m, a, lda, b, ldb, x, ldx, scale, work,
info)
dla_tgstein_l3_2sโ Level-3 Bartels-Stewart Algorithm for the generalized Stein equation (Two Stage)
subroutine dla_tgstein_l3_2s (trans, m, a, lda, b, ldb, x, ldx, scale,
work, info)
dla_tglyap_recursiveโ Recursive Blocking Algorithm for the generalized Lyapunov equation.
recursive subroutine dla_tglyap_recursive (trans, m, a, lda, b, ldb, x,
ldx, scale, work, info)
dla_tgstein_recursiveโ Recursive Blocking Algorithm for the generalized Stein equation.
recursive subroutine dla_tgstein_recursive (trans, m, a, lda, b, ldb, x,
ldx, scale, work, info)
dla_ggstein_refineโ Iterative Refinement for the Generalized Lyapunov Equations.
subroutine dla_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)
๐ฆ DETAILED DESCRIPTION ๐ฆ
Double precision solvers for generalized Lyapunov and Stein equations with triangular coefficient matrices. that's the entire thesis statement, and honestly? iconic. โจ
๐ FUNCTION DOCUMENTATION ๐
๐ dla_ggstein_refine
Iterative Refinement for the Generalized Lyapunov Equations.
subroutine dla_ggstein_refine (character, dimension(1) trans, character,
dimension(1) guess, integer m, double precision, dimension(lda, *) a,
integer lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension( ldx, *) x, integer ldx, double precision,
dimension(ldy,*) y, integer ldy, double precision, dimension(ldas, *)
as, integer ldas, double precision, dimension(ldbs,*) bs, integer ldbs,
double precision, dimension(ldq, *) q, integer ldq, double precision,
dimension(ldz, *) z, integer ldz, integer maxit, double precision tau,
double precision, dimension(*) convlog, double precision, dimension(*)
work, integer ldwork, integer info)
๐ซ Purpose
so DLA_GGSTEIN solves a generalized Stein equation, and it comes in exactly two flavours bestie:
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, and we're solving it with iterative refinement. the right hand side Y and the solution X are both M-by-M matrices. ๐ซถ
and here's the thing โ the matrix pencil (A,B) has to hand over both its original data and its generalized Schur decomposition, because the iterative refinement process needs both. no shortcuts, both or nothing. ๐
๐ฅ Parameters
TRANSโTRANS is CHARACTER. it picks which form of the system we're solving, with respect toA:== 'N':Equation (1) is solved== 'T':Equation (2) is solved
GUESSโGUESS is CHARACTER. tells us whetherXis walking in with an initial guess or not:= 'I':Xcontains an initial guess= 'N':No initial guess โXgets set to zero at the beginning of the iteration
MโM is INTEGER. the order of the matricesAandB. and it'sM >= 0, periodt.AโA is DOUBLE PRECISION array, dimension (LDA,M). this array holds the original matrixAthat defines the equation. ๐LDAโLDA is INTEGER. the leading dimension of the arrayA, andLDA >= max(1,M).BโB is DOUBLE PRECISION array, dimension (LDB,M). this one holds the original matrixBthat defines the equation.LDBโLDB is INTEGER. leading dimension of the arrayB, withLDB >= max(1,M).XโX is DOUBLE PRECISION array, dimension (LDX,M). on input, it holds the initial guess โ but only ifGUESS = 'I'. on output, it holds the solutionX. glow up. โจLDXโLDX is INTEGER. leading dimension of the arrayX,LDX >= max(1,M).YโY is DOUBLE PRECISION array, dimension (LDY,M). on input it holds the right hand sideY, and it stays unchanged for the entire iteration. it's just built different, it doesn't move. ๐LDYโLDY is INTEGER. leading dimension of the arrayY,LDY >= max(1,M).ASโAS is DOUBLE PRECISION array, dimension (LDAS,M). holds the generalized Schur decomposition of theA.LDASโLDAS is INTEGER. leading dimension of the arrayAS,LDAS >= max(1,M).BSโBS is DOUBLE PRECISION array, dimension (LDBS,M). holds the generalized Schur decomposition of theB.LDBSโLDBS is INTEGER. leading dimension of the arrayBS,LDBS >= max(1,M).QโQ is DOUBLE PRECISION array, dimension (LDQ,M). holds the left generalized Schur vectors for(A,B)as returned byDGGES. ๐LDQโLDQ is INTEGER. leading dimension of the arrayQ,LDQ >= max(1,M).ZโZ is DOUBLE PRECISION array, dimension (LDZ,M). holds the right generalized Schur vectors for(A,B)as returned byDGGES.LDZโLDZ is INTEGER. leading dimension of the arrayZ,LDZ >= max(1,M).MAXITโMAXIT is INTEGER. on input it's the maximum number of iterations that get performed, andMAXIT <= 100. on exit it holds the number of iteration steps the algorithm actually took. she reports back. ๐TAUโTAU is DOUBLE PRECISION. on input, the additional security factor for the stopping criterion โ typical values are0.1. on exit, it holds the last relative residual from when the stopping criterion kicked in.CONVLOGโCONVLOG is DOUBLE PRECISION array, dimension (MAXIT). the convergence history of the iterative refinement lives here.CONVLOG(I)holds the maximum relative residual before it is solved for the I-th time. receipts, basically. ๐WORKโWORK is DOUBLE PRECISION array, dimension (MAX(1,LDWORK)). workspace for the algorithm. the optimal workspace gets returned inLDWORKifLDWORK == -1on input โ and in that case, no computations are performed at all.LDWORKโLDWORK is INTEGER. ifLDWORK == -1, the subroutine returns the required size of the workspace inLDWORKon exit. no computations are performed and none of the arrays are referenced. it's just vibes and math. โจINFOโINFO is INTEGER:== 0:Success ๐> 0:Iteration failed in stepINFO๐ญ< 0:ifINFO = -i, the i-th argument had an illegal value= -50:Some of the internal settings likeNB,...are incorrect. ๐
๐ง See also
DLA_TGSTEIN_L3DLA_TGSTEIN_L2DLA_TGSTEIN_L3_2SDLA_TGSTEIN_DAGDLA_TGSTEIN_RECURSIVE
๐ Author
Martin Koehler, MPI Magdeburg
๐ Date
October 2025
๐ Definition
Definition at line 243 of file dla_ggstein_refine.f90.
๐ dla_tglyap_dag
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation with DAG scheduling.
subroutine dla_tglyap_dag (character, dimension(1) trans, integer m, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb,*) b, integer ldb, double precision, dimension(ldx, *) x,
integer ldx, double precision scale, double precision, dimension(*)
work, integer info)
๐ซ Purpose
DLA_TGLYAP_DAG solves a generalized Lyapunov equation, and yeah, it also comes in two 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 matrix, and X and Y are symmetric M-by-M matrices. ๐ธ
typically the matrix pencil (A,B) gets created by DGGES from LAPACK. iykyk.
โ ๏ธ Attention
The algorithm is implemented using BLAS level 3 operations and DAG. that's the whole flex.
๐ฅ Parameters
TRANSโTRANS is CHARACTER. specifies the form of the system of equations with respect toAandB:== 'N':Equation (1) is solved.== 'T':Equation (2) is solved.
MโM is INTEGER. the order of the matricesAandB.M >= 0.AAโ DOUBLE PRECISION array, dimension(LDA,M). Bestie, this matrix has to be (quasi-) upper triangular. That's not a suggestion, that's the vibe check it has to pass. ๐LDAโ INTEGER. The leading dimension of the arrayA. Rule of the land:LDA >= max(1,M). ๐Bโ DOUBLE PRECISION array, dimension(LDB,M). The matrixBmust be upper triangular. Note it's upper triangular proper, no quasi-ness here, she's a strict queen. ๐LDBโ INTEGER. The leading dimension of the arrayB. And yes:LDB >= max(1,M). ๐ฆXโ DOUBLE PRECISION array, dimension(LDX,N). On input,Xholds the right hand sideY. On output,Xholds the solution of Equation (1) or (2), whichever one you picked withTRANSA,TRANSB, andSGN. Both the right hand sideYand the solutionXareM-by-Nmatrices. So she's the glow-up container: comes in as a problem, leaves as the answer. โจLDXโ INTEGER. The leading dimension of the arrayX. Constraint, say it with me:LDX >= max(1,M). ๐SCALEโ DOUBLE PRECISION. This is the scaling factor whose whole job is stopping overflow from ruining the result. IfINFO == 0thenSCALEis1.0D0. Otherwise โ if one of the inner systems couldn't be solved correctly โ0 < SCALE <= 1holds true. So she's the safety net, no cap. ๐ธWORKโ DOUBLE PRECISION array, dimensionLWORK. Workspace for the algorithm. And here's the thing, bestie: you need to query the workspace before running the computation. You do that by calling the subroutine withINFO == -1on input, and the required workspace comes back to you inINFO. Don't skip the query, that's the whole plot. ๐INFOโ INTEGER. She's the receipts, so let's read her carefully.
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 154 of file dla_tglyap_dag.f90.
subroutine dla_tglyap_l2
subroutine dla_tglyap_l2 (character, dimension(1) trans, integer m, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x,
integer ldx, double precision scale, double precision, dimension(*)
work, integer info)
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
Purpose:
fortran !> !> DLA_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 DGGES from LAPACK. !>
Attention
The algorithm is implemented using BLAS level 2 operations. That's the whole tea. ๐
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. Constraint:M >= 0. ๐Aโ DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. No exceptions, bestie. ๐LDAโ INTEGER. The leading dimension of the arrayA.LDA >= max(1,M). ๐ฆBโ DOUBLE PRECISION array, dimension(LDB,M). The matrixBmust be upper triangular. ๐LDBโ INTEGER. The leading dimension of the arrayB.LDB >= max(1,M). ๐ธXโ DOUBLE PRECISION array, dimension(LDX,N). On input,Xcontains the right hand sideY. On output,Xcontains the solution of Equation (1) or (2) as selected byTRANS. Right hand sideYand the solutionXareM-by-Nmatrices. โจLDXโ INTEGER. The leading dimension of the arrayX.LDX >= max(1,M). ๐SCALEโ DOUBLE PRECISION. A scaling factor to prevent overflow in the result. IfINFO == 0thenSCALEis1.0D0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. ๐WORKโ DOUBLE PRECISION array, dimensionLWORK. Workspace for the algorithm. The workspace needs to be queried before running the computation โ you query by calling the subroutine withINFO == -1on input, and 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. ๐
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 155 of file dla_tglyap_l2.f90.
subroutine dla_tglyap_l2_unopt
subroutine dla_tglyap_l2_unopt (character, dimension(1) trans, integer m,
double precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x,
integer ldx, double precision scale, double precision, dimension(*)
work, integer info)
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation (Unoptimized)
Purpose:
fortran !> !> DLA_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 DGGES from LAPACK. !>
Attention
The algorithm is implemented using BLAS level 2 operations but works with inefficient DSYR2 calls in the case TRANS="T". So like, she functions, but she is not thriving in that mode. ๐ญ
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. Constraint:M >= 0. ๐Aโ DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. ๐LDAโ INTEGER. The leading dimension of the arrayA.LDA >= max(1,M). ๐ฆBโ DOUBLE PRECISION array, dimension(LDB,M). The matrixBmust be upper triangular. ๐LDBโ INTEGER. The leading dimension of the arrayB.LDB >= max(1,M). ๐ธXโ DOUBLE PRECISION array, dimension(LDX,N). On input,Xcontains the right hand sideY. On output,Xcontains the solution of Equation (1) or (2) as selected byTRANS. Right hand sideYand the solutionXareM-by-Nmatrices. โจLDXโ INTEGER. The leading dimension of the arrayX.LDX >= max(1,M). ๐SCALEโ DOUBLE PRECISION. A scaling factor to prevent overflow in the result. IfINFO == 0thenSCALEis1.0D0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. ๐WORKโ DOUBLE PRECISION array, dimensionLWORK. Workspace for the algorithm. The workspace needs to be queried before running the computation โ call the subroutine withINFO == -1on input and the required workspace gets 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. ๐
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 156 of file dla_tglyap_l2_unopt.f90.
๐
dla_tglyap_l3
subroutine dla_tglyap_l3 (character, dimension(1) trans, integer m, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x,
integer ldx, double precision scale, double precision, dimension(*)
work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
Purpose:
okay bestie so DLA_TGLYAP_L3 solves a generalized Lyapunov equation, and it comes in two flavors:
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 DGGES from LAPACK. ๐ฆ
Attention
The algorithm is implemented using BLAS level 3 operations. she's efficient, your honor โจ
Parameters
TRANS
TRANS is CHARACTER. It 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular. no exceptions bestie ๐
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
B
B is DOUBLE PRECISION array, dimension (LDB,M). The matrix B must be upper triangular.
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
X
X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
LDX
LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
SCALE
SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. ๐ซถ
WORK
WORK is DOUBLE PRECISION array, dimension LWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO.
INFO
INFO is 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 154 of file dla_tglyap_l3.f90.
๐ธ dla_tglyap_l3_2s
subroutine dla_tglyap_l3_2s (character, dimension(1) trans, integer m,
double precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x,
integer ldx, double precision scale, double precision, dimension(*)
work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation two stage.
Purpose:
so DLA_TGLYAP_L3_2S solves a generalized Lyapunov equation, same two forms as always:
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 DGGES from LAPACK. ๐
Attention
The algorithm is implemented using BLAS level 3 operations with two stage blocking (DAG inner solves). it's giving parallel energy โจ
Parameters
TRANS
TRANS is CHARACTER. It 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 DOUBLE PRECISION 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 is DOUBLE PRECISION array, dimension (LDB,M). The matrix B must be upper triangular.
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
X
X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
LDX
LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
SCALE
SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. ๐ซถ
WORK
WORK is DOUBLE PRECISION array, dimension LWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO.
INFO
INFO is 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 dla_tglyap_l3_2stage.f90.
๐ง dla_tglyap_recursive
recursive subroutine dla_tglyap_recursive (character, dimension(1) trans,
integer m, double precision, dimension(lda, *) a, integer lda, double
precision, dimension(ldb,*) b, integer ldb, double precision,
dimension(ldx, *) x, integer ldx, double precision scale, double
precision, dimension(*) work, integer info)
Recursive Blocking Algorithm for the generalized Lyapunov equation.
Purpose:
and now for the main character: DLA_TGLYAP_RECURSIVE solves a generalized Lyapunov equation in the usual two 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 DGGES from LAPACK. ๐
Attention
The algorithm is implemented using recursive blocking. it calls itself, it's self-care fr fr ๐
Parameters
TRANS
TRANS is CHARACTER(1). It 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 DOUBLE PRECISION 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 is DOUBLE PRECISION array, dimension (LDB,M). The matrix B must be upper triangular.
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
X
X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
LDX
LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
SCALEโ
SCALE
okay so SCALE is DOUBLE PRECISION and it's literally the vibe preserver ๐
โ it's a scaling factor whose whole job is to stop your result from overflowing. if INFO == 0 then SCALE is 1.0D0, no drama. but if one of the inner systems couldn't be solved correctly, then 0 < SCALE <= 1 holds true. so a SCALE that's not 1.0D0 is the algorithm quietly telling you "bestie i did what i could" ๐ญ
WORK
WORK is a DOUBLE PRECISION array, dimension M*M, and it's just workspace for the algorithm. it's the backstage area, not the main character โจ
INFO
INFO is INTEGER, and here's the tea:
== 0: successful exit, we ate ๐< 0: ifINFO = -i, the i-th argument had an illegal value โ you passed something cursed, go fix it ๐> 0: the equation is not solved correctly. one of the arising inner system got singular. not a slay. ๐
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition
at line 140 of file dla_tglyap_recursive.f90.
๐ฆ subroutine dla_tgstein_dag ๐ฆ
okay bestie, next up, and she is giving parallel energy:
subroutine dla_tgstein_dag (character, dimension(1) trans, integer m, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb,*) b, integer ldb, double precision, dimension(ldx, *) x,
integer ldx, double precision scale, double precision, dimension(*)
work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation with DAG scheduling. the DAG is the whole point, she's out here running tasks in a graph, iykyk ๐ง
Purpose
okay so DLA_TGSTEIN_DAG solves a generalized Lyapunov equation, and it comes in two flavors:
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. and like, typically the matrix pencil (A,B) is created by DGGES from LAPACK. so if you got your (A,B) from DGGES, you're in the right place ๐ซถ
Attention: the algorithm is implemented using BLAS level 3 operations and DAG . (yes, there's a space before the period, she's quirky like that ๐ธ)
Parameters
TRANS
TRANSisCHARACTER(1). it 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
AisDOUBLE PRECISIONarray, dimension(LDA,M). the matrixAmust be (quasi-) upper triangular.
LDA
LDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,M).
B
BisDOUBLE PRECISIONarray, dimension(LDB,M). the matrixBmust be upper triangular.
LDB
LDBisINTEGER. the leading dimension of the arrayB.LDB >= max(1,M).
X
XisDOUBLE PRECISIONarray, 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
SCALEisDOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. ifINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.
WORK
WORKisDOUBLE PRECISIONarray, dimensionLWORK. workspace for the algorithm. and listen, the workspace needs to be queried before running the computation โ the query is performed by calling the subroutine withINFO == -1on input, and the required workspace is then returned inINFO. so don't just roll up with a randomWORK, do the query first bestie ๐
INFO
INFOisINTEGER. 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 152 of file dla_tgstein_dag.f90.
๐ subroutine dla_tgstein_l2 ๐
and now the level-2 sister, same energy, fewer BLAS levels:
subroutine dla_tgstein_l2 (character, dimension(1) trans, integer m, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x,
integer ldx, double precision scale, double precision, dimension(*)
work, integer info)
Level-2 Bartels-Stewart Algorithm for the generalized Stein equation. periodt. ๐
Purpose
okay so DLA_TGSTEIN_L2 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. and typically the matrix pencil (A,B) is created by DGGES from LAPACK. iconic behavior honestly โญ
Attention: the algorithm is implemented using BLAS level 2 operations.
Parameters
TRANS
TRANSisCHARACTER(1). it 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
AisDOUBLE PRECISIONarray, dimension(LDA,M). the matrixAmust be (quasi-) upper triangular.
LDA
LDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,M).
B
BisDOUBLE PRECISIONarray, dimension(LDB,M). the matrixBmust be upper triangular.
LDB
LDBisINTEGER. the leading dimension of the arrayB.LDB >= max(1,M).
X
XisDOUBLE PRECISIONarray, 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
SCALEisDOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. ifINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.
WORK
WORKisDOUBLE PRECISIONarray, dimensionLWORK. workspace for the algorithm. and yes, same deal as before: the workspace needs to be queried before running the computation โ the query is performed by calling the subroutine withINFO == -1on input, and the required workspace is then returned inINFO. always query, never guess ๐
INFO
INFOisINTEGER. 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 154 of file dla_tgstein_l2.f90.
๐ subroutine dla_tgstein_l3 ๐
and the trilogy concludes with the level-3 baddie:
subroutine dla_tgstein_l3 (character, dimension(1) trans, integer m, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x,
integer ldx, double precision scale, double precision, dimension(*)
work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation. the final boss ๐ฅ
Purpose
okay so DLA_TGSTEIN_L3 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. and typically the matrix pencil (A,B) is created by DGGES from LAPACK. she's consistent, she's reliable, she's that girl โจ
Attention: the algorithm is implemented using BLAS level 3 operations.
Parameters
TRANS
TRANSisCHARACTER(1). it 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
AisDOUBLE PRECISIONarray, dimension(LDA,M). the matrixAmust be (quasi-) upper triangular.
LDA
LDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,M).
B
BโBis aDOUBLE PRECISIONarray, dimension(LDB,M). Bestie, this matrix has to be upper triangular or we're not doing this. ๐LDBโLDBisINTEGER, the leading dimension of the arrayB. Requirement:LDB >= max(1,M). No exceptions, she's strict. ๐XโXis aDOUBLE PRECISIONarray, dimension(LDX,N). On input,Xis holding your right hand sideYlike it's carrying your emotional baggage. On output,Xcontains the solution of Equation (1) or (2), whichever one you picked withTRANSA,TRANSB, andSGN. Both the right hand sideYand the solutionXareM-by-Nmatrices. โจLDXโLDXisINTEGER, the leading dimension of the arrayX. Requirement:LDX >= max(1,M). Respect the leading dimension, it's the main character. ๐SCALEโSCALEisDOUBLE PRECISION, and she's here purely to stop your result from overflowing into the void. IfINFO == 0thenSCALEis1.0D0; otherwise, if one of the inner systems couldn't be solved correctly, then0 < SCALE <= 1holds true. Iconic damage-control behaviour honestly. ๐WORKโWORKis aDOUBLE PRECISIONarray, dimensionLWORK. It's the workspace for the algorithm. Heads up though: the workspace needs to be queried before running the computation. You do that by calling the subroutine withINFO == -1on input, and then the required workspace comes back to you inINFO. Like a lil fortune teller but for memory. ๐ฎINFOโINFOisINTEGER. Here's the whole vibe:
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 dla_tgstein_l3.f90.
๐ dla_tgstein_l3_2s โ Level-3 Bartels-Stewart Algorithm for the generalized Stein equation (Two Stage)
subroutine dla_tgstein_l3_2s (character, dimension(1) trans, integer m,
double precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x,
integer ldx, double precision scale, double precision, dimension(*)
work, integer info)
โจ Purpose โจ
DLA_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 DGGES from LAPACK. ๐ฆ
๐ Attention
The algorithm is implemented using BLAS level 3 operations with two level blocking.
๐ 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โAis aDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAโLDAisINTEGER, the leading dimension of the arrayA. Requirement:LDA >= max(1,M).BโBis aDOUBLE PRECISIONarray, dimension(LDB,M). The matrixBmust be upper triangular.LDBโLDBisINTEGER, the leading dimension of the arrayB. Requirement:LDB >= max(1,M).XโXis aDOUBLE PRECISIONarray, 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. Requirement:LDX >= max(1,M).SCALEโSCALEisDOUBLE PRECISION. It's a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKโWORKis aDOUBLE PRECISIONarray, 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.
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 dla_tgstein_l3_2stage.f90.
๐ธ dla_tgstein_recursive โ Recursive Blocking Algorithm for the generalized Stein equation
recursive subroutine dla_tgstein_recursive (character, dimension(1) trans,
integer m, double precision, dimension(lda, *) a, integer lda, double
precision, dimension(ldb, *) b, integer ldb, double precision,
dimension(ldx, *) x, integer ldx, double precision scale, double
precision, dimension(*) work, integer info)
โจ Purpose โจ
DLA_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 DGGES from LAPACK. โญ
๐ Attention
The algorithm is implemented using recursive blocking.
๐ 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โAis aDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAโLDAisINTEGER, the leading dimension of the arrayA. Requirement:LDA >= max(1,M).BโBis aDOUBLE PRECISIONarray, dimension(LDB,M). The matrixBmust be upper triangular.LDBโLDBisINTEGER, the leading dimension of the arrayB. Requirement:LDB >= max(1,M).XโXis aDOUBLE PRECISIONarray, 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. Requirement:LDX >= max(1,M).SCALEโSCALEisDOUBLE PRECISION. A scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKโWORKis aDOUBLE PRECISIONarray, dimensionM*M. Workspace for the algorithm. No query dance needed this time, she just wantsM*M. ๐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 dla_tgstein_recursive.f90.
๐ Author
Generated automatically by Doxygen for MEPACK from the source code.
And that's a wrap bestie!! ๐ซถ This whole lil masterpiece is MEPACK version 1.1.2, stamped Thu Oct 9 2025 00:00:00, and filed under dbltglyap(3). Go forth and solve those generalized Stein equations, you absolute legend. ๐
โจ๐
๐ฆ 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