dbltgsylv(3)
๐ dbltgsylv ๐ โ double precision, triangular generalized Sylvester era โจ
okay so bestie, you just opened dbltgsylv(3) from the MEPACK girlies and I am so glad you're here ๐ซถ this page is the entire double precision lineup โ every solver, kernel, and recursion situation for triangular generalized Sylvester equations. it's a lot. it's giving โจalgorithm catalogโจ. we're gonna get through it together, no cap.
โจ NAME โจ
dbltgsylv โ Double Precision ๐ โ the Double Precision routines for triangular generalized Sylvester equations. that's the whole vibe, periodt.
โจ SYNOPSIS โจ
๐ธ Functions ๐ธ
okay so every single one of these is a subroutine, bestie โ except the last three, which are recursive subroutines and yes that distinction matters ๐
go off.
subroutine dla_tgcsylv_dag (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ the Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation, and it does the whole thing with DAG scheduling ๐ฅ she's organized, she's parallel, she ate.subroutine dla_tgcsylv_dual_dag (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ the OpenMP4 - DAG Algorithm for the dual generalized coupled Sylvester equation โจ threads said let's go.subroutine dla_tgsylv_dag (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation, with DAG based parallelization. iconic behaviour honestly.subroutine dla_tgcsylv_dual_kernel_44nn (sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, info)โ solver for a 4x4 dual generalized coupled Sylvester equation whenTRANSA = N,TRANSB = N๐subroutine dla_tgcsylv_dual_kernel_44nt (sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, info)โ same 4x4 dual generalized coupled Sylvester equation solver energy, butTRANSA = N,TRANSB = T๐ฆsubroutine dla_tgcsylv_dual_kernel_44tn (sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, info)โ 4x4 dual generalized coupled Sylvester equation solver,TRANSA = T,TRANSB = N๐ธsubroutine dla_tgcsylv_dual_kernel_44tt (sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, info)โ and the last of the quartet: 4x4 dual generalized coupled Sylvester equation,TRANSA = T,TRANSB = Tโญsubroutine dla_tgcsylv_dual_l2 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation. level 2 but make it dual โจsubroutine dla_tgcsylv_dual_l2_local_copy (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation, this one tagged (Local Copy) ๐subroutine dla_tgcsylv_dual_l2_local_copy_128 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the dual generalized coupled Sylvester equation (Local Copy), the_128flavour ๐subroutine dla_tgcsylv_dual_l2_local_copy_32 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the dual generalized coupled Sylvester equation (Local Copy),_32edition ๐subroutine dla_tgcsylv_dual_l2_local_copy_64 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the dual generalized coupled Sylvester equation (Local Copy),_64girlie ๐subroutine dla_tgcsylv_dual_l2_local_copy_96 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the dual generalized coupled Sylvester equation (Local Copy),_96and that's the whole local-copy set ๐ฅsubroutine dla_tgcsylv_l2 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation, and it's marked (Optimized) ๐subroutine dla_tgcsylv_l2_local_copy (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the generalized coupled Sylvester equation (Optimized) โจsubroutine dla_tgcsylv_l2_local_copy_128 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the generalized coupled Sylvester equation (Optimized),_128variant ๐ฆsubroutine dla_tgcsylv_l2_local_copy_32 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the generalized coupled Sylvester equation (Optimized),_32variant ๐ธsubroutine dla_tgcsylv_l2_local_copy_64 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the generalized coupled Sylvester equation (Optimized),_64variant โญsubroutine dla_tgcsylv_l2_local_copy_96 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the generalized coupled Sylvester equation (Optimized),_96variant ๐subroutine dla_tgcsylv_l2_reorder (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the generalized coupled Sylvester equation (Optimized), and this one reorders, hence the name, iykyk ๐subroutine dla_tgcsylv_l2_unopt (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-2 Kagstroem-Westin/Bartels-Stewart for the generalized coupled Sylvester equation, (unoptimized) โ yes bestie, the unoptimized one exists too and we respect her ๐ซถsubroutine dla_tgsylv_gardiner_laub (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ the Level-2 Gardiner-Laub algorithm for the generalized Sylvester equation ๐ a whole different algorithm family, we love range.subroutine dla_tgsylv_l2 (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation, (Optimized) โจsubroutine dla_tgsylv_l2_colwise (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-2 Bartels-Stewart for the generalized Sylvester equation, (unoptimized), going column-wise ๐subroutine dla_tgsylv_l2_local_copy (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-2 Bartels-Stewart for the generalized Sylvester equation, (Optimized) ๐subroutine dla_tgsylv_l2_local_copy_128 (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-2 Bartels-Stewart for the generalized Sylvester equation, (Optimized),_128๐subroutine dla_tgsylv_l2_local_copy_32 (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-2 Bartels-Stewart for the generalized Sylvester equation, (Optimized),_32๐subroutine dla_tgsylv_l2_local_copy_64 (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-2 Bartels-Stewart for the generalized Sylvester equation, (Optimized),_64๐subroutine dla_tgsylv_l2_local_copy_96 (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-2 Bartels-Stewart for the generalized Sylvester equation, (Optimized),_96๐ฅsubroutine dla_tgsylv_l2_reorder (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-2 Bartels-Stewart for the generalized Sylvester equation, (Optimized), reordering edition โจsubroutine dla_tgsylv_l2_rowwise (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-2 Bartels-Stewart for the generalized Sylvester equation, (unoptimized), row-wise this time ๐ฆsubroutine dla_tgcsylv_dual_l3 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation ๐ level 3, dual, she's back and she's bigger.subroutine dla_tgcsylv_dual_l3_2s (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm with sub blocking for the dual generalized coupled Sylvester equation ๐ธ the2smeans sub blocking, and it's giving structure.subroutine dla_tgcsylv_l3_2s (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation, (optimized), sub-blocking style ๐subroutine dla_tgcsylv_l3 (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation, (optimized) โจsubroutine dla_tgcsylv_l3_unopt (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation, (unoptimized) ๐ still valid, still serving.subroutine dla_tgsylv_l3_2s (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation,2sflavour ๐ฅsubroutine dla_tgsylv_l3_colwise (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation, going column-wise ๐ฆsubroutine dla_tgsylv_l3 (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation โญ the classic.subroutine dla_tgsylv_l3_rowwise (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation, row-wise ๐recursive subroutine dla_tgcsylv_dual_recursive (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ the Recursive blocking Algorithm for the dual generalized coupled Sylvester equation ๐ note therecursivekeyword bestie, she calls herself.recursive subroutine dla_tgcsylv_recursive (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, work, info)โ the Recursive Algorithm for the generalized coupled Sylvester equation ๐ธ recursion girlies rise.recursive subroutine dla_tgsylv_recursive (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)โ the Level-3 Recursive Blocked Solver for the generalized Sylvester equation ๐ and that's the wholerecursivetrio.
and that's the SYNOPSIS roster for this part bestie ๐ there's so much more coming โ don't go anywhere, we're not even close to done ๐
๐ Detailed Description ๐
okay so bestie, this whole section is about double precision routines for triangular generalized Sylvester equations. no cap. We're solving the standard Sylvester equation where the coefficient matrices are (quasi) triangular. Those matrices are normally generated with the help of the Schur decomposition from LAPACK. And every single routine here? Works in double precision arithmetic. periodt. ๐
โจ Function Documentation โจ
๐ฆ dla_tgcsylv_dag ๐ฆ
subroutine dla_tgcsylv_dag (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn1, double precision sgn2,
integer m, integer n, double precision, dimension(lda, *) a, integer
lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
This is the Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation, and it's got DAG scheduling on top. iconic behavior. ๐ฅ
โจ Purpose โจ
!>
!> DLA_TGCSYLV_DAG solves a generalized coupled Sylvester equation of the following form
!>
!> op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
!> op1(C) * R + SGN2 * L * op2(D) = SCALE * F
!>
!> where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular
!> matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or
!> D can be quasi upper triangular as well. The right hand side Y and the solution X
!> M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are
!> created by DGGES from LAPACK.
!>
So basically you've got these two equations, and A and C are M-by-M, B and D are N-by-N. A is quasi upper triangular, C is upper triangular, and B and D are upper triangular โ but either B or D can be quasi upper triangular too. The right hand side Y and the solution X are M-by-N matrices (yeah, the original says Y and X, even though the equations use E, F, R, L โ we're keeping it exactly as written, bestie ๐). The matrix pencils (A,C) and (B,D) (or (D,B)) usually come from DGGES in LAPACK. ๐
๐ฌ Remarks ๐ฌ
The Algorithm uses OpenMP DAG scheduling. that's it, that's the remark. periodt. โจ
๐ธ Parameters ๐ธ
TRANSAโCHARACTER(1). Specifies the form of the system of equations with respect to A and C:== 'N':op1(A) = A,op1(C) = C(No transpose for A and C);== 'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C). ๐TRANSBโCHARACTER(1). Specifies the form of the system of equations with respect to B and D:== 'N':op2(B) = B,op2(D) = D(No transpose for B and D);== 'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D). ๐ฆSGN1โDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation. ๐ธSGN2โDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation. ๐ธMโINTEGER. The order of the matrices A and C.M >= 0. ๐NโINTEGER. The order of the matrices B and D.N >= 0. ๐AโDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular. ๐LDAโINTEGER. The leading dimension of the array A.LDA >= max(1,M). โจBโDOUBLE PRECISIONarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular. ๐LDBโINTEGER. The leading dimension of the array B.LDB >= max(1,N). ๐CโDOUBLE PRECISIONarray, dimension(LDC,M). The matrix C must be upper triangular. ๐LDCโINTEGER. The leading dimension of the array C.LDC >= max(1,M). ๐DโDOUBLE PRECISIONarray, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular. ๐ฆLDDโINTEGER. The leading dimension of the array D.LDD >= max(1,N). ๐ธEโDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrix E contains the right hand side E. On output, the matrix E contains the solution R of Equation (1) as selected by TRANSA, TRANSB, and SGN1/SGN2. Right hand side E and the solution R are M-by-N matrices. ๐LDEโINTEGER. The leading dimension of the array E.LDE >= max(1,M). โจFโDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrix F contains the right hand side F. On output, the matrix F contains the solution L of Equation (1) as selected by TRANSA, TRANSB, and SGN1/SGN2. Right hand side F and the solution L are M-by-N matrices. ๐LDFโINTEGER. The leading dimension of the array F.LDE >= max(1,M).
not me catching that the original literally saysLDE >= max(1,M)forLDF๐ญ we keep it exactly as written, bestie. no cap.
SCALEโDOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. ๐ธWORKโDOUBLE PRECISIONarray, 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 of INFO is 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 217 of file dla_tgcsylv_dag.f90.
๐ dla_tgcsylv_dual_dag ๐
subroutine dla_tgcsylv_dual_dag (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn1, double precision sgn2,
integer m, integer n, double precision, dimension(lda, *) a, integer
lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
OpenMP4 - DAG Algorithm for the dual generalized coupled Sylvester equation. it's giving duality, bestie. ๐ฅ
โจ Purpose โจ
!>
!> DLA_TGCSYLV_DUAL_DAG solves a generalized coupled Sylvester equation of the following form
!>
!> op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
!> SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
!>
!> where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular
!> matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or
!> D can be quasi upper triangular as well. The right hand sides E, F and the solutions R, L are
!> M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are
!> created by DGGES from LAPACK.
!> The equation (1) is the dual to the generalized coupled Sylvester equation
!>
!> op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
!> op1(C) * R + SGN2 * L * op2(D) = SCALE * F
!>
!> The equation (1) is the dual one to equation (2) with respect to the underlying linear system.
!> Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields
!>
!> | kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
!> Z X = | |*| | = | |
!> | kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
!>
!> Regarding Z**T one obtains
!>
!> | kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
!> Z**T X = | |*| | = | |
!> | SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
!>
!> which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB
!> are expressed in terms of the Sylvester equation (2).
!>
!>
So yeah, this is the dual to the generalized coupled Sylvester equation (2). The whole Kronecker form thing shows why TRANSA and TRANSB are expressed in terms of equation (2), not (1). iykyk. ๐
๐ธ Parameters ๐ธ
TRANSAโCHARACTER(1). Specifies the form of the system of equations with respect to A and C:== 'N':op1(A) = A,op1(C) = C(No transpose for A and C);== 'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C). ๐TRANSBโCHARACTER(1). Specifies the form of the system of equations with respect to B and D:== 'N':op2(B) = B,op2(D) = D(No transpose for B and D);== 'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D). โจSGN1โDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation. ๐SGN2โDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation. ๐MโINTEGER. The order of the matrices A and C.M >= 0. ๐NโINTEGER. The order of the matrices B and D.N >= 0. ๐AโDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular. ๐ฆLDALDAโ INTEGER โจ it's the leading dimension of the arrayA, so the rule isLDA >= max(1,M). No cap.Bโ DOUBLE PRECISION array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. And heads up bestie: if the matrixDis already quasi-upper triangular, thenBhas to be plain upper triangular. it's giving teamwork ๐คLDBโ INTEGER ๐ leading dimension of the arrayB. Constraint:LDB >= max(1,N).Cโ DOUBLE PRECISION array, dimension(LDC,M). The matrixCmust be upper triangular, periodt.LDCโ INTEGER ๐ธ leading dimension of the arrayC. Constraint:LDC >= max(1,M).Dโ DOUBLE PRECISION array, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. And mirror-mirror: if the matrixBis already quasi-upper triangular, thenDmust be upper triangular. ๐LDDโ INTEGER โญ leading dimension of the arrayD. Constraint:LDD >= max(1,N).Eโ DOUBLE PRECISION array, dimension(LDE,N). On input, the matrixEholds the right hand sideE. On output, the matrixEholds the solutionRof Equation (1), as selected byTRANSA,TRANSB, andSGN1/SGN2. Both the right hand sideEand the solutionRareM-by-Nmatrices. ๐ฆ it literally transforms in place.LDEโ INTEGER ๐ leading dimension of the arrayE. Constraint:LDE >= max(1,M).Fโ DOUBLE PRECISION array, dimension(LDF,N). On input, the matrixFholds the right hand sideF. On output, the matrixFholds the solutionLof Equation (1), as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand solutionLareM-by-Nmatrices. โจLDFโ INTEGER ๐ leading dimension of the arrayF. Constraint, and I'm quoting this exactly:LDE >= max(1,M). yes it saysLDE๐ we report, we don't rewrite.SCALEโ DOUBLE PRECISION.SCALEis a scaling factor that exists to prevent overflow in the result. IfINFO == 0thenSCALEis1.0D0; otherwise, if one of the inner systems could not be solved correctly, then0 < SCALE <= 1holds true. ๐ฅ protecting your numbers fr fr.WORKโ DOUBLE PRECISION array, dimensionLWORK. Workspace for the algorithm. You have to query the workspace before running the computation โ you do that by calling the subroutine withINFO == -1on input, and then the required workspace comes back inINFO. ๐ don't skip the query bestie.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 ๐
Definition at line 237 of file dla_tgcsylv_dual_dag.f90.
๐ฆ subroutine dla_tgcsylv_dual_kernel_44nn ๐ฆ
subroutine dla_tgcsylv_dual_kernel_44nn (double precision sgn1, double
precision sgn2, integer m, integer n, double precision, dimension(lda,
*) a, integer lda, double precision, dimension(ldb, *) b, integer ldb,
double precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, integer info)
Solver for a 4x4 dual generalized coupled Sylvester equation (TRANSA = N, TRANSB = N) โจ
Purpose ๐
DLA_TGCSYLV_DUAL_KERNEL_44NN solves a generalized coupled Sylvester equation of the following form ๐
op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. ๐
The equation (1) is the dual to the generalized coupled Sylvester equation
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
The equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields โจ
| kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
Z X = | |*| | = | |
| kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
Regarding Z**T one obtains ๐
| kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
Z**T X = | |*| | = | |
| SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2). ๐
iykyk.
Attention โ ๏ธ
This routine only allows to solve equations that are at most of size4 x 4. The operator argumentsTRANSAandTRANSBare fixed toop1(H) = Handop2(H) = H. The primary use of this function is to end the recursion indla_tgcsylv_dual_recursive. ๐ซถ so like, don't come here with your giant matrix, it is literally not that girl.
Parameters ๐
SGN1โ DOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation. ๐SGN2โ DOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation. ๐Mโ INTEGER. The order of the matricesAandC. Range:128 >= M >= 0. ๐ธNโ INTEGER. The order of the matricesBandD. Range:128 >= N >= 0. ๐ธAโ DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. โจLDAโ INTEGER. The leading dimension of the arrayA. Constraint:LDA >= max(1,M). ๐Bโ DOUBLE PRECISION array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. ๐คLDBโ INTEGER. The leading dimension of the arrayB. Constraint:LDB >= max(1,N). โญCโ DOUBLE PRECISION array, dimension(LDC,M). The matrixCmust be upper triangular. periodt.LDCโ INTEGER. The leading dimension of the arrayC. Constraint:LDC >= max(1,M). ๐Dโ DOUBLE PRECISION array, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. ๐LDDโ INTEGER. The leading dimension of the arrayD. Constraint:LDD >= max(1,N). ๐Eโ DOUBLE PRECISION array, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRareM-by-Nmatrices. ๐ฆLDEโ INTEGER. The leading dimension of the arrayE. Constraint:LDE >= max(1,M). ๐Fโ DOUBLE PRECISION array, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLareM-by-Nmatrices. โจLDFโ INTEGER. The leading dimension of the arrayF. Constraint, quoted exactly:LDE >= max(1,M). ๐ again with theLDE, iconic honestly.SCALEโ DOUBLE 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. ๐ฅINFOโ INTEGER ๐
On exit:
== 0: successful exit> 0: The equation is not solved correctly. One of the arising inner system got singular. ๐
Author ๐ธ
Martin Koehler, MPI Magdeburg
Date ๐
October 2025
Definition ๐
Definition at line 206 of file dla_tgcsylv_dual_kernel_44_nn.f90.
๐ subroutine dla_tgcsylv_dual_kernel_44nt ๐
subroutine dla_tgcsylv_dual_kernel_44nt (double precision sgn1, double
precision sgn2, integer m, integer n, double precision, dimension(lda,
*) a, integer lda, double precision, dimension(ldb, *) b, integer ldb,
double precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, integer info)
Solver for a 4x4 dual generalized coupled Sylvester equation (TRANSA = N, TRANSB = T) โจ
Purpose ๐
...okay so like, here's the whole vibe of it, bestie. โจ DLA_TGCSYLV_DUAL_KERNEL_44NT solves a generalized coupled Sylvester equation that looks like this:
op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. And also? Either B or D can be quasi upper triangular too, no big deal. ๐
The right hand sides E, F and the solutions R, L are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK, iykyk. ๐ซถ
Equation (1) is the dual to the generalized coupled Sylvester equation
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
The equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields
| kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
Z X = | |*| | = | |
| kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
Regarding Z**T one obtains
| kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
Z**T X = | |*| | = | |
| SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2). ๐ฆ
๐ Attention ๐
This routine only allows to solve equations that are at most of size 4 x 4. The operator argumentsTRANSAandTRANSBare fixed toop1(H) = Handop2(H) = H**T. The primary use of this function is to end the recursion indla_tgcsylv_dual_recursive.
โจ Parameters โจ
SGN1โSGN1is DOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation. ๐SGN2โSGN2is DOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation. ๐MโMis INTEGER. The order of the matrices A and C.128 >= M >= 0.NโNis INTEGER. The order of the matrices B and D.128 >= N >= 0.AโAis DOUBLE PRECISION array, dimension(LDA,M). The matrix A must be (quasi-) upper triangular.LDAโLDAis INTEGER. The leading dimension of the array A.LDA >= max(1,M).BโBis DOUBLE PRECISION array, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular. ๐LDBโLDBis INTEGER. The leading dimension of the array B.LDB >= max(1,N).CโCis DOUBLE PRECISION array, dimension(LDC,M). The matrix C must be upper triangular.LDCโLDCis INTEGER. The leading dimension of the array C.LDC >= max(1,M).DโDis DOUBLE PRECISION array, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular. ๐LDDโLDDis INTEGER. The leading dimension of the array D.LDD >= max(1,N).EโEis DOUBLE PRECISION array, dimension(LDE,N). On input, the matrix E contains the right hand side E. On output, the matrix E contains the solution R of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side E and the solution R are M-by-N matrices. ๐ธLDEโLDEis INTEGER. The leading dimension of the array E.LDE >= max(1,M).FโFis DOUBLE PRECISION array, dimension(LDF,N). On input, the matrix F contains the right hand side F. On output, the matrix F contains the solution L of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side F and the solution L are M-by-N matrices. ๐ธLDFโLDFis INTEGER. The leading dimension of the array F.LDE >= max(1,M). (yes bestie, it saysLDEthere, that's literally what it says, we don't touch it ๐)SCALEโSCALEis DOUBLE 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.INFOโINFOis INTEGER.- On exit:
== 0: successful exit ๐> 0: The equation is not solved correctly. One of the arising inner system got singular. ๐ญ
- On exit:
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
โญ Definition โญ
Definition at line 206 of file dla_tgcsylv_dual_kernel_44_nt.f90.
๐
dla_tgcsylv_dual_kernel_44tn ๐
subroutine dla_tgcsylv_dual_kernel_44tn (double precision sgn1, double
precision sgn2, integer m, integer n, double precision, dimension(lda,
*) a, integer lda, double precision, dimension(ldb, *) b, integer ldb,
double precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, integer info)
Solver for a 4x4 dual generalized coupled Sylvester equation (TRANSA = T, TRANSB = N). ๐ฅ
๐ Purpose ๐
okay so like, DLA_TGCSYLV_DUAL_KERNEL_44TN solves a generalized coupled Sylvester equation of the following form
op1(A)**T * R + op1(C)**T *L = SCALE * E (1)
SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand sides E, F and the solutions R, L are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. ๐ซถ
The equation (1) is the dual to the generalized coupled Sylvester equation
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
The equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields
| kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
Z X = | |*| | = | |
| kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
Regarding Z**T one obtains
| kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
Z**T X = | |*| | = | |
| SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2). ๐ฆ
๐ Attention ๐
This routine only allows to solve equations that are at most of size 4 x 4. The operator argumentsTRANSAandTRANSBare fixed toop1(H) = H**Tandop2(H) = H. The primary use of this function is to end the recursion indla_tgcsylv_dual_recursive.
โจ Parameters โจ
SGN1โSGN1is DOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation. ๐SGN2โSGN2is DOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation. ๐MโMis INTEGER. The order of the matrices A and C.128 >= M >= 0.NโNis INTEGER. The order of the matrices B and D.128 >= N >= 0.AโAis DOUBLE PRECISION array, dimension(LDA,M). The matrix A must be (quasi-) upper triangular.LDAโLDAis INTEGER. The leading dimension of the array A.LDA >= max(1,M).BโBis DOUBLE PRECISION array, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular. ๐LDBโLDBis INTEGER. The leading dimension of the array B.LDB >= max(1,N).CโCis DOUBLE PRECISION array, dimension(LDC,M). The matrix C must be upper triangular.LDCโLDCis INTEGER. The leading dimension of the array C.LDC >= max(1,M).DโDis DOUBLE PRECISION array, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular. ๐LDDโLDDis INTEGER. The leading dimension of the array D.LDD >= max(1,N).EEโDOUBLE PRECISIONarray</p>, dimension(LDE,N). On input it's holding the right hand sideE. On output? Bestie, it's been replaced ๐ โ now it holds the solutionRof Equation (1), as selected byTRANSA,TRANSB, andSGN1/SGN2. Both the right hand sideEand the solutionRareM-by-Nmatrices, no cap.LDEโINTEGER. It's the leading dimension of the arrayE. Requirement:LDE >= max(1,M). That's the vibe check, and it must pass.FโDOUBLE PRECISIONarray</p>, dimension(LDF,N). On input it's carrying the right hand sideF. On output it's carrying the solutionLof Equation (1), again as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand solutionLareM-by-Nmatrices. Periodt.LDFโINTEGER. The leading dimension of the arrayF. And the constraint, exactly as written:LDE >= max(1,M). ๐ Yes, it saysLDE. That's what the page says, so that's what we're saying, fr fr.SCALEโDOUBLE PRECISION. She's the scaling factor whose whole job is to stop the result from overflowing. IfINFO == 0thenSCALEis1.0D0. Otherwise โ like, if one of the inner systems couldn't be solved correctly โ then0 < SCALE <= 1holds true. ๐INFOโINTEGER. On exit:== 0: successful exit โจ> 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 206 of file dla_tgcsylv_dual_kernel_44_tn.f90.
subroutine dla_tgcsylv_dual_kernel_44tt ๐ฆ
Okay here's the signature, copied exactly, character for character:
subroutine dla_tgcsylv_dual_kernel_44tt (double precision sgn1, double
precision sgn2, integer m, integer n, double precision, dimension(lda,
*) a, integer lda, double precision, dimension(ldb, *) b, integer ldb,
double precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, integer info)
Solver for a 4x4 dual generalized coupled Sylvester equation (TRANSA = T, TRANSB = T). Not me being dramatic โ that's literally the one-liner. ๐
Purpose:
!>
!> DLA_TGCSYLV_DUAL_KERNEL_44TT solves a generalized coupled Sylvester equation of the following form
!>
!> op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
!> SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
!>
!> where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular
!> matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or
!> D can be quasi upper triangular as well. The right hand sides E, F and the solutions R, L are
!> M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are
!> created by DGGES from LAPACK.
!> The equation (1) is the dual to the generalized coupled Sylvester equation
!>
!> op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
!> op1(C) * R + SGN2 * L * op2(D) = SCALE * F
!>
!> The equation (1) is the dual one to equation (2) with respect to the underlying linear system.
!> Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields
!>
!> | kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
!> Z X = | |*| | = | |
!> | kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
!>
!> Regarding Z**T one obtains
!>
!> | kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
!> Z**T X = | |*| | = | |
!> | SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
!>
!> which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB
!> are expressed in terms of the Sylvester equation (2).
!>
!>
Attention ๐จ
This routine only allows to solve equations that are at most of size 4 x 4. The operator arguments TRANSA and TRANSB are fixed to op1(H) = H**T and op2(H) = H**T. The primary use of this function is to end the recursion in dla_tgcsylv_dual_recursive. Like, it's the little one that says "we're done here" ๐ธ
Parameters
SGN1โDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation.SGN2โDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation.MโINTEGER. The order of the matricesAandC. Constraint:128 >= M >= 0.NโINTEGER. The order of the matricesBandD. Constraint:128 >= N >= 0.AโDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BโDOUBLE PRECISIONarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. And heads up: if the matrixDis already quasi-upper triangular, then the matrixBmust be upper triangular. ๐LDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular. No quasi about it.LDCโINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. And flip it: if the matrixBis already quasi-upper triangular, then the matrixDmust be upper triangular. ๐ซถLDDโINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).EโDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRareM-by-Nmatrices.LDEโINTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FโDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLareM-by-Nmatrices.LDFโINTEGER. The leading dimension of the arrayF. And once again, exactly as the page says:LDE >= max(1,M). ๐ Keeping it verbatim because that's the assignment.SCALEโDOUBLE PRECISION. 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. ๐INFOโINTEGER. On exit:== 0: successful exit โจ> 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 206 of file dla_tgcsylv_dual_kernel_44_tt.f90.
subroutine dla_tgcsylv_dual_l2 ๐ง
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation. Say that five times fast, I dare you ๐ญ
Here's the signature, verbatim:
subroutine dla_tgcsylv_dual_l2 (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn1, double precision sgn2,
integer m, integer n, double precision, dimension(lda, *) a, integer
lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Purpose:
!>
!> DLA_TGCSYLV_DUAL_L2 solves a generalized coupled Sylvester equation of the following form
!>
!> op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
!> SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
!>
!> where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular
!> matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or
!> D can be quasi upper triangular as well. The right hand sides E, F and the solutions R, L are
!> M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are
!> created by DGGES from LAPACK.
!> The equation (1) is the dual to the generalized coupled Sylvester equation
!>
!> op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
!> op1(C) * R + SGN2 * L * op2(D) = SCALE * F
!>
!> The equation (1) is the dual one to equation (2) with respect to the underlying linear system.
!> Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields
!>
!> | kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
!> Z X = | |*| | = | |
!> | kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
!>
!> Regarding Z**T one obtains
!>
!> | kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
!> Z**T X = | |*| | = | |
!> | SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
!>
!> which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB
!> are expressed in terms of the Sylvester equation (2).
!>
!>
โจ Remarks โจ
Okay so real talk about the vibe of this algorithm: it's implemented using BLAS level 2 operations and hand written optimizations. That's the whole flex. ๐
Parameters ๐
TRANSAโTRANSAisCHARACTER(1). It specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(no transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(transposeAandC)
TRANSBโTRANSBisCHARACTER(1). It specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(no transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(transposeBandD)
SGN1โSGN1isDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the first equation. ๐ซถSGN2โSGN2isDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the second equation. โจMโMisINTEGER. The order of the matricesAandC.M >= 0.NโNisINTEGER. The order of the matricesBandD.N >= 0.AโAisDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. no cap, that shape mattersLDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BโBisDOUBLE PRECISIONarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. yes, that's conditional, read it twice bestieLDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโCisDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular. ๐LDCโLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDisDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. mirror logic, love that for usLDDโLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).EโEisDOUBLE PRECISIONarray, dimension(LDE,N).- On input, the matrix
Econtains the right hand sideE. - On output, the matrix
Econtains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. - Right hand side
Eand the solutionRare M-by-N matrices. ๐ฆ
- On input, the matrix
LDEโLDEisINTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FโFisDOUBLE PRECISIONarray, dimension(LDF,N).- On input, the matrix
Fcontains the right hand sideF. - On output, the matrix
Fcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. - Right hand side
Fand the solutionLare M-by-N matrices. ๐ฆ
- On input, the matrix
LDFโLDFisINTEGER. The leading dimension of the arrayF.LDE >= max(1,M). heads up: the doc literally saysLDEhere, notLDF, so we're keeping it exactly as written โ iykykSCALEโSCALEisDOUBLE PRECISION.SCALEis 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โWORKisDOUBLE PRECISIONarray, 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. workspace query first or perish ๐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. ๐
- On input:
Optimizations: ๐ฅ
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DGERby Fortran intrinsic,
Author โ Martin Koehler, MPI Magdeburg ๐
Date โ October 2025
Definition โ at line 245 of file dla_tgcsylv_dual_l2.f90.
subroutine dla_tgcsylv_dual_l2_local_copy (character, dimension(1) transa,
character, dimension(1) transb, double precision sgn1, double precision
sgn2, integer m, integer n, double precision, dimension(lda, *) a,
integer lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation (Local Copy) ๐
Purpose:
okay so bestie, DLA_TGCSYLV_DUAL_L2_LOCAL_COPY ๐ solves a generalized coupled Sylvester equation shaped exactly like this:
op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Also, literally either B or D can be quasi upper triangular too, no biggie. The right hand sides E, F and the solutions R, L are all M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are made by DGGES from LAPACK. ๐ซถ
The equation (1) is the dual to the generalized coupled Sylvester equation
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
and equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. That gives you:
| kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
Z X = | |*| | = | |
| kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
and looking at Z**T you get:
| kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
Z**T X = | |*| | = | |
| SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
which belongs to the Sylvester equation (1). That's literally why the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2). iykyk ๐ธ
โจ Remarks โจ
The algorithm is implemented using BLAS level 2 operations plus hand written optimizations, and it uses local copies of the input data. For this reason M and N are limited to 128. ๐
๐ Parameters ๐
TRANSA
TRANSA is CHARACTER(1).
Specifies the form of the system of equations with respect to A and C:
== 'N':op1(A) = A,op1(C) = C(no transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(transposeAandC)
TRANSB
TRANSB is CHARACTER(1).
Specifies the form of the system of equations with respect to B and D:
== 'N':op2(B) = B,op2(D) = D(no transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(transposeBandD)
SGN1
SGN1 is DOUBLE PRECISION, allowed values: +/-1.
Specifies the sign between in the first equation.
SGN2
SGN2 is DOUBLE PRECISION, allowed values: +/-1.
Specifies the sign between in the second equation.
M
M is INTEGER.
The order of the matrices A and C. 128 >= M >= 0.
N
N is INTEGER.
The order of the matrices B and D. 128 >= N >= 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,N).
The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular, the matrix B must be upper triangular.
LDB
LDB is INTEGER.
The leading dimension of the array B. LDB >= max(1,N).
C
C is DOUBLE PRECISION array, dimension (LDC,M).
The matrix C must be upper triangular.
LDC
LDC is INTEGER.
The leading dimension of the array C. LDC >= max(1,M).
D
D is DOUBLE PRECISION array, dimension (LDD,N).
The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular, the matrix D must be upper triangular.
LDD
LDD is INTEGER.
The leading dimension of the array D. LDD >= max(1,N).
E
E is DOUBLE PRECISION array, dimension (LDE,N).
On input, the matrix E contains the right hand side E.
On output, the matrix E contains the solution R of Equation (1) as selected by TRANSA, TRANSB, and SGN1/SGN2.
Right hand side E and the solution R are M-by-N matrices.
LDE
LDE is INTEGER.
The leading dimension of the array E. LDE >= max(1,M).
F
F is DOUBLE PRECISION array, dimension (LDF,N).
On input, the matrix F contains the right hand side F.
On output, the matrix F contains the solution L of Equation (1) as selected by TRANSA, TRANSB, and SGN1/SGN2.
Right hand side F and the solution L are M-by-N matrices.
LDF
LDF is INTEGER.
The leading dimension of the array F. LDE >= 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 be queried before 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. ๐ญ
๐ซ Optimizations ๐ซ
- Replaced
DAXPYoperation by Fortran intrinsic - No BLAS calls.
- Input data is copied to local arrays to increase the data locality if used from inside a level-3 solver.
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
โญ Definition โญ
At line 247 of file dla_tgcsylv_dual_l2_opt_local_copy.f90.
๐ฆ dla_tgcsylv_dual_l2_local_copy_128 ๐ฆ
subroutine dla_tgcsylv_dual_l2_local_copy_128 ( transa, transb, sgn1,
sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f,
ldf, scale, work, info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation (Local Copy) โจ
Purpose:
(to be continuedโฆ bestie stay tuned ๐)
like, DLA_TGCSYLV_DUAL_L2_LOCAL_COPY_128 solves a generalized coupled Sylvester equation that looks exactly like this, bestie:
op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. And plot twist ๐ซข โ either B or D can be quasi upper triangular too. The right hand sides E, F and the solutions R, L are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. iconic.
Equation (1) is the dual to the generalized coupled Sylvester equation:
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
Equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields:
| kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
Z X = | |*| | = | |
| kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
Regarding Z**T one obtains:
| kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
Z**T X = | |*| | = | |
| SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2). no cap, that's the whole point ๐
โจ Remarks โจ
The algorithm is implemented using BLAS level 2 operations and hand written optimizations, and it uses local copies of the input data. For this reason M and N are limited to 128. Furthermore, the algorithm uses alignment of the local arrays if this is supported by the compiler. At the moment this is used with ifort and xlf but not with gfortran. ๐ซถ
๐ธ Parameters ๐ธ
TRANSAโ isCHARACTER(1). Specifies the form of the system of equations with respect to A and C:== 'N':op1(A) = A,op1(C) = C(No transpose for A and C)== 'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSBโ isCHARACTER(1). Specifies the form of the system of equations with respect to B and D:== 'N':op2(B) = B,op2(D) = D(No transpose for B and D)== 'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGN1โ isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation.SGN2โ isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation.Mโ isINTEGER. The order of the matrices A and C.128 >= M >= 0.Nโ isINTEGER. The order of the matrices B and D.128 >= N >= 0.Aโ isDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular.LDAโ isINTEGER. The leading dimension of the array A.LDA >= max(1,M).Bโ isDOUBLE PRECISIONarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.LDBโ isINTEGER. The leading dimension of the array B.LDB >= max(1,N).Cโ isDOUBLE PRECISIONarray, dimension(LDC,M). The matrix C must be upper triangular.LDCโ isINTEGER. The leading dimension of the array C.LDC >= max(1,M).Dโ isDOUBLE PRECISIONarray, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.LDDโ isINTEGER. The leading dimension of the array D.LDD >= max(1,N).Eโ isDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrix E contains the right hand side E. On output, the matrix E contains the solution R of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side E and the solution R are M-by-N matrices.LDEโ isINTEGER. The leading dimension of the array E.LDE >= max(1,M).Fโ isDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrix F contains the right hand side F. On output, the matrix F contains the solution L of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side F and the solution L are M-by-N matrices.LDFโ isINTEGER. The leading dimension of the array F.LDE >= max(1,M).SCALEโ isDOUBLE 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โ isDOUBLE PRECISIONarray, 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โ isINTEGER.- 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:
๐ฅ Optimizations: ๐ฅ
- Replaced
DAXPYoperation by Fortran intrinsic - No BLAS calls.
- Input data is copied to local arrays to increase the data locality if used from inside a level-3 solver.
- The local copies are aligned to 64 byte if supported by the compiler.
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
Definition at line 248 of file dla_tgcsylv_dual_l2_opt_local_copy_128.f90.
๐ฆ subroutine dla_tgcsylv_dual_l2_local_copy_32 ๐ฆ
subroutine dla_tgcsylv_dual_l2_local_copy_32 ( transa, transb, sgn1,
sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f,
ldf, scale, work, info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation (Local Copy) ๐
Purpose:
okay so DLA_TGCSYLV_DUAL_L2_LOCAL_COPY_32 is out here solving a generalized coupled Sylvester equation that looks like this, bestie:
op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand sides E, F and the solutions R, L are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. ๐
The equation (1) is the dual to the generalized coupled Sylvester equation
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
The equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields
| kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
Z X = | |*| | = | |
| kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
Regarding Z**T one obtains
| kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
Z**T X = | |*| | = | |
| SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2). ๐ฆ
๐ Remarks ๐
The algorithm is implemented using BLAS level 2 operations and hand written optimizations, and it uses local copies of the input data. For this reason M and N are limited to 32. Furthermore, the algorithm uses alignment of the local arrays if this is supported by the compiler. At the moment this is used with ifort and xlf but not with gfortran. ๐ญ
๐ธ Parameters ๐ธ
TRANSAโTRANSAisCHARACTER(1). Specifies the form of the system of equations with respect to A and C:'N':op1(A) = A,op1(C) = C(No transpose for A and C)'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSBโTRANSBisCHARACTER(1). Specifies the form of the system of equations with respect to B and D:'N':op2(B) = B,op2(D) = D(No transpose for B and D)'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGN1โSGN1isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the terms in the first equation. โจSGN2โSGN2isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the terms in the second equation. โจMโMisINTEGER. The order of the matrices A and C.32 >= M >= 0.NโNisINTEGER. The order of the matrices B and D.32 >= N >= 0.AโAisDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular.LDAโLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BโBisDOUBLE PRECISIONarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.LDBโLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).CโCisDOUBLE PRECISIONarray, dimension(LDC,M). The matrix C must be upper triangular.LDCโLDCisINTEGER. The leading dimension of the array C.LDC >= max(1,M).DโDisDOUBLE PRECISIONarray, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.LDDโLDDisINTEGER. The leading dimension of the array D.LDD >= max(1,N).EโEisDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrix E contains the right hand side E. On output, the matrix E contains the solution R of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side E and the solution R are M-by-N matrices.LDEโLDEisINTEGER. The leading dimension of the array E.LDE >= max(1,M).FโFisDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrix F contains the right hand side F. On output, the matrix F contains the solution L of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side F and the solution L are M-by-N matrices.LDFโLDFisINTEGER. The leading dimension of the array F.LDE >= max(1,M). (yes, that's what it says, bestie โLDEnotLDF) ๐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. 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.
- On input:
๐ฅ Optimizations: ๐ฅ
- Replaced
DAXPYoperation by Fortran intrinsic - No BLAS calls.
- Input data is copied to local arrays to increase the data locality if used from inside a level-3 solver.
- The local copies are aligned to
64byte if supported by the compiler.
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
Definition at line 247 of file dla_tgcsylv_dual_l2_opt_local_copy_32.f90.
subroutine dla_tgcsylv_dual_l2_local_copy_64 ( transa, transb, sgn1,
sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f,
ldf, scale, work, info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation (Local Copy)
๐ฏ Purpose:
...and it solves a generalized coupled Sylvester equation that looks like this, bestie ๐
op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
where A is an M-by-M quasi upper triangular matrix, C is an M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Also, either B or D can be quasi upper triangular too, it's giving flexible โจ The right hand sides E, F and the solutions R, L are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. iykyk ๐ง
The equation (1) is the dual to the generalized coupled Sylvester equation
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
The equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields ๐ซ
| kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
Z X = | |*| | = | |
| kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
Regarding Z**T one obtains
| kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
Z**T X = | |*| | = | |
| SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2). No cap, that's just how the duality works ๐ฆ
๐ Remarks ๐
The algorithm is implemented using BLAS level 2 operations and hand written optimizations, and it uses local copies of the input data. For this reason M and N are limited to 64. Furthermore, the algorithm uses alignment of the local arrays if this is supported by the compiler. At the moment this is used with ifort and xlf but not with gfortran. ๐ (gfortran bestie we still love you)
๐ธ Parameters ๐ธ
TRANSAโ is CHARACTER(1). Specifies the form of the system of equations with respect toAandC:== 'N': op1(A) = A, op1(C) = C (No transpose for A and C);== 'T': op1(A) = A**T, op1(C) = C **T (Transpose A and C).TRANSBโ is CHARACTER(1). Specifies the form of the system of equations with respect toBandD:== 'N': op2(B) = B, op2(D) = D (No transpose for B and D);== 'T': op2(B) = B**T, op2(D) = D **T (Transpose B and D).SGN1โ is DOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation. โจSGN2โ is DOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation. โจMโ is INTEGER. The order of the matricesAandC.64 >= M >= 0.Nโ is INTEGER. The order of the matricesBandD.64 >= N >= 0.Aโ is DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAโ is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bโ is DOUBLE PRECISION array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. ๐LDBโ is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).Cโ is DOUBLE PRECISION array, dimension(LDC,M). The matrixCmust be upper triangular.LDCโ is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).Dโ is DOUBLE PRECISION array, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. ๐LDDโ is INTEGER. The leading dimension of the arrayD.LDD >= max(1,N).Eโ is DOUBLE PRECISION array, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRare M-by-N matrices. The way it just transforms ๐ฆLDEโ is INTEGER. The leading dimension of the arrayE.LDE >= max(1,M).Fโ is DOUBLE PRECISION array, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLare M-by-N matrices. ๐LDFโ is INTEGER. The leading dimension of the arrayF.LDE >= max(1,M). (yes bestie, the manpage really saysLDEhere, we do not fix it, we report it ๐)SCALEโ is DOUBLE 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โ is DOUBLE PRECISION 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โ 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.
Heads up bestie: a positive INFO means an inner system went singular, so the solve did not go off. ๐
โก Optimizations: โก
- Replaced
DAXPYoperation by Fortran intrinsic ๐ฅ - No BLAS calls.
- Input data is copied to local arrays to increase the data locality if used from inside a level-3 solver. ๐ฆ
- The local copies are aligned to 64 byte if supported by the compiler. โจ
๐ Author ๐
Martin Koehler, MPI Magdeburg ๐
๐๏ธ Date ๐๏ธ
October 2025
๐ Definition ๐
At line 246 of file dla_tgcsylv_dual_l2_opt_local_copy_64.f90. ๐ซถ
๐ And now, a whole new icon enters the chat ๐
subroutine dla_tgcsylv_dual_l2_local_copy_96 ( transa, transb, sgn1,
sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f,
ldf, scale, work, info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation (Local Copy) ๐ฆ
Purpose:
Remarks ๐ญ
okay so bestie, the tea on the implementation: the algorithm is implemented using BLAS level 2 operations and hand written optimizations, and it uses local copies of the input data. For this reason M and N are limited to 96 โ no cap, that's the ceiling, periodt.
Furthermore, the algorithm uses alignment of the local arrays if this is supported by the compiler. At the moment this is used with ifort and xlf but not with gfortran. ๐
Parameters ๐
TRANSAโTRANSAisCHARACTER(1). Specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSBโTRANSBisCHARACTER(1). Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGN1โSGN1isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation. โจSGN2โSGN2isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation. โจMโMisINTEGER. The order of the matricesAandC.96 >= M >= 0. ๐NโNisINTEGER. The order of the matricesBandD.96 >= N >= 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,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. ๐LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโCisDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular.LDCโLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDisDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. ๐LDDโLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).EโEisDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRareM-by-Nmatrices. ๐ฆLDEโLDEisINTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FโFisDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLareM-by-Nmatrices. ๐ฆLDFโLDFisINTEGER. The leading dimension of the arrayF.LDE >= max(1,M). (yes bestie, it literally saysLDEthere, we don't fix it, we report it ๐)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. 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, 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:
Optimizations: โก
- Replaced
DAXPYoperation by Fortran intrinsic - No BLAS calls.
- Input data is copied to local arrays to increase the data locality if used from inside a level-3 solver.
- The local copies are aligned to 64 byte if supported by the compiler.
Author ๐
Martin Koehler, MPI Magdeburg
Date ๐ธ
October 2025
Definition ๐
Definition at line 246 of file dla_tgcsylv_dual_l2_opt_local_copy_96.f90.
โจ next up: the level-3 icon herself โจ
subroutine dla_tgcsylv_dual_l3 (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn1, double precision sgn2,
integer m, integer n, double precision, dimension(lda, *) a, integer
lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the dual generalized coupled Sylvester equation. ๐
Purpose:
TRANSAโ it's aCHARACTER(1), bestie, and it picks the form of the system forAandC:== 'N':op1(A) = A,op1(C) = C(no transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(transposeAandC)
TRANSBโ alsoCHARACTER(1), and it does the same job but forBandD:== 'N':op2(B) = B,op2(D) = D(no transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(transposeBandD)
SGN1โDOUBLE PRECISION, allowed values+/-1. It sets the sign between... in the first equation. ๐SGN2โDOUBLE PRECISION, allowed values+/-1. Same deal, but it's the sign in the second equation.MโINTEGER, the order of the matricesAandC. Gotta beM >= 0.NโINTEGER, the order of the matricesBandD. AlsoN >= 0.AโDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular, no negotiating.LDAโINTEGER, the leading dimension of the arrayA.LDA >= max(1,M).BโDOUBLE PRECISIONarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. And here's the catch: if the matrixDis already quasi-upper triangular, thenBhas to be plain old upper triangular. โจLDBโINTEGER, the leading dimension of the arrayB.LDB >= max(1,N).CโDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular.LDCโINTEGER, the leading dimension of the arrayC.LDC >= max(1,M).DโDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. Mirror of theBrule: if the matrixBis already quasi-upper triangular, thenDhas to be upper triangular.LDDโINTEGER, the leading dimension of the arrayD.LDD >= max(1,N).EโDOUBLE PRECISIONarray, dimension(LDE,N). On input it's holding the right hand sideE. On output it's holding the solutionRof Equation (1) โ as selected byTRANSA,TRANSB, andSGN1/SGN2. Both the RHSEand the solutionRareM-by-Nmatrices.LDEโINTEGER, the leading dimension of the arrayE.LDE >= max(1,M).FโDOUBLE PRECISIONarray, dimension(LDF,N). On input it holds the right hand sideF, and on output it holds the solutionLof Equation (1) โ again as selected byTRANSA,TRANSB, andSGN1/SGN2. RHSFand solutionLareM-by-Nmatrices.LDFโINTEGER, the leading dimension of the arrayF.LDE >= max(1,M).
ngl this one's written asLDE >= max(1,M)in the source, like, theFparam sayingLDE. That's literally what it says, so that's literally what you get. ๐ซถ
SCALEโDOUBLE PRECISION, and it's the scaling factor keeping your result from overflowing into the void. IfINFO == 0thenSCALEis1.0D0; otherwise, if one of the inner systems couldn't be solved correctly,0 < SCALE <= 1holds true.WORKโDOUBLE PRECISIONarray, dimensionLWORK. It's the workspace for the algorithm. And the way you get the right size? You query it before running the computation โ call the subroutine withINFO == -1on input, and the required workspace comes back inINFO. Iconic behaviour fr.INFOโINTEGER. 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 systems got singular ๐
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 236 of file dla_tgcsylv_dual_l3.f90.
subroutine dla_tgcsylv_dual_l3_2s
subroutine dla_tgcsylv_dual_l3_2s (character, dimension(1) transa,
character, dimension(1) transb, double precision sgn1, double precision
sgn2, integer m, integer n, double precision, dimension(lda, *) a,
integer lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm with sub blocking for the dual generalized coupled Sylvester equation. ๐
Purpose:
okay so, bestie, we're about to get into it โ this is the _2s sibling and its whole personality is sub blocking, so stay tuned for what that actually means in the next part. ๐ฆ
!>
!> DLA_TGCSYLV_DUAL_L3_2S solves a generalized coupled Sylvester equation of the following form
!>
!> op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
!> SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
!>
!> where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular
!> matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or
!> D can be quasi upper triangular as well. The right hand sides E, F and the solutions R, L are
!> M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are
!> created by DGGES from LAPACK.
!> The equation (1) is the dual to the generalized coupled Sylvester equation
!>
!> op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
!> op1(C) * R + SGN2 * L * op2(D) = SCALE * F
!>
!> The equation (1) is the dual one to equation (2) with respect to the underlying linear system.
!> Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields
!>
!> | kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
!> Z X = | |*| | = | |
!> | kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
!>
!> Regarding Z**T one obtains
!>
!> | kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
!> Z**T X = | |*| | = | |
!> | SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
!>
!> which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB
!> are expressed in terms of the Sylvester equation (2).
!>
!>
๐ธ Parameters ๐ธ
TRANSAโ it's aCHARACTER(1), bestie, and it sets the form of the system of equations with respect to A and C:== 'N':op1(A) = A,op1(C) = Cโ no transpose for A and C, we leave them exactly as they are ๐== 'T':op1(A) = A**T,op1(C) = C**Tโ transpose A and C ๐
TRANSBโ also aCHARACTER(1), and it sets the form of the system of equations with respect to B and D:== 'N':op2(B) = B,op2(D) = Dโ no transpose for B and D, untouched, pristine โจ== 'T':op2(B) = B**T,op2(D) = D**Tโ transpose B and D, flip 'em ๐
SGN1โ aDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the first equation. Lowkey tiny, highkey load-bearing โ๏ธSGN2โ aDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the second equation. Same energy, different line ๐ซถMโ anINTEGER. It's the order of the matrices A and C.M >= 0, no negativity allowed ๐Nโ anINTEGER. It's the order of the matrices B and D.N >= 0๐ฆAโ aDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular. It's giving very structured, very triangular, obsessed ๐LDAโ anINTEGER. The leading dimension of the array A.LDA >= max(1,M)๐Bโ aDOUBLE PRECISIONarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. And heads up: if the matrix D is already quasi-upper triangular, then the matrix B must be plain upper triangular. Only one of them gets to be quasi, bestie, we don't do double quasi ๐ญLDBโ anINTEGER. The leading dimension of the array B.LDB >= max(1,N)๐Cโ aDOUBLE PRECISIONarray, dimension(LDC,M). The matrix C must be upper triangular. No quasi, no exceptions, C is a straight-A student ๐LDCโ anINTEGER. The leading dimension of the array C.LDC >= max(1,M)๐งฎDโ aDOUBLE PRECISIONarray, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. And the flip side of the B situation: if the matrix B is already quasi-upper triangular, then the matrix D must be upper triangular. Same rule, other direction ๐LDDโ anINTEGER. The leading dimension of the array D.LDD >= max(1,N)โ๏ธEโ aDOUBLE PRECISIONarray, dimension(LDE,N).- On input, the matrix E contains the right hand side E.
- On output, the matrix E contains the solution R of Equation (1) as selected by
TRANSA,TRANSB, andSGN1/SGN2. - Right hand side E and the solution R are M-by-N matrices. Glow up moment, it literally becomes the answer ๐
LDEโ anINTEGER. The leading dimension of the array E.LDE >= max(1,M)๐Fโ aDOUBLE PRECISIONarray, dimension(LDF,N).- On input, the matrix F contains the right hand side F.
- On output, the matrix F contains the solution L of Equation (1) as selected by
TRANSA,TRANSB, andSGN1/SGN2. - Right hand side F and the solution L are M-by-N matrices. Same arc, same main character energy ๐
LDFโ anINTEGER. The leading dimension of the array F.LDE >= max(1,M). Yes bestie, the doc literally saysLDEright there and I am not about to edit the source ๐ (we report it exactly as written, fr fr)SCALEโ aDOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0D0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. It's the seatbelt of this whole operation ๐WORKโ aDOUBLE PRECISIONarray, dimensionLWORK. Workspace for the algorithm.- The workspace needs to queried before the running the computation. (yes, that's the original phrasing, we stan a legend ๐)
- The query is performed by calling the subroutine with
INFO == -1on input. - The required workspace is then returned in
INFO.
INFOโ anINTEGER.- 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. Surprise, INFO is the answer now โจ
- 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. Not the vibe, bestie ๐ญ
- On input:
๐ Author
Martin Koehler, MPI Magdeburg
๐ Date
October 2025
Definition at line 237 of file dla_tgcsylv_dual_l3_2stage.f90.
๐ recursive subroutine dla_tgcsylv_dual_recursive
recursive subroutine dla_tgcsylv_dual_recursive (character, dimension(1)
transa, character, dimension(1) transb, double precision sgn1, double
precision sgn2, integer m, integer n, double precision, dimension(lda,
*) a, integer lda, double precision, dimension(ldb, *) b, integer ldb,
double precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Recursive blocking Algorithm for the dual generalized coupled Sylvester equation.
๐ฏ Purpose
okay so bestie, DLA_TGCSYLV_DUAL_RECURSIVE solves a generalized coupled Sylvester equation that's literally giving this:
op1(A)**T * R + op1(C)**T * L = SCALE * E (1)
SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand sides E, F and the solutions R, L are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK.
The equation (1) is the dual to the generalized coupled Sylvester equation
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
The equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields
| kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E |
Z X = | |*| | = | |
| kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F |
Regarding Z**T one obtains
| kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E |
Z**T X = | |*| | = | |
| SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F |
which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2).
๐ธ Parameters ๐ธ
TRANSAโ bestie, this isCHARACTER(1). It specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(No transpose for A and C)== 'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSBโCHARACTER(1). Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(No transpose for B and D)== 'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGN1โDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation.SGN2โDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation.MโINTEGER. The order of the matricesAandC.M >= 0.NโINTEGER. The order of the matricesBandD.N >= 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,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular.LDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโDOUBLE PRECISION array, dimension (LDC,M). The matrixCmust be upper triangular.LDCโINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDOUBLE PRECISION array, dimension (LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular.LDDโINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).EโDOUBLE PRECISION array, dimension (LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRare M-by-N matrices.LDEโINTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FโDOUBLE PRECISION array, dimension (LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLare M-by-N matrices.LDFโINTEGER. The leading dimension of the arrayF.LDE >= max(1,M). (yep, the original saysLDE, notLDFhere, fr fr)SCALEโDOUBLE 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โ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 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 at line 240 of file dla_tgcsylv_dual_recursive.f90.
okay next up, bestie, we got dla_tgcsylv_l2:
subroutine dla_tgcsylv_l2 (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn1, double precision sgn2,
integer m, integer n, double precision, dimension(lda, *) a, integer
lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (Optimized)
Purpose:
SCALEโ DOUBLE PRECISION, bestie. It's the little safety valve ๐ซง that stops your result from straight-up overflowing. IfINFO == 0thenSCALEis1.0D0, easy peasy. But if one of the inner systems couldn't be solved correctly, then0 < SCALE <= 1โ so you know something got sketchy when that number dips below 1. ๐WORKโ DOUBLE PRECISION array, dimensionLWORK. This is the workspace for the algorithm, and here's the tea โ: you gotta query it before you run the computation. No just-yeeting a random array size at it. You do the query by calling the subroutine withINFO == -1on input, and then the required workspace gets handed back to you inINFO. โจINFOโ INTEGER. The receipts. ๐งพ
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 ๐
On exit, normal operation:
== 0: successful exit, we ate ๐< 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. ๐
โจ Optimizations: โจ
Like, the glow-up list. Look at her go:
- Replaced level-3 by level-2 and level-1 calls,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DGERby Fortran intrinsic,
Author: Martin Koehler, MPI Magdeburg ๐
Date: October 2025 ๐๏ธ
Definition at line 225 of file dla_tgcsylv_l2.f90. ๐
subroutine dla_tgcsylv_l2_local_copy (character, dimension(1) transa,
character, dimension(1) transb, double precision sgn1, double precision
sgn2, integer m, integer n, double precision, dimension(lda, *) a,
integer lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (Optimized) ๐ธ
Purpose:
๐ Remarks ๐
The algorithm is implemented using BLAS level 2 operations and hand written optimizations. bestie they literally hand-optimized it, we love a craftsperson ๐ซถ
โจ Parameters โจ
TRANSA
TRANSA is CHARACTER(1) โ it tells us what the system of equations looks like with respect to A and C:
'N':op1(A) = A,op1(C) = C(no transpose forAandC, she's being herself ๐ )'T':op1(A) = A**T,op1(C) = C **T(transposeAandC, flip era ๐)
TRANSB
TRANSB is CHARACTER(1) โ same energy, but for B and D:
'N':op2(B) = B,op2(D) = D(no transpose forBandD)'T':op2(B) = B**T,op2(D) = D **T(transposeBandD)
SGN1
SGN1 is DOUBLE PRECISION, allowed values: +/-1. It specifies the sign between in the first equation. no cap, just a plus or minus deciding the whole vibe of equation one ๐
SGN2
SGN2 is DOUBLE PRECISION, allowed values: +/-1. It specifies the sign between in the second equation. same deal, second equation's turn to choose ๐ธ
M
M is INTEGER. The order of the matrices A and C. M >= 0.
N
N is INTEGER. The order of the matrices B and D. N >= 0.
A
A is DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular. she's got structure, she's not a full mess ๐
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
B
B is DOUBLE PRECISION array, dimension (LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular. okay so only ONE of them gets to be quasi, them's the rules bestie โจ
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
C
C is DOUBLE PRECISION array, dimension (LDC,M). The matrix C must be upper triangular.
LDC
LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
D
D is DOUBLE PRECISION array, dimension (LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular. yeah yeah it's a duo thing, one quasi max ๐ฅ
LDD
LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
E
E is DOUBLE PRECISION array, dimension (LDE,N).
On input, the matrix E contains the right hand side E. On output, the matrix E contains the solution R of Equation (1) โ yes, and again, on output the matrix E contains the solution R of Equation (1) โ as selected by TRANSA, TRANSB, and SGN1/SGN2. Right hand side E and the solution R are M-by-N matrices. she comes in as input and leaves as the answer, glow up of the century ๐ญ๐
LDE
LDE is INTEGER. The leading dimension of the array E. LDE >= max(1,M).
F
F is DOUBLE PRECISION array, dimension (LDF,N).
On input, the matrix F contains the right hand side F. On output, the matrix F contains the solution L of Equation (1) โ as selected by TRANSA, TRANSB, and SGN1/SGN2. Right hand side F and the solution L are M-by-N matrices. same main character arc, but for L this time ๐ฆ
LDF
LDF is INTEGER. The leading dimension of the array F. LDE >= max(1,M). (yes it says LDE, we're quoting it exactly, no editing the source bestie ๐)
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. she's out here saving your numbers from overflowing into infinity and beyond ๐
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. so like, ask her how much space she needs BEFORE you show up, okay? ๐
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. (rip, the inner system said no ๐)
๐ Optimizations: ๐
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DTRMVandDGERby Fortran intrinsic, - Use local copies of
A,B,C,D,E, andF(M,N<=128) .
๐ธ Author ๐ธ
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
๐ Definition ๐
At line 227 of file dla_tgcsylv_l2_opt_local_copy.f90.
subroutine dla_tgcsylv_l2_local_copy_128 ( transa, transb, sgn1, sgn2,
m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf,
scale, work, info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (Optimized)
Purpose:
and bestieโฆ the Purpose section is about to go off, keep scrolling ๐
okay so this is the local-copy-128 version ๐ and honestly? it's the same energy as the others but with a very specific vibe: 128 is the whole personality. Let's get into it.
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
Where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. ๐ซถ
โจ Remarks โจ
The algorithm is implemented using BLAS level 2 operations plus hand written optimizations and aligned local copies. no cap, it's hand-tuned. ๐
๐ธ Parameters ๐ธ
TRANSAโTRANSAisCHARACTER(1). It specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(no transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C**T(transposeAandC)
TRANSBโTRANSBisCHARACTER(1). It specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(no transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D**T(transposeBandD)
SGN1โSGN1isDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the first equation. โญSGN2โSGN2isDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the second equation. โญMโMisINTEGER. The order of the matricesAandC.128 => M >= 0. ๐NโNisINTEGER. The order of the matricesBandD.128 >= N >= 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,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. โ ๏ธLDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโCisDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular.LDCโLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDisDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. โ ๏ธLDDโLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).EโEisDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRare M-by-N matrices. (and yes bestie, the source says "On output, the matrix E contains the solution R of Equation (1)" twice in a row โ we said what we said, and we're keeping it ๐)LDEโLDEisINTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FโFisDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLare M-by-N matrices.LDFโLDFisINTEGER. The leading dimension of the arrayF.LDE >= max(1,M). (not me noticing it saysLDEhere and notLDFโ that's literally what the page says, so that's literally what you get ๐)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. 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, 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:
๐ฅ Optimizations: ๐ฅ
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DTRMVandDGERby Fortran intrinsic, - Align local copies and fix problem size to
<= 128
Author ๐ซถ
Martin Koehler, MPI Magdeburg
Date ๐
October 2025
Definition at line 225 of file dla_tgcsylv_l2_opt_local_copy_128.f90.
okay and now the next one pulls up and it's giving smaller, cuter, thirty-two energy ๐
subroutine dla_tgcsylv_l2_local_copy_32 ( transa, transb, sgn1, sgn2, m,
n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale,
work, info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (Optimized) โจ
Purpose:
...and bestie we are NOT done yet, keep scrolling ๐
๐ DLA_TGCSYLV_L2_LOCAL_COPY_32 ๐
okay bestie so DLA_TGCSYLV_L2_LOCAL_COPY_32 solves a generalized coupled Sylvester equation that looks exactly like this:
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. bestie, either B or D can be quasi upper triangular as well, no cap. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. slay. โจ
๐ Remarks ๐
The algorithm is implemented using BLAS level 2 operations and hand written optimizations and aligned local copies. it's giving โจ*artisanal*โจ tbh.
๐ Parameters ๐
TRANSAโTRANSAisCHARACTER(1). Specifies the form of the system of equations with respect to A and C:== 'N':op1(A) = A,op1(C) = C(No transpose for A and C)== 'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSBโTRANSBisCHARACTER(1). Specifies the form of the system of equations with respect to B and D:== 'N':op2(B) = B,op2(D) = D(No transpose for B and D)== 'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGN1โSGN1isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the first equation.SGN2โSGN2isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between in the second equation.MโMisINTEGER. The order of the matrices A and C.32 => M >= 0.NโNisINTEGER. The order of the matrices B and D.32 >= N >= 0.AโAisDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular.LDAโLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BโBisDOUBLE PRECISIONarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.LDBโLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).CโCisDOUBLE PRECISIONarray, dimension(LDC,M). The matrix C must be upper triangular.LDCโLDCisINTEGER. The leading dimension of the array C.LDC >= max(1,M).DโDisDOUBLE PRECISIONarray, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.LDDโLDDisINTEGER. The leading dimension of the array D.LDD >= max(1,N).EโEisDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrix E contains the right hand side E. On output, the matrix E contains the solution R of Equation (1). On output, the matrix E contains the solution R of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side E and the solution R are M-by-N matrices. (yes it really says that twice, that's the original, I'm not messing with it ๐)LDEโLDEisINTEGER. The leading dimension of the array E.LDE >= max(1,M).FโFisDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrix F contains the right hand side F. On output, the matrix F contains the solution L of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side F and the solution L are M-by-N matrices.LDFโLDFisINTEGER. The leading dimension of the array F.LDE >= max(1,M). (yes, it saysLDEhere, and I am faithfully reporting this crime ๐ญ)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. 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, 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:
๐ Optimizations: ๐
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DTRMVandDGERby Fortran intrinsic, - Align local copies and fix problem size to
<= 32
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
Definition at line 226 of file dla_tgcsylv_l2_opt_local_copy_32.f90.
๐ dla_tgcsylv_l2_local_copy_64 ๐
subroutine dla_tgcsylv_l2_local_copy_64 ( transa, transb, sgn1, sgn2, m,
n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale,
work, info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (Optimized) โ the 64 version, bestie, the glow-up edition โจ
Purpose:
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Also, bestie, either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. ๐
โจ Remarks โจ
The algorithm is implemented using BLAS level 2 operations and hand written optimizations and aligned local copies. hand written, like, artisanal. ๐
๐ฆ Parameters ๐ฆ
TRANSA
TRANSA is CHARACTER(1)
Specifies the form of the system of equations with respect to A and C:
== 'N': op1(A) = A, op1(C) = C (No transpose for A and C)
== 'T': op1(A) = A**T, op1(C) = C **T (Transpose A and C)
TRANSB
TRANSB is CHARACTER(1)
Specifies the form of the system of equations with respect to B and D:
== 'N': op2(B) = B, op2(D) = D (No transpose for B and D)
== 'T': op2(B) = B**T, op2(D) = D **T (Transpose B and D)
SGN1
SGN1 is DOUBLE PRECISION, allowed values: +/-1
Specifies the sign between in the first equation. yes, "between in" โ that's the original wording, we're not fixing it, it's iconic โจ
SGN2
SGN2 is DOUBLE PRECISION, allowed values: +/-1
Specifies the sign between in the second equation.
M
M is INTEGER
The order of the matrices A and C. 64 => M >= 0.
N
N is INTEGER
The order of the matrices B and D. 64 >= N >= 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,N)
The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.
LDB
LDB is INTEGER
The leading dimension of the array B. LDB >= max(1,N).
C
C is DOUBLE PRECISION array, dimension (LDC,M)
The matrix C must be upper triangular.
LDC
LDC is INTEGER
The leading dimension of the array C. LDC >= max(1,M).
D
D is DOUBLE PRECISION array, dimension (LDD,N)
The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.
LDD
LDD is INTEGER
The leading dimension of the array D. LDD >= max(1,N).
E
E is DOUBLE PRECISION array, dimension (LDE,N)
On input, the matrix E contains the right hand side E.
On output, the matrix E contains the solution R of Equation (1)
On output, the matrix E contains the solution R of Equation (1) as selected by TRANSA, TRANSB, and SGN1/SGN2.
(yeah it says the output line twice in the source โ we are leaving it, no cap, it's canon ๐)
Right hand side E and the solution R are M-by-N matrices.
LDE
LDE is INTEGER
The leading dimension of the array E. LDE >= max(1,M).
F
F is DOUBLE PRECISION array, dimension (LDF,N)
On input, the matrix F contains the right hand side F.
On output, the matrix F contains the solution L of Equation (1) as selected by TRANSA, TRANSB, and SGN1/SGN2.
Right hand side F and the solution L are M-by-N matrices.
LDF
LDF is INTEGER
The leading dimension of the array F. LDE >= max(1,M).
(not me noticing it says LDE in the LDF description ๐ โ keeping it exactly as written, because that's the whole assignment)
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 : if INFO = -i, the i-th argument had an illegal value
>= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: The equation is not solved correctly. One of the arising inner
system got singular.
๐ Optimizations: ๐
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DTRMVandDGERby Fortran intrinsic, - Align local copies and fix problem size to
<= 64
๐ธ Author ๐ธ
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
โญ Definition โญ
Defined at line 226 of file dla_tgcsylv_l2_opt_local_copy_64.f90.
subroutine dla_tgcsylv_l2_local_copy_96 ( transa, transb, sgn1, sgn2, m,
n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale,
work, info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (Optimized)
Purpose:
DLA_TGCSYLV_L2_LOCAL_COPY_96 is here to solve a generalized coupled Sylvester equation, and bestie, it's giving big math energy. The form it handles is literally this:
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
okay so let's decode the cast list ๐
โ A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Also? Either B or D can be quasi upper triangular as well, no cap. The right hand side Y and the solution X are M-by-N matrices. And typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. iykyk.
๐ธ Remarks ๐ธ
The algorithm is implemented using BLAS level 2 operations, plus hand written optimizations and aligned local copies. It's giving crafty, honestly.
โจ Parameters โจ
TRANSAโTRANSAisCHARACTER(1). It specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSBโTRANSBisCHARACTER(1). It specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGN1โSGN1isDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the first equation. ๐SGN2โSGN2isDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the second equation.MโMisINTEGER. The order of the matricesAandC.96 => M >= 0.NโNisINTEGER. The order of the matricesBandD.96 >= N >= 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,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. ๐LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโCisDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular.LDCโLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDisDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular.LDDโLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).EโEisDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRare M-by-N matrices.LDEโLDEisINTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FโFisDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLare M-by-N matrices.LDFโLDFisINTEGER. The leading dimension of the arrayF.LDE >= max(1,M). (yes bestie, the page really saysLDEthere โ we keep the lore exactly as it is ๐)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. safety first, always.WORKโWORKisDOUBLE PRECISIONarray, 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, 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:
๐ฅ Optimizations: ๐ฅ
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DTRMVandDGERby Fortran intrinsic, - Align local copies and fix problem size to <= 96
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
Definition at line 225 of file dla_tgcsylv_l2_opt_local_copy_96.f90.
subroutine dla_tgcsylv_l2_reorder โ okay now we're meeting the next icon in the lineup, and her signature is a whole mouthful, so here it is, verbatim, no edits:
subroutine dla_tgcsylv_l2_reorder (character, dimension(1) transa,
character, dimension(1) transb, double precision sgn1, double precision
sgn2, integer m, integer n, double precision, dimension(lda, *) a,
integer lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (Optimized)
๐ Purpose: ๐
okay so DLA_TGCSYLV_L2_REORDER ๐
solves a generalized coupled Sylvester equation that looks a little something like this, bestie:
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Also โ plot twist โ either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. โจ
๐ Remarks ๐
The algorithm is implemented using BLAS level 2 operations and hand written optimizations. iconic, honestly.
๐ธ Parameters ๐ธ
TRANSAโ isCHARACTER(1). Specifies the form of the system of equations with respect toAandC:'N':op1(A) = A,op1(C) = C(No transpose forAandC)'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSBโ isCHARACTER(1). Specifies the form of the system of equations with respect toBandD:'N':op2(B) = B,op2(D) = D(No transpose forBandD)'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGN1โ isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign in the first equation. ๐SGN2โ isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign in the second equation.Mโ isINTEGER. The order of the matricesAandC.M >= 0.Nโ isINTEGER. The order of the matricesBandD.N >= 0.Aโ isDOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAโ isINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bโ isDOUBLE PRECISION array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. ๐LDBโ isINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).Cโ isDOUBLE PRECISION array, dimension(LDC,M). The matrixCmust be upper triangular.LDCโ isINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).Dโ isDOUBLE PRECISION array, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular.LDDโ isINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).Eโ isDOUBLE PRECISION array, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRareM-by-Nmatrices.LDEโ isINTEGER. The leading dimension of the arrayE.LDE >= max(1,M).Fโ isDOUBLE PRECISION array, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLareM-by-Nmatrices.LDFโ isINTEGER. The leading dimension of the arrayF.LDE >= max(1,M). (yes bestie, that's literally what it says ๐)SCALEโ isDOUBLE 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โ isDOUBLE PRECISION 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โ isINTEGER.- 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:
๐ Optimizations: ๐
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DTRMVandDGERby Fortran intrinsic, - Column first computation of the solution.
๐ Author
Martin Koehler, MPI Magdeburg
๐ Date
October 2025
๐ฅ Definition
At line 226 of file dla_tgcsylv_l2_opt_reorder.f90.
subroutine dla_tgcsylv_l2_unopt (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn1, double precision sgn2,
integer m, integer n, double precision, dimension(lda, *) a, integer
lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Level-2 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (unoptimized) ๐ฆ
Purpose:
Attention โ ๏ธ bestie read this before you @ me โ this algorithm is implemented using BLAS level 2 operations without further optimizations. For a faster implementation see DLA_TGSYLV_L2. That's it, that's the whole heads-up. ๐
TRANSAโTRANSA is CHARACTER(1). It picks the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(no transpose for A and C, we're keeping it chill)== 'T':op1(A) = A**T,op1(C) = C **T(transpose A and C, spicy mode ๐ฅ)
TRANSBโTRANSB is CHARACTER(1). Same energy but forBandD:== 'N':op2(B) = B,op2(D) = D(no transpose for B and D)== 'T':op2(B) = B**T,op2(D) = D **T(transpose B and D)
SGN1โSGN1 is DOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the first equation. ๐SGN2โSGN2 is DOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the second equation. (yes, twin signs, twin equations, it's giving symmetry โจ)MโM is INTEGER. The order of the matricesAandC.M >= 0.NโN is INTEGER. The order of the matricesBandD.N >= 0.AโA is DOUBLE PRECISION array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular. no cap.LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BโB is DOUBLE PRECISION array, dimension (LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. (they take turns, it's a whole thing ๐)LDBโLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโC is DOUBLE PRECISION array, dimension (LDC,M). The matrixCmust be upper triangular. periodt.LDCโLDC is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโD is DOUBLE PRECISION array, dimension (LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular.LDDโLDD is INTEGER. The leading dimension of the arrayD.LDD >= max(1,N).EโE is DOUBLE PRECISION array, dimension (LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRareM-by-Nmatrices. she goes in one girl and comes out another ๐LDEโLDE is INTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FโF is DOUBLE PRECISION array, dimension (LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLareM-by-Nmatrices.LDFโLDF is INTEGER. The leading dimension of the arrayF.LDE >= max(1,M). ๐ โ yeah it saysLDEright there, I'm copying it exactly, not my business, not my problem.SCALEโSCALE is DOUBLE 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. she's literally the safety net ๐ซถ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 withINFO == -1on input. The required workspace is then returned inINFO. query first, allocate second, no exceptions ๐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. ๐ญ she said "singular", she said "no solution for you"
- On input:
๐ Optimizations: ๐
- Nothing. ๐ (iconic honestly โ what you see is what you get)
๐ธ Author ๐ธ
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
Definition at line 225 of file dla_tgcsylv_l2_unopt.f90.
subroutine dla_tgcsylv_l3 (character, dimension(1) transa, character, dimension(1) transb, double precision sgn1, double precision sgn2, integer m, integer n, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c, integer ldc, double precision, dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e, integer lde, double precision, dimension(ldf,*) f, integer ldf, double precision scale, double precision, dimension(*) work, integer info)
Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (optimized)
Purpose:
๐ okay so, the entire vibe of this routine in one (1) blessed equation:
!> op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
!> op1(C) * R + SGN2 * L * op2(D) = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Also โ plot twist โ either B or D can be quasi upper triangular too, bestie. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. no cap ๐ซถ
Attention ๐ญ
The algorithm is implemented using BLAS level 3 operations. she's fancy like that ๐
Parameters ๐
TRANSAโTRANSAisCHARACTER(1). It specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(no transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(transposeAandC)
TRANSBโTRANSBisCHARACTER(1). It specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(no transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(transposeBandD)
SGN1โSGN1isDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the first equation. ๐SGN2โSGN2isDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the second equation. ๐MโMisINTEGER. The order of the matricesAandC.M >= 0.NโNisINTEGER. The order of the matricesBandD.N >= 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,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. ๐LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโCisDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular.LDCโLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDisDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. ๐LDDโLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).EโEisDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRare M-by-N matrices. โจLDEโLDEisINTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FโFisDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLare M-by-N matrices. โจLDFโLDFisINTEGER. The leading dimension of the arrayF.LDE >= max(1,M). (yes bestie, it literally saysLDEthere, we are not the ones who typed it, we just report it ๐ซ )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. 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, 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:
Optimizations: ๐ฅ
- Nothing but standard L3 BLAS calls.
- Changed computation order to column major
Author ๐
Martin Koehler, MPI Magdeburg
Date ๐
October 2025
Definition at line 223 of file dla_tgcsylv_l3_opt.f90.
โจ dla_tgcsylv_l3_2s โจ
subroutine dla_tgcsylv_l3_2s (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn1, double precision sgn2,
integer m, integer n, double precision, dimension(lda, *) a, integer
lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (optimized) ๐
Purpose: ๐
!> DLA_TGCSYLV_L3_2S solves a generalized coupled Sylvester equation of the following form
!>
!> op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
!> op1(C) * R + SGN2 * L * op2(D) = SCALE * F
!>
!> where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular
!> matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or
!> D can be quasi upper triangular as well. The right hand side Y and the solution X
!> M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are
!> created by DGGES from LAPACK.
!>
๐ซถ Remarks
okay so this algorithm is out here using 2 Stage blocking with DAG scheduled solves and honestly? iconic behavior ๐
โจ Parameters โจ
TRANSAโ bestie,TRANSAisCHARACTER(1)and it says what shape the system of equations takes with respect to A and C:== 'N':op1(A) = A,op1(C) = C(no transpose for A and C, we're keeping it chill)== 'T':op1(A) = A**T,op1(C) = C **T(transpose A and C, flipping the whole vibe)
TRANSBโTRANSBisCHARACTER(1)and it says what shape the system takes with respect to B and D:== 'N':op2(B) = B,op2(D) = D(no transpose for B and D)== 'T':op2(B) = B**T,op2(D) = D **T(transpose B and D)
SGN1โSGN1isDOUBLE PRECISION, allowed values are+/-1, and it specifies the sign between in the first equation. yes it's literally just a sign, but it matters okay ๐SGN2โSGN2isDOUBLE PRECISION, allowed values are+/-1, and it specifies the sign between in the second equation.MโMisINTEGER, the order of the matrices A and C.M >= 0. no negativity allowed bestie ๐NโNisINTEGER, the order of the matrices B and D.N >= 0.AโAis aDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular. no cap.LDAโLDAisINTEGER, the leading dimension of the array A.LDA >= max(1,M).BโBis aDOUBLE PRECISIONarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular, then the matrix B must be upper triangular. the way that these two have to coordinate... ๐LDBโLDBisINTEGER, the leading dimension of the array B.LDB >= max(1,N).CโCis aDOUBLE PRECISIONarray, dimension(LDC,M). The matrix C must be upper triangular. periodt.LDCโLDCisINTEGER, the leading dimension of the array C.LDC >= max(1,M).DโDis aDOUBLE PRECISIONarray, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular, then the matrix D must be upper triangular. it's giving mutual exclusivity, lowkey.LDDโLDDisINTEGER, the leading dimension of the array D.LDD >= max(1,N).EโEis aDOUBLE PRECISIONarray, dimension(LDE,N). On input, the matrix E contains the right hand side E. On output, the matrix E contains the solution R of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side E and the solution R are M-by-N matrices. glow up moment โจLDEโLDEisINTEGER, the leading dimension of the array E.LDE >= max(1,M).FโFis aDOUBLE PRECISIONarray, dimension(LDF,N). On input, the matrix F contains the right hand side F. On output, the matrix F contains the solution L of Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand side F and the solution L are M-by-N matrices.LDFโLDFisINTEGER, the leading dimension of the array F.LDE >= max(1,M).
๐จ okay so heads up: the manpage literally saysLDE >= max(1,M)here forLDFtoo. that's what it says, so that's what I'm telling you. not me fixing it, i'm just the messenger ๐
SCALEโSCALEisDOUBLE PRECISION. It's a scaling factor to prevent overflow in the result. IfINFO == 0then SCALE is1.0D0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. it's the safety net bestie ๐ซถ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. so like... ask first, then compute. consent culture but for memory ๐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. it's giving tragedy ๐ญ
- On input:
๐ Author
Martin Koehler, MPI Magdeburg
๐ Date
October 2025
โญ Definition
Definition at line 217 of file dla_tgcsylv_l3_2stage.f90.
subroutine dla_tgcsylv_l3_unopt (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn1, double precision sgn2,
integer m, integer n, double precision, dimension(lda, *) a, integer
lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Level-3 Kagstroem-Westin/Bartels-Stewart Algorithm for the generalized coupled Sylvester equation (unoptimized)
so yeah bestie, this one is the unoptimized sibling โ same algorithm energy, just not the glow-up version. still valid, still doing the work ๐ฆ
Purpose:
(and the purpose section keeps going, hold that thought โ part 25 has it ๐)
the two equations are literally the whole plot, so here they are, unedited, no notes:
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
so who's who in this little friend group? A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are both N-by-N upper triangular matrices. and plot twist bestie โ either B or D can be quasi upper triangular as well ๐ซถ. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. iykyk โจ
โจ Attention โจ
The algorithm is implemented using BLAS level 3 operations. that's it, that's the whole warning, it's a flex not a red flag ๐
๐ Parameters ๐
okay buckle up, here's every single one, no skipping, I said what I said:
TRANSAโTRANSA is CHARACTER(1). It specifies the form of the system of equations with respect toAandC:'N':op1(A) = A,op1(C) = C(no transpose forAandC)'T':op1(A) = A**T,op1(C) = C **T(transposeAandC)
TRANSBโTRANSB is CHARACTER(1). It specifies the form of the system of equations with respect toBandD:'N':op2(B) = B,op2(D) = D(no transpose forBandD)'T':op2(B) = B**T,op2(D) = D **T(transposeBandD)
SGN1โSGN1 is DOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the first equation.SGN2โSGN2 is DOUBLE PRECISION, allowed values:+/-1. It specifies the sign between in the second equation.MโM is INTEGER. The order of the matricesAandC.M >= 0.NโN is INTEGER. The order of the matricesBandD.N >= 0.AโA is DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. no exceptions bestie ๐LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BโB is DOUBLE PRECISION array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. yes they're negotiating, keep up ๐ธLDBโLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโC is DOUBLE PRECISION array, dimension(LDC,M). The matrixCmust be upper triangular. periodt.LDCโLDC is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโD is DOUBLE PRECISION array, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. it's giving reciprocity ๐ซLDDโLDD is INTEGER. The leading dimension of the arrayD.LDD >= max(1,N).EโE is DOUBLE PRECISION array, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideEand the solutionRareM-by-Nmatrices. glow up in real time ๐ญLDEโLDE is INTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FโF is DOUBLE PRECISION array, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. Right hand sideFand the solutionLareM-by-Nmatrices. twin behaviour fr fr ๐ฆLDFโLDF is INTEGER. The leading dimension of the arrayF.LDE >= max(1,M). ๐ okay so the source literally saysLDEright there and notLDFโ I'm just the messenger, don't come for me, I am reporting it faithfully ๐SCALEโSCALE is DOUBLE 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. she's just here to keep things from overflowing, an icon, a protector ๐WORKโWORK is DOUBLE PRECISION 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. so yes, you gotta ask nicely first, she doesn't do surprises ๐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.
- On input:
bestie ifINFOcomes back> 0on a normal run, that's not a vibe check you passed โ that means the equation is not solved correctly and one of the arising inner system got singular. read theINFO, always read theINFO๐
๐ฅ Optimizations: ๐ฅ
- Nothing but standard L3 BLAS calls. that's the whole optimization list and honestly? clean, efficient, no notes ๐ฅ
๐ Author ๐
Martin Koehler, MPI Magdeburg โ the legend, the moment, the main character ๐ซถ
๐ Date ๐
October 2025
โญ Definition โญ
Definition at line 223 of file dla_tgcsylv_l3_unopt.f90.
๐ฆ recursive subroutine dla_tgcsylv_recursive
okay new function, new era, here's the signature, verbatim, don't touch it:
recursive subroutine dla_tgcsylv_recursive (character, dimension(1) transa,
character, dimension(1) transb, double precision sgn1, double precision
sgn2, integer m, integer n, double precision, dimension(lda, *) a,
integer lda, double precision, dimension(ldb, *) b, integer ldb, double
precision, dimension(ldc, *) c, integer ldc, double precision,
dimension(ldd, *) d, integer ldd, double precision, dimension(lde, *) e,
integer lde, double precision, dimension(ldf,*) f, integer ldf, double
precision scale, double precision, dimension(*) work, integer info)
Recursive Algorithm for the generalized coupled Sylvester equation. โจ
๐ Purpose: ๐
โจ DLA_TGCSYLV_RECURSIVE โจ
okay so DLA_TGCSYLV_RECURSIVE solves a generalized coupled Sylvester equation that looks like this ๐
op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1)
op1(C) * R + SGN2 * L * op2(D) = SCALE * F
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. also!! either B or D can be quasi upper triangular too, no biggie ๐
. the right hand side Y and the solution X are M-by-N matrices. typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK, iykyk โจ
๐ซถ Attention
the algorithm is implemented using BLAS level 3 operations. so it's giving fast, periodt ๐ฅ
๐ Parameters
TRANSAโ TRANSA isCHARACTER(1). it specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSBโ TRANSB isCHARACTER(1). it specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGN1โ SGN1 isDOUBLE PRECISION, allowed values:+/-1. it specifies the sign between in the first equation ๐ซSGN2โ SGN2 isDOUBLE PRECISION, allowed values:+/-1. it specifies the sign between in the second equation ๐ซMโ M isINTEGER. the order of the matricesAandC.M >= 0๐Nโ N isINTEGER. the order of the matricesBandD.N >= 0๐Aโ A isDOUBLE PRECISIONarray, dimension(LDA,M). the matrixAmust be (quasi-) upper triangular ๐ฆLDAโ LDA isINTEGER. the leading dimension of the arrayA.LDA >= max(1,M)Bโ B isDOUBLE PRECISIONarray, dimension(LDB,N). the matrixBmust be (quasi-) upper triangular. if the matrixDis already quasi-upper triangular the matrixBmust be upper triangular ๐LDBโ LDB isINTEGER. the leading dimension of the arrayB.LDB >= max(1,N)Cโ C isDOUBLE PRECISIONarray, dimension(LDC,M). the matrixCmust be upper triangular ๐ธLDCโ LDC isINTEGER. the leading dimension of the arrayC.LDC >= max(1,M)Dโ D isDOUBLE PRECISIONarray, dimension(LDD,N). the matrixDmust be (quasi-) upper triangular. if the matrixBis already quasi-upper triangular the matrixDmust be upper triangular ๐LDDโ LDD isINTEGER. the leading dimension of the arrayD.LDD >= max(1,N)Eโ E isDOUBLE PRECISIONarray, dimension(LDE,N). on input, the matrixEcontains the right hand sideE. on output, the matrixEcontains the solutionRof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. right hand sideEand the solutionRare M-by-N matrices ๐LDEโ LDE isINTEGER. the leading dimension of the arrayE.LDE >= max(1,M)Fโ F isDOUBLE PRECISIONarray, dimension(LDF,N). on input, the matrixFcontains the right hand sideF. on output, the matrixFcontains the solutionLof Equation (1) as selected byTRANSA,TRANSB, andSGN1/SGN2. right hand sideFand the solutionLare M-by-N matrices ๐LDFโ LDF isINTEGER. the leading dimension of the arrayF.LDE >= max(1,M)๐ (yes bestie, it saysLDEin the original, we're not gonna "fix" it, we just report it fr fr)SCALEโ SCALE isDOUBLE PRECISION. SCALE is 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โ WORK isDOUBLE PRECISIONarray, dimension1. workspace for the algorithm ๐ ๏ธINFOโ INFO isINTEGER== 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 205 of file dla_tgcsylv_recursive.f90.
๐ dla_tgsylv_dag
subroutine dla_tgsylv_dag (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn, integer m, integer n, double
precision, dimension(lda, m) a, integer lda, double precision,
dimension(ldb, n) b, integer ldb, double precision, dimension(ldc, m) c,
integer ldc, double precision, dimension(ldd, n) d, integer ldd, double
precision, dimension(ldx, n) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG based parallelization โจ๐ฅ
Purpose:
๐ DLA_TGSYLV_DAG โ the DAG-scheduled girlie
okay so bestie, DLA_TGSYLV_DAG solves a generalized Sylvester equation, and there are two whole flavors:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Also โ plot twist โ either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. iykyk ๐
Remarks ๐ธ โ the algorithm is implemented using BLAS level 3 operations and OpenMP 4.0 DAG scheduling. (yes bestie, that's the whole reason it has _DAG in the name, main character energy โจ)
Attention ๐ โ due to the parallel nature of the algorithm the scaling is not applied to the right hand. If the problem is ill-posed and scaling appears, you have to solve the equation again with a solver with complete scaling support like DLA_TGSYLV_L3. no cap, do not skip this.
Parameters ๐
TRANSAโTRANSAisCHARACTER(1). Specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSBโTRANSBisCHARACTER(1). Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGNโSGNisDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.= 1: Solve Equation (1)== -1: Solve Equation (2)
MโMisINTEGER. The order of the matricesAandC.M >= 0.NโNisINTEGER. The order of the matricesBandD.N >= 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,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. (one of them gets to be the quasi one, not both, we don't do chaos ๐)LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโCisDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular.LDCโLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDisDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular.LDDโLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).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. (she does double duty, iconic ๐)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. IfSCALE .NE. 1the problem is no solved correctly in this case one have to use an other solver. โ ๏ธWORKโWORKisDOUBLE PRECISIONarray, 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. (ask her first, she'll tell you how much room she needs, we love a communicative queen ๐ซถ)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.
- On input:
Author ๐ โ Martin Koehler, MPI Magdeburg
Date โ October 2025
Definition at line 208 of file dla_tgsylv_dag.f90.
๐ฆ dla_tgsylv_gardiner_laub โ the level-2 legend
subroutine dla_tgsylv_gardiner_laub (character, dimension(1) transa,
character, dimension(1) transb, double precision sgn, integer m, integer
n, double precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(2*m,*) work, integer info)
Level-2 Gardiner-Laub algorithm for the generalized Sylvester equation. fr fr, that's the whole vibe โจ
Purpose:
okay so the whole point of this routine is that it solves a generalized Sylvester equation, and it's giving โจ two forms โจ โ pick your fighter:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. And either B or D can be quasi upper triangular as well โ so don't come at me about the shapes, that's on purpose ๐ฆ. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK.
๐ธ Remarks ๐ธ
The algorithm implements the ideas by Gardiner et. al. on top of BLAS level 2 operations. iykyk ๐
๐จ Attention ๐จ
Scaling is not supported by this algorithm so SCALE == 1. Not a drill bestie โ do not come in here expecting a cute little scaling rescue ๐ญ
๐ Parameters ๐
TRANSAโCHARACTER(1). Specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSBโCHARACTER(1). Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGNโDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.= 1: Solve Equation (1)== -1: Solve Equation (2)
MโINTEGER. The order of the matricesAandC.M >= 0.NโINTEGER. The order of the matricesBandD.N >= 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,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. only one of them gets to be quasi, them's the rules ๐LDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโDOUBLE PRECISION array, dimension(LDC,M). The matrixCmust be upper triangular.LDCโINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDOUBLE PRECISION array, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. see? told you โจLDDโINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).XโDOUBLE PRECISION array, dimension(LDX,N).- On input, the matrix
Xcontains the right hand sideY. - On output, the matrix
Xcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. - Right hand side
Yand the solutionXare M-by-N matrices.
- On input, the matrix
LDXโINTEGER. The leading dimension of the arrayX.LDB >= max(1,M). yes bestie, the doc literally saysLDBhere ๐ I am not editing the source, I am merely reporting it fr frSCALEโDOUBLE 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โDOUBLE PRECISION 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. query first, compute second, that's the order ๐ซถ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 at line 204 of file dla_tgsylv_gardiner_laub.f90.
๐ง subroutine dla_tgsylv_l2 ๐ง
subroutine dla_tgsylv_l2 (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn, integer m, integer n, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized)
Purpose
okay bestie so DLA_TGSYLV_L2 solves a generalized Sylvester equation, and it comes in two flavours, pick your fighter:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. โจ plot twist โจ either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. iykyk ๐
๐ Remarks ๐
The algorithm is implemented using BLAS level 2 operations and hand written optimizations. no cap, someone really sat there and optimized this by hand ๐ซถ
๐ Parameters ๐
TRANSAโTRANSAisCHARACTER(1). It specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSBโTRANSBisCHARACTER(1). It specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGNโSGNisDOUBLE PRECISION, allowed values:+/-1. It specifies the sign between the two parts of the Sylvester equation.= 1: Solve Equation (1)== -1: Solve Equation (2)
MโMisINTEGER. The order of the matricesAandC.M >= 0.NโNisINTEGER. The order of the matricesBandD.N >= 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,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. the drama of it all ๐LDBโLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโCisDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular.LDCโLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDisDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. they can't BOTH be quasi, it's giving mutual exclusivity ๐LDDโLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).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. glow up: input Y becomes output solution โจLDXโLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).
fr fr, that's exactly what it says โ LDB โ we're not the ones who wrote it, we're just the ones who report it faithfully ๐ซถ
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. keeping your numbers from overflowing the whole vibe ๐WORKโWORKisDOUBLE PRECISIONarray, 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. you MUST ask first, bestie, no guessing your workspace size ๐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. ๐ singular inner system detected, the math has fallen apart
- On input:
๐ฅ Optimizations: ๐ฅ
- Replaced level-3 by level-2 and level-1 calls,
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ธ Date ๐ธ
October 2025
Definition at line 207 of file dla_tgsylv_l2.f90.
and now for the next one, hold onto your bobba ๐ง
subroutine dla_tgsylv_l2_colwise (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn, integer m, integer n, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (unoptimized)
Purpose: โจ
โจ DLA_TGSYLV_L2_UNOPT โจ
okay bestie, so DLA_TGSYLV_L2_UNOPT is out here solving a generalized Sylvester equation, and it's giving two iconic forms:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand side Y and the solution X M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK.
โ ๏ธ Attention โ ๏ธ The algorithm is implemented using BLAS level 2 operations without further optimizations. For a faster implementation see DLA_TGSYLV_L2.
๐ธ Parameters ๐ธ
TRANSAโCHARACTER(1). Specifies the form of the system of equations with respect to A and C:== 'N':op1(A) = A,op1(C) = C(No transpose for A and C)== 'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSBโCHARACTER(1). Specifies the form of the system of equations with respect to B and D:== 'N':op2(B) = B,op2(D) = D(No transpose for B and D)== 'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGNโDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.= 1: Solve Equation (1)== -1: Solve Equation (2)
MโINTEGER. The order of the matrices A and C.M >= 0.NโINTEGER. The order of the matrices B and D.N >= 0.AโDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular.LDAโINTEGER. The leading dimension of the array A.LDA >= max(1,M).BโDOUBLE PRECISIONarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.LDBโINTEGER. The leading dimension of the array B.LDB >= max(1,N).CโDOUBLE PRECISIONarray, dimension(LDC,M). The matrix C must be upper triangular.LDCโINTEGER. The leading dimension of the array C.LDC >= max(1,M).DโDOUBLE PRECISIONarray, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.LDDโINTEGER. The leading dimension of the array D.LDD >= max(1,N).XโDOUBLE PRECISIONarray, 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โINTEGER. The leading dimension of the array X.LDB >= max(1,M). (Note: original says LDB here, we keep it exactly.)SCALEโDOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKโDOUBLE PRECISIONarray, 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 of INFO is 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:
๐ Optimizations: ๐
- Nothing.
๐ Author
Martin Koehler, MPI Magdeburg
๐ Date
October 2025
Definition at line 208 of file dla_tgsylv_l2_colwise.f90.
๐ฆ dla_tgsylv_l2_local_copy ๐ฆ
subroutine dla_tgsylv_l2_local_copy (character, dimension(1) transa,
character, dimension(1) transb, double precision sgn, integer m, integer
n, double precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized)
Purpose:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
so like, <pink>A</pink> is a M-by-M quasi upper triangular matrix, <pink>C</pink> is a M-by-M upper triangular matrix, and <cyan>B</cyan> and <cyan>D</cyan> are N-by-N upper triangular matrices. And get this โ either B or D can be quasi upper triangular as well. ๐
The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. iykyk โจ
๐จ Attention ๐จ
Bestie listen to me. The algorithm solves problems of dimension at most128(M,N <=128). That's the ceiling. Do not come for it with a 200-by-200 problem, she will simply not. ๐
โจ Parameters โจ
TRANSA
TRANSA is CHARACTER(1) โ it specifies the form of the system of equations with respect to A and C:
== 'N': op1(A) = A, op1(C) = C (No transpose for A and C)
== 'T': op1(A) = A**T, op1(C) = C **T (Transpose A and C)
TRANSB
TRANSB is CHARACTER(1) โ and she specifies the form of the system of equations with respect to B and D:
== 'N': op2(B) = B, op2(D) = D (No transpose for B and D)
== 'T': op2(B) = B**T, op2(D) = D **T (Transpose B and D)
SGN
SGN is DOUBLE PRECISION, allowed values: +/-1 ๐ It specifies the sign between the two parts of the Sylvester equation.
= 1: Solve Equation (1)== -1: Solve Equation (2)
M
M is INTEGER. The order of the matrices A and C. 128 >= M >= 0. ๐
N
N is INTEGER. The order of the matrices B and D. 128 >= N >= 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,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular. ๐ซถ
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
C
C is DOUBLE PRECISION array, dimension (LDC,M). The matrix C must be upper triangular. โจ
LDC
LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
D
D is DOUBLE PRECISION array, dimension (LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular. ๐ซถ
LDD
LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
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. LDB >= max(1,M). (yes bestie, the source literally says LDB there and not LDX, we are simply relaying the lore, no cap ๐๐)
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 : if INFO = -i, the i-th argument had an illegal value
>= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: The equation is not solved correctly. One of the arising inner
system got singular.
๐ฅ Optimizations ๐ฅ
- Replaced level-3 by level-2 and level-1 calls, โจ
- Reorder the solution order to column first style, ๐
- Replaced
DAXPYoperation by Fortran intrinsic ๐ - Replaced all BLAS calls except of
DTRMVandDGERby Fortran intrinsic, ๐ฆ - Use local copies of
A,B,C,D, andX(M,N <=128) . ๐ DTRMVworks sequential. ๐ข
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ธ Date ๐ธ
October 2025
Definition at line 214 of file dla_tgsylv_l2_opt_local_copy.f90.
โญ dla_tgsylv_l2_local_copy_128 โญ
subroutine dla_tgsylv_l2_local_copy_128 ( transa, transb, sgn, m, n, a,
lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized) ๐
Purpose:
okay so bestie, meet DLA_TGSYLV_L2_LOCAL_COPY_128 ๐ she solves a generalized Sylvester equation, and it's giving exactly one of these two forms:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. And literally โ not me being dramatic โ either B or D can be quasi upper triangular as well ๐. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. iykyk ๐
Attention ๐จ
The size of the Problem is limited by M,N <= 128.
Bestie, that's a hard cap. She is a local copy girlie and she is not built for your giant matrices, no cap ๐
Parameters
TRANSA โ TRANSA is CHARACTER(1). She specifies the form of the system of equations with respect to A and C:
== 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSB โ TRANSB is CHARACTER(1). She specifies the form of the system of equations with respect to B and D:
== 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGN โ SGN is DOUBLE PRECISION, allowed values: +/-1. She specifies the sign between the two parts of the Sylvester equation.
= 1: Solve Equation (1)== -1: Solve Equation (2)
M โ M is INTEGER. The order of the matrices A and C. 128 >= M >= 0.
N โ N is INTEGER. The order of the matrices B and D. 128 >= N >= 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,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.
LDB โ LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
C โ C is DOUBLE PRECISION array, dimension (LDC,M). The matrix C must be upper triangular.
LDC โ LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
D โ D is DOUBLE PRECISION array, dimension (LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.
LDD โ LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
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. LDB >= 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.
Optimizations: โจ
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DTRMVby Fortran intrinsic, - Use local copies of
A,B,C,D, andX. DTRMVworks purely sequential- Align local copies and fix problem size to
<= 128
Author ๐
Martin Koehler, MPI Magdeburg
Date ๐ธ
October 2025
Definition
Definition at line 215 of file dla_tgsylv_l2_opt_local_copy_128.f90.
๐ฆ dla_tgsylv_l2_local_copy_32
subroutine dla_tgsylv_l2_local_copy_32 ( transa, transb, sgn, m, n, a,
lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized)
Purpose:
โ ๏ธ Heads up bestie: the size of the problem is capped at M,N <= 32. That's the whole vibe, no cap.
โจ Parameters โจ
TRANSAโTRANSAisCHARACTER(1)๐ซ It tells you what form the system of equations is taking, specifically forAandC:'N':op1(A) = A,op1(C) = C(no transpose forAandC, we keep it cute as-is ๐ )'T':op1(A) = A**T,op1(C) = C**T(transposeAandC, flip it and reverse it โจ)
TRANSBโTRANSBisCHARACTER(1)๐ฆ Same energy, but now it's the form of the system w.r.t.BandD:'N':op2(B) = B,op2(D) = D(no transpose forBandD)'T':op2(B) = B**T,op2(D) = D**T(transposeBandD, periodt)
SGNโSGNisDOUBLE PRECISION, allowed values:+/-1๐ It's the sign between the two parts of the Sylvester equation, like the little plus-or-minus that changes EVERYTHING:= 1: solve Equation (1)== -1: solve Equation (2)
MโMisINTEGERโ the order of the matricesAandC. Constraint:32 >= M >= 0๐NโNisINTEGERโ the order of the matricesBandD. Constraint:32 >= N >= 0๐AโAisDOUBLE PRECISION array, dimension (LDA,M)โ and listen,Amust be (quasi-) upper triangular. Non-negotiable bestie ๐LDAโLDAisINTEGERโ the leading dimension of the arrayA. Rule:LDA >= max(1,M).BโBisDOUBLE PRECISION array, dimension (LDB,N)โBmust be (quasi-) upper triangular. BUT ifDis already quasi-upper triangular, thenBmust be plain upper triangular. It's giving teamwork, iykyk ๐LDBโLDBisINTEGERโ the leading dimension of the arrayB. Rule:LDB >= max(1,N).CโCisDOUBLE PRECISION array, dimension (LDC,M)โCmust be upper triangular. No quasi business here, just straight upper triangular โญLDCโLDCisINTEGERโ the leading dimension of the arrayC. Rule:LDC >= max(1,M).DโDisDOUBLE PRECISION array, dimension (LDD,N)โDmust be (quasi-) upper triangular. And mirroring theBsituation: ifBis already quasi upper triangular, thenDmust be upper triangular. Symmetry slay ๐ธLDDโLDDisINTEGERโ the leading dimension of the arrayD. Rule:LDD >= max(1,N).XโXisDOUBLE PRECISION array, dimension (LDX,N)โ she's the main character and she's doing a transformation arc ๐- On input,
Xholds the right hand sideY. - On output,
Xholds the solution of Equation (1) or (2), whichever got selected byTRANSA,TRANSB, andSGN. - For the record: right hand side
Yand the solutionXare bothM-by-Nmatrices. Same size, different era โจ
- On input,
LDXโLDXisINTEGERโ the leading dimension of the arrayX. Rule (as written):LDB >= max(1,M). ๐ซถ (yes girl, it saysLDB, we report what the manpage says, no editing the lore)SCALEโSCALEisDOUBLE PRECISIONโ a scaling factor whose whole job is preventing overflow in the result ๐ค IfINFO == 0thenSCALEis1.0D0. Otherwise, if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. She's doing damage control and she's doing it flawlessly ๐ชWORKโWORKisDOUBLE PRECISION array, dimension LWORKโ the workspace for the algorithm. Lowkey important: you gotta query the workspace before running the computation. The query happens by calling the subroutine withINFO == -1on input. The required workspace then comes back to you inINFO. It's giving "ask before you take" ๐ฅ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. Slay, mystery solved โจ
- On exit, normal operation:
== 0: successful exit, we ate ๐< 0: ifINFO = -i, the i-th argument had an illegal value ๐> 0: the equation is not solved correctly. One of the arising inner systems got singular. Not the vibe, but at least you know ๐ญ
- On input:
๐ Optimizations: ๐
- Replaced level-3 by level-2 and level-1 calls
- Reorder the solution order to column first style
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DTRMVby Fortran intrinsic - Use local copies of
A,B,C,D, andX DTRMVworks purely sequential- Align local copies and fix problem size to
<= 32
๐ Author ๐
Martin Koehler, MPI Magdeburg ๐ซถ
๐ Date ๐
October 2025
Definition at line 215 of file dla_tgsylv_l2_opt_local_copy_32.f90.
๐ง subroutine dla_tgsylv_l2_local_copy_64 ๐ง
subroutine dla_tgsylv_l2_local_copy_64 ( transa, transb, sgn, m, n, a,
lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized) ๐
Purpose:
okay bestie, so DLA_TGSYLV_L2_LOCAL_COPY_64 solves a generalized Sylvester equation, and it comes in exactly two flavours ๐
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix and B and D are N-by-N upper triangular matrices. And here's the plot twist ๐ฆ โ either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) (or (D,B)) are created by DGGES from LAPACK. no cap, that's just how they get born โจ
๐จ Attention ๐จ
The size of the Problem is limited by M,N <= 64. That's the ceiling, bestie, do not test it ๐
๐ Parameters ๐
TRANSAโTRANSA is CHARACTER(1). It specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSBโTRANSB is CHARACTER(1). Same energy, but now it specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGNโSGN is DOUBLE PRECISION, allowed values:+/-1. It's the sign between the two parts of the Sylvester equation, so basically it decides which equation you're getting:= 1: Solve Equation (1)== -1: Solve Equation (2)
MโM is INTEGER. The order of the matricesAandC.64 >= M >= 0.NโN is INTEGER. The order of the matricesBandD.64 >= N >= 0.AโA is DOUBLE PRECISION array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular.LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BโB is DOUBLE PRECISION array, dimension (LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. (so they can't both be quasi, it's one or the other, periodt ๐)LDBโLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโC is DOUBLE PRECISION array, dimension (LDC,M). The matrixCmust be upper triangular.LDCโLDC is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโD is DOUBLE PRECISION array, dimension (LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular.LDDโLDD is INTEGER. The leading dimension of the arrayD.LDD >= max(1,N).XโX is DOUBLE PRECISION 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 does a glow-up in place ๐LDXโLDX is INTEGER. The leading dimension of the arrayX.LDB >= max(1,M). (yep, that's literally what it says in there, and we do not touch it ๐ซฃ)SCALEโSCALE is DOUBLE 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โ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 withINFO == -1on input. The required workspace is then returned inINFO.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.
- On input:
โก Optimizations โก
the way this routine got the full makeover ๐
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced DAXPY operation by Fortran intrinsic
- Replaced all BLAS calls except of DTRMV by Fortran intrinsic,
- Use local copies of A, B, C, D, and X.
- DTRMV works purely sequential
- Align local copies and fix problem size to <= 64
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
Definition at line 215 of file dla_tgsylv_l2_opt_local_copy_64.f90.
๐งฎ subroutine dla_tgsylv_l2_local_copy_96 ๐งฎ
subroutine dla_tgsylv_l2_local_copy_96 ( transa, transb, sgn, m, n, a,
lda, b, ldb, c, ldc, d, ldd, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized) โจ
๐ Purpose ๐
โ ๏ธ heads up bestie: this routine is size-limited. The size of the Problem is limited by M,N <= 96. That's the whole vibe. 96 is the ceiling, periodt.
๐งธ Parameters ๐งธ
TRANSAโTRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A and C:'N':op1(A) = A,op1(C) = C(No transpose for A and C)'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSBโTRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B and D:'N':op2(B) = B,op2(D) = D(No transpose for B and D)'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGNโSGN is DOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.1: Solve Equation (1)-1: Solve Equation (2)
MโM is INTEGER. The order of the matrices A and C.96 >= M >= 0.NโN is INTEGER. The order of the matrices B and D.96 >= N >= 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,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.LDBโLDB is INTEGER. The leading dimension of the array B.LDB >= max(1,N).CโC is DOUBLE PRECISION array, dimension (LDC,M). The matrix C must be upper triangular.LDCโLDC is INTEGER. The leading dimension of the array C.LDC >= max(1,M).DโD is DOUBLE PRECISION array, dimension (LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.LDDโLDD is INTEGER. The leading dimension of the array D.LDD >= max(1,N).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, andSGN. - Right hand side Y and the solution X are M-by-N matrices.
LDXโLDX is INTEGER. The leading dimension of the array X.LDB >= max(1,M).SCALEโSCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds 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 withINFO == -1on 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 of INFO is 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.
โจ Optimizations: โจ
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
DTRMVby Fortran intrinsic, - Use local copies of
A,B,C,D, andX. DTRMVworks purely sequential- Align local copies and fix problem size to
<= 96
Author: Martin Koehler, MPI Magdeburg
Date: October 2025
Definition at line 215 of file dla_tgsylv_l2_opt_local_copy_96.f90.
๐ subroutine dla_tgsylv_l2_reorder ๐
subroutine dla_tgsylv_l2_reorder (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn, integer m, integer n, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized) ๐
๐ Purpose:
Okay so DLA_TGSYLV_L2_REORDER</p> solves a generalized Sylvester equation, and bestie it comes in two whole flavours ๐
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand side Y and the solution X M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. โจ
๐ซถ Attention ๐ซถ
The algorithm is implemented using BLAS level 2 operations and hand written optimizations. no cap, somebody sat down and hand-tuned this thing ๐ญ
๐ Parameters ๐
TRANSAโ it's aCHARACTER(1)bestie. Specifies the form of the system of equations with respect toAandC:'N':op1(A) = A,op1(C) = C(No transpose for A and C)'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSBโ also aCHARACTER(1). Specifies the form of the system of equations with respect toBandD:'N':op2(B) = B,op2(D) = D(No transpose for B and D)'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGNโ aDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.= 1: Solve Equation (1)== -1: Solve Equation (2)
MโINTEGER. The order of the matricesAandC.M >= 0. ๐NโINTEGER. The order of the matricesBandD.N >= 0. ๐AโDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. periodt.LDAโINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BโDOUBLE PRECISIONarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. ๐LDBโINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular.LDCโINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. ๐LDDโINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).XโDOUBLE 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. it goes in as Y and comes out as the answer, iconic behaviour fr fr โจLDXโINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEโDOUBLE 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โDOUBLE PRECISIONarray, 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:
Not me reading > 0 and knowing that's the "one of the inner systems went singular" girlie. she's not slaying today ๐ญ
๐ Optimizations: ๐
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
DAXPYoperation by Fortran intrinsic - Replaced all
BLAScalls except ofDTRMVandDGERby Fortran intrinsic,
๐ Author ๐
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
Definition at line 211 of file dla_tgsylv_l2_reorder.f90.
๐ฆ subroutine dla_tgsylv_l2_rowwise ๐ฆ
subroutine dla_tgsylv_l2_rowwise (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn, integer m, integer n, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (unoptimized)
Purpose:
DLA_TGSYLV_L2_UNOPT solves a generalized Sylvester equation of the following forms
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand side Y and the solution X M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK.
๐จ Attention ๐จ
The algorithm is implemented using BLAS level 2 operations without further optimizations. For a faster implementation see DLA_TGSYLV_L2. likeโฆ she works, but she's not the fast one, okay? iykyk ๐
๐ Parameters ๐
TRANSA โ TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A and C:
== 'N':op1(A) = A,op1(C) = C(No transpose for A and C)== 'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSB โ TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B and D:
== 'N':op2(B) = B,op2(D) = D(No transpose for B and D)== 'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGN โ SGN is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation.
= 1: Solve Equation (1)== -1: Solve Equation (2)
M โ M is INTEGER. The order of the matrices A and C. M >= 0.
N โ N is INTEGER. The order of the matrices B and D. N >= 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,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.
LDB โ LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
C โ C is DOUBLE PRECISION array, dimension (LDC,M). The matrix C must be upper triangular.
LDC โ LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
D โ D is DOUBLE PRECISION array, dimension (LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.
LDD โ LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
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. LDB >= max(1,M).
bestieโฆ yes. that literally saysLDBin theLDXdescription. we are quoting the page exactly as it is, no edits, no cap. ๐ซถ
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.
โจ Optimizations โจ
- Nothing.
literally nothing. she is what she is and we respect her for it ๐
๐ธ Author ๐ธ
Martin Koehler, MPI Magdeburg
๐ Date ๐
October 2025
Definition at line 208 of file dla_tgsylv_l2_rowwise.f90.
๐ฆ and nowโฆ the level-3 girlie ๐ฆ
subroutine dla_tgsylv_l3 (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn, integer m, integer n, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. level THREE?? she upgraded, bestie, we LOVE a glow up ๐โจ
๐ Purpose: ๐
So like, DLA_TGSYLV_L3 solves a generalized Sylvester equation, and it comes in these two flavors bestie:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. โจ And lowkey the plot twist: either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. ๐
๐ Attention
The algorithm is implemented using BLAS level 3 operations. periodt.
๐ซ Remarks
The algorithm works without DTRMM calls because of performance issues, no cap. All DTRMM calls are replaced by block-GEMM operations. ๐ซถ Therefore it is necessary that A and C contain zeros below the diagonal. (Like, zero zeros, fr fr. Don't skip this.)
๐ธ Parameters
TRANSAโTRANSAisCHARACTER(1)๐- Specifies the form of the system of equations with respect to
AandC: == 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
- Specifies the form of the system of equations with respect to
TRANSBโTRANSBisCHARACTER(1)๐- Specifies the form of the system of equations with respect to
BandD: == 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
- Specifies the form of the system of equations with respect to
SGNโSGNisDOUBLE PRECISION, allowed values:+/-1โญ- Specifies the sign between the two parts of the Sylvester equation.
= 1: Solve Equation (1)== -1: Solve Equation (2)
MโMisINTEGER- The order of the matrices
AandC.M >= 0.
- The order of the matrices
NโNisINTEGER- The order of the matrices
BandD.N >= 0.
- The order of the matrices
AโAisDOUBLE PRECISIONarray, dimension(LDA,M)- The matrix
Amust be (quasi-) upper triangular.
- The matrix
LDAโLDAisINTEGER- The leading dimension of the array
A.LDA >= max(1,M).
- The leading dimension of the array
BโBisDOUBLE PRECISIONarray, dimension(LDB,N)- The matrix
Bmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. ๐
- The matrix
LDBโLDBisINTEGER- The leading dimension of the array
B.LDB >= max(1,N).
- The leading dimension of the array
CโCisDOUBLE PRECISIONarray, dimension(LDC,M)- The matrix
Cmust be upper triangular.
- The matrix
LDCโLDCisINTEGER- The leading dimension of the array
C.LDC >= max(1,M).
- The leading dimension of the array
DโDisDOUBLE PRECISIONarray, dimension(LDD,N)- The matrix
Dmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. ๐
- The matrix
LDDโLDDisINTEGER- The leading dimension of the array
D.LDD >= max(1,N).
- The leading dimension of the array
XโXisDOUBLE PRECISIONarray, dimension(LDX,N)๐ฆ- On input, the matrix
Xcontains the right hand sideY. - On output, the matrix
Xcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. - Right hand side
Yand the solutionXareM-by-Nmatrices.
- On input, the matrix
LDXโLDXisINTEGER- The leading dimension of the array
X.LDX >= max(1,M).
- The leading dimension of the array
SCALEโSCALEisDOUBLE PRECISION๐SCALEis a scaling factor to prevent the overflow in the result.- If
INFO == 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.
- The workspace needs to queried before the running the computation.
- The query is performed by calling the subroutine with
INFO == -1on input. - The required workspace is then returned in
INFO.
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 205 of file dla_tgsylv_l3_opt.f90.
๐ subroutine dla_tgsylv_l3_2s
okay so here's the whole signature bestie, copy it exactly, no typos, no vibes-based guessing:
subroutine dla_tgsylv_l3_2s (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn, integer m, integer n, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. ๐ง
๐ฏ Purpose:
okay so what's it actually for? ๐
DLA_TGSYLV_L3_2S is out here doing the absolute most ๐
โ it solves a generalized Sylvester equation, and bestie, it comes in two whole flavors:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. And plot twist ๐ซข โ either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. no cap โจ
Attention ๐
The algorithm is implemented using BLAS level 3 operations. she ate, periodt.
Parameters ๐
TRANSAโTRANSA is CHARACTER(1). Specifies the form of the system of equations with respect toAandC:== 'N': op1(A) = A, op1(C) = C (No transpose for A and C)== 'T': op1(A) = A**T, op1(C) = C **T (Transpose A and C)
TRANSBโTRANSB is CHARACTER(1). Specifies the form of the system of equations with respect toBandD:== 'N': op2(B) = B, op2(D) = D (No transpose for B and D)== 'T': op2(B) = B**T, op2(D) = D **T (Transpose B and D)
SGNโSGN is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation. ๐= 1 : Solve Equation (1)== -1: Solve Equation (2)
MโM is INTEGER. The order of the matricesAandC.M >= 0.NโN is INTEGER. The order of the matricesBandD.N >= 0.AโA is DOUBLE PRECISION array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular.LDAโLDA is INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BโB is DOUBLE PRECISION array, dimension (LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular.LDBโLDB is INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CโC is DOUBLE PRECISION array, dimension (LDC,M). The matrixCmust be upper triangular.LDCโLDC is INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DโD is DOUBLE PRECISION array, dimension (LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular.LDDโLDD is INTEGER. The leading dimension of the arrayD.LDD >= max(1,N).XโX is DOUBLE PRECISION 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โLDX is INTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEโSCALE is DOUBLE 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โ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 withINFO == -1on input. The required workspace is then returned inINFO. ๐งINFOโINFO is INTEGER.- On input:
== -1 : Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0 : if INFO = -i, the i-th argument had an illegal value>= 0: The value of INFO is the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: if INFO = -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:
bestie, notice that > 0 case โ that's the "it didn't work, one of the inner systems went singular" situation. not a vibe. ๐ญ
Author ๐ธ
Martin Koehler, MPI Magdeburg
Date ๐
October 2025
Definition ๐
Definition at line 202 of file dla_tgsylv_l3_2stage.f90.
okay next up we got a whole other one, and it's giving colwise energy ๐
subroutine dla_tgsylv_l3_colwise (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn, integer m, integer n, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation.
Purpose:
okay so DLA_TGSYLV_L3_COLWISE solves a generalized Sylvester equation, and bestie there are two whole forms it can handle โ pick your fighter:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. and yes โ either B or D can be quasi upper triangular as well, no cap. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. ๐
Attention
The algorithm is implemented using BLAS level 3 operations. โจ
Remarks
The algorithm works without DTRMM calls because of performance issues. All DTRMM calls are replaced by block-GEMM operations. Therefore it is necessary that A and C contain zeros below the diagonal. ๐ซถ
bestie this is the part where you listen โ zeros below the diagonal inAandC, or the whole vibe collapses. ๐
Parameters
TRANSAโ isCHARACTER(1). Specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A,op1(C) = C(No transpose forAandC)== 'T':op1(A) = A**T,op1(C) = C **T(TransposeAandC)
TRANSBโ isCHARACTER(1). Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,op2(D) = D(No transpose forBandD)== 'T':op2(B) = B**T,op2(D) = D **T(TransposeBandD)
SGNโ isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.= 1 :Solve Equation (1)== -1:Solve Equation (2)
Mโ isINTEGER. The order of the matricesAandC.M >= 0.Nโ isINTEGER. The order of the matricesBandD.N >= 0.Aโ isDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. โญLDAโ isINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bโ isDOUBLE PRECISIONarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. ๐ธLDBโ isINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).Cโ isDOUBLE PRECISIONarray, dimension(LDC,M). The matrixCmust be upper triangular.LDCโ isINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).Dโ isDOUBLE PRECISIONarray, dimension(LDD,N). The matrixDmust be (quasi-) upper triangular. If the matrixBis already quasi-upper triangular the matrixDmust be upper triangular. ๐ธLDDโ isINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).Xโ isDOUBLE 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. glow up: in goesY, out comes the answer ๐LDXโ isINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEโ isDOUBLE 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โ isDOUBLE PRECISIONarray, 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โ isINTEGER.- 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:
not the > 0 case ๐ โ if you see that, an inner system went singular and the equation is not solved correctly. That's not a vibe, that's a bug report.
Author
Martin Koehler, MPI Magdeburg ๐
Date
October 2025
Definition at line 204 of file dla_tgsylv_l3_colwise.f90.
subroutine dla_tgsylv_l3_rowwise
subroutine dla_tgsylv_l3_rowwise (character, dimension(1) transa, character,
dimension(1) transb, double precision sgn, integer m, integer n, double
precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. โจ
Purpose:
okay so bestie, DLA_TGSYLV_L3_ROWWISE is literally solving a generalized Sylvester equation, and it comes in two iconic flavors, no cap:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix, and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand side Y and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. It's giving LAPACK energy, fr fr. ๐
Attention ๐จ โ The algorithm is implemented using BLAS level 3 operations. Slay.
โจ Parameters โจ
TRANSAโ isCHARACTER(1). Specifies the form of the system of equations with respect to A and C:== 'N':op1(A) = A,op1(C) = C(No transpose for A and C)== 'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSBโ isCHARACTER(1). Specifies the form of the system of equations with respect to B and D:== 'N':op2(B) = B,op2(D) = D(No transpose for B and D)== 'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGNโ isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.= 1: Solve Equation (1)== -1: Solve Equation (2)
Mโ isINTEGER. The order of the matrices A and C.M >= 0.Nโ isINTEGER. The order of the matrices B and D.N >= 0.Aโ isDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular.LDAโ isINTEGER. The leading dimension of the array A.LDA >= max(1,M).Bโ isDOUBLE PRECISIONarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.LDBโ isINTEGER. The leading dimension of the array B.LDB >= max(1,N).Cโ isDOUBLE PRECISIONarray, dimension(LDC,M). The matrix C must be upper triangular.LDCโ isINTEGER. The leading dimension of the array C.LDC >= max(1,M).Dโ isDOUBLE PRECISIONarray, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.LDDโ isINTEGER. The leading dimension of the array D.LDD >= max(1,N).Xโ isDOUBLE PRECISIONarray, 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 byTRANSA,TRANSB, andSGN. Right hand side Y and the solution X are M-by-N matrices.LDXโ isINTEGER. The leading dimension of the array X.LDX >= max(1,M).SCALEโ isDOUBLE 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โ isDOUBLE 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โ isINTEGER.- 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 203 of file dla_tgsylv_l3_rowwise.f90.
๐ธ recursive subroutine dla_tgsylv_recursive ๐ธ
recursive subroutine dla_tgsylv_recursive (character, dimension(1) transa,
character, dimension(1) transb, double precision sgn, integer m, integer
n, double precision, dimension(lda, *) a, integer lda, double precision,
dimension(ldb, *) b, integer ldb, double precision, dimension(ldc, *) c,
integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
precision, dimension(ldx, *) x, integer ldx, double precision scale,
double precision, dimension(*) work, integer info)
Level-3 Recursive Blocked Solver for the generalized Sylvester equation.
โจ Purpose โจ
DLA_TGSYLV_RECURSIVE solves a generalized Sylvester equation of the following forms:
op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1)
or
op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, C is a M-by-M upper triangular matrix and B and D are N-by-N upper triangular matrices. Furthermore either B or D can be quasi upper triangular as well. The right hand side E and the solution X are M-by-N matrices. Typically the matrix pencils (A,C) and (B,D) ( or (D,B) ) are created by DGGES from LAPACK. ๐
Attention ๐จ โ The algorithm is a rewrite of RECSY with some optimizations.
โจ Parameters โจ
TRANSAโ isCHARACTER(1). Specifies the form of the system of equations with respect to A and C:== 'N':op1(A) = A,op1(C) = C(No transpose for A and C)== 'T':op1(A) = A**T,op1(C) = C **T(Transpose A and C)
TRANSBโ isCHARACTER(1). Specifies the form of the system of equations with respect to B and D:== 'N':op2(B) = B,op2(D) = D(No transpose for B and D)== 'T':op2(B) = B**T,op2(D) = D **T(Transpose B and D)
SGNโ isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.= 1: Solve Equation (1)== -1: Solve Equation (2)
Mโ isINTEGER. The order of the matrices A and C.M >= 0.Nโ isINTEGER. The order of the matrices B and D.N >= 0.Aโ isDOUBLE PRECISIONarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular.LDAโ isINTEGER. The leading dimension of the array A.LDA >= max(1,M).Bโ isDOUBLE PRECISIONarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular. If the matrix D is already quasi-upper triangular the matrix B must be upper triangular.LDBโ isINTEGER. The leading dimension of the array B.LDB >= max(1,N).Cโ isDOUBLE PRECISIONarray, dimension(LDC,M). The matrix C must be upper triangular.LDCโ isINTEGER. The leading dimension of the array C.LDC >= max(1,M).Dโ isDOUBLE PRECISIONarray, dimension(LDD,N). The matrix D must be (quasi-) upper triangular. If the matrix B is already quasi-upper triangular the matrix D must be upper triangular.LDDโ isINTEGER. The leading dimension of the array D.LDD >= max(1,N).Xโ isDOUBLE PRECISIONarray, dimension(LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution X of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand side Y and the solution X are M-by-N matrices.LDXโ isINTEGER. The leading dimension of the array X.LDX >= max(1,M).SCALEโ isDOUBLE 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โ isDOUBLE PRECISIONarray, dimensionM*N. Workspace for the algorithm.INFOโ isINTEGER.== 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 190 of file dla_tgsylv_recursive.f90.
๐ Author ๐
Generated automatically by Doxygen for MEPACK from the source code.
And that's the whole page, bestie! โจ This was auto-generated by Doxygen for MEPACK, version 1.1.2, dated Thu Oct 9 2025 00:00:00, and it's the dbltgsylv(3) manual. Bye! ๐๐ฆ
๐ฆ 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