# dbltglyap - Man Page

## Name

dbltglyap — Double Precision

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

## Synopsis

### Functions

subroutine **dla_tglyap_dag** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

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

subroutine **dla_tgstein_dag** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

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

subroutine **dla_tglyap_l2** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

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

subroutine **dla_tglyap_l2_unopt** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

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

subroutine **dla_tgstein_l2** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

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

subroutine **dla_tglyap_l3** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

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

subroutine **dla_tglyap_l3_2s** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

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

subroutine **dla_tgstein_l3** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

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

subroutine **dla_tgstein_l3_2s** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

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

recursive subroutine **dla_tglyap_recursive** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

Recursive Blocking Algorithm for the generalized Lyapunov equation.

recursive subroutine **dla_tgstein_recursive** (trans, m, a, lda, b, ldb, x, ldx, scale, work, info)

Recursive Blocking Algorithm for the generalized Stein equation.

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

Iterative Refinement for the Generalized Lyapunov Equations.

## Detailed Description

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

## Function Documentation

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

Iterative Refinement for the Generalized Lyapunov Equations.

**Purpose:**

DLA_GGSTEIN solves a generalized Stein equation of the following forms A * X * A^T - B * X * B^T = SCALE * Y (1) or A^T * X * A - B^T * X * B = SCALE * Y (2) where (A,B) is a M-by-M matrix pencil using iterative refinement. The right hand side Y and the solution X are M-by-M matrices. The matrix pencil (A,B) needs to provide as the original data as well as in generalized Schur decomposition since both are required in the iterative refinement process.

**Parameters***TRANS*TRANS is CHARACTER Specifies the form of the system of equations with respect to A : == 'N': Equation (1) is solved == 'T': Equation (2) is solved

*GUESS*GUESS is CHARACTER Specifies whether X contains an initial guess or nor not. = 'I': X contains an initial guess = 'N': No initial guess, X is set to zero at the begin of the iteration.

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

*A*A is DOUBLE PRECISION array, dimension (LDA,M) The array A contains the original matrix A defining the equation.

*LDA*LDA is INTEGER The leading dimension of the array A. LDA >= max(1,M).

*B*B is DOUBLE PRECISION array, dimension (LDB,M) The array B contains the original matrix B defining the equation.

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

*X*X is DOUBLE PRECISION array, dimension (LDX,M) On input, the array X contains the initial guess, if GUESS = 'I'. On output, the array X contains the solution X.

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

*Y*Y is DOUBLE PRECISION array, dimension (LDY,M) On input, the array Y contains the right hand side Y. The array stays unchanged during the iteration.

*LDY*LDY is INTEGER The leading dimension of the array Y. LDY >= max(1,M).

*AS*AS is DOUBLE PRECISION array, dimension (LDAS,M) The array AS contains the generalized Schur decomposition of the A.

*LDAS*LDAS is INTEGER The leading dimension of the array AS. LDAS >= max(1,M).

*BS*BS is DOUBLE PRECISION array, dimension (LDBS,M) The array AS contains the generalized Schur decomposition of the B.

*LDBS*LDBS is INTEGER The leading dimension of the array BS. LDBS >= max(1,M).

*Q*Q is DOUBLE PRECISION array, dimension (LDQ,M) The array Q contains the left generalized Schur vectors for (A,B) as returned by DGGES.

*LDQ*LDQ is INTEGER The leading dimension of the array Q. LDQ >= max(1,M).

*Z*Z is DOUBLE PRECISION array, dimension (LDZ,M) The array Z contains the right generalized Schur vectors for (A,B) as returned by DGGES.

*LDZ*LDZ is INTEGER The leading dimension of the array Z. LDZ >= max(1,M).

*MAXIT*MAXIT is INTEGER On input, MAXIT contains the maximum number of iteration that are performed, MAXIT <= 100 On exit, MAXIT contains the number of iteration steps taken by the algorithm.

*TAU*TAU is DOUBLE PRECISION On input, TAU contains the additional security factor for the stopping criterion, typical values are 0.1 On exit, TAU contains the last relative residual when the stopping criterion got valid.

*CONVLOG*CONVLOG is DOUBLE PRECISION array, dimension (MAXIT) The CONVLOG array contains the convergence history of the iterative refinement. CONVLOG(I) contains the maximum relative residual before it is solved for the I-th time.

*WORK*WORK is DOUBLE PRECISION array, dimension (MAX(1,LDWORK)) Workspace for the algorithm. The optimal workspace is returned in LDWORK, if LDWORK == -1 on input. In this case no computations are performed.

*LDWORK*LDWORK is INTEGER If LDWORK == -1 the subroutine will return the required size of the workspace in LDWORK on exit. No computations are performed and none of the arrays are referenced.

*INFO*INFO is INTEGER == 0: Success > 0: Iteration failed in step INFO < 0: if INFO = -i, the i-th argument had an illegal value = -50: Some of the internal settings like NB,... are incorrect.

**See also**DLA_TGSTEIN_L3

DLA_TGSTEIN_L2

DLA_TGSTEIN_L3_2S

DLA_TGSTEIN_DAG

DLA_TGSTEIN_RECURSIVE

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **243** of file **dla_ggstein_refine.f90**.

### subroutine dla_tglyap_dag (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb,*) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

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

**Purpose:**

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

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

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

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

*A*A is 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 LWORK Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO.

*INFO*INFO is INTEGER On input: == -1 : Perform a workspace query <> -1: normal operation On exit, workspace query: < 0 : if INFO = -i, the i-th argument had an illegal value >= 0: The value of INFO is the required number of elements in the workspace. On exit, normal operation: == 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: The equation is not solved correctly. One of the arising inner system got singular.

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **154** of file **dla_tglyap_dag.f90**.

### subroutine dla_tglyap_l2 (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

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

**Purpose:**

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

**Attention**The algorithm is implemented using BLAS level 2 operations.

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

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

*A*A is 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 TRANS. 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 LWORK Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO.

*INFO*INFO is INTEGER On input: == -1 : Perform a workspace query <> -1: normal operation On exit, workspace query: < 0 : if INFO = -i, the i-th argument had an illegal value >= 0: The value of INFO is the required number of elements in the workspace. On exit, normal operation: == 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: The equation is not solved correctly. One of the arising inner system got singular.

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **155** of file **dla_tglyap_l2.f90**.

### subroutine dla_tglyap_l2_unopt (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

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

**Purpose:**

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

**Attention**The algorithm is implemented using BLAS level 2 operations but works with inefficient DSYR2 calls in the case TRANS='T'.

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

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

*A*A is 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 TRANS. 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 LWORK Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with INFO == -1 on input. The required workspace is then returned in INFO.

*INFO*INFO is INTEGER On input: == -1 : Perform a workspace query <> -1: normal operation On exit, workspace query: < 0 : if INFO = -i, the i-th argument had an illegal value >= 0: The value of INFO is the required number of elements in the workspace. On exit, normal operation: == 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: The equation is not solved correctly. One of the arising inner system got singular.

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **156** of file **dla_tglyap_l2_unopt.f90**.

### subroutine dla_tglyap_l3 (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

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

**Purpose:**

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

**Attention**The algorithm is implemented using BLAS level 3 operations.

**Parameters***TRANS**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**WORK**INFO***Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **154** of file **dla_tglyap_l3.f90**.

### subroutine dla_tglyap_l3_2s (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

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

**Purpose:**

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

**Attention**The algorithm is implemented using BLAS level 3 operations with two stage blocking (DAG inner solves)

**Parameters***TRANS**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**WORK**INFO***Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **153** of file **dla_tglyap_l3_2stage.f90**.

### recursive subroutine dla_tglyap_recursive (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb,*) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

Recursive Blocking Algorithm for the generalized Lyapunov equation.

**Purpose:**

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

**Attention**The algorithm is implemented using recursive blocking.

**Parameters***TRANS*TRANS is CHARACTER(1) 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**LDX*LDX is INTEGER The leading dimension of the array X. LDX >= max(1,M).

*SCALE**WORK*WORK is DOUBLE PRECISION array, dimension M*M Workspace for the algorithm.

*INFO*INFO is INTEGER == 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: The equation is not solved correctly. One of the arising inner system got singular.

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **140** of file **dla_tglyap_recursive.f90**.

### subroutine dla_tgstein_dag (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb,*) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

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

**Purpose:**

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

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

**Parameters***TRANS*TRANS is CHARACTER(1) Specifies the form of the system of equations with respect to A, B, and C: == 'N': Equation (1) is solved. == 'T': Equation (2) is solved.

*M*M is INTEGER The order of the matrices A and C. M >= 0.

*A*A is 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**LDX*LDX is INTEGER The leading dimension of the array X. LDX >= max(1,M).

*SCALE**WORK**INFO***Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **152** of file **dla_tgstein_dag.f90**.

### subroutine dla_tgstein_l2 (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

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

**Purpose:**

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

**Attention**The algorithm is implemented using BLAS level 2 operations.

**Parameters***TRANS*TRANS is CHARACTER(1) Specifies the form of the system of equations with respect to A, B, and C: == 'N': Equation (1) is solved. == 'T': Equation (2) is solved.

*M*M is INTEGER The order of the matrices A and C. M >= 0.

*A*A is 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**LDX*LDX is INTEGER The leading dimension of the array X. LDX >= max(1,M).

*SCALE**WORK**INFO***Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **154** of file **dla_tgstein_l2.f90**.

### subroutine dla_tgstein_l3 (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

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

**Purpose:**

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

**Attention**The algorithm is implemented using BLAS level 3 operations.

**Parameters***TRANS*TRANS is CHARACTER(1) Specifies the form of the system of equations with respect to A, B, and C: == 'N': Equation (1) is solved. == 'T': Equation (2) is solved.

*M*M is INTEGER The order of the matrices A and C. M >= 0.

*A*A is 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**LDX*LDX is INTEGER The leading dimension of the array X. LDX >= max(1,M).

*SCALE**WORK**INFO***Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **153** of file **dla_tgstein_l3.f90**.

### subroutine dla_tgstein_l3_2s (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

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

**Purpose:**

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

**Attention**The algorithm is implemented using BLAS level 3 operations with two level blocking.

**Parameters***TRANS**M*M is INTEGER The order of the matrices A and C. M >= 0.

*A*A is DOUBLE PRECISION array, dimension (LDA,M) The matrix A must be (quasi-) upper triangular.

*LDA*LDA is INTEGER The leading dimension of the array A. LDA >= max(1,M).

*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**LDX*LDX is INTEGER The leading dimension of the array X. LDX >= max(1,M).

*SCALE**WORK**INFO***Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **153** of file **dla_tgstein_l3_2stage.f90**.

### recursive subroutine dla_tgstein_recursive (character, dimension(1) trans, integer m, double precision, dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x, integer ldx, double precision scale, double precision, dimension(*) work, integer info)

Recursive Blocking Algorithm for the generalized Stein equation.

**Purpose:**

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

**Attention**The algorithm is implemented using recursive blocking.

**Parameters***TRANS**M*M is INTEGER The order of the matrices A and C. M >= 0.

*A*A is DOUBLE PRECISION array, dimension (LDA,M) The matrix A must be (quasi-) upper triangular.

*LDA*LDA is INTEGER The leading dimension of the array A. LDA >= max(1,M).

*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**LDX*LDX is INTEGER The leading dimension of the array X. LDX >= max(1,M).

*SCALE**WORK*WORK is DOUBLE PRECISION array, dimension M*M Workspace for the algorithm.

*INFO*INFO is INTEGER == 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: The equation is not solved correctly. One of the arising inner system got singular.

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **140** of file **dla_tgstein_recursive.f90**.

## Author

Generated automatically by Doxygen for MEPACK from the source code.