sgltglyap(3)

πŸ“¦
version 1.1.2 Β· 3 versions
, in fedora 43

πŸ’… sgltglyap πŸ’…

okay bestie, welcome to sgltglyap(3) from the MEPACK manual, section 3 β€” single precision edition, and no cap, this page is a whole vibe. sit down, hydrate, we're doing math. 🫢


🌸 NAME 🌸

sgltglyap β€” Single Precision

  • Single precision solvers for generalized Lyapunov and Stein equations with triangular coefficient matrices.

✨ SYNOPSIS ✨

πŸŽ€ Functions πŸŽ€

  • ```fortran subroutine sla_tglyap_dag (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation with DAG scheduling.

- ```fortran
subroutine sla_tgstein_dag (trans, m, a, lda, b, ldb, x, ldx, scale,
    work, info)

Level-3 Bartels-Stewart Algorithm for the generalized Stein equation with DAG scheduling.

  • ```fortran subroutine sla_tglyap_l2 (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation.

- ```fortran
subroutine sla_tglyap_l2_unopt (trans, m, a, lda, b, ldb, x, ldx, scale,
    work, info)

Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation (Unoptimized)

  • ```fortran subroutine sla_tgstein_l2 (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-2 Bartels-Stewart Algorithm for the generalized Stein equation.

- ```fortran
subroutine sla_tglyap_l3 (trans, m, a, lda, b, ldb, x, ldx, scale, work,
    info)

Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.

  • ```fortran subroutine sla_tglyap_l3_2s (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation two stage.

- ```fortran
subroutine sla_tgstein_l3 (trans, m, a, lda, b, ldb, x, ldx, scale, work,
    info)

Level-3 Bartels-Stewart Algorithm for the generalized Stein equation.

  • ```fortran subroutine sla_tgstein_l3_2s (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation (Two Stage)

- ```fortran
recursive subroutine sla_tglyap_recursive (trans, m, a, lda, b, ldb, x,
    ldx, scale, work, info)

Recursive Blocking Algorithm for the generalized Lyapunov equation.

  • ```fortran recursive subroutine sla_tgstein_recursive (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)
Recursive Blocking Algorithm for the generalized Stein equation.

- ```fortran
subroutine sla_ggstein_refine (trans, guess, m, a, lda, b, ldb, x, ldx,
    y, ldy, as, ldas, bs, ldbs, q, ldq, z, ldz, maxit, tau, convlog,
    work, ldwork, info)

Iterative Refinement for the Generalized Lyapunov Equations.


πŸ’– Detailed Description πŸ’–

Single precision solvers for generalized Lyapunov and Stein equations with triangular coefficient matrices.


πŸ¦‹ Function Documentation πŸ¦‹

✨ subroutine sla_ggstein_refine ✨

subroutine sla_ggstein_refine (character, dimension(1) trans, character,
    dimension(1) guess, integer m, real, dimension(lda, *) a, integer lda,
    real, dimension(ldb, *) b, integer ldb, real, dimension( ldx, *) x,
    integer ldx, real, dimension(ldy,*) y, integer ldy, real,
    dimension(ldas, *) as, integer ldas, real, dimension(ldbs,*) bs, integer
    ldbs, real, dimension(ldq, *) q, integer ldq, real, dimension(ldz, *) z,
    integer ldz, integer maxit, real tau, real, dimension(*) convlog, real,
    dimension(*) work, integer ldwork, integer info)

Iterative Refinement for the Generalized Lyapunov Equations.

🌟 Purpose 🌟

SLA_GGSTEIN solves a generalized Stein equation of the following forms:

A * X * A^T - B * X * B^T = SCALE * Y                                              (1)

or

A^T * X * A - B^T * X * B =  SCALE * Y                                             (2)

where (A,B) is a M-by-M matrix pencil using iterative refinement. The right hand side Y and the solution X are M-by-M matrices. The matrix pencil (A,B) needs to provide as the original data as well as in generalized Schur decomposition since both are required in the iterative refinement process. πŸ’…

πŸŽ€ Parameters πŸŽ€

  • TRANS β€” TRANS is CHARACTER. Specifies the form of the system of equations with respect to A:
    • == 'N': Equation (1) is solved
    • == 'T': Equation (2) is solved
  • GUESS β€” GUESS is CHARACTER. Specifies whether X contains an initial guess or nor not.
    • = 'I': X contains an initial guess
    • = 'N': No initial guess, X is set to zero at the begin of the iteration.
  • M β€” M is INTEGER. The order of the matrices A and B. M >= 0.
  • A β€” A is REAL array, dimension (LDA,M). The array A contains the original matrix A defining the equation.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,M). The array B contains the original matrix B defining the equation.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is REAL array, dimension (LDX,M). On input, the array X contains the initial guess, if GUESS = 'I'. On output, the array X contains the solution X.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is REAL array, dimension (LDY,M). On input, the array Y contains the right hand side Y. The array stays unchanged during the iteration.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • AS β€” AS is REAL array, dimension (LDAS,M). The array AS contains the generalized Schur decomposition of the A.
  • LDAS β€” LDAS is INTEGER. The leading dimension of the array AS. LDAS >= max(1,M).
  • BS β€” BS is REAL array, dimension (LDBS,M). The array AS contains the generalized Schur decomposition of the B.
  • LDBS β€” LDBS is INTEGER. The leading dimension of the array BS. LDBS >= max(1,M).
  • Q β€” Q is REAL array, dimension (LDQ,M). The array Q contains the left generalized Schur vectors for (A,B) as returned by SGGES.
  • LDQ β€” LDQ is INTEGER. The leading dimension of the array Q. LDQ >= max(1,M).
  • Z β€” Z is REAL array, dimension (LDZ,M). The array Z contains the right generalized Schur vectors for (A,B) as returned by SGGES.
  • LDZ β€” LDZ is INTEGER. The leading dimension of the array Z. LDZ >= max(1,M).
  • MAXIT β€” MAXIT is INTEGER. On input, MAXIT contains the maximum number of iteration that are performed, MAXIT <= 100. On exit, MAXIT contains the number of iteration steps taken by the algorithm.
  • TAU β€” TAU is REAL. On input, TAU contains the additional security factor for the stopping criterion, typical values are 0.1. On exit, TAU contains the last relative residual when the stopping criterion got valid.
  • CONVLOG β€” CONVLOG is REAL array, dimension (MAXIT). The CONVLOG array contains the convergence history of the iterative refinement. CONVLOG(I) contains the maximum relative residual before it is solved for the I-th time.
  • WORK β€” WORK is REAL array, dimension (MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace is returned in LDWORK, if LDWORK == -1 on input. In this case no computations are performed.
  • LDWORK β€” LDWORK is INTEGER. If LDWORK == -1 the subroutine will return the required size of the workspace in LDWORK on exit. No computations are performed and none of the arrays are referenced.
  • INFO β€” INFO is INTEGER.
    • == 0: Success
    • > 0: Iteration failed in step INFO
    • < 0: if INFO = -i, the i-th argument had an illegal value
    • = -50: Some of the internal settings like NB,... are incorrect.

🌈 See also 🌈

  • SLA_TGSTEIN_L3
  • SLA_TGSTEIN_L2
  • SLA_TGSTEIN_L3_2S
  • SLA_TGSTEIN_DAG
  • SLA_TGSTEIN_RECURSIVE

πŸ‘‘ Author πŸ‘‘

Martin Koehler, MPI Magdeburg

πŸ—“οΈ Date πŸ—“οΈ

October 2025

πŸ“ Definition πŸ“

Definition at line 243 of file sla_ggstein_refine.f90.


πŸ¦‹ subroutine sla_tglyap_dag πŸ¦‹

subroutine sla_tglyap_dag (character, dimension(1) trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldb,*) b, integer ldb,
    real, dimension(ldx, *) x, integer ldx, real scale, real, dimension(*)
    work, integer info)

Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation with DAG scheduling.

🌟 Purpose 🌟

SLA_TGLYAP_DAG solves a generalized Lyapunov equation of the following forms:

A * X * B^T + A * X * B^T = SCALE * Y                                              (2)

or

A^T * X * B + A^T * X * B =  SCALE * Y                                             (1)

where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. πŸ’…

⚠️ Attention ⚠️

The algorithm is implemented using BLAS level 3 operations and DAG.

πŸŽ€ Parameters πŸŽ€

  • TRANS β€” TRANS is CHARACTER. Specifies the form of the system of equations with respect to A and B:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. The order of the matrices A and B. M >= 0.
  • A β€” A is REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B
  • B β€” REAL array, dimension (LDB,M). Bestie, B has to be upper triangular. That's the vibe, that's the rule. πŸ¦‹
  • LDB β€” INTEGER, the leading dimension of the array B. Constraint check: LDB >= max(1,M). No notes. πŸ’…
  • X β€” REAL array, dimension (LDX,N). On input, X is holding the right hand side Y like it's carrying your iced coffee β˜•. On output, X has the solution of Equation (1) or (2), whichever one you picked with TRANSA, TRANSB, and SGN. Both the right hand side Y and the solution X are M-by-N matrices. M-by-N. Say it with me. πŸŽ€
  • LDX β€” INTEGER, leading dimension of the array X. Constraint: LDX >= max(1,M). Iconic behavior, no drama. ✨
  • SCALE β€” REAL. This is the scaling factor whose whole job is to stop the result from overflowing πŸ”₯. If INFO == 0 then SCALE is 1.0. Otherwise, if one of the inner systems couldn't be solved correctly, then 0 < SCALE <= 1 holds true. Respect the bounds, she's doing her best.
  • WORK β€” REAL array, dimension LWORK. It's the workspace for the algorithm, and ngl you have to query it before you run the computation β€” don't just send it. You do the query by calling the subroutine with INFO == -1 on input, and then the required workspace comes back to you in INFO. It's giving "ask before you assume." πŸ™ˆ
  • INFO β€” INTEGER. Okay so this one has layers, keep up:
    • On input:
      • == -1 β€” Perform a workspace query
      • <> -1 β€” normal operation
    • On exit, workspace query:
      • < 0 β€” 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

Definition at line 154 of file sla_tglyap_dag.f90.


πŸ‘‘ sla_tglyap_l2

Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation.

subroutine sla_tglyap_l2 (character, dimension(1) trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
    ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
    dimension(*) work, integer info)

🎯 Purpose

!>
!> SLA_TGLYAP_L2 solves a generalized Lyapunov  equation of the following forms
!>
!>    A * X * B^T + B * X * A^T = SCALE * Y                                              (1)
!>
!> or
!>
!>    A^T * X * B + B^T * X * A =  SCALE * Y                                             (2)
!>
!> where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular,
!> and X and Y are symmetric  M-by-M matrices.
!> Typically the matrix pencil (A,B) is created by SGGES from LAPACK.
!>

πŸ‘€ Attention

The algorithm is implemented using BLAS level 2 operations. That's it, that's the note. πŸ’–

🧩 Parameters

  • TRANS β€” CHARACTER. Specifies the form of the system of equations with respect to A and B:
    • == 'N' β€” Equation (1) is solved.
    • == 'T' β€” Equation (2) is solved.
  • M β€” INTEGER. The order of the matrices A and B. M >= 0. 🌸
  • A β€” REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular. Yes, quasi, that hyphen is load-bearing. 🫢
  • LDA β€” INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” REAL array, dimension (LDB,M). The matrix B must be upper triangular. Periodt. πŸ’…
  • LDB β€” INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • 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 TRANS. Right hand side Y and the solution X are M-by-N matrices. πŸ¦‹
  • LDX β€” INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” REAL. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. ✨
  • WORK β€” REAL array, dimension LWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO. (Yes bestie, you literally must ask first. πŸ”₯)
  • INFO β€” INTEGER.
    • On input:
      • == -1 β€” Perform a workspace query
      • <> -1 β€” normal operation
    • On exit, workspace query:
      • < 0 β€” if INFO = -i, the i-th argument had an illegal value
      • >= 0 β€” The value of INFO is the required number of elements in the workspace.
    • On exit, normal operation:
      • == 0 β€” successful exit πŸŽ‰
      • < 0 β€” if INFO = -i, the i-th argument had an illegal value
      • > 0 β€” The equation is not solved correctly. One of the arising inner system got singular. πŸ’€

✍️ Author

Martin Koehler, MPI Magdeburg

πŸ“… Date

October 2025

πŸ“ Definition

Definition at line 155 of file sla_tglyap_l2.f90.


🌈 sla_tglyap_l2_unopt

Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation (Unoptimized)

subroutine sla_tglyap_l2_unopt (character, dimension(1) trans, integer m,
    real, dimension(lda, *) a, integer lda, real, dimension(ldb, *) b,
    integer ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
    dimension(*) work, integer info)

🎯 Purpose

!>
!> SLA_TGLYAP_L2 solves a generalized Lyapunov  equation of the following forms
!>
!>    A * X * B^T + B * X * A^T = SCALE * Y                                              (1)
!>
!> or
!>
!>    A^T * X * B + B^T * X * A =  SCALE * Y                                             (2)
!>
!> where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular,
!> and X and Y are symmetric  M-by-M matrices.
!> Typically the matrix pencil (A,B) is created by SGGES from LAPACK.
!>

πŸ‘€ Attention

The algorithm is implemented using BLAS level 2 operations but works with inefficient SSYR2 calls in the case TRANS="T". Yeah, she's the unoptimized one, she said what she said. 😭

🧩 Parameters

  • TRANS β€” CHARACTER. Specifies the form of the system of equations with respect to A and B:
    • == 'N' β€” Equation (1) is solved.
    • == 'T' β€” Equation (2) is solved.
  • M β€” INTEGER. The order of the matrices A and B. M >= 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,M). The matrix B must be upper triangular. πŸ’…
  • LDB β€” INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • 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 TRANS. Right hand side Y and the solution X are M-by-N matrices. πŸ¦‹
  • LDX β€” INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” REAL. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. ✨
  • WORK β€” REAL array, dimension LWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO. 🫢
  • INFO β€” INTEGER.
    • On input:
      • == -1 β€” Perform a workspace query
      • <> -1 β€” normal operation
    • On exit, workspace query:
      • < 0 β€” if INFO = -i, the i-th argument had an illegal value
      • >= 0 β€” The value of INFO is the required number of elements in the workspace.
    • On exit, normal operation:
      • == 0 β€” successful exit πŸŽ‰
      • < 0 β€” if INFO = -i, the i-th argument had an illegal value
      • > 0 β€” The equation is not solved correctly. One of the arising inner system got singular. πŸ’€

✍️ Author

Martin Koehler, MPI Magdeburg

πŸ“… Date

October 2025

πŸ“ Definition

Definition at line 156 of file sla_tglyap_l2_unopt.f90.


πŸ”₯ sla_tglyap_l3

Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.

subroutine sla_tglyap_l3 (character, dimension(1) trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
    ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
    dimension(*) work, integer info)

🎯 Purpose

Okay so real talk, here's the whole situation this routine is solving, bestie πŸŽ€

A * X * B^T + B * X * A^T = SCALE * Y                                              (1)

or

A^T * X * B + B^T * X * A =  SCALE * Y                                             (2)

where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular matrix, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. iykyk πŸ’…


Attention 🫢

The algorithm is implemented using BLAS level 3 operations. no cap, it's fast.

Parameters ✨

  • TRANS β€” TRANS is CHARACTER. It says which form of the system of equations we're doing, with respect to A and B:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. The order of the matrices A and B. M >= 0. (yes bestie, it can be zero, and that's valid 🌸)
  • A β€” A is REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular. That's the vibe it needs to serve, okay?
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,M). The matrix B must be upper triangular.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is REAL. It's a scaling factor to prevent the overflow in the result 🫣. If INFO == 0 then SCALE is 1.0; otherwise, if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is REAL array, dimension LWORK. Workspace for the algorithm. And listen: the workspace needs to be queried before running the computation. You do the query by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO. not me forgetting to query the workspace… couldn't be me πŸ™ˆ
  • INFO β€” INFO is INTEGER. Here's the whole saga:
    • 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 154 of file sla_tglyap_l3.f90.


πŸ’– subroutine sla_tglyap_l3_2s πŸ’–

subroutine sla_tglyap_l3_2s (character, dimension(1) trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
    ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
    dimension(*) work, integer info)

Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation two stage. it's giving ✨organized chaos✨

Purpose πŸ¦‹

SLA_TGLYAP_L3_2S solves a generalized Lyapunov  equation of the following forms

   A * X * B^T + B * X * A^T = SCALE * Y                                              (1)

or

   A^T * X * B + B^T * X * A =  SCALE * Y                                             (2)

where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular,
and X and Y are symmetric  M-by-M matrices.
Typically the matrix pencil (A,B) is created by SGGES from LAPACK.

Attention 🫢

The algorithm is implemented using BLAS level 3 operations with two stage blocking (DAG inner solves). obsessed, honestly πŸ”₯

Parameters ✨

  • TRANS β€” TRANS is CHARACTER. It specifies the form of the system of equations with respect to A and B:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. The order of the matrices A and B. M >= 0.
  • A β€” A is REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,M). The matrix B must be upper triangular.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is REAL. A scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0; otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is REAL array, dimension LWORK. Workspace for the algorithm. The workspace needs to be queried before running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO. 🫢
  • INFO β€” INFO is INTEGER. The lore:
    • 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 153 of file sla_tglyap_l3_2stage.f90.


🌈 recursive subroutine sla_tglyap_recursive 🌈

recursive subroutine sla_tglyap_recursive (character, dimension(1) trans,
    integer m, real, dimension(lda, *) a, integer lda, real,
    dimension(ldb,*) b, integer ldb, real, dimension(ldx, *) x, integer ldx,
    real scale, real, dimension(*) work, integer info)

Recursive Blocking Algorithm for the generalized Lyapunov equation. she recurses, she blocks, she slays πŸ’…

Purpose πŸ¦‹

SLA_TGLYAP_RECURSIVE solves a generalized Lyapunov  equation of the following forms

   A * X * B^T + B * X * A^T = SCALE * Y                                              (1)

or

   A^T * X * B + B^T * X * A =  SCALE * Y                                             (2)

where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular,
and X and Y are symmetric  M-by-M matrices.
Typically the matrix pencil (A,B) is created by SGGES from LAPACK.

Attention 🫢

The algorithm is implemented using recursive blocking. it's giving main character energy ✨

Parameters ✨

  • TRANS β€” TRANS is CHARACTER(1). It specifies the form of the system of equations with respect to A and B:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. The order of the matrices A and B. M >= 0.
  • A β€” A is REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,M). The matrix B must be upper triangular.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is REAL. A scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0; otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is REAL array, dimension M*M. Workspace for the algorithm. πŸŽ€
  • INFO β€” INFO is INTEGER.
    • == 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 140 of file sla_tglyap_recursive.f90.

πŸ¦‹ subroutine sla_tgstein_dag

subroutine sla_tgstein_dag (character, dimension(1) trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldb,*) b, integer ldb,
    real, dimension(ldx, *) x, integer ldx, real scale, real, dimension(*)
    work, integer info)

Level-3 Bartels-Stewart Algorithm for the generalized Stein equation, but make it scheduled β€” with DAG energy. ✨

πŸŽ€ Purpose

okay bestie, SLA_TGSTEIN_DAG solves a generalized Lyapunov equation of one of these two forms:

A * X * A^T - B * X * B^T = SCALE * Y                                              (1)

or

A^T * X * A - B^T * X * B =  SCALE * Y                                             (2)

where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular matrix, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. iykyk πŸ’…

πŸ’€ Attention

The algorithm is implemented using BLAS level 3 operations and DAG . no cap.

🌸 Parameters

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A, B, and C:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. The order of the matrices A and C. M >= 0. 🫢
  • A β€” A is REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,M). The matrix B must be upper triangular.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is REAL. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. protect the vibes from overflow fr.
  • WORK β€” WORK is REAL array, dimension LWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO. ✨
  • INFO β€” INFO is INTEGER.
    • On input:
      • == -1 : Perform a workspace query
      • <> -1: normal operation
    • On exit, workspace query:
      • < 0 : if INFO = -i, the i-th argument had an illegal value
      • >= 0: The value of INFO is the required number of elements in the workspace.
    • On exit, normal operation:
      • == 0: successful exit
      • < 0: if INFO = -i, the i-th argument had an illegal value
      • > 0: The equation is not solved correctly. One of the arising inner system got singular. 😭
  • Author β€” Martin Koehler, MPI Magdeburg
  • Date β€” October 2025
  • Definition at line 152 of file sla_tgstein_dag.f90.

🌈 subroutine sla_tgstein_l2

subroutine sla_tgstein_l2 (character, dimension(1) trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
    ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
    dimension(*) work, integer info)

Level-2 Bartels-Stewart Algorithm for the generalized Stein equation. the l2 era, iconic. πŸ‘‘

πŸŽ€ Purpose

okay so SLA_TGSTEIN_L2 solves a generalized Lyapunov equation of one of these two forms:

A * X * A^T - B * X * B^T = SCALE * Y                                              (1)

or

A^T * X * A - B^T * X * B =  SCALE * Y                                             (2)

where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular matrix, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. πŸ¦‹

πŸ’€ Attention

The algorithm is implemented using BLAS level 2 operations. periodt.

🌸 Parameters

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A, B, and C:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. The order of the matrices A and C. M >= 0. πŸ’–
  • A β€” A is REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,M). The matrix B must be upper triangular.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is REAL. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. overflow really said not today πŸ’….
  • WORK β€” WORK is REAL array, dimension LWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO. ⭐
  • INFO β€” INFO is INTEGER.
    • On input:
      • == -1 : Perform a workspace query
      • <> -1: normal operation
    • On exit, workspace query:
      • < 0 : if INFO = -i, the i-th argument had an illegal value
      • >= 0: The value of INFO is the required number of elements in the workspace.
    • On exit, normal operation:
      • == 0: successful exit
      • < 0: if INFO = -i, the i-th argument had an illegal value
      • > 0: The equation is not solved correctly. One of the arising inner system got singular. πŸ™ˆ
  • Author β€” Martin Koehler, MPI Magdeburg
  • Date β€” October 2025
  • Definition at line 154 of file sla_tgstein_l2.f90.

⭐ subroutine sla_tgstein_l3

subroutine sla_tgstein_l3 (character, dimension(1) trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
    ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
    dimension(*) work, integer info)

Level-3 Bartels-Stewart Algorithm for the generalized Stein equation. l3 said main character energy only. 🌟

πŸŽ€ Purpose

bestie, SLA_TGSTEIN_L3 solves a generalized Lyapunov equation of one of these two forms:

A * X * A^T - B * X * B^T = SCALE * Y                                              (1)

or

A^T * X * A - B^T * X * B =  SCALE * Y                                             (2)

where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular matrix, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. 🧚

πŸ’€ Attention

The algorithm is implemented using BLAS level 3 operations. no DAG, just pure level-3 slay.

🌸 Parameters

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A, B, and C:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. The order of the matrices A and C. M >= 0. πŸ“
  • A β€” A is REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,M). The matrix B must be upper triangular.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is REAL. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. the overflow shield fr fr.
  • WORK
  • WORK β€” REAL array, dimension LWORK. It's the ✨workspace✨ bestie. And no cap: you gotta query it before you run the computation. How? Call the subroutine with INFO == -1 on input, and the required workspace comes back to you in INFO. It's giving "ask first, then do the math" πŸ’…
  • INFO β€” INTEGER. She's the receipts-holder, so listen up πŸ‘‘

On input:

  • == -1 : perform a workspace query πŸ”
  • <> -1 : normal operation, business as usual πŸ’–

On exit, workspace query:

  • < 0 : 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. That's your number bestie, go get it πŸŽ€

On exit, normal operation:

  • == 0 : successful exit, slay πŸŽ‰
  • < 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 πŸ’€ (not the cute kind of singular, the sad kind)

Author: Martin Koehler, MPI Magdeburg 🌸

Date: October 2025 πŸ¦‹

Definition at line 153 of file sla_tgstein_l3.f90.


πŸ‘‘ sla_tgstein_l3_2s β€” the two-stage level-3 icon

subroutine sla_tgstein_l3_2s (character, dimension(1) trans, integer m,
    real, dimension(lda, *) a, integer lda, real, dimension(ldb, *) b,
    integer ldb, real, dimension(ldx, *) x, integer ldx, real scale, real,
    dimension(*) work, integer info)

Level-3 Bartels-Stewart Algorithm for the generalized Stein equation (Two Stage) ✨

Purpose:

okay so, SLA_TGSTEIN_L3_2S solves a generalized Lyapunov equation of the following forms:

A * X * A^T - B * X * B^T = SCALE * Y                                              (1)

or

A^T * X * A - B^T * X * B =  SCALE * Y                                             (2)

where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. iykyk πŸ’œ

Attention:

The algorithm is implemented using BLAS level 3 operations with two level blocking. Highkey fancy, lowkey fast πŸ”₯

Parameters:

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A, B, and C:
    • == 'N' : Equation (1) is solved 🌈
    • == 'T' : Equation (2) is solved 🌈
  • M β€” M is INTEGER. The order of the matrices A and C. M >= 0. ✨
  • A β€” A is REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular. She has structure, respect it πŸ’…
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). πŸ“
  • B β€” B is REAL array, dimension (LDB,M). The matrix B must be upper triangular. πŸŽ€
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M). πŸ“
  • X β€” X is 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. She literally transforms in front of you, main character energy πŸ¦‹
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M). πŸ“
  • SCALE β€” SCALE is REAL. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. She's the seatbelt 🫢
  • WORK β€” WORK is REAL array, dimension LWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO. (yes, "to queried" β€” we said what we said, bestie 😭)
  • INFO β€” INFO is INTEGER.

On input:

  • == -1 : perform a workspace query πŸ”
  • <> -1 : normal operation πŸ’–

On exit, workspace query:

  • < 0 : if INFO = -i, the i-th argument had an illegal value 😭
  • >= 0 : the value of INFO is the required number of elements in the workspace πŸŽ€

On exit, normal operation:

  • == 0 : successful exit πŸŽ‰
  • < 0 : if INFO = -i, the i-th argument had an illegal value πŸ™ˆ
  • > 0 : the equation is not solved correctly. One of the arising inner system got singular πŸ’€

Author: Martin Koehler, MPI Magdeburg 🌸

Date: October 2025 πŸ¦‹

Definition at line 153 of file sla_tgstein_l3_2stage.f90.


🧚 sla_tgstein_recursive β€” recursion, but make it fashion

recursive subroutine sla_tgstein_recursive (character, dimension(1) trans,
    integer m, real, dimension(lda, *) a, integer lda, real, dimension(ldb,
    *) b, integer ldb, real, dimension(ldx, *) x, integer ldx, real scale,
    real, dimension(*) work, integer info)

Recursive Blocking Algorithm for the generalized Stein equation. ✨

Purpose:

SLA_TGSTEIN_RECURSIVE solves a generalized Lyapunov equation of the following forms:

A * X * A^T - B * X * B^T = SCALE * Y                                              (1)

or

A^T * X * A - B^T * X * B =  SCALE * Y                                             (2)

where A is a M-by-M quasi upper triangular matrix, B is a M-by-M upper triangular, and X and Y are symmetric M-by-M matrices. Typically the matrix pencil (A,B) is created by SGGES from LAPACK. Same equation, different blocking strategy, we contain multitudes πŸ’œ

Attention:

The algorithm is implemented using recursive blocking. It's giving "she calls herself" πŸ”

Parameters:

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A, B, and C:
    • == 'N' : Equation (1) is solved 🌈
    • == 'T' : Equation (2) is solved 🌈
  • M β€” M is INTEGER. The order of the matrices A and C. M >= 0. ✨
  • A β€” A is REAL array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular. πŸ’…
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). πŸ“
  • B β€” B is REAL array, dimension (LDB,M). The matrix B must be upper triangular. πŸŽ€
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M). πŸ“
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M). πŸ“
  • SCALE β€” SCALE is REAL. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. 🫢
  • WORK β€” WORK is REAL array, dimension M*M. Workspace for the algorithm. And heads up bestie: this one is just M*M, no fancy INFO == -1 query ritual here πŸ’–
  • INFO β€” INFO is INTEGER.
    • == 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 140 of file sla_tgstein_recursive.f90.


πŸ’– Author

Generated automatically by Doxygen for MEPACK from the source code. Not me writing this by hand at 2am, the robots did it πŸ€–βœ¨

and that's a wrap on sgltglyap(3), bestie!! MEPACK Version 1.1.2, dated Thu Oct 9 2025 00:00:00 β€” she's stamped, dated, and absolutely iconic. go solve some Stein equations, you've got this πŸ’…πŸŒˆπŸ‘‘
πŸ“¦ where this page comes from