ctrlyap(3)

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

🌸 NAME 🌸

okay bestie, you just opened ctrlyap(3) β€” that's the MEPACK manual, section 3, page ctrlyap, and no it's not a typo, that's really the name. So what is it? It's the C-Interface:

  • C-Interface for standard Lyapunov and Stein equations with triangular coefficient matrices. πŸ’–

✨ SYNOPSIS ✨

πŸŽ€ Functions πŸŽ€

  • void mepack_double_trlyap_dag (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” DAG Scheduled Bartels-Stewart Algorithm for the standard Lyapunov Equation. ✨
  • void mepack_single_trlyap_dag (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” DAG Scheduled Bartels-Stewart Algorithm for the standard Lyapunov Equation. ✨
  • void mepack_double_trstein_dag (const char *TRANSA, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm for the Stein equation with OpenMP 4. πŸ”₯
  • void mepack_single_trstein_dag (const char *TRANSA, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm for the Stein equation with OpenMP 4. πŸ”₯
  • void mepack_double_trlyap_level2 (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation. πŸ’…
  • void mepack_double_trlyap_level2_opt (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation (Optimized for small problems). 🐣
  • void mepack_single_trlyap_level2 (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation. πŸ’…
  • void mepack_single_trlyap_level2_opt (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation (Optimized for small problems). 🐣
  • void mepack_double_trstein_level2 (const char *TRANSA, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Level-2 Bartels-Stewart Algorithm for the Stein equation. πŸ¦‹
  • void mepack_single_trstein_level2 (const char *TRANSA, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Level-2 Bartels-Stewart Algorithm for the Stein equation. πŸ¦‹
  • void mepack_double_trlyap_level3 (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm for the standard Lyapunov Equation. πŸ‘‘
  • void mepack_double_trlyap_level3_2stage (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm with sub-blocking for the standard Lyapunov Equation. πŸ‘‘
  • void mepack_single_trlyap_level3 (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm for the standard Lyapunov Equation. πŸ‘‘
  • void mepack_single_trlyap_level3_2stage (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm with sub-blocking for the standard Lyapunov Equation. πŸ‘‘
  • void mepack_double_trstein_level3 (const char *TRANSA, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm for the Stein equation. πŸ”₯
  • void mepack_double_trstein_level3_2stage (const char *TRANSA, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm with sub-blocking for the Stein equation. πŸ”₯
  • void mepack_single_trstein_level3 (const char *TRANSA, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm for the Stein equation. πŸ”₯
  • void mepack_single_trstein_level3_2stage (const char *TRANSA, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Level-3 Bartels-Stewart Algorithm with sub-blocking for the Stein equation. πŸ”₯
  • void mepack_double_trlyap_recursive (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Level-3 Recursive Blocked Algorithm for the standard Lyapunov Equation. πŸŒ€
  • void mepack_single_trlyap_recursive (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Level-3 Recursive Blocked Algorithm for the standard Lyapunov Equation. πŸŒ€
  • void mepack_double_trstein_recursive (const char *TRANSA, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO) β€” Recursive blocking level-3 Bartels-Stewart Algorithm for the Stein equation. πŸŒ€
  • void mepack_single_trstein_recursive (const char *TRANSA, int M, float *A, int LDA, float *X, int LDX, float *SCALE, float *WORK, int *INFO) β€” Recursive blocking level-3 Bartels-Stewart Algorithm for the Stein equation. πŸŒ€

πŸ¦‹ Detailed Description πŸ¦‹

So here's the whole vibe, bestie: this is the C-Interface for standard Lyapunov and Stein equations with triangular coefficient matrices.

The Fortran routines that solve standard Lyapunov and Stein equations with triangular coefficients are wrapped in C so you have easier access to them. Every single wrapper routine is a direct wrapper to the corresponding Fortran subroutine β€” no sanity checks in the wrappers. Those checks are done by the Fortran routines instead.

⚠️ Big warning moment: since these routines use int values to pass sizes, the work_space query will fail for large scale problems. That's literally why you should use mepack_memory to query the required work_space from C code. That function is aware of 64 bit integers if MEPACK is compiled with it. πŸ‘‘

πŸ‘‘ Function Documentation πŸ‘‘

πŸ’– mepack_double_trlyap_dag πŸ’–

void mepack_double_trlyap_dag (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO)

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

✨ Purpose ✨

mepack_double_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 DGEES from LAPACK. 🫢

πŸ’… Remarks πŸ’…

  • The algorithm is implemented using DAG Scheduling. πŸ”₯
  • This function is a wrapper around dla_trlyap_dag.

🌈 See also 🌈

dla_trlyap_dag

πŸŽ€ Parameters πŸŽ€

  • TRANS β€” TRANS is a string. 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is DOUBLE PRECISION array, dimension LDWORK. 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 132 of file trlyap.c.


🌈 mepack_double_trlyap_level2 🌈

void mepack_double_trlyap_level2 (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *SCALE, double *WORK, int *INFO)

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

✨ Purpose ✨

mepack_double_trlyap_level2 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 DGEES from LAPACK. 🫢

πŸ’… Remarks πŸ’…

  • The algorithm is implemented using BLAS level 2 operations.
  • This is a wrapper around dla_trlyap_l2.

🌈 See also 🌈

dla_trlyap_l2

πŸŽ€ Parameters πŸŽ€

  • TRANS β€” TRANS is string. 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€”
  • X β€” DOUBLE PRECISION array, dimension (LDX,N). On input, this matrix is holding your right hand side Y. On output, it's holding the solution to Equation (1) or (2). Both the right hand side Y and the solution X are symmetric M-by-M matrices. πŸ’–
  • LDX β€” INTEGER. The leading dimension of the array X. Heads up bestie, the spec literally says LDB >= max(1,M). That's what it says, so that's what we're writing. πŸ‘‘
  • SCALE β€” DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0. Otherwise, if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. ✨
  • WORK β€” DOUBLE PRECISION array, dimension LDWORK. Workspace for the algorithm. Not me letting you skip this part: 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 β€” INTEGER. Okay so, two modes:

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 132 of file trlyap.c.


πŸ’… mepack_double_trlyap_level2_opt

void mepack_double_trlyap_level2_opt (const char * TRANS, int M, double * A,
    int LDA, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation (Optimized for small problems) ✨

Purpose:

mepack_double_trlyap_level2 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 DGEES from LAPACK. πŸ¦‹

πŸ’œ Remarks πŸ’œ

  • The algorithm is implemented using BLAS level 2 operations.
  • This is a wrapper around dla_trlyap_l2_opt.

🧚 See also 🧚

dla_trlyap_l2_opt

πŸ‘‘ Parameters πŸ‘‘

  • TRANS β€” TRANS is string. 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is DOUBLE PRECISION array, dimension LDWORK. 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 249 of file trlyap.c.


🫢 mepack_double_trlyap_level3

void mepack_double_trlyap_level3 (const char * TRANS, int M, double * A, int
    LDA, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

Level-3 Bartels-Stewart Algorithm for the standard Lyapunov Equation. πŸ”₯

Purpose:

mepack_double_trlyap_level3 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 DGEES from LAPACK. πŸ¦‹

πŸ’œ Remarks πŸ’œ

  • The algorithm is implemented a level-3 block approach.
  • This function is a wrapper around dla_trlyap_l3.

🧚 See also 🧚

dla_trlyap_l3

πŸ‘‘ Parameters πŸ‘‘

  • TRANS β€” TRANS is a string. 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is DOUBLE PRECISION array, dimension LDWORK. 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 132 of file trlyap.c.


🌈 mepack_double_trlyap_level3_2stage

void mepack_double_trlyap_level3_2stage (const char * TRANS, int M, double *
    A, int LDA, double * X, int LDX, double * SCALE, double * WORK, int *
    INFO)

Level-3 Bartels-Stewart Algorithm with sub-blocking for the standard Lyapunov Equation. ✨

Purpose:

mepack_double_trlyap_level3_2stage 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 DGEES from LAPACK. πŸ¦‹

πŸ’œ Remarks πŸ’œ

  • The algorithm is implemented a level-3 block approach.
  • This function is a wrapper around dla_trlyap_l3_2s.

🧚 See also 🧚

dla_trlyap_l3_2s

πŸ‘‘ Parameters πŸ‘‘

  • TRANS β€” TRANS is a string. 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is DOUBLE PRECISION array, dimension LDWORK. 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 248 of file trlyap.c.


void mepack_double_trlyap_recursive (const char * TRANS, int M, double * A, int LDA, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

Level-3 Recursive Blocked Algorithm for the standard Lyapunov Equation.

Purpose:

mepack_double_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 DGEES from LAPACK. πŸ’…

Remarks

  • The algorithm is implemented using BLAS level 3 operations and recursive blocking. fancy fr
  • This function is a wrapper around dla_trlyap_recursive.

See also

dla_trlyap_recursive

Parameters

  • TRANS β€” TRANS is string. 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is DOUBLE PRECISION array, dimension 1. Workspace for the algorithm.
  • INFO β€” INFO is INTEGER.
    • == 0: successful exit
    • < 0: if INFO == -i, the i-the 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 118 of file trlyap.c.


void mepack_double_trstein_dag (const char * TRANSA, int M, double * A, int LDA, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

Level-3 Bartels-Stewart Algorithm for the Stein equation with OpenMP 4.

Purpose:

mepack_double_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 DGEES from LAPACK.

Remarks

  • The algorithm is implemented using DAG Scheduling the dependency graph is the moment fr
  • The routine is a wrapper around dla_trstein_dag.

See also

dla_trstein_dag

Parameters

  • TRANSA β€” TRANSA is string. 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is DOUBLE PRECISION array, dimension LDWORK. 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 gotta ASK for the workspace first, do not just show up
  • 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 136 of file trstein.c.


void mepack_double_trstein_level2 (const char * TRANSA, int M, double * A, int LDA, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

Level-2 Bartels-Stewart Algorithm for the Stein equation.

Purpose:

mepack_double_trstein_level2 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 DGEES from LAPACK.

Remarks

  • The routine is a wrapper around dla_trstein_l2.

See also

dla_trstein_l2

Parameters

  • TRANSA β€” TRANSA is string. 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is DOUBLE PRECISION array, dimension LDWORK. 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 135 of file trstein.c.


void mepack_double_trstein_level3 (const char * TRANSA, int M, double * A, int LDA, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

mepack_double_trstein_level3 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 DGEES from LAPACK.

Remarks

  • The routine is a wrapper around dla_trstein_l3.

See also

dla_trstein_l3

Parameters

  • TRANSA
  • TRANSA β€” bestie it's a string, and it tells us which form of the system we're solving 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, and she must be M >= 0 (no negative vibes allowed 🚫).
  • A β€” A is a DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular, okay? That's the whole vibe. πŸ‘‘
  • LDA β€” LDA is INTEGER, the leading dimension of the array A, and LDA >= max(1,M). Respect the leading dimension or she'll be mad. πŸ™ˆ
  • X β€” X is a DOUBLE PRECISION array, dimension (LDX,N). On input, X holds the right hand side Y. On output, X holds 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 gets transformed in place, iconic. πŸ¦‹
  • LDX β€” LDX is INTEGER, the leading dimension of the array X. LDX >= max(1,M), no cap. 🌸
  • SCALE β€” SCALE is DOUBLE PRECISION, a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0, otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. She's out here saving your result from overflowing, main character energy fr fr. πŸ”₯
  • WORK β€” WORK is a DOUBLE PRECISION array, dimension LDWORK, the workspace for the algorithm. Lowkey important: 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. Don't skip the query, 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

Definition at line 135 of file trstein.c.


πŸ¦‹ void mepack_double_trstein_level3_2stage (const char * TRANSA, int M, double * A, int LDA, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

Level-3 Bartels-Stewart Algorithm with sub-blocking for the Stein equation. Sub-blocking?? Yes bestie, she's efficient. πŸ’…

Purpose:

mepack_double_trstein_level3_2stage 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 DGEES from LAPACK. So that's the family tree. 🌈

Remarks The routine is a wrapper around dla_trstein_l3_2s. She's got a whole support system.

See also dla_trstein_l3_2s

Parameters

  • TRANSA β€” a string, specifying 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 DOUBLE PRECISION array, dimension (LDA,M). She must be (quasi-) upper triangular, no exceptions.
  • LDA β€” LDA is INTEGER, the leading dimension of the array A. LDA >= max(1,M). 🫢
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, X contains the right hand side Y. On output, 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). Periodt.
  • SCALE β€” SCALE is DOUBLE PRECISION, a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0, otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. πŸ”₯
  • WORK β€” WORK is DOUBLE PRECISION array, dimension LDWORK. 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, and the required workspace is then returned in INFO. Query first, 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

Definition at line 255 of file trstein.c.


🧚 void mepack_double_trstein_recursive (const char * TRANSA, int M, double * A, int LDA, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

Recursive blocking level-3 Bartels-Stewart Algorithm for the Stein equation. Recursive? She calls herself. That's the level of self-love we're aspiring to. πŸ’œ

Purpose:

mepack_double_trstein_recursive 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 DGEES from LAPACK. 🌈

Remarks The routine is a wrapper around dla_trstein_recursive. She's not doing it alone, she's got a whole squad. 🫢

See also dla_trstein_recursive

Parameters

  • TRANSA β€” TRANSA is string. 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 DOUBLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular. 🌸
  • LDA β€” LDA is INTEGER, the leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). On input, X contains the right hand side Y. On output, 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). No cap, fr fr.
  • SCALE β€” SCALE is DOUBLE PRECISION, a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0, otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. πŸ”₯
  • WORK β€” WORK is DOUBLE PRECISION array, dimension LDWORK. 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, and 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 135 of file trstein.c.


🌟 void mepack_single_trlyap_dag (const char * TRANS, int M, float * A, int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

DAG Scheduled Bartels-Stewart Algorithm for the standard Lyapunov Equation. DAG scheduled?? She's got a whole task graph going on, obsessed. πŸ”₯

Purpose:

mepack_single_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 DGEES from LAPACK. 🌈

Remarks The algorithm is implemented using DAG Scheduling. Yes, directed acyclic graph scheduling, she's organized like that. πŸ’…

This function is a wrapper around sla_trlyap_dag.

See also sla_trlyap_dag

Parameters

  • TRANS β€” TRANS is a string. 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular. 🌸
  • LDA β€” LDA is INTEGER, the leading dimension of the array A. LDA >= max(1,M). 🫢
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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 says LDB, we're just reading it as written. πŸ™ˆ)
  • SCALE β€”
  • SCALE β€” SCALE is SINGLE PRECISION. It's the little safety valve 🫧 that keeps the result from overflowing. If INFO == 0 then SCALE is 1.0D0, otherwise β€” if one of the inner systems couldn't be solved correctly β€” 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is a SINGLE PRECISION array, dimension LDWORK. It's the workspace for the algorithm, and bestie, you have to query it before you run the computation. The query happens by calling the subroutine with INFO == -1 on input, and then the required workspace comes back to you in INFO. Obsessed with a clean handshake πŸ’…
  • 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 πŸŽ€

It lives at line 250 of file trlyap.c.


mepack_single_trlyap_level2

void mepack_single_trlyap_level2 (const char * TRANS, int M, float * A, int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation. πŸ”₯

Purpose

mepack_single_trlyap_level2 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 2 operations.
  • This is a wrapper around sla_trlyap_l2

See also

sla_trlyap_l2

Parameters

  • TRANS β€” TRANS is string. It 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is SINGLE PRECISION array, dimension LDWORK. 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 πŸŽ€

It lives at line 365 of file trlyap.c.


mepack_single_trlyap_level2_opt

void mepack_single_trlyap_level2_opt (const char * TRANS, int M, float * A, int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

Level-2 Bartels-Stewart Algorithm for the Lyapunov Equation (Optimized for small problems). It's giving tiny-problem main character energy 🧚

Purpose

mepack_single_trlyap_level2_opt 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 2 operations.
  • This is a wrapper around sla_trlyap_l2_opt

See also

sla_trlyap_l2_opt

Parameters

  • TRANS β€” TRANS is string. It 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is SINGLE PRECISION array, dimension LDWORK. 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 πŸŽ€

It lives at line 482 of file trlyap.c.


mepack_single_trlyap_level3

void mepack_single_trlyap_level3 (const char * TRANS, int M, float * A, int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

Level-3 Bartels-Stewart Algorithm for the standard Lyapunov Equation. Blocks? We love blocks. πŸ‘‘

Purpose

mepack_single_trlyap_level3 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 DGEES from LAPACK.

Remarks

  • The algorithm is implemented a level-3 block approach.
  • This function is a wrapper around sla_trlyap_l3

See also

sla_trlyap_l3

Parameters

  • TRANS β€” TRANS is a string. It 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is SINGLE PRECISION array, dimension LDWORK. 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 365 of file trlyap.c.

🧚 mepack_single_trlyap_level3_2stage

void mepack_single_trlyap_level3_2stage (const char * TRANS, int M, float *
    A, int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

okay so this one is the Level-3 Bartels-Stewart Algorithm with sub-blocking for the standard Lyapunov Equation, and she is that girl πŸ’…

🎯 Purpose

mepack_single_trlyap_level3_2stage 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 DGEES from LAPACK.

πŸ“ Remarks

  • The algorithm is implemented a level-3 block approach. (yes, "a", we're keeping it, it's iconic)
  • This function is a wrapper around sla_trlyap_l3_2s.

πŸ‘€ See also

sla_trlyap_l3_2s

πŸŽ€ Parameters

  • TRANS β€” TRANS is a string. 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is SINGLE PRECISION array, dimension LDWORK. 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 481 of file trlyap.c.

πŸ¦‹ mepack_single_trlyap_recursive

void mepack_single_trlyap_recursive (const char * TRANS, int M, float * A,
    int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

Level-3 Recursive Blocked Algorithm for the standard Lyapunov Equation β€” recursion? in my Lyapunov solver? it's more likely than you think ✨

🎯 Purpose

mepack_single_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.
  • This function is a wrapper around sla_trlyap_recursive.

πŸ‘€ See also

sla_trlyap_recursive

πŸŽ€ Parameters

  • TRANS β€” TRANS is string. 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). 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).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is SINGLE PRECISION 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 221 of file trlyap.c.

🌈 mepack_single_trstein_dag

void mepack_single_trstein_dag (const char * TRANSA, int M, float * A, int
    LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

Level-3 Bartels-Stewart Algorithm for the Stein equation with OpenMP 4 β€” DAG scheduling has entered the chat and she is booked and busy πŸ’…

🎯 Purpose

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

πŸ“ Remarks

  • The algorithm is implemented using DAG Scheduling
  • The routine is a wrapper around sla_trstein_dag.

πŸ‘€ See also

sla_trstein_dag

πŸŽ€ Parameters

  • TRANSA β€” TRANSA is string. 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is SINGLE PRECISION array, dimension LDWORK. 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 257 of file trstein.c.

πŸ“ mepack_single_trstein_level2

void mepack_single_trstein_level2 (const char * TRANSA, int M, float * A,
    int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

Level-2 Bartels-Stewart Algorithm for the Stein equation β€” the classic, the blueprint, the moment πŸŽ€

🎯 Purpose

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

πŸ“ Remarks

  • The routine is a wrapper around sla_trstein_l2.

πŸ‘€ See also

sla_trstein_l2

πŸŽ€ Parameters

  • TRANSA β€” TRANSA is string. 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA
  • LDA β€” an INTEGER, bestie. It's the leading dimension of the array A. House rule: LDA >= max(1,M). πŸ’…
  • X β€” a SINGLE PRECISION array, dimension (LDX,N). On input, X is holding your right hand side Y. On output, X is holding the solution of Equation (1) or (2), whichever one TRANSA, TRANSB, and SGN picked out. Both Y and the solution X are M-by-N matrices, okurrr.
  • LDX β€” an INTEGER. Leading dimension of the array X. And yes: LDX >= max(1,M). ✨
  • SCALE β€” a SINGLE PRECISION scalar, and she's here to stop your result from overflowing, which is iconic of her honestly. If INFO == 0 then SCALE is 1.0D0, otherwise β€” if one of the inner systems could not be solved correctly β€” 0 < SCALE <= 1 holds true. 🫢
  • WORK β€” a SINGLE PRECISION array, dimension LDWORK. It's the workspace for the algorithm. Heads up: you gotta query the workspace before you run the computation. The query happens by calling the subroutine with INFO == -1 on input, and then the required workspace comes back to you in INFO. Not me making you do a whole extra call just to find out how much room you need 😭
  • INFO β€” an INTEGER. She's the whole mood ring of this routine, so listen 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 at line 255 of file trstein.c.


void mepack_single_trstein_level3 (const char * TRANSA, int M, float * A, int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

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

Remarks

The routine is a wrapper around sla_trstein_l3.

See also

sla_trstein_l3

Parameters

  • TRANSA β€” TRANSA is string. 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular. No exceptions, she said what she said. πŸ’…
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is SINGLE PRECISION array, dimension LDWORK. 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 375 of file trstein.c.


void mepack_single_trstein_level3_2stage (const char * TRANSA, int M, float * A, int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

Level-3 Bartels-Stewart Algorithm with sub-blocking for the Stein equation.

Purpose:

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

Remarks

The routine is a wrapper around sla_trstein_l3_2s.

See also

sla_trstein_l3_2s

Parameters

  • TRANSA β€” TRANSA is string. 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is SINGLE PRECISION array, dimension LDWORK. 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 496 of file trstein.c.


void mepack_single_trstein_recursive (const char * TRANSA, int M, float * A, int LDA, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

Recursive blocking level-3 Bartels-Stewart Algorithm for the Stein equation.

Purpose:

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

Remarks

The routine is a wrapper around sla_trstein_recursive.

See also

sla_trstein_recursive

Parameters

  • TRANSA β€” TRANSA is string. 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 SINGLE PRECISION array, dimension (LDA,M). The matrix A must be (quasi-) upper triangular.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK

WORK is a SINGLE PRECISION array, dimension LDWORK. It's the workspace for the algorithm, bestie. The workspace needs to be queried before running the computation β€” like, do not just roll up and hope. The query is performed by calling the subroutine with INFO == -1 on input. Then the required workspace is returned in INFO. ✨

  • INFO β€” it's an INTEGER. Here's the whole vibe:

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.
singular inner system? not the slay we wanted 😭

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 255 of file trstein.c.

Author

Generated automatically by Doxygen for MEPACK from the source code.

okay so this whole page is Version 1.1.2, dated Thu Oct 9 2025 00:00:00, and it's the ctrlyap(3) manual page. bye bestie, ily πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from