# ctglyap - Man Page

## Name

ctglyap — C-Interface

— C-Interface for generalized Lyapunov and Stein equations with triangular coefficient matrices.

## Synopsis

### Functions

void mepack_double_tglyap_dag (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation with DAG scheduling.
void mepack_single_tglyap_dag (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation with DAG scheduling.
void mepack_double_tgstein_dag (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation with DAG scheduling.
void mepack_single_tgstein_dag (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation with DAG scheduling.
void mepack_double_tglyap_level2 (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
void mepack_double_tglyap_level2_unopt (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation (Unoptimized)
void mepack_single_tglyap_level2 (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
void mepack_single_tglyap_level2_unopt (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Lyapunov equation (Unoptimized)
void mepack_double_tgstein_level2 (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Stein equation.
void mepack_single_tgstein_level2 (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Stein equation.
void mepack_double_tglyap_level3 (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
void mepack_double_tglyap_level3_2stage (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm with sub-blocking for the generalized Lyapunov equation.
void mepack_single_tglyap_level3 (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
void mepack_single_tglyap_level3_2stage (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm with sub-blocking for the generalized Lyapunov equation.
void mepack_double_tgstein_level3 (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation.
void mepack_double_tgstein_level3_2stage (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm with sub-blocking for the generalized Stein equation.
void mepack_single_tgstein_level3 (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Stein equation.
void mepack_single_tgstein_level3_2stage (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Level-3 Bartels-Stewart Algorithm with sub-blocking for the generalized Stein equation.
void mepack_double_tglyap_recursive (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Recursive blocking Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
void mepack_single_tglyap_recursive (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Recursive blocking Level-3 Bartels-Stewart Algorithm for the generalized Lyapunov equation.
void mepack_double_tgstein_recursive (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *SCALE, double *WORK, int *INFO)
Recursive blocking Level-3 Bartels-Stewart Algorithm for the generalized Stein equation.
void mepack_single_tgstein_recursive (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *SCALE, float *WORK, int *INFO)
Recursive blocking Level-3 Bartels-Stewart Algorithm for the generalized Stein equation.

## Detailed Description

C-Interface for generalized Lyapunov and Stein equations with triangular coefficient matrices.

The Fortran routines to solve generalized Lyapunov and Stein equations with triangular coefficients are wrapped in C to provide an easier access to them. All wrapper routines are direct wrappers to the corresponding Fortran subroutines without sanity checks. These are performed by the Fortran routines. Since the routines are using int values to pass sizes the work_space query will fail for large scale problems. For this reason the function mepack_memory should be used to query the required work_space from a C code. This function is aware of 64 bit integers if MEPACK is compiled with it.

## Function Documentation

### void mepack_double_tglyap_dag (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tglyap_dag solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tglyap_dag.

dla_tglyap_dag

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 146 of file tglyap.c.

### void mepack_double_tglyap_level2 (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tglyap_level2 solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tglyap_l2.

dla_tglyap_l2

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 146 of file tglyap.c.

### void mepack_double_tglyap_level2_unopt (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tglyap_level2_unopt solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tglyap_l2_unopt.

dla_tglyap_l2_unopt

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 281 of file tglyap.c.

### void mepack_double_tglyap_level3 (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tglyap_level3 solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tglyap_l3.

dla_tglyap_l3

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 146 of file tglyap.c.

### void mepack_double_tglyap_level3_2stage (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tglyap_level3_2stage solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tglyap_l3_2s.

dla_tglyap_l3_2s

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 281 of file tglyap.c.

### void mepack_double_tglyap_recursive (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tglyap_recursive solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tglyap_recursive.

dla_tglyap_recursive

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 146 of file tglyap.c.

### void mepack_double_tgstein_dag (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tgstein_dag solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tgstein_dag.

dla_tgstein_dag

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 146 of file tgstein.c.

### void mepack_double_tgstein_level2 (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tgstein_level2 solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tgstein_l2.

dla_tgstein_l2

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 146 of file tgstein.c.

### void mepack_double_tgstein_level3 (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tgstein_level3 solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tgstein_l3.

dla_tgstein_l3

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 146 of file tgstein.c.

### void mepack_double_tgstein_level3_2stage (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tgstein_level3_2stage solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tgstein_l3_2s.

dla_tgstein_l3_2s

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 281 of file tgstein.c.

### void mepack_double_tgstein_recursive (const char * TRANS, int M, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * SCALE, double * WORK, int * INFO)

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

Purpose:

```mepack_double_tgstein_recursive solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around dla_tgstein_recursive.

dla_tgstein_recursive

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is DOUBLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 146 of file tgstein.c.

### void mepack_single_tglyap_dag (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tglyap_dag solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tglyap_dag.

sla_tglyap_dag

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 281 of file tglyap.c.

### void mepack_single_tglyap_level2 (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tglyap_level2 solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tglyap_l2.

sla_tglyap_l2

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 420 of file tglyap.c.

### void mepack_single_tglyap_level2_unopt (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tglyap_level2_unopt solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tglyap_l2_unopt.

sla_tglyap_l2_unopt

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 557 of file tglyap.c.

### void mepack_single_tglyap_level3 (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tglyap_level3 solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tglyap_l3.

sla_tglyap_l3

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 416 of file tglyap.c.

### void mepack_single_tglyap_level3_2stage (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tglyap_level3_2stage solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tglyap_l3_2s.

sla_tglyap_l3_2s

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 551 of file tglyap.c.

### void mepack_single_tglyap_recursive (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tglyap_recursive solves a generalized Lyapunov  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tglyap_recursive.

sla_tglyap_recursive

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 281 of file tglyap.c.

### void mepack_single_tgstein_dag (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tgstein_dag solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tgstein_dag.

sla_tgstein_dag

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 281 of file tgstein.c.

### void mepack_single_tgstein_level2 (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tgstein_level2 solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tgstein_l2.

sla_tgstein_l2

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 282 of file tgstein.c.

### void mepack_single_tgstein_level3 (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tgstein_level3 solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tgstein_l3.

sla_tgstein_l3

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 416 of file tgstein.c.

### void mepack_single_tgstein_level3_2stage (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tgstein_level3_2stage solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tgstein_l3_2s.

sla_tgstein_l3_2s

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 551 of file tgstein.c.

### void mepack_single_tgstein_recursive (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * SCALE, float * WORK, int * INFO)

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

Purpose:

```mepack_single_tgstein_recursive solves a generalized Stein  equation of the following forms

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

or

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

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

This function is a wrapper around sla_tgstein_recursive.

sla_tgstein_recursive

Parameters

TRANS

```         TRANS is a string
Specifies the form of the system of equations with respect to A and B:
== 'N':  Equation (1) is solved.
== 'T':  Equation (2) is solved.```

M

```         M is INTEGER
The order of the matrices A and B.  M >= 0.```

A

```         A is 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).```

B

```         B is SINGLE PRECISION array, dimension (LDB,M)
The matrix B must be upper triangular.```

LDB

```         LDB is INTEGER
The leading dimension of the array B.  LDB >= max(1,M).```

X

```         X is 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

Januar 2023

Definition at line 281 of file tgstein.c.

## Author

Generated automatically by Doxygen for MEPACK from the source code.

## Info

Tue Mar 7 2023 Version 1.0.3 MEPACK