sgltrlyap(3)

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

πŸ’– sgltrlyap(3) β€” MEPACK πŸ’–

okay bestie, buckle up, we're in the sgltrlyap(3) section of the MEPACK manual and it's a whole journey. ✨


🌸 NAME 🌸

sgltrlyap β€” Single Precision routines.

  • Single precision routines for standard Lyapunov and Stein equations with triangular coefficient matrices.

πŸŽ€ SYNOPSIS πŸŽ€

✨ Functions ✨

  • subroutine sla_trlyap_dag (trans, m, a, lda, x, ldx, scale, work, info) β€” DAG Scheduled Bartels-Stewart Algorithm for the standard Lyapunov Equation.
  • subroutine sla_trstein_dag (trans, m, a, lda, x, ldx, scale, work, info) β€” Level-3 Bartels-Stewart Algorithm for the Stein equation.
  • subroutine sla_trlyap_kernel_44n (m, a, lda, x, ldx, scale, info) β€” Solver for a 4x4 standard Lyapunov equation (TRANS = N)
  • subroutine sla_trlyap_kernel_44t (m, a, lda, x, ldx, scale, info) β€” Solver for a 4x4 standard Lyapunov equation (TRANS = T)
  • subroutine sla_trlyap_l2 (transa, m, a, lda, x, ldx, scale, work, info) β€” Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation.
  • subroutine sla_trlyap_l2_opt (transa, m, a, lda, x, ldx, scale, work, info) β€” Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation (Optimized)
  • subroutine sla_trstein_l2 (trans, m, a, lda, x, ldx, scale, work, info) β€” Level-2 Bartels-Stewart Algorithm for the Stein equation.
  • subroutine sla_trlyap_l3 (trans, m, a, lda, x, ldx, scale, work, info) β€” Level-3 Bartels-Stewart Algorithm for the standard Lyapunov Equation.
  • subroutine sla_trlyap_l3_2s (trans, m, a, lda, x, ldx, scale, work, info) β€” Level-3 Bartels-Stewart Algorithm for the standard Lyapunov Equation with 2 stage blocking.
  • subroutine sla_trstein_l3 (trans, m, a, lda, x, ldx, scale, work, info) β€” Level-3 Bartels-Stewart Algorithm for the Stein equation.
  • subroutine sla_trstein_l3_2s (trans, m, a, lda, x, ldx, scale, work, info) β€” Level-3 Bartels-Stewart Algorithm for the Stein equation with 2 stage blocking.
  • recursive subroutine sla_trlyap_recursive (trans, m, a, lda, x, ldx, scale, work, info) β€” Level-3 Recursive Blocked Algorithm for the standard Lyapunov Equation.
  • recursive subroutine sla_trstein_recursive (trans, m, a, lda, x, ldx, scale, work, info) β€” Recursive Blocked Algorithm for the Stein equation.

πŸ¦‹ Detailed Description πŸ¦‹

Single precision routines for standard Lyapunov and Stein equations with triangular coefficient matrices. that's the whole vibe. πŸ’…


πŸ‘‘ Function Documentation πŸ‘‘

🌈 subroutine sla_trlyap_dag

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

DAG Scheduled Bartels-Stewart Algorithm for the standard Lyapunov Equation.

✨ Purpose ✨

!> SLA_TRLYAP_DAG solves a Lyapunov equation of the following forms
!>
!>    A  * X  +  X * A**T = SCALE * Y                              (1)
!>
!> or
!>
!>    A ** T * X  +  X * A = SCALE * Y                              (2)
!>
!> where A is a M-by-M quasi upper triangular matrix.
!> The right hand side Y and the solution X are M-by-N matrices.  Typically the matrix A
!> is generated by SGEES from LAPACK.
!>

πŸŽ€ Remarks πŸŽ€

The algorithm is implemented using DAG Scheduling. that's the whole thing, she's scheduled. πŸ—“οΈ

πŸ’œ Parameters πŸ’œ

  • TRANS
!>          TRANS is CHARACTER(1)
!>          Specifies the form of the system of equations with respect to A:
!>          == 'N':  op1(A) = A
!>          == 'T':  op1(A) = A**T
!>
  • 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).
!>
  • 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)
!>          Right hand side Y and the solution X are symmetric M-by-M matrices.
!>
  • LDX
!>          LDX is INTEGER
!>          The leading dimension of the array X.  LDB >= max(1,M).
!>

(yes bestie, it literally says LDB in there β€” we do not question the ancestors, we just report the lore. πŸ™ˆ)

  • 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 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 137 of file sla_trlyap_dag.f90.


🌈 subroutine sla_trlyap_kernel_44n

subroutine sla_trlyap_kernel_44n (integer m, real, dimension(lda, *) a,
    integer lda, real, dimension(ldx, *) x, integer ldx, real scale, integer
    info)

Solver for a 4x4 standard Lyapunov equation (TRANS = N)

✨ Purpose ✨

!>
!> SLA_TRLYAP_KERNEL_44N solves a Lyapunov  equation of the following form
!>
!>    A * X  + X * A**T = SCALE * Y                              (1)
!>
!> where A is a M-by-M quasi upper triangular matrix.
!> The right hand side Y and the solution X M-by-M matrices.
!> Typically the matrix  A is created by SGEES from LAPACK.
!> The algorithm is implemented without 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.
!>
!>
🚨 heads up bestie: no input checking, no BLAS level 2, M and N capped at 4. she is tiny and she is fast and she trusts you completely. do not betray her. 😭

πŸ’œ Parameters πŸ’œ

  • M
!>          M is INTEGER
!>          The order of the matrices A and C.  4 >= 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).
!>
  • 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.  LDB >= 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 < SCAL <= 1 holds true.
!>

(SCAL here, LDB above β€” the manpage is serving typo realness and we are keeping every single character, periodt. πŸ’…)

  • INFO
!>          INFO is INTEGER
!>          On output:
!>          == 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 109 of file sla_trlyap_kernel_44_n.f90.


🌈 subroutine sla_trlyap_kernel_44t

subroutine sla_trlyap_kernel_44t (integer m, real, dimension(lda, *) a,
    integer lda, real, dimension(ldx, *) x, integer ldx, real scale, integer
    info)

Solver for a 4x4 standard Lyapunov equation (TRANS = T)

✨ Purpose ✨

!>
!> SLA_TRLYAP_KERNEL_44T solves a Lyapunov  equation of the following form
!>
!>    A **T * X  + X * A = SCALE * Y                              (1)
!>
!> where A is a M-by-M quasi upper triangular matrix.
!> The right hand side Y and the solution X M-by-M matrices.
!> Typically the matrix  A is created by SGEES from LAPACK.
!> The algorithm is implemented without 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 energy as her sibling: no input checking, no BLAS level 2, order capped at 4. iconic, unhinged, correct. πŸ”₯

πŸ’œ Parameters πŸ’œ

  • M
!>          M is INTEGER
!>          The order of the matrices A and C.  4 >= 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).
!>
  • 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.  LDB >= 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 < SCAL <= 1 holds true.
!>
  • INFO
!>          INFO is INTEGER
!>          On output:
!>          == 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


okay that's it for part 1 bestie, there's more coming and we are NOT done yet πŸ’–

Date: October 2025

Definition at line 109 of file sla_trlyap_kernel_44_t.f90.


🌸 sla_trlyap_l2 🌸

Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation.

okay bestie, this one is lowkey the whole moment πŸ’…

subroutine sla_trlyap_l2 (character, dimension(1) transa, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldx, *) x, integer
    ldx, real scale, real, dimension(*) work, integer info)

✨ Purpose

!> !> SLA_TRLYAP_L2 solves a Lyapunov equation of the following forms !> !> A * X + X * A**T = SCALE * Y (1) !> !> or !> !> A **T * X - X * A = SCALE * Y (2) !> !> where A is a M-by-M quasi upper triangular matrix. !> The right hand side Y and the solution X are M-by-N matrices. Typically the matrix A !> is generated by SGEES from LAPACK. !>

fr fr, that's equations (1) and (2), no cap 🫢

🌈 Remarks

The algorithm is implemented using BLAS level 2 operations.

The transposed case (2) is optimized w.r.t. to the usage of the SSYR2 operation. ✨

πŸ’œ Parameters

TRANSA

!> TRANSA is CHARACTER(1) !> Specifies the form of the system of equations with respect to A: !> == 'N': op1(A) = A !> == 'T': op1(A) = A**T !>

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). !>

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) !> Right hand side Y and the solution X are symmetric M-by-M matrices. !>

LDX

!> LDX is INTEGER !> The leading dimension of the array X. LDB >= max(1,M). !>

not me noticing the original says LDB here and not LDX 😭 keep it exactly as it is, bestie, that's a faithful copy 🫢

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 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

Definition at line 138 of file sla_trlyap_l2.f90.


πŸ’… sla_trlyap_l2_opt πŸ’…

Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation (Optimized).

bestie this is the same vibe but ✨optimized✨ β€” the icon behavior fr fr

subroutine sla_trlyap_l2_opt (character, dimension(1) transa, integer m,
    real, dimension(lda, *) a, integer lda, real, dimension(ldx, *) x,
    integer ldx, real scale, real, dimension(*) work, integer info)

✨ Purpose

!> !> SLA_TRLYAP_L2 solves a Lyapunov equation of the following forms !> !> A * X + X * A**T = SCALE * Y (1) !> !> or !> !> A **T * X - X * A = SCALE * Y (2) !> !> where A is a M-by-M quasi upper triangular matrix. !> The right hand side Y and the solution X are M-by-N matrices. Typically the matrix A !> is generated by SGEES from LAPACK. !>

yes it still says SLA_TRLYAP_L2 in the Purpose, not _opt β€” that's literally what the original says, we do not edit, we only serve πŸ’…

🌈 Remarks

The algorithm is implemented using BLAS level 2 operations.

The transposed case (2) is optimized w.r.t. to the usage of the SSYR2 operation. ✨

πŸ’œ Parameters

TRANSA

!> TRANSA is CHARACTER(1) !> Specifies the form of the system of equations with respect to A: !> == 'N': op1(A) = A !> == 'T': op1(A) = A**T !>

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). !>

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) !> Right hand side Y and the solution X are symmetric M-by-M matrices. !>

LDX

!> LDX is INTEGER !> The leading dimension of the array X. LDB >= max(1,M). !>

again with the LDB 😭 iconic of the original, don't touch it 🫢

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 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

Definition at line 138 of file sla_trlyap_l2_opt.f90.


πŸ”₯ sla_trlyap_l3 πŸ”₯

Level-3 Bartels-Stewart Algorithm for the standard Lyapunov Equation.

okay now we're in our level 3 era, main character energy fr fr πŸ’…

subroutine sla_trlyap_l3 (character, dimension(1) trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldx, *) x, integer
    ldx, real scale, real, dimension(*) work, integer info)
heads up bestie: this one's argument is called trans, not transa β€” yes really, that's the original, we keep it πŸ’–

✨ Purpose

!> SLA_TRLYAP_L3 solves a Lyapunov equation of the following forms !> !> A * X + X * A**T = SCALE * Y (1) !> !> or !> !> A ** T * X + X * A = SCALE * Y (2) !> !> where A is a M-by-M quasi upper triangular matrix. !> The right hand side Y and the solution X are M-by-N matrices. Typically the matrix A !> is generated by SGEES from LAPACK. !>

and yes, equation (2) here is a plus and the A ** T has a space in it β€” that's literally the source text, no edits, periodt 🫢

🌈 Remarks

The algorithm is implemented using BLAS level 3 operations. πŸ”₯

πŸ’œ Parameters

TRANS

!> TRANS is CHARACTER !> Specifies the form of the system of equations with respect to A: !> == 'N': op1(A) = A !> == 'T': op1(A) = A**T !>

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). !>

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) !> Right hand side Y and the solution X are symmetric M-by-M matrices. !>

LDX

!> LDX is INTEGER !> The leading dimension of the array X. LDB >= max(1,M). !>

third time's the charm, still LDB in the source, still keeping it πŸ’€

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 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

Definition at line 137 of file sla_trlyap_l3.f90.

sla_trlyap_l3_2s β€” Level-3 Bartels-Stewart Algorithm for the standard Lyapunov Equation with 2 stage blocking πŸ’…

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

Purpose: okay bestie, this one solves a Lyapunov equation, and it comes in two flavors:

!> SLA_TRLYAP_L3_2S solves a Lyapunov equation of the following forms
!>
!>    A  * X  +  X * A**T = SCALE * Y                              (1)
!>
!> or
!>
!>    A ** T * X  +  X * A = SCALE * Y                              (2)
!>
!> where A is a M-by-M quasi upper triangular matrix.
!> The right hand side Y and the solution X are M-by-N matrices.  Typically the matrix A
!> is generated by SGEES from LAPACK.
!>

Remarks β€” The algorithm is implemented using BLAS level 3 operations and DAG schedule block solves.

Parameters let's go parameter by parameter, no skipping πŸ’–

  • TRANS β€” TRANS is CHARACTER. It says how the system treats A: == 'N': op1(A) = A; == 'T': op1(A) = A**T.
  • 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).
  • 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). Right hand side Y and the solution X are symmetric M-by-M matrices.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDB >= max(1,M). (yes, it says LDB, that's what the original says, don't @ me)
  • 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 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 137 of file sla_trlyap_l3_2stage.f90.


sla_trlyap_recursive β€” Level-3 Recursive Blocked Algorithm for the standard Lyapunov Equation.

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

Purpose: same equation energy, different blocking strategy

!> SLA_TRLYAP_RECURSIVE solves a Lyapunov equation of the following forms
!>
!>    A  * X  +  X * A**T = SCALE * Y                              (1)
!>
!> or
!>
!>    A ** T * X  +  X * A = SCALE * Y                              (2)
!>
!> where A is a M-by-M quasi upper triangular matrix.
!> The right hand side Y and the solution X are M-by-N matrices.  Typically the matrix A
!> is generated by SGEES from LAPACK.
!>

Remarks β€” The algorithm is implemented using BLAS level 3 operations and recursive blocking.

Parameters

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A: == 'N': op1(A) = A; == 'T': op1(A) = A**T.
  • 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).
  • 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). Right hand side Y and the solution X are symmetric M-by-M matrices.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDB >= max(1,M). (again with LDB, iconic typo)
  • 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 1. 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 125 of file sla_trlyap_recursive.f90.


sla_trstein_dag β€” Level-3 Bartels-Stewart Algorithm for the Stein equation.

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

Purpose: Stein equation time, DAG scheduling edition

!>
!> SLA_TRSTEIN_DAG solves a Stein equation of the following forms
!>
!>    A * X * A^T - X  = SCALE * Y                                              (2)
!>
!> or
!>
!>    A^T * X * A - X  =  SCALE * Y                                             (1)
!>
!> where A is a M-by-M quasi upper triangular matrix.
!> and X and Y are symmetric  M-by-M matrices.
!> Typically the matrix A is created by SGEES from LAPACK.
!>

Attention β€” The algorithm is implemented using BLAS level 3 operations.

Remarks β€” The algorithm is implemented using DAG Scheduling

Parameters

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A 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).
  • 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 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 142 of file sla_trstein_dag.f90.


sla_trstein_l2 β€” Level-2 Bartels-Stewart Algorithm for the Stein equation.

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

Purpose:

okay so SLA_TRSTEIN_L2 is out here solving a generalized Lyapunov equation πŸ’… and honestly there are exactly two forms it can take, bestie:

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

or

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

where A is a M-by-M quasi upper triangular matrix, and X and Y are symmetric M-by-M matrices. and like, typically the matrix A is created by SGEES from LAPACK, iykyk πŸ¦‹

🚨 Attention

The algorithm is implemented using BLAS level 2 operations.

πŸ“‹ Parameters

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A 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).
  • 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 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 143 of file sla_trstein_l2.f90.


πŸ¦‹ subroutine sla_trstein_l3

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

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

🎯 Purpose

ok so SLA_TRSTEIN_L3 solves a standard Stein equation, and there are two flavors, bestie:

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

or

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

where A is a M-by-M quasi upper triangular matrix, and X and Y are symmetric M-by-M matrices. and typically the matrix A is created by SGEES from LAPACK πŸ’–

🚨 Attention

The algorithm is implemented using BLAS level 3 operations. (yes, level three, we're eating today πŸ“)

πŸ“‹ Parameters

  • TRANS β€” TRANS is CHARACTER. Specifies the form of the system of equations with respect to A 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).
  • 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 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 141 of file sla_trstein_l3.f90.


🌈 subroutine sla_trstein_l3_2s

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

Level-3 Bartels-Stewart Algorithm for the Stein equation with 2 stage blocking. πŸ‘‘

🎯 Purpose

SLA_TRSTEIN_L3_2S solves a generalized Lyapunov equation, two forms again, but heads up: the equation numbers are swapped compared to her sister routines πŸ”₯

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

or

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

where A is a M-by-M quasi upper triangular matrix, and X and Y are symmetric M-by-M matrices. and typically the matrix A is created by SGEES from LAPACK 🌸

🚨 Attention

The algorithm is implemented using BLAS level 3 operations and a DAG scheduled inner solver. (not her being extra, we love her for it πŸ’…)

πŸ“‹ Parameters

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A 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).
  • 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 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 141 of file sla_trstein_l3_2stage.f90.


πŸ’œ recursive subroutine sla_trstein_recursive

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

Recursive Blocked Algorithm for the Stein equation. 🧚

🎯 Purpose

bestie, SLA_TRSTEIN_RECURSIVE solves a generalized Lyapunov equation, and it's giving two possible forms. no cap. ✨

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

or

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

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

✨ Attention ✨

The algorithm is implemented using recursive blocking. that's the whole tea, and it's lowkey iconic. πŸ«–βœ¨

πŸ’– Parameters πŸ’–

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A 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).
  • 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*N. 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 129 of file sla_trstein_recursive.f90.

πŸ¦‹ Author πŸ¦‹

Generated automatically by Doxygen for MEPACK from the source code.


and that's the whole vibe, bestie. This page is sgltrlyap(3) from MEPACK version 1.1.2, dated Thu Oct 9 2025 00:00:00. slay. πŸ’…βœ¨

πŸ“¦ where this page comes from