sgltrsylv(3)
β¨ sgltrsylv β¨ β straight out of the MEPACK manual, section 3 π
okay so bestie, pull up a chair πͺ because this is the sgltrsylv(3) page and it is long. This is part 1 of 17, so we're gonna take it slow and cute. Let's go π¦
πΈ NAME πΈ
sgltrsylv β Single Precision
- Single Precision routines for triangular standard Sylvester equations.
π SYNOPSIS π
β¨ Functions β¨
sla_trsylv2_dagβ Level-3 Bartels-Stewart Algorithm for the discrete time Sylvester equation with DAG based parallelization.
subroutine sla_trsylv2_dag (transa, transb, sgn, m, n, a, lda, b, ldb, x,
ldx, scale, work, info)
sla_trsylv_dagβ Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG parallelization.
subroutine sla_trsylv_dag (transa, transb, sgn, m, n, a, lda, b, ldb, x,
ldx, scale, work, info)
sla_trsylv2_kernel_44nnβ Solver for a 4x4 discrete time Sylvester equation (TRANSA = N, TRANSB = N)
subroutine sla_trsylv2_kernel_44nn (sgn, m, n, a, lda, b, ldb, x, ldx,
scale, info)
sla_trsylv2_kernel_44ntβ Solver for a 4x4 discrete time Sylvester equation (TRANSA = N, TRANSB = T)
subroutine sla_trsylv2_kernel_44nt (sgn, m, n, a, lda, b, ldb, x, ldx,
scale, info)
sla_trsylv2_kernel_44tnβ Solver for a 4x4 discrete time Sylvester equation (TRANSA = T, TRANSB = N)
subroutine sla_trsylv2_kernel_44tn (sgn, m, n, a, lda, b, ldb, x, ldx,
scale, info)
sla_trsylv2_kernel_44ttβ Solver for a 4x4 discrete time Sylvester equation (TRANSA = T, TRANSB = T)
subroutine sla_trsylv2_kernel_44tt (sgn, m, n, a, lda, b, ldb, x, ldx,
scale, info)
sla_trsylv_kernel_44nnβ Solver for a 4x4 Sylvester equation (TRANSA = N, TRANSB = N)
subroutine sla_trsylv_kernel_44nn (sgn, m, n, a, lda, b, ldb, x, ldx,
scale, info)
sla_trsylv_kernel_44ntβ Solver for a 4x4 Sylvester equation (TRANSA = N, TRANSB = T)
subroutine sla_trsylv_kernel_44nt (sgn, m, n, a, lda, b, ldb, x, ldx,
scale, info)
sla_trsylv_kernel_44tnβ Solver for a 4x4 Sylvester equation (TRANSA = T, TRANSB = N)
subroutine sla_trsylv_kernel_44tn (sgn, m, n, a, lda, b, ldb, x, ldx,
scale, info)
sla_trsylv_kernel_44ttβ Solver for a 4x4 Sylvester equation (TRANSA = T, TRANSB = T)
subroutine sla_trsylv_kernel_44tt (sgn, m, n, a, lda, b, ldb, x, ldx,
scale, info)
sla_trsylv2_l2β Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
subroutine sla_trsylv2_l2 (transa, transb, sgn, m, n, a, lda, b, ldb, x,
ldx, scale, work, info)
sla_trsylv2_l2_local_copyβ Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
subroutine sla_trsylv2_l2_local_copy (transa, transb, sgn, m, n, a, lda,
b, ldb, x, ldx, scale, work, info)
sla_trsylv2_l2_local_copy_128β Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
subroutine sla_trsylv2_l2_local_copy_128 (transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
sla_trsylv2_l2_local_copy_32β Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
subroutine sla_trsylv2_l2_local_copy_32 (transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
sla_trsylv2_l2_local_copy_64β Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
subroutine sla_trsylv2_l2_local_copy_64 (transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
sla_trsylv2_l2_local_copy_96β Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
subroutine sla_trsylv2_l2_local_copy_96 (transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
sla_trsylv2_l2_reorderβ Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
subroutine sla_trsylv2_l2_reorder (transa, transb, sgn, m, n, a, lda, b,
ldb, x, ldx, scale, work, info)
sla_trsylv2_l2_unoptβ Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (unoptimized)
subroutine sla_trsylv2_l2_unopt (transa, transb, sgn, m, n, a, lda, b,
ldb, x, ldx, scale, work, info)
sla_trsylv_l2β Level-2 Bartels-Stewart Algorithm for the Sylvester equation (optimized)
subroutine sla_trsylv_l2 (transa, transb, sgn, m, n, a, lda, b, ldb, x,
ldx, scale, work, info)
sla_trsylv_l2_local_copyβ Level-2 Bartels-Stewart Algorithm for the Sylvester equation (optimized)
subroutine sla_trsylv_l2_local_copy (transa, transb, sgn, m, n, a, lda,
b, ldb, x, ldx, scale, work, info)
sla_trsylv_l2_local_copy_128β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized)
subroutine sla_trsylv_l2_local_copy_128 (transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
sla_trsylv_l2_local_copy_32β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized)
subroutine sla_trsylv_l2_local_copy_32 (transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
sla_trsylv_l2_local_copy_64β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized)
subroutine sla_trsylv_l2_local_copy_64 (transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
sla_trsylv_l2_local_copy_96β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized)
subroutine sla_trsylv_l2_local_copy_96 (transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
sla_trsylv_l2_reorderβ Level-2 Bartels-Stewart Algorithm for the Sylvester equation (optimized)
subroutine sla_trsylv_l2_reorder (transa, transb, sgn, m, n, a, lda, b,
ldb, x, ldx, scale, work, info)
sla_trsylv_l2_unoptβ Level-2 Bartels-Stewart Algorithm for the Sylvester equation (unoptimized)
subroutine sla_trsylv_l2_unopt (transa, transb, sgn, m, n, a, lda, b,
ldb, x, ldx, scale, work, info)
sla_trsylv2_l3_2sβ Two level blocked Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
subroutine sla_trsylv2_l3_2s (transa, transb, sgn, m, n, a, lda, b, ldb,
x, ldx, scale, work, info)
sla_trsylv2_l3β Level-3 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
subroutine sla_trsylv2_l3 (transa, transb, sgn, m, n, a, lda, b, ldb, x,
ldx, scale, work, info)
sla_trsylv2_l3_unoptβ Level-3 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Not Optimized)
subroutine sla_trsylv2_l3_unopt (transa, transb, sgn, m, n, a, lda, b,
ldb, x, ldx, scale, work, info)
sla_trsylv_l3_2sβ Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation.
subroutine sla_trsylv_l3_2s (transa, transb, sgn, m, n, a, lda, b, ldb,
x, ldx, scale, work, info)
sla_trsylv_l3β Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation.
subroutine sla_trsylv_l3 (transa, transb, sgn, m, n, a, lda, b, ldb, x,
ldx, scale, work, info)
sla_trsylv_l3_unoptβ Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation (unoptimized)
subroutine sla_trsylv_l3_unopt (transa, transb, sgn, m, n, a, lda, b,
ldb, x, ldx, scale, work, info)
sla_trsylv2_recursiveβ Level-3 Recursive Blocked Algorithm for the discrete time Sylvester equation.
recursive subroutine sla_trsylv2_recursive (transa, transb, sgn, m, n,
a, lda, b, ldb, x, ldx, scale, work, info)
sla_trsylv_recursiveβ Level-3 Recursive Blocked Solver for the Sylvester equation.
recursive subroutine sla_trsylv_recursive (transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
π Detailed Description π
Single Precision routines for triangular standard Sylvester equations.
okay so this whole section? it's the solvers for the standard Sylvester equation with (quasi) triangular coefficient matrices. π«
and like, where do those coefficient matrices come from? bestie, they're normally generated with the help of the Schur decomposition from LAPACK. that's the origin story π«Ά
and every single code in here uses single precision arithmetic. no double, no mixing, just single. periodt. π
π Function Documentation π
π¦ subroutine sla_trsylv2_dag π¦
subroutine sla_trsylv2_dag (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, m) a, integer lda, real, dimension(ldb, n) b, integer
ldb, real, dimension(ldx, n) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the discrete time Sylvester equation with DAG based parallelization.
β¨ Purpose β¨
!>
!> SLA_TRSYLV2_DAG solves a discrete time Sylvester equation of the following forms
!>
!> op1(A) * X * op2(B) + X = SCALE * Y (1)
!>
!> or
!>
!> op1(A) * X * op2(B) - X = SCALE * Y (2)
!>
!> where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper
!> quasi triangular matrices. The right hand side Y and the solution X
!> M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK.
!>
so basically: A is a M-by-M quasi upper triangular matrix, B is a N-by-N upper quasi triangular matrix (yes the original says "matrices", we don't question it π), and the right hand side Y and the solution X are M-by-N matrices. and the glow-up moment? A and B are typically created by SGEES from LAPACK. iconic. π
πΈ Remarks πΈ
The algorithm is implemented using BLAS level 3 operations and OpenMP 4.0 DAG scheduling. yes, DAG scheduling, she's doing the most and we love her for it π
π Attention π
bestie, listen. due to the parallel nature of the algorithm, the scaling is not applied to the right hand. so if the problem is ill-posed and scaling shows up, you have to solve the equation again with a solver that has complete scaling support β like the SLA_TRSYLV2_L3 routine. no shortcuts, no cap. π¨
π Parameters π
TRANSAβ aCHARACTER(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β aCHARACTER(1). it 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βREAL, and the allowed values are+/-1. it 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βREAL array, 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βREAL array, dimension(LDB,N). the matrix B must be (quasi-) upper triangular. heads up: 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).XβREAL 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 byTRANSA,TRANSB, andSGN. right hand side Y and the solution X are M-by-N matrices. π¦LDXβ it's anINTEGER, bestie, and it's the leading dimension of the arrayX. Rule:LDX >= max(1,M). Don't test it. It WILL test you back. πSCALEβ aREAL, and it's the little hero that stops your result from overflowing. IfINFO == 0thenSCALEis1.0. Otherwise, if one of the inner systems couldn't be solved correctly, then0 < SCALE <= 1holds true. And ifSCALE .NE. 1? Then the problem is not solved correctly and you have to go use another solver. Not me finding this out at runtime πWORKβ aREAL array, dimension LWORK. It's the workspace for the algorithm. You must query this workspace before running the computation, no skipping. You do the query by calling the subroutine withINFO == -1on input. The required workspace then comes back to you inINFO. It's giving "ask before you take" energy π«ΆINFOβ anINTEGER, and it's the main character of diagnostics honestly π
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, slay β¨< 0β ifINFO = -i, the i-th argument had an illegal value> 0β the equation is not solved correctly. One of the arising inner system got singular. π
β¨ Author β¨
Martin Koehler, MPI Magdeburg
π Date π
October 2025
π¦ Definition π¦
Definition at line 181 of file sla_trsylv2_dag.f90.
π subroutine sla_trsylv2_kernel_44nn
subroutine sla_trsylv2_kernel_44nn (real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, integer info)
Solver for a 4x4 discrete time Sylvester equation (TRANSA = N, TRANSB = N). Okay so this one is specifically the 4x4 girlies, no cap.
π Purpose π
SLA_TRSYLV2_KERNEL_44NN solves a discrete time Sylvester equation that looks like this:
A * X * B + SGN * X = SCALE * Y (1)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. The algorithm is implemented using BLAS level 2 operations. Thereby the order of M and N is at most 4. Furthermore, for fast execution the function does not check the input arguments. π«£ (iconic of it, honestly, but you HAVE been warned.)
πΈ Parameters πΈ
SGNβ aREAL, allowed values:+/-1. It specifies the sign between the two parts of the Sylvester equation.Mβ anINTEGER, the order of the matrixA. Constraint:4 >= M >= 0.Nβ anINTEGER, the order of the matrixB. Constraint:4 >= N >= 0.Aβ aREAL array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular. No exceptions bestie.LDAβ anINTEGER, the leading dimension of the arrayA. Rule:LDA >= max(1,M).Bβ aREAL array, dimension (LDB,N). The matrixBmust be (quasi-) upper triangular too. Matching set, we love to see it πLDBβ anINTEGER, the leading dimension of the arrayB. Rule:LDB >= max(1,N).Xβ aREAL array, dimension (LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) as selected bySGN. Right hand sideYand the solutionXare M-by-N matrices. It's giving "same array, new identity" πLDXβ anINTEGER, the leading dimension of the arrayX. Rule:LDB >= max(1,M). (Yes, that saysLDB. We're reporting it exactly as written, bestie, not our typo π)SCALEβ aREAL, the scaling factor to prevent overflow in the result. IfINFO == 0thenSCALEis1.0, otherwise if one of the inner systems could not be solved correctly,0 < SCAL <= 1holds true. (And yes,SCALβ again, exactly as written π)INFOβ anINTEGER.
On input:
= 1β skip the input data checks<> 1β check input data like normal LAPACK like routines
On output:
== 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 135 of file sla_trsylv2_kernel_44_nn.f90.
π subroutine sla_trsylv2_kernel_44nt
subroutine sla_trsylv2_kernel_44nt (real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, integer info)
Solver for a 4x4 discrete time Sylvester equation (TRANSA = N, TRANSB = T). Same family, different transpose, we move πΈ
π Purpose π
SLA_TRSYLV2_KERNEL_44NT solves a discrete time Sylvester equation shaped like this:
A * X * B**T + SGN * X = SCALE * Y (1)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. The algorithm is implemented using BLAS level 2 operations. Thereby the order of M and N is at most 4. Furthermore, for fast execution the function does not check the input arguments. π
πΈ Parameters πΈ
SGNβ aREAL, allowed values:+/-1. It specifies the sign between the two parts of the Sylvester equation.Mβ anINTEGER, the order of the matrixA. Constraint:4 >= M >= 0.Nβ anINTEGER, the order of the matrixB. Constraint:4 >= N >= 0.Aβ aREAL array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβ anINTEGER, the leading dimension of the arrayA. Rule:LDA >= max(1,M).Bβ aREAL array, dimension (LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβ anINTEGER, the leading dimension of the arrayB. Rule:LDB >= max(1,N).Xβ aREAL array, dimension (LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) as selected bySGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβ anINTEGER, the leading dimension of the arrayX. Rule:LDB >= max(1,M). (StillLDB. Still reporting faithfully. π«Ά)SCALEβ aREAL, the scaling factor to prevent overflow in the result. IfINFO == 0thenSCALEis1.0, otherwise if one of the inner systems could not be solved correctly,0 < SCAL <= 1holds true.INFOβ anINTEGER.
On input:
= 1β skip the input data checks<> 1β check input data like normal LAPACK like routines
On output:
== 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 134 of file sla_trsylv2_kernel_44_nt.f90.
π subroutine sla_trsylv2_kernel_44tn
subroutine sla_trsylv2_kernel_44tn (real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, integer info)
Solver for a 4x4 discrete time Sylvester equation (TRANSA = T, TRANSB = N). Transpose moved to the other side, she's flexible like that π
π Purpose π
SLA_TRSYLV2_KERNEL_44TN solves a discrete time Sylvester equation of this exact form:
A**T * X * B + SGN * X = SCALE * Y (1)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. The algorithm is implemented using BLAS level 2 operations. Thereby the order of M and N is at most 4. Furthermore, for fast execution the function does not check the input arguments. (Same disclaimer, same energy, still true π€)
πΈ Parameters πΈ
SGNβ aREAL, allowed values:+/-1. It specifies the sign between the two parts of the Sylvester equation.Mβ anINTEGER, the order of the matrixA. Constraint:4 >= M >= 0.Nβ anINTEGER, the order of the matrixB. Constraint:4 >= N >= 0.Aβ aREAL array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβ anINTEGER, the leading dimension of the arrayA. Rule:LDA >= max(1,M).Bβ aREAL array, dimension (LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβ anINTEGER, the leading dimension of the arrayB. Rule:LDB >= max(1,N).Xβ aREAL array, dimension (LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) as selected bySGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβ anINTEGER, the leading dimension of the arrayX. Rule:LDB >= max(1,M). (You already know the drill π)LDXβLDXis INTEGER. It's the leading dimension of the arrayX. And bestie, the page saysLDB >= max(1,M)here β yes, it saysLDB, notLDX, we're keeping it exactly as written, no cap. πSCALEβSCALEis REAL. It's a scaling factor whose whole job is to stop the result from overflowing. IfINFO == 0thenSCALEis1.0, otherwise β if one of the inner systems couldn't be solved correctly β0 < SCAL <= 1holds true. πINFOβINFOis INTEGER. On input:= 1: skip the input data checks β¨<> 1: check input data like normal LAPACK like routines do.
On output:
== 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 135 of file sla_trsylv2_kernel_44_tn.f90.
πΈ subroutine sla_trsylv2_kernel_44tt
subroutine sla_trsylv2_kernel_44tt (real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, integer info)
Solver for a 4x4 discrete time Sylvester equation (TRANSA = T, TRANSB = T) π
Purpose β¨
Okay so SLA_TRSYLV2_KERNEL_44TT solves a discrete time Sylvester equation that looks like this:
A**T * X * B**T + SGN * X = SCALE * Y (1)
Where A is a M-by-M quasi upper triangular matrix and B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK, iykyk. π
The algorithm is implemented using BLAS level 2 operations. Thereby the order of M and N is at most 4. And β this is the part you gotta know, bestie β for fast execution, the function does not check the input arguments. It just goes. πββοΈπ¨
Parameters π
SGNβSGNis REAL, allowed values:+/-1. It specifies the sign between the two parts of the Sylvester equation. π«MβMis INTEGER. The order of the matrixA.4 >= M >= 0.NβNis INTEGER. The order of the matrixB.4 >= N >= 0.AβAis REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBis REAL array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXis REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) as selected bySGN. π Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXis INTEGER. The leading dimension of the arrayX. And again, the page literally saysLDB >= max(1,M)β we are NOT correcting it, we keep it fr fr. π«ΆSCALEβSCALEis REAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0, otherwise if one of the inner systems could not be solved correctly,0 < SCAL <= 1holds true.INFOβINFOis INTEGER. On input:= 1: skip the input data checks β¨<> 1: check input data like normal LAPACK like routines.
On output:
== 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 135 of file sla_trsylv2_kernel_44_tt.f90.
π subroutine sla_trsylv2_l2
subroutine sla_trsylv2_l2 (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized) π₯
Purpose β¨
So SLA_TRSYLV2_L2 solves a generalized Sylvester equation, and it comes in two flavors:
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
Where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrix. The right hand side Y and the solution X are M-by-N matrices. And yep, typically the matrices A and B are created by SGEES from LAPACK. π
Parameters π
TRANSAβTRANSAis 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βTRANSBis 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)
SGNβSGNis REAL, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.= 1: solve Equation (1)== -1: solve Equation (2)
MβMis INTEGER. The order of the matricesAandC.M >= 0.NβNis INTEGER. The order of the matricesBandD.N >= 0.AβAis REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBis REAL array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular, the matrixBmust be upper triangular. π«ΆLDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXis REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. π Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXis INTEGER. The leading dimension of the arrayX. And once again the page saysLDB >= max(1,M), and once again we are keeping it exactly. Not me fixing a manpage, never. πSCALEβSCALEis REAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis REAL array, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. πINFOβINFOis INTEGER. On input:== -1: perform a workspace query π<> -1: normal operation
On exit, workspace query:
< 0: ifINFO = -i, the i-th argument had an illegal value π>= 0: the value ofINFOis the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value> 0: the equation is not solved correctly. One of the arising inner system got singular. π
Optimizations π₯
- Replaced level-3 by level-2 and level-1 calls,
- Replaced
SAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
STRMVandSGERby Fortran intrinsic,
Author π
Martin Koehler, MPI Magdeburg
Date π¦
October 2025
Definition π
Definition at line 182 of file sla_trsylv2_l2.f90.
π¦ subroutine sla_trsylv2_l2_local_copy
subroutine sla_trsylv2_l2_local_copy (character, dimension(1) transa,
character, dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized) π
Purpose β¨
β¨ sla_trsylv2_l2_local_copy β¨
okay bestie, so SLA_TRSYLV2_L2_LOCAL_COPY is out here solving a generalized Sylvester equation and honestly it's giving main character energy. π
It handles two forms:
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. β¨
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β REAL, 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β REAL array, 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β REAL 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β INTEGER. The leading dimension of the array B.LDB >= max(1,N).Xβ REAL 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β INTEGER. The leading dimension of the array X.LDB >= max(1,M). (yes, it says LDB, not LDX, we're just the messenger π)SCALEβ REAL. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβ REAL array, dimensionLWORK. Workspace for the algorithm. The workspace needs to be queried before running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned in INFO.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: π₯
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced SAXPY operation by Fortran intrinsic
- Replaced all BLAS calls except of STRMV and SGER by Fortran intrinsic,
- Use local copies of A, B, C, D, and X (M, N <=128) .
Author β Martin Koehler, MPI Magdeburg Date β October 2025 Definition at line 184 of file sla_trsylv2_l2_opt_local_copy.f90.
β¨ sla_trsylv2_l2_local_copy_128 β¨
subroutine sla_trsylv2_l2_local_copy_128 ( transa, transb, sgn, m, n,
a, lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
Purpose:
SLA_TRSYLV2_L2_LOCAL_COPY_128 solves a generalized Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrices. The right hand side Y and the solution X M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK.
Attention β οΈ
The size of the Problem is limited by M,N <= 128
Parameters (same as above, bestie, but we're listing them again because rules are rules π)
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β REAL, 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β REAL array, 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β REAL 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β INTEGER. The leading dimension of the array B.LDB >= max(1,N).Xβ REAL 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β INTEGER. The leading dimension of the array X.LDB >= max(1,M). (again with the LDB, iconic typo energy π)SCALEβ REAL. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβ REAL array, dimensionLWORK. Workspace for the algorithm. The workspace needs to be queried before running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned in INFO.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: π₯
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced SAXPY operation by Fortran intrinsic
- Replaced all BLAS calls except of STRMV by Fortran intrinsic,
- Use local copies of A, B, C, D, and X.
- Align local copies and fix problem size to <= 128
Author β Martin Koehler, MPI Magdeburg Date β October 2025 Definition at line 184 of file sla_trsylv2_l2_opt_local_copy_128.f90.
β¨ sla_trsylv2_l2_local_copy_32 β¨
subroutine sla_trsylv2_l2_local_copy_32 ( transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
Purpose:
okay so it solves a generalized Sylvester equation in one of these two flavors:
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. iykyk π¦
Attention πΈ β The size of the Problem is limited by M,N <= 32
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βSGNisREAL, 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βAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. βLDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. (not me clocking that conditional, but okay bestie, noted) πLDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREALarray, 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 arrayX.LDB >= max(1,M). (yes, that's literally what it says β copying it exactly, no cap)SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. she's just here to keep the numbers from going feral πWORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. (workspace query first, bestie β always)INFOβINFOisINTEGER.
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 SAXPY operation by Fortran intrinsic
- Replaced all BLAS calls except of STRMV by Fortran intrinsic,
- Use local copies of A, B, C, D, and X.
- Align local copies and fix problem size to <= 32
Author β Martin Koehler, MPI Magdeburg
Date β October 2025
Definition at line 184 of file sla_trsylv2_l2_opt_local_copy_32.f90.
sla_trsylv2_l2_local_copy_64
subroutine sla_trsylv2_l2_local_copy_64 ( transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized) β¨ the sixty-four era β¨
Purpose:
!>
!> SLA_TRSYLV2_L2_LOCAL_COPY_64 solves a generalized Sylvester equation of the following forms
!>
!> op1(A) * X * op2(B) + X = SCALE * Y (1)
!>
!> or
!>
!> op1(A) * X * op2(B) - X = SCALE * Y (2)
!>
!> where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper
!> quasi triangular matrices. The right hand side Y and the solution X
!> M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK.
!>
okay so same two equations as before, same A, same B, same SGEES origin story:
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. π
Attention π¦ β The size of the Problem is limited by M,N <= 64
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βSGNisREAL, 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βAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. π₯LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular. (same conditional, still clocking it π)LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREALarray, 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 arrayX.LDB >= max(1,M). (again, verbatim, don't come for me π)SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. overflow protection, she's so considerate πWORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.
On input:
== -1 : Perform a workspace query
<> -1: normal operation
On exit, workspace query:
< 0 : 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 SAXPY operation by Fortran intrinsic
- Replaced all BLAS calls except of STRMV by Fortran intrinsic,
- Use local copies of A, B, C, D, and X.
- Align local copies and fix problem size to <= 64
Author β Martin Koehler, MPI Magdeburg
Date β October 2025
Definition at line 184 of file sla_trsylv2_l2_opt_local_copy_64.f90.
sla_trsylv2_l2_local_copy_96
subroutine sla_trsylv2_l2_local_copy_96 ( transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized) β¨ and now we're in the ninety-six timeline β¨
Purpose:
so bestie, SLA_TRSYLV2_L2_LOCAL_COPY_96 solves a generalized Sylvester equation, and it shows up in two lil flavors:
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrices. The right hand side Y and the solution X M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK.
π¨ Attention π¨
The size of the Problem is limited by M,N <= 96
like, that's the whole vibe of the "96" in the name, ok? don't come for her π
πΈ Parameters πΈ
TRANSAβTRANSAisCHARACTER(1). It picks 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). Same energy, but for 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βSGNisREAL, allowed values:+/-1. It decides 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 A and C.M >= 0.NβNisINTEGER. The order of the matrices B and D.N >= 0.AβAisREALarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular. no exceptions bestie β¨LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BβBisREALarray, 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).XβXisREALarray, 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. it really said "glow up in place" πLDXβLDXisINTEGER. The leading dimension of the array X.LDB >= max(1,M).SCALEβSCALEisREAL. It's a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. (yes you gotta ask first, it's called β¨consentβ¨)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
SAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
STRMVby Fortran intrinsic, - Use local copies of A, B, C, D, and X.
- Align local copies and fix problem size to <= 96
π Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
π Definition
at line 184 of file sla_trsylv2_l2_opt_local_copy_96.f90.
subroutine sla_trsylv2_l2_reorder
subroutine sla_trsylv2_l2_reorder (character, dimension(1) transa,
character, dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized)
π― Purpose:
so this one, SLA_TRSYLV2_L2_UNOPT, solves a generalized Sylvester equation of the following forms:
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrices. The right hand side Y and the solution X M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK.
ik the name says _UNOPT and the title says "Optimized" and that's a whole identity crisis but bestie that's literally what it says, I don't make the rules π
πΈ 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)
SGNβSGNisREAL, 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 A and C.M >= 0.NβNisINTEGER. The order of the matrices B and D.N >= 0.AβAisREALarray, 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βBisREALarray, 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).XβXisREALarray, 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βLDXisINTEGER. The leading dimension of the array X.LDB >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis 1.0 otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to 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
SAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
STRMVandSGERby Fortran intrinsic,
π Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
π Definition
at line 183 of file sla_trsylv2_l2_opt_reorder.f90.
subroutine sla_trsylv2_l2_unopt
subroutine sla_trsylv2_l2_unopt (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the discrete time Sylvester equation (unoptimized)
π― Purpose:
SLA_TRSYLV2_L2_UNOPT solves a generalized Sylvester equation of the following forms β¨
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrices. The right hand side Y and the solution X M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. No cap π
Attention π
The algorithm is implemented using BLAS level 2 operations without further optimizations. For a faster implementation see SLA_TRSYLV2_L2. Bestie, this one is the no-frills version β it works, it's just not the glow-up π
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βSGNisREAL, 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βAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,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).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to be queried before running the computation β the query is performed by calling the subroutine withINFO == -1on input, and 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.
Author π
Martin Koehler, MPI Magdeburg
Date ποΈ
October 2025
Definition at line 181 of file sla_trsylv2_l2_unopt.f90.
sla_trsylv2_l3 π¦
subroutine sla_trsylv2_l3 (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized) β¨
Purpose: π
SLA_TRSYLV2_L3 solves a generalized Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrices. The right hand side Y and the solution X M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. Same energy as before, just the optimized flavor π
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βSGNisREAL, 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βAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,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).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to be queried before running the computation β you do that by calling the subroutine withINFO == -1on input, and the required workspace comes back 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:
Author π
Martin Koehler, MPI Magdeburg
Date ποΈ
October 2025
Definition at line 173 of file sla_trsylv2_l3_opt.f90.
sla_trsylv2_l3_2s πΈ
subroutine sla_trsylv2_l3_2s (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Two level blocked Bartels-Stewart Algorithm for the discrete time Sylvester equation (Optimized) π₯
Purpose: π
...it solves a generalized Sylvester equation of these two iconic shapes:
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. iykyk β¨
π Remarks
The algorithm used level-3 BLAS operations and a DAG scheduled inner solver. lowkey iconic behavior.
π Attention
Because of the parallel nature of the inner solvers, the scaling is turned off andSCALEis set toONE. No scaling era for this one, bestie β that's just how it is. π«Ά
πΈ Parameters
TRANSAβTRANSAisCHARACTER(1). It tells you 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 tells you 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βSGNisREAL, and the allowed values are+/-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βAisREAL array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular. no exceptions, bestie.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREAL array, 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).XβXisREAL 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 solutionXareM-by-Nmatrices. glow up fr fr πLDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREAL 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 withINFO == -1on input. The required workspace is then returned inINFO. ask before you act, periodt.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 174 of file sla_trsylv2_l3_2stage.f90.
π sla_trsylv2_l3_unopt
subroutine sla_trsylv2_l3_unopt (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the discrete time Sylvester equation (Not Optimized). yes bestie, the not optimized one β she's doing her best and honestly that's valid. π«Ά
Purpose
SLA_TRSYLV2_L3_UNOPT solves a generalized Sylvester equation of the following forms:
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. β¨
π Attention
This function iterates column first over the result, and from this fact it will be a bit slower than SLA_TRSYLV2_L3. not a flaw, just a lifestyle. π
πΈ 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βSGNisREAL, 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βAisREAL array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREAL array, 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).XβXisREAL 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 solutionXareM-by-Nmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREAL 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 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:
π Author
Martin Koehler, MPI Magdeburg
π¦ Date
October 2025
Definition at line 175 of file sla_trsylv2_l3_unopt.f90.
π§ sla_trsylv2_recursive
recursive subroutine sla_trsylv2_recursive (character, dimension(1) transa,
character, dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Recursive Blocked Algorithm for the discrete time Sylvester equation.
Purpose
okay so SLA_TRSYLV2_RECURSIVE solves a generalized Sylvester equation that looks like this, bestie:
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N upper quasi triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are created by SGEES from LAPACK. iykyk π
πΈ Remarks πΈ
The algorithm uses recursive blocking instead of the Bartels-Stewart approach. it's giving main character energy, no cap π«Ά
β¨ Parameters β¨
TRANSAβ isCHARACTER(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β isCHARACTER(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β isREAL, 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β isREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβ isINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bβ isREALarray, 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).Xβ isREALarray, 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β isINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβ isREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβ isREALarray, dimensionM*N. Workspace for the algorithm.INFOβ isINTEGER.
== 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.
π Author π
Martin Koehler, MPI Magdeburg
π Date π
October 2025
Definition at line 163 of file sla_trsylv2_recursive.f90.
π¦ sla_trsylv_dag π¦
subroutine sla_trsylv_dag (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, n) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG parallelization. β
π Purpose π
SLA_TRSYLV_DAG solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. π
πΈ Remarks πΈ
The algorithm is implemented using BLAS level 3 operations and OpenMP 4.0 DAG Scheduling.
π 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 SLA_TRSYLV_L3. fr fr, don't skip this one. π
β¨ Parameters β¨
TRANSAβ isCHARACTER(1). Specifies the form of the system of equations with respect toA:
== 'N': op1(A) = A
== 'T': op1(A) = A**T
TRANSBβ isCHARACTER(1). Specifies the form of the system of equations with respect toB:
== 'N': op2(B) = B,
== 'T': op2(B) = B**T
SGNβ isREAL, 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β isREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβ isINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bβ isREALarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβ isINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).Xβ isREALarray, 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β isINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβ isREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβ isREALarray, 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 : 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.
π Author π
Martin Koehler, MPI Magdeburg
π Date π
October 2025
Definition at line 177 of file sla_trsylv_dag.f90.
π sla_trsylv_kernel_44nn π
subroutine sla_trsylv_kernel_44nn (real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, integer info)
Solver for a 4x4 Sylvester equation (TRANSA = N, TRANSB = N) π
π Purpose π
okay so SLA_TRSYLV_KERNEL_44NN solves a Sylvester equation that looks exactly like this:
A * X + SGN * X * B = SCALE * Y (1)
where A is a M-by-M quasi upper triangular matrix and B is N-by-N quasi upper triangular matrices. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are create by SGEES from LAPACK. The algorithm is implemented without using BLAS level 2 operations. Because of that, the order of M and N is at most 4. And, for fast execution, the function does not check the input arguments. π (yes bestie, it just trusts you β don't make it regret that)
Parameters
SGNβSGNis REAL, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.MβMis INTEGER. The order of the matricesAandC.4 >= M >= 0.NβNis INTEGER. The order of the matricesBandD.4 >= N >= 0.AβAis REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBis REAL array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular.LDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXis REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis REAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCAL <= 1holds true.INFOβINFOis INTEGER. On output:== 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 134 of file sla_trsylv_kernel_44_nn.f90.
sla_trsylv_kernel_44nt π¦
subroutine sla_trsylv_kernel_44nt (real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, integer info)
Solver for a 4x4 Sylvester equation (TRANSA = N, TRANSB = T)
Purpose:
SLA_TRSYLV_KERNEL_44NT solves a Sylvester equation of the following form:
A * X + SGN * X * B**T = SCALE * Y (1)
where A is a M-by-M quasi upper triangular matrix and B is N-by-N quasi upper triangular matrices. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are create by SGEES from LAPACK. The algorithm is implemented using without BLAS level 2 operations. Because of that, the order of M and N is at most 4. And for fast execution, the function does not check the input arguments. β¨
Parameters
SGNβSGNis REAL, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.MβMis INTEGER. The order of the matricesAandC.4 >= M >= 0.NβNis INTEGER. The order of the matricesBandD.4 >= N >= 0.AβAis REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBis REAL array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular.LDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXis REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis REAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCAL <= 1holds true.INFOβINFOis INTEGER. On output:== 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 133 of file sla_trsylv_kernel_44_nt.f90.
sla_trsylv_kernel_44tn π
subroutine sla_trsylv_kernel_44tn (real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, integer info)
Solver for a 4x4 Sylvester equation (TRANSA = T, TRANSB = N)
Purpose:
SLA_TRSYLV_KERNEL_44TN solves a Sylvester equation of the following form:
A**T * X + SGN * X * B = SCALE * Y (1)
where A is a M-by-M quasi upper triangular matrix and B is N-by-N quasi upper triangular matrices. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are create by SGEES from LAPACK. The algorithm is implemented without using BLAS level 2 operations. Because of that, the order of M and N is at most 4. And for fast execution, the function does not check the input arguments. π
Parameters
SGNβSGNis REAL, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.MβMis INTEGER. The order of the matricesAandC.4 >= M >= 0.NβNis INTEGER. The order of the matricesBandD.4 >= N >= 0.AβAis REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBis REAL array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. If the matrixDis already quasi-upper triangular the matrixBmust be upper triangular.LDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXis REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis REAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCAL <= 1holds true.INFOβINFOis INTEGER. On output:== 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 133 of file sla_trsylv_kernel_44_tn.f90.
sla_trsylv_kernel_44tt π
subroutine sla_trsylv_kernel_44tt (real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, integer info)
Solver for a 4x4 Sylvester equation (TRANSA = T, TRANSB = T)
Purpose:
SCALEβ REAL, the lil' safety-scaling factor that keeps your result from overflowing into the void β¨ ifINFO == 0thenSCALEis1.0; otherwise, when one of the inner systems couldn't be solved correctly,0 < SCAL <= 1holds true (yes bestie, that's exactly how it's written in the docs βSCAL, noEβ we report, we don't edit π )INFOβ INTEGER, the receipts. On output:== 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 133 of file sla_trsylv_kernel_44_tt.f90.
π sla_trsylv_l2
subroutine sla_trsylv_l2 (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the Sylvester equation (optimized)
β¨ Purpose:
!> !> SLA_TRSYLV_L2 solves a Sylvester equation of the following forms !> !> op1(A) * X + X * op2(B) = SCALE * Y (1) !> !> or !> !> op1(A) * X - X * op2(B) = SCALE * Y (2) !> !> where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular !> matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices !> A and B are generated via SGEES form LAPACK. !>
β¨ Parameters
TRANSAβ CHARACTER(1). Tells us what form the system of equations takes with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβ CHARACTER(1). Same energy, but forB:== 'N':op2(B) = B,== 'T':op2(B) = B**T
SGNβ REAL, 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β REAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. βLDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bβ REAL array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular. βLDBβ INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).Xβ REAL array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXareM-by-Nmatrices. πLDXβ INTEGER. The leading dimension of the arrayX.LDB >= max(1,M)(yup, that's what it says βLDB, on theLDXentry. Copying it down faithfully, no cap π)SCALEβ REAL. A scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβ REAL array, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. πINFOβ INTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO = -i, the i-th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
- On input:
π Optimizations:
- Replaced level-3 by level-2 and level-1 calls,
- Replaced SAXPY operation by Fortran intrinsic
- Replaced all BLAS calls except of STRMV and SGER by Fortran intrinsic,
π«Ά Author
Martin Koehler, MPI Magdeburg
πΈ Date
October 2025
π¦ Definition
Definition at line 180 of file sla_trsylv_l2.f90.
π sla_trsylv_l2_local_copy
subroutine sla_trsylv_l2_local_copy (character, dimension(1) transa,
character, dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the Sylvester equation (optimized)
β¨ Purpose:
okay this is where the next part swoops in, bestie β the purpose section for this one is right there and we're picking it up next π
okay so SLA_TRSYLV_L2_LOCAL_COPY solves a Sylvester equation that looks like this:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. no cap, that's the whole vibe π
πΈ 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βSGNisREAL, 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βAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. (yes bestie you literally have to ask first, it's giving "let me check my calendar" energy π)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 (we're going smaller, and honestly? it's serving)
- Reorder the solution order to column first style
- Replaced
SAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
STRMVandSGERby Fortran intrinsic - Use local copies of
A,B,C,D, andX(M, N <=128)
π Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
Definition at line 181 of file sla_trsylv_l2_opt_local_copy.f90.
π¦ subroutine sla_trsylv_l2_local_copy_128
subroutine sla_trsylv_l2_local_copy_128 ( transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized)
π« Purpose π«
SLA_TRSYLV_L2_LOCAL_COPY_128 solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. π
πΈ Parameters πΈ
TRANSAβTRANSAisCHARACTER(1). Specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβTRANSBisCHARACTER(1). Specifies the form of the system of equations with respect toB:== 'N':op2(B) = B,== 'T':op2(B) = B**T
SGNβSGNisREAL, 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.128 >= M >= 0.NβNisINTEGER. The order of the matricesBandD.128 >= N >= 0.AβAisREALarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREALarray, dimensionLWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO = -i, 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
SAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
STRMVby Fortran intrinsic - Use local copies of
A,B,C,D, andX. - Align local copies and fix problem size to <= 64
π Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
Definition at line 183 of file sla_trsylv_l2_opt_local_copy_128.f90.
π§ subroutine sla_trsylv_l2_local_copy_32
subroutine sla_trsylv_l2_local_copy_32 ( transa, transb, sgn, m, n, a,
lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized)
π« Purpose π«
okay so SLA_TRSYLV_L2_LOCAL_COPY_32 solves a Sylvester equation, and it comes in these two flavors:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically bestie, the matrices A and B get generated via SGEES form LAPACK. π¦
π Parameters π
TRANSAβTRANSAisCHARACTER(1). It says which form the system of equations takes with respect toA: if it's'N'thenop1(A) = A, and if it's'T'thenop1(A) = A**T. πTRANSBβTRANSBisCHARACTER(1). Same energy but forB:'N'meansop2(B) = B,and'T'meansop2(B) = B**T. β¨SGNβSGNisREAL, allowed values:+/-1. It picks 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.32 >= M >= 0.NβNisINTEGER. The order of the matricesBandD.32 >= N >= 0.AβAisREAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREAL array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREAL 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βLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).
bestie i'm just the messenger π the doc literally saysLDBin thatLDXdescription. i am NOT fixing it, that's what it says, periodt.
SCALEβSCALEisREAL. It's a scaling factor to prevent overflow in the result. IfINFO == 0thenSCALEis1.0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. π«WORKβWORKisREAL array, dimensionLWORK. Workspace for the algorithm. Lowkey you have to query the workspace before running the computation β you do the query by calling the subroutine withINFO == -1on input, and then the required workspace gets 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. π
π Optimizations: π
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
SAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
STRMVby Fortran intrinsic, - Use local copies of
A,B,C,D, andX. - Align local copies and fix problem size to
<= 64
π Author π
Martin Koehler, MPI Magdeburg
πΈ Date πΈ
October 2025
Definition at line 183 of file sla_trsylv_l2_opt_local_copy_32.f90.
β¨ subroutine sla_trsylv_l2_local_copy_64 ( transa, transb, sgn, m, n, a, lda, b, ldb, x, ldx, scale, work, info) β¨
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized) π
π Purpose: π
SLA_TRSYLV_L2_LOCAL_COPY_64 solves a Sylvester equation, same two forms as before bestie:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B get generated via SGEES form LAPACK. π¦
π Parameters π
TRANSAβTRANSAisCHARACTER(1). Which form the system of equations takes with respect toA:'N'meansop1(A) = A,'T'meansop1(A) = A**T. β¨TRANSBβTRANSBisCHARACTER(1). Which form with respect toB:'N'meansop2(B) = B,and'T'meansop2(B) = B**T. β¨SGNβSGNisREAL, allowed values:+/-1. Picks 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.64 >= M >= 0.NβNisINTEGER. The order of the matricesBandD.64 >= N >= 0.AβAisREAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREAL array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREAL 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βLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).
yeah bestie it says LDB again. copy-paste is a lifestyle apparently π
SCALEβSCALEisREAL. A scaling factor to prevent overflow in the result. IfINFO == 0thenSCALEis1.0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. π«WORKβWORKisREAL array, dimensionLWORK. Workspace for the algorithm. You gotta query the workspace before running the computation β call the subroutine withINFO == -1on input and the required workspace comes back 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. π
π Optimizations: π
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced
SAXPYoperation by Fortran intrinsic - Replaced all BLAS calls except of
STRMVby Fortran intrinsic, - Use local copies of
A,B,C,D, andX. - Align local copies and fix problem size to
<= 64
π Author π
Martin Koehler, MPI Magdeburg
πΈ Date πΈ
October 2025
Definition at line 182 of file sla_trsylv_l2_opt_local_copy_64.f90.
π¦ subroutine sla_trsylv_l2_local_copy_96 ( transa, transb, sgn, m, n, a, lda, b, ldb, x, ldx, scale, work, info) π¦
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation (Optimized) π
π Purpose: π
so basically SLA_TRSYLV_L2_LOCAL_COPY_96 solves a Sylvester equation that looks like one of these two glow-ups:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix and B is a N-by-N quasi upper triangular matrix π¦. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. iykyk β¨
π Parameters π
TRANSAβTRANSAisCHARACTER(1). Specifies the form of the system of equations with respect to A:== 'N': op1(A) = A== 'T': op1(A) = A**T
TRANSBβTRANSBisCHARACTER(1). Specifies the form of the system of equations with respect to B:== 'N': op2(B) = B,== 'T': op2(B) = B**T
SGNβSGNisREAL, 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 A and C.96 >= M >= 0.NβNisINTEGER. The order of the matrices B and D.96 >= N >= 0.AβAisREAL array, 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βBisREAL array, dimension (LDB,N). The matrix B must be (quasi-) upper triangular.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).XβXisREAL 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βLDXisINTEGER. The leading dimension of the array X.LDB >= max(1,M).SCALEβSCALEisREAL. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREAL 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βINFOisINTEGER.- 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:
π Optimizations:
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced SAXPY operation by Fortran intrinsic
- Replaced all BLAS calls except of STRMV by Fortran intrinsic,
- Use local copies of A, B, C, D, and X.
- Align local copies and fix problem size to <= 64
πΈ Author πΈ
Martin Koehler, MPI Magdeburg
β Date β
October 2025
π Definition π
At line 181 of file sla_trsylv_l2_opt_local_copy_96.f90.
π sla_trsylv_l2_reorder π
subroutine sla_trsylv_l2_reorder (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the Sylvester equation (optimized)
π¦ Purpose:
okay so SLA_TRSYLV_L2_REORDER solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. fr fr π
Attention π The algorithm is implemented using BLAS level 2 operations without further optimizations. For a faster implementation see SLA_TRSYLV_L2.
π 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)
SGNβSGNisREAL, 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 A and C.M >= 0.NβNisINTEGER. The order of the matrices B and D.N >= 0.AβAisREAL array, 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βBisREAL array, dimension (LDB,N). The matrix B must be (quasi-) upper triangular.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).XβXisREAL 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βLDXisINTEGER. The leading dimension of the array X.LDB >= max(1,M).SCALEβSCALEisREAL. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREAL 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βINFOisINTEGER.- 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:
π Optimizations:
- Replaced level-3 by level-2 and level-1 calls,
- Reorder the solution order to column first style,
- Replaced SAXPY operation by Fortran intrinsic
- Replaced all BLAS calls except of STRMV and SGER by Fortran intrinsic,
πΈ Author πΈ
Martin Koehler, MPI Magdeburg
β Date β
October 2025
π Definition π
At line 182 of file sla_trsylv_l2_opt_reorder.f90.
β¨ sla_trsylv_l2_unopt β¨
subroutine sla_trsylv_l2_unopt (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-2 Bartels-Stewart Algorithm for the Sylvester equation (unoptimized)
π¦ Purpose:
Parameters (continued from the l2_unopt version, bestie, we're still in it)
TRANSAβ it's aCHARACTER(1). Tells us the form of the system of equations with respect to A and C, and the valid vibes are:'N':op1(A) = A,op1(C) = C(no transpose for A and C, they're serving as-is π )'T':op1(A) = A**T,op1(C) = C **T(transpose A and C, flip 'em)
TRANSBβ also aCHARACTER(1). Same energy but for 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β aREAL, and the only allowed values are+/-1, no in-between, pick a side bestie. It 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. Constraint:M >= 0.NβINTEGER. The order of the matrices B and D. Constraint:N >= 0.AβREALarray, dimension(LDA,M). The matrix A must be (quasi-) upper triangular. That's not a suggestion, that's the law π«ΆLDAβINTEGER. The leading dimension of the array A.LDA >= max(1,M).BβREALarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular.LDBβINTEGER. The leading dimension of the array B.LDB >= max(1,N).XβREALarray, 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. So yeah she's doing double duty, input then output, main character behaviour honestly πLDXβINTEGER. The leading dimension of the array X.LDB >= max(1,M). (yes it literally saysLDBin there, we are reporting what the page says, no notes π)SCALEβREAL. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. She's holding your hand so nothing explodes πWORKβREALarray, dimensionLWORK. Workspace for the algorithm. And listen: the workspace needs to be queried before running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. Do the query first, I'm begging πINFOβINTEGER. Buckle up:- On input:
== -1: perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO = -i, the i-th argument had an illegal value>= 0: the value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value> 0: the equation is not solved correctly. One of the arising inner system got singular. π
- On input:
Optimizations:
- Nothing.
Like. Nothing. Zero. Not a single one. It's giving "we're just happy to be here" π
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 180 of file sla_trsylv_l2_unopt.f90.
subroutine sla_trsylv_l3
subroutine sla_trsylv_l3 (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. Okay so this is the same energy as the L2 one but with BLAS level 3, and we love an upgrade π¦
Purpose:
!> SLA_TRSYLV_L3 solves a Sylvester equation of the following forms
!>
!> op1(A) * X + X * op2(B) = SCALE * Y (1)
!>
!> or
!>
!> op1(A) * X - X * op2(B) = SCALE * Y (2)
!>
!> where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular
!> matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices
!> A and B are generated via SGEES form LAPACK.
!>
Attention
The algorithm is implemented using BLAS level 3 operations. That's the whole glow-up, no further notes π
Parameters
TRANSAβCHARACTER(1). Specifies the form of the system of equations with respect to A:'N':op1(A) = A'T':op1(A) = A**T
TRANSBβCHARACTER(1). Specifies the form of the system of equations with respect to B:'N':op2(B) = B,'T':op2(B) = B**T
SGNβREAL, 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βREALarray, 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βREALarray, dimension(LDB,N). The matrix B must be (quasi-) upper triangular.LDBβINTEGER. The leading dimension of the array B.LDB >= max(1,N).XβREALarray, 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βINTEGER. The leading dimension of the array X.LDB >= max(1,M). (still saysLDB, still quoting it exactly, iykyk π)SCALEβREAL. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβREALarray, 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.
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 172 of file sla_trsylv_l3_opt.f90.
subroutine sla_trsylv_l3_2s
subroutine sla_trsylv_l3_2s (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. Yeah, same description as the one above β the "2s" is the plot twist and we're about to find out what it means π
Purpose:
SLA_TRSYLV_L3_2S is out here solving a Sylvester equation, and the forms are literally these two, bestie:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix, and the right hand side Y plus the solution X are both M-by-N matrices. Typically A and B are generated via SGEES form LAPACK. π¦
β¨ Remarks β¨
The algorithm is implemented using BLAS level 3 operations and a two level inner solver β that's a massive parallel DAG scheduled solver from SLA_TRSYLV_DAG plus optimized kernel solvers. Two layers of solving. Main character energy fr fr. π
π Attention π
Due to the parallel nature of the inner solvers the scaling is turned off andSCALEis set toONE. So do not come looking for a scale factor here, she doesn't do that. π«Ά
πΈ Parameters πΈ
TRANSAβTRANSAisCHARACTER(1). It specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβTRANSBisCHARACTER(1). It specifies the form of the system of equations with respect toB:== 'N':op2(B) = B,== 'T':op2(B) = B**T
SGNβSGNisREAL, 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βAisREAL array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREAL array, dimension (LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREAL 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 solutionXareM-by-Nmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREAL 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β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 π§
Definition at line 174 of file sla_trsylv_l3_2stage.f90.
okay NEXT bestie, new function, same energy π
subroutine sla_trsylv_l3_unopt (character, dimension(1) transa, character,
dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
π Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation (unoptimized) π
Purpose:
SLA_TRSYLV_L3_UNOPT solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. β¨
π Attention π
The algorithm is implemented using BLAS level 3 operations.
π Parameters π
TRANSAβTRANSAisCHARACTER(1). It specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβTRANSBisCHARACTER(1). It specifies the form of the system of equations with respect toB:== 'N':op2(B) = B,== 'T':op2(B) = B**T
SGNβSGNisREAL, 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βAisREAL array, dimension (LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREAL array, dimension (LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREAL 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 solutionXareM-by-Nmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).(yes bestie, it saysLDBhere, that's literally what the page says, I'm just the messenger π)SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREAL 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β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 β
Definition at line 172 of file sla_trsylv_l3_unopt.f90.
and now for something recursive, periodt π
recursive subroutine sla_trsylv_recursive (character, dimension(1) transa,
character, dimension(1) transb, real sgn, integer m, integer n, real,
dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
dimension(*) work, integer info)
π Level-3 Recursive Blocked Solver for the Sylvester equation π
Purpose:
she recurses, she blocks, she solves β details incoming, stay tuned bestie πΈ
okay bestie, so SLA_TRSYLV_RECURSIVE is literally here to solve a Sylvester equation, and it comes in two iconic forms: π
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. π
β¨
β¨ ATTENTION β¨
The algorithm is implemented using BLAS level 3 operations and recursive blocking. So it's fast, bestie. No cap. π₯π
β¨ PARAMETERS β¨
TRANSAβTRANSAisCHARACTER(1). Specifies the form of the system of equations with respect to A:== 'N': op1(A) = A== 'T': op1(A) = A**T
TRANSBβTRANSBisCHARACTER(1). Specifies the form of the system of equations with respect to B:== 'N': op2(B) = B,== 'T': op2(B) = B**T
SGNβSGNisREAL, 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 A and C.M >= 0.NβNisINTEGER. The order of the matrices B and D.N >= 0.AβAisREAL array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREAL array, dimension(LDB,N). The matrixBmust be (quasi-) upper triangular.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisREAL 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βLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M). (yes bestie, it saysLDBπ)SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisREAL array, dimension1. Workspace for the algorithm.INFOβINFOisINTEGER.== 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.
β¨ AUTHOR β¨
Martin Koehler, MPI Magdeburg
β¨ DATE β¨
October 2025
Definition at line 160 of file sla_trsylv_recursive.f90.
β¨ AUTHOR β¨
Generated automatically by Doxygen for MEPACK from the source code.
And that's the whole vibe, bestie! This page is from Version 1.1.2, dated Thu Oct 9 2025 00:00:00, for sgltrsylv(3). Stay iconic! πβ¨π¦π
π¦ 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