ctrlyap(3)
πΈ 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 useintvalues to pass sizes, thework_spacequery will fail for large scale problems. That's literally why you should usemepack_memoryto query the requiredwork_spacefrom 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βTRANSis a string. Specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMis INTEGER. The order of the matricesAandC.M >= 0.AβAis DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis DOUBLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetric M-by-M matrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis DOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis DOUBLE PRECISION array, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOis INTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- On input:
πΈ 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βTRANSis string. Specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMis INTEGER. The order of the matricesAandC.M >= 0.AβAis DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXβDOUBLE PRECISIONarray, dimension(LDX,N). On input, this matrix is holding your right hand sideY. On output, it's holding the solution to Equation (1) or (2). Both the right hand sideYand the solutionXare symmetricM-by-Mmatrices. πLDXβINTEGER. The leading dimension of the arrayX. Heads up bestie, the spec literally saysLDB >= max(1,M). That's what it says, so that's what we're writing. πSCALEβDOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0. Otherwise, if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. β¨WORKβDOUBLE PRECISIONarray, dimensionLDWORK. 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 withINFO == -1on input. The required workspace is then returned inINFO. π«ΆINFOβINTEGER. Okay so, two modes:
On input:
== -1: Perform a workspace query<> -1: normal operation
On exit, workspace query:
< 0: ifINFO == -i, thei-th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, thei-th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
πΈ 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βTRANSis string. Specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMisINTEGER. The order of the matricesAandC.M >= 0.AβAisDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXisDOUBLE PRECISIONarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetricM-by-Mmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisDOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisDOUBLE PRECISIONarray, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.
On input:
== -1: Perform a workspace query<> -1: normal operation
On exit, workspace query:
< 0: ifINFO == -i, thei-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, thei-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
πΈ 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βTRANSis a string. Specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMisINTEGER. The order of the matricesAandC.M >= 0.AβAisDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXisDOUBLE PRECISIONarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetricM-by-Mmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisDOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisDOUBLE PRECISIONarray, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.
On input:
== -1: Perform a workspace query<> -1: normal operation
On exit, workspace query:
< 0: ifINFO == -i, thei-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, thei-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
πΈ 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βTRANSis a string. Specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMisINTEGER. The order of the matricesAandC.M >= 0.AβAisDOUBLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXisDOUBLE PRECISIONarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetricM-by-Mmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEisDOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisDOUBLE PRECISIONarray, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
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βTRANSis string. Specifies the form of the system of equations with respect to A:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMis INTEGER. The order of the matricesAandC.M >= 0.AβAis DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis DOUBLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetricM-by-Mmatrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis DOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis DOUBLE PRECISION array, dimension1. Workspace for the algorithm.INFOβINFOis INTEGER.== 0: successful exit< 0: ifINFO == -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βTRANSAis string. Specifies the form of the system of equations with respect toAandC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMis INTEGER. The order of the matricesAandC.M >= 0.AβAis DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis DOUBLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXareM-by-Nmatrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEis DOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis DOUBLE PRECISION array, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO. yes bestie you gotta ASK for the workspace first, do not just show upINFOβINFOis INTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- On input:
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βTRANSAis string. Specifies the form of the system of equations with respect toAandC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMis INTEGER. The order of the matricesAandC.M >= 0.AβAis DOUBLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis DOUBLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXareM-by-Nmatrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEis DOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis DOUBLE PRECISION array, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOis INTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- On input:
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
TRANSATRANSAβ 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βMis INTEGER, the order of the matrices A and C, and she must beM >= 0(no negative vibes allowed π«).AβAis a DOUBLE PRECISION array, dimension(LDA,M). The matrix A must be (quasi-) upper triangular, okay? That's the whole vibe. πLDAβLDAis INTEGER, the leading dimension of the array A, andLDA >= max(1,M). Respect the leading dimension or she'll be mad. πXβXis 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 byTRANSA,TRANSB, andSGN. Right hand side Y and the solution X are M-by-N matrices. She literally gets transformed in place, iconic. π¦LDXβLDXis INTEGER, the leading dimension of the array X.LDX >= max(1,M), no cap. πΈSCALEβSCALEis DOUBLE PRECISION, a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0D0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. She's out here saving your result from overflowing, main character energy fr fr. π₯WORKβWORKis 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 withINFO == -1on input. The required workspace is then returned in INFO. Don't skip the query, bestie. πINFOβINFOis INTEGER:
On input:
== -1: Perform a workspace query<> -1: normal operation
On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit β¨< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
π 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βMis INTEGER, the order of the matrices A and C.M >= 0. πAβAis DOUBLE PRECISION array, dimension(LDA,M). She must be (quasi-) upper triangular, no exceptions.LDAβLDAis INTEGER, the leading dimension of the array A.LDA >= max(1,M). π«ΆXβXis 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 byTRANSA,TRANSB, andSGN. Right hand side Y and the solution X are M-by-N matrices. πΈLDXβLDXis INTEGER, the leading dimension of the array X.LDX >= max(1,M). Periodt.SCALEβSCALEis DOUBLE PRECISION, a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0D0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. π₯WORKβWORKis 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 withINFO == -1on input, and the required workspace is then returned in INFO. Query first, bestie. πINFOβINFOis INTEGER:
On input:
== -1: Perform a workspace query<> -1: normal operation
On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit β¨< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
π 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βTRANSAis 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βMis INTEGER, the order of the matrices A and C.M >= 0. πAβAis DOUBLE PRECISION array, dimension(LDA,M). The matrix A must be (quasi-) upper triangular. πΈLDAβLDAis INTEGER, the leading dimension of the array A.LDA >= max(1,M).XβXis 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 byTRANSA,TRANSB, andSGN. Right hand side Y and the solution X are M-by-N matrices. π¦LDXβLDXis INTEGER, the leading dimension of the array X.LDX >= max(1,M). No cap, fr fr.SCALEβSCALEis DOUBLE PRECISION, a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0D0, otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. π₯WORKβWORKis 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 withINFO == -1on input, and the required workspace is then returned in INFO. πINFOβINFOis INTEGER:
On input:
== -1: Perform a workspace query<> -1: normal operation
On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit β¨< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
π 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βTRANSis a string. Specifies the form of the system of equations with respect to A:== 'N':op1(A) = A== 'T':op1(A) = A**Tβ¨
MβMis INTEGER, the order of the matrices A and C.M >= 0. πAβAis SINGLE PRECISION array, dimension(LDA,M). The matrix A must be (quasi-) upper triangular. πΈLDAβLDAis INTEGER, the leading dimension of the array A.LDA >= max(1,M). π«ΆXβXis 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βLDXis 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βSCALEis SINGLE PRECISION. It's the little safety valve π«§ that keeps the result from overflowing. IfINFO == 0thenSCALEis1.0D0, otherwise β if one of the inner systems couldn't be solved correctly β0 < SCALE <= 1holds true.WORKβWORKis a SINGLE PRECISION array, dimensionLDWORK. 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 withINFO == -1on input, and then the required workspace comes back to you inINFO. Obsessed with a clean handshake πINFOβINFOisINTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- On input:
β¨ Author β¨
Martin Koehler, MPI Magdeburg
πΈ Date πΈ
October 2025
π Definition π
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βTRANSis string. It specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMisINTEGER. The order of the matricesAandC.M >= 0.AβAis SINGLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetric M-by-M matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis SINGLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis SINGLE PRECISION array, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- On input:
β¨ 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βTRANSis string. It specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMisINTEGER. The order of the matricesAandC.M >= 0.AβAis SINGLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetric M-by-M matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis SINGLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis SINGLE PRECISION array, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- On input:
β¨ 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βTRANSis a string. It specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMisINTEGER. The order of the matricesAandC.M >= 0.AβAis SINGLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetric M-by-M matrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis SINGLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis SINGLE PRECISION array, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On input:
- On exit, normal operation:
== 0: successful exit π< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- π«Ά Author: Martin Koehler, MPI Magdeburg
- π Date: October 2025
- π Definition at line 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βTRANSis a string. Specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMis INTEGER. The order of the matricesAandC.M >= 0.AβAis SINGLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetric M-by-M matrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis SINGLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis SINGLE PRECISION array, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOis INTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- On input:
- π«Ά 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βTRANSis string. Specifies the form of the system of equations with respect toA:== 'N':op1(A) = A== 'T':op1(A) = A**T
MβMis INTEGER. The order of the matricesAandC.M >= 0.AβAis SINGLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXare symmetric M-by-M matrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis SINGLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis SINGLE PRECISION array, dimension1. Workspace for the algorithm.INFOβINFOis INTEGER.== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- π«Ά Author: Martin Koehler, MPI Magdeburg
- π Date: October 2025
- π Definition at line 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βTRANSAis string. Specifies the form of the system of equations with respect toAandC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMis INTEGER. The order of the matricesAandC.M >= 0.AβAis SINGLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXare M-by-N matrices.LDXβLDXis INTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEis SINGLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis SINGLE PRECISION array, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOis INTEGER.- On input:
== -1: Perform a workspace query<> -1: normal operation
- On exit, workspace query:
< 0: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
- On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
- On input:
- π«Ά 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βTRANSAis string. Specifies the form of the system of equations with respect toAandC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMis INTEGER. The order of the matricesAandC.M >= 0.AβAis SINGLE PRECISION array, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDALDAβ anINTEGER, bestie. It's the leading dimension of the arrayA. House rule:LDA >= max(1,M). πXβ aSINGLE PRECISIONarray, dimension(LDX,N). On input,Xis holding your right hand sideY. On output,Xis holding the solution of Equation (1) or (2), whichever oneTRANSA,TRANSB, andSGNpicked out. BothYand the solutionXareM-by-Nmatrices, okurrr.LDXβ anINTEGER. Leading dimension of the arrayX. And yes:LDX >= max(1,M). β¨SCALEβ aSINGLE PRECISIONscalar, and she's here to stop your result from overflowing, which is iconic of her honestly. IfINFO == 0thenSCALEis1.0D0, otherwise β if one of the inner systems could not be solved correctly β0 < SCALE <= 1holds true. π«ΆWORKβ aSINGLE PRECISIONarray, dimensionLDWORK. 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 withINFO == -1on input, and then the required workspace comes back to you inINFO. Not me making you do a whole extra call just to find out how much room you need πINFOβ anINTEGER. 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: ifINFO == -i, thei-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit π< 0: ifINFO == -i, thei-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular. π
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βTRANSAis string. Specifies the form of the system of equations with respect toAandC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMisINTEGER. The order of the matricesAandC.M >= 0. πΈAβAisSINGLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular. No exceptions, she said what she said. πLDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXisSINGLE PRECISIONarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXareM-by-Nmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisSINGLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisSINGLE PRECISIONarray, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.
On input:
== -1: Perform a workspace query<> -1: normal operation
On exit, workspace query:
< 0: ifINFO == -i, thei-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, thei-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
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βTRANSAis string. Specifies the form of the system of equations with respect toAandC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMisINTEGER. The order of the matricesAandC.M >= 0.AβAisSINGLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXisSINGLE PRECISIONarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXareM-by-Nmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisSINGLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKisSINGLE PRECISIONarray, dimensionLDWORK. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine withINFO == -1on input. The required workspace is then returned inINFO.INFOβINFOisINTEGER.
On input:
== -1: Perform a workspace query<> -1: normal operation
On exit, workspace query:
< 0: ifINFO == -i, thei-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, thei-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
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βTRANSAis string. Specifies the form of the system of equations with respect toAandC:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMisINTEGER. The order of the matricesAandC.M >= 0.AβAisSINGLE PRECISIONarray, dimension(LDA,M). The matrixAmust be (quasi-) upper triangular.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXisSINGLE PRECISIONarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2) as selected byTRANSA,TRANSB, andSGN. Right hand sideYand the solutionXareM-by-Nmatrices.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisSINGLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORK
WORK is 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: ifINFO == -i, the i-Th argument had an illegal value>= 0: The value ofINFOis the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit< 0: ifINFO == -i, the i-Th argument had an illegal value> 0: The equation is not solved correctly. One of the arising inner system got singular.
singular inner system? 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
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms