# sglggsylv - Man Page

## Name

sglggsylv — Single Precision

— Single Precision routines for generalized Sylvester equations.

## Synopsis

### Functions

subroutine **sla_ggcsylv** (facta, factb, transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, qa, ldqa, za, ldza, qb, ldqb, zb, ldzb, e, lde, f, ldf, scale, work, ldwork, info)

Frontend for the solution of Coupled Generalized Sylvester Equations.

subroutine **sla_ggcsylv_dual** (facta, factb, transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, qa, ldqa, za, ldza, qb, ldqb, zb, ldzb, e, lde, f, ldf, scale, work, ldwork, info)

Frontend for the solution of the dual Coupled Generalized Sylvester Equations.

subroutine **sla_ggsylv** (facta, factb, transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, qa, ldqa, za, ldza, qb, ldqb, zb, ldzb, x, ldx, scale, work, ldwork, info)

Frontend for the solution of Generalized Sylvester Equations.

subroutine **sla_ggcsylv_dual_refine** (transa, transb, guess, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, r, ldr, l, ldl, e, lde, f, ldf, as, ldas, bs, ldbs, cs, ldcs, ds, ldds, q, ldq, z, ldz, u, ldu, v, ldv, maxit, tau, convlog, work, ldwork, info)

Iterative Refinement for the dual Coupled Generalized Sylvester Equations.

subroutine **sla_ggcsylv_refine** (transa, transb, guess, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, r, ldr, l, ldl, e, lde, f, ldf, as, ldas, bs, ldbs, cs, ldcs, ds, ldds, q, ldq, z, ldz, u, ldu, v, ldv, maxit, tau, convlog, work, ldwork, info)

Iterative Refinement for the Coupled Generalized Sylvester Equations.

subroutine **sla_ggsylv_refine** (transa, transb, guess, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, y, ldy, as, ldas, bs, ldbs, cs, ldcs, ds, ldds, q, ldq, z, ldz, u, ldu, v, ldv, maxit, tau, convlog, work, ldwork, info)

Iterative Refinement for the Generalized Sylvester Equations.

## Detailed Description

Single Precision routines for generalized Sylvester equations.

This subsection contains the solvers for generalized Sylvester equations with general coefficient matrices in single precision arithmetic. The generalized Schur decompositions are computed in single precision with the help of LAPACK.

## Function Documentation

### subroutine sla_ggcsylv (character, dimension(1) facta, character, dimension(1) factb, character, dimension(1) transa, character, dimension(1) transb, real sgn1, real sgn2, integer m, integer n, real, dimension(lda,*) a, integer lda, real, dimension(ldb, *) b, integer ldb, real, dimension(ldc, *) c, integer ldc, real, dimension(ldd,*) d, integer ldd, real, dimension(ldqa, *) qa, integer ldqa, real, dimension(ldza, *) za, integer ldza, real, dimension(ldqb, *) qb, integer ldqb, real, dimension(ldzb, *) zb, integer ldzb, real, dimension(lde, *) e, integer lde, real, dimension(ldf,*) f, integer ldf, real scale, real, dimension(*) work, integer ldwork, integer info)

Frontend for the solution of Coupled Generalized Sylvester Equations.

**Purpose:**

SLA_GGCSYLV solves a coupled generalized Sylvester equation of the following forms op1(A) * R + SGN1 * L * op2(B) = SCALE * E (1) op1(C) * R + SGN2 * L * op2(D) = SCALE * F where (A,C) is a M-by-M matrix pencil and (B,D) is a N-by-N matrix pencil. The right hand side (E,F) and the solution (R,L) are M-by-N matrix pencils. The pencils (A,C) and (B,D) can be either given as general unreduced matrices or in terms of their generalized Schur decomposition. If they are given as general matrices their generalized Schur decomposition will be computed.

**Parameters***FACTA*FACTA is CHARACTER Specifies how the matrix pencil (A,C) is given. == 'N': The matrix pencil (A,C) is given as a general matrices and its Schur decomposition A = QA*S*ZA**T, C = QA*R*ZA**T will be computed. == 'F': The matrix pencil (A,C) is already in generalized Schur form and S, R, QA, and ZA are given.

*FACTB*FACTB is CHARACTER Specifies how the matrix pencil (B,D) is given. == 'N': The matrix pencil (B,D) is given as a general matrices and its Schur decomposition B = QB*U*ZB**T, D = QB*V*ZB**T will be computed. == 'F': The matrix pencil (B,D) is already in generalized Schur form and U, V, QB, and ZB are given.

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

*TRANSB*TRANSB is CHARACTER Specifies the form of the system of equations with respect to B and D: == 'N': op2(B) = B, == 'T': op2(B) = B**T

*SGN1*SGN1 is REAL, allowed values: +/-1 Specifies the sign between in the first equation.

*SGN2*SGN2 is REAL, allowed values: +/-1 Specifies the sign between in the second equation.

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

*N*N is INTEGER The order of the matrices B and D. N >= 0.

*A*A is REAL array, dimension (LDA,M) If FACT == 'N', the matrix A is a general matrix and it is overwritten with the (quasi-) upper triangular factor S of the Schur decomposition of (A,C). If FACT == 'F', the matrix A contains its (quasi-) upper triangular matrix S of the Schur decomposition of (A,C).

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

*B*B is REAL array, dimension (LDB,N) If FACT == 'N', the matrix B is a general matrix and it is overwritten with the (quasi-) upper triangular factor U of the Schur decomposition of (B,D). If FACT == 'F', the matrix B contains its (quasi-) upper triangular matrix U of the Schur decomposition of (B,D).

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

*C*C is REAL array, dimension (LDC,M) If FACT == 'N', the matrix C is a general matrix and it is overwritten with the upper triangular factor R of the Schur decomposition of (A,C). If FACT == 'F', the matrix C contains its upper triangular matrix R of the Schur decomposition of (A,C).

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

*D*D is REAL array, dimension (LDD,N) If FACT == 'N', the matrix D is a general matrix and it is overwritten with the upper triangular factor V of the Schur decomposition of (B,D). If FACT == 'F', the matrix D contains its upper triangular matrix V of the Schur decomposition of (B,D).

*LDD*LDD is INTEGER The leading dimension of the array D. LDD >= max(1,N).

*QA*QA is REAL array, dimension (LDQA,M) If FACT == 'N', the matrix QA is an empty M-by-M matrix on input and contains the left Schur vectors of (A,C) on output. If FACT == 'F', the matrix QA contains the left Schur vectors of (A,C).

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

*ZA*ZA is REAL array, dimension (LDZA,M) If FACT == 'N', the matrix ZA is an empty M-by-M matrix on input and contains the right Schur vectors of (A,C) on output. If FACT == 'F', the matrix ZA contains the right Schur vectors of (A,C).

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

*QB*QB is REAL array, dimension (LDQB,N) If FACT == 'N', the matrix QB is an empty N-by-N matrix on input and contains the left Schur vectors of (B,D) on output. If FACT == 'F', the matrix QB contains the left Schur vectors of (B,D).

*LDQB*LDQB is INTEGER The leading dimension of the array QB. LDQB >= max(1,N).

*ZB*ZB is REAL array, dimension (LDZB,N) If FACT == 'N', the matrix ZB is an empty N-by-N matrix on input and contains the right Schur vectors of (B,D) on output. If FACT == 'F', the matrix ZB contains the right Schur vectors of (B,D).

*LDZB*LDZB is INTEGER The leading dimension of the array ZB. LDZB >= max(1,N).

*E*E is REAL array, dimension (LDE,N) On input, the matrix E contains the right hand side E. On output, the matrix E contains the solution R.

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

*F*F is REAL array, dimension (LDF,N) On input, the matrix F contains the right hand side F. On output, the matrix F contains the solution L.

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

*SCALE*SCALE is REAL SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.

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

*LDWORK*LDWORK is INTEGER If LDWORK == -1 on input 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: successful exit = 1: SGGES failed = 2: SLA_SORT_GEV failed = 3: Inner solver failed < 0: if INFO = -i, the i-th argument had an illegal value

**See also**SLA_TGCSYLV_DAG

DLA_TGCSYLV_LEVEL3

SLA_TGCSYLV_L3_2S

SLA_TGCSYLV_L2_UNOPT

SLA_TGCSYLV_L2

SLA_TGCSYLV_L2_REORDER

SLA_TGCSYLV_L2_LOCAL_COPY_32

SLA_TGCSYLV_L2_LOCAL_COPY_64

SLA_TGCSYLV_L2_LOCAL_COPY_96

SLA_TGCSYLV_L2_LOCAL_COPY_128

SLA_TGCSYLV_L2_LOCAL_COPY

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **310** of file **sla_ggcsylv.f90**.

### subroutine sla_ggcsylv_dual (character, dimension(1) facta, character, dimension(1) factb, character, dimension(1) transa, character, dimension(1) transb, real sgn1, real sgn2, integer m, integer n, real, dimension(lda,*) a, integer lda, real, dimension(ldb, *) b, integer ldb, real, dimension(ldc, *) c, integer ldc, real, dimension(ldd,*) d, integer ldd, real, dimension(ldqa, *) qa, integer ldqa, real, dimension(ldza, *) za, integer ldza, real, dimension(ldqb, *) qb, integer ldqb, real, dimension(ldzb, *) zb, integer ldzb, real, dimension(lde, *) e, integer lde, real, dimension(ldf,*) f, integer ldf, real scale, real, dimension(*) work, integer ldwork, integer info)

Frontend for the solution of the dual Coupled Generalized Sylvester Equations.

**Purpose:**

SLA_GGCSYLV_DUAL_L3 solves a generalized coupled Sylvester equation of the following form op1(A)**T * R + op1(C)**T * L = SCALE * E (1) SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F where A and C are M-by-M matrices and B and D are N-by-N matrices. The right hand sides E, F and the solutions R, L are M-by-N matrices. The equation (1) is the dual to the generalized coupled Sylvester equation op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2) op1(C) * R + SGN2 * L * op2(D) = SCALE * F The equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields | kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E | Z X = | |*| | = | | | kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F | Regarding Z**T one obtains | kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E | Z**T X = | |*| | = | | | SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F | which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2).

**Parameters***FACTA*FACTA is CHARACTER Specifies how the matrix pencil (A,C) is given. == 'N': The matrix pencil (A,C) is given as a general matrices and its Schur decomposition A = QA*S*ZA**T, C = QA*R*ZA**T will be computed. == 'F': The matrix pencil (A,C) is already in generalized Schur form and S, R, QA, and ZA are given.

*FACTB*FACTB is CHARACTER Specifies how the matrix pencil (B,D) is given. == 'N': The matrix pencil (B,D) is given as a general matrices and its Schur decomposition B = QB*U*ZB**T, D = QB*V*ZB**T will be computed. == 'F': The matrix pencil (B,D) is already in generalized Schur form and U, V, QB, and ZB are given.

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

*TRANSB*TRANSB is CHARACTER Specifies the form of the system of equations with respect to B and D: == 'N': op2(B) = B, == 'T': op2(B) = B**T

*SGN1*SGN1 is REAL, allowed values: +/-1 Specifies the sign between in the first equation.

*SGN2*SGN2 is REAL, allowed values: +/-1 Specifies the sign between in the second equation.

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

*N*N is INTEGER The order of the matrices B and D. N >= 0.

*A*A is REAL array, dimension (LDA,M) If FACT == 'N', the matrix A is a general matrix and it is overwritten with the (quasi-) upper triangular factor S of the Schur decomposition of (A,C). If FACT == 'F', the matrix A contains its (quasi-) upper triangular matrix S of the Schur decomposition of (A,C).

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

*B*B is REAL array, dimension (LDB,N) If FACT == 'N', the matrix B is a general matrix and it is overwritten with the (quasi-) upper triangular factor U of the Schur decomposition of (B,D). If FACT == 'F', the matrix B contains its (quasi-) upper triangular matrix U of the Schur decomposition of (B,D).

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

*C*C is REAL array, dimension (LDC,M) If FACT == 'N', the matrix C is a general matrix and it is overwritten with the upper triangular factor R of the Schur decomposition of (A,C). If FACT == 'F', the matrix C contains its upper triangular matrix R of the Schur decomposition of (A,C).

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

*D*D is REAL array, dimension (LDD,N) If FACT == 'N', the matrix D is a general matrix and it is overwritten with the upper triangular factor V of the Schur decomposition of (B,D). If FACT == 'F', the matrix D contains its upper triangular matrix V of the Schur decomposition of (B,D).

*LDD*LDD is INTEGER The leading dimension of the array D. LDD >= max(1,N).

*QA*QA is REAL array, dimension (LDQA,M) If FACT == 'N', the matrix QA is an empty M-by-M matrix on input and contains the left Schur vectors of (A,C) on output. If FACT == 'F', the matrix QA contains the left Schur vectors of (A,C).

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

*ZA*ZA is REAL array, dimension (LDZA,M) If FACT == 'N', the matrix ZA is an empty M-by-M matrix on input and contains the right Schur vectors of (A,C) on output. If FACT == 'F', the matrix ZA contains the right Schur vectors of (A,C).

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

*QB*QB is REAL array, dimension (LDQB,N) If FACT == 'N', the matrix QB is an empty N-by-N matrix on input and contains the left Schur vectors of (B,D) on output. If FACT == 'F', the matrix QB contains the left Schur vectors of (B,D).

*LDQB*LDQB is INTEGER The leading dimension of the array QB. LDQB >= max(1,N).

*ZB*ZB is REAL array, dimension (LDZB,N) If FACT == 'N', the matrix ZB is an empty N-by-N matrix on input and contains the right Schur vectors of (B,D) on output. If FACT == 'F', the matrix ZB contains the right Schur vectors of (B,D).

*LDZB*LDZB is INTEGER The leading dimension of the array ZB. LDZB >= max(1,N).

*E*E is REAL array, dimension (LDE,N) On input, the matrix E contains the right hand side E. On output, the matrix E contains the solution R.

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

*F*F is REAL array, dimension (LDF,N) On input, the matrix F contains the right hand side F. On output, the matrix F contains the solution L.

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

*SCALE*SCALE is REAL SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.

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

*LDWORK*LDWORK is INTEGER If LDWORK == -1 on input, 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: successful exit = 1: SGGES failed = 2: SLA_SORT_GEV failed = 3: Inner solver failed < 0: if INFO = -i, the i-th argument had an illegal value

**See also**SLA_TGCSYLV_DUAL_DAG

DLA_TGCSYLV_DUAL_LEVEL3

SLA_TGCSYLV_DUAL_L3_2S

SLA_TGCSYLV_DUAL_L2

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_32

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_64

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_96

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_128

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **326** of file **sla_ggcsylv_dual.f90**.

### subroutine sla_ggcsylv_dual_refine (character, dimension(1) transa, character, dimension(1) transb, character, dimension(1) guess, real sgn1, real sgn2, integer m, integer n, real, dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer ldb, real, dimension(ldc, *) c, integer ldc, real, dimension(ldd, *) d, integer ldd, real, dimension(ldr, *) r, integer ldr, real, dimension(ldl, *) l, integer ldl, real, dimension ( lde , * ) e, integer lde, real, dimension( ldf, *) f, integer ldf, real, dimension(ldas, *) as, integer ldas, real, dimension(ldbs,*) bs, integer ldbs, real, dimension(ldcs, *) cs, integer ldcs, real, dimension(ldds, *) ds, integer ldds, real, dimension(ldq, *) q, integer ldq, real, dimension(ldz, *) z, integer ldz, real, dimension(ldu, *) u, integer ldu, real, dimension(ldv, *) v, integer ldv, integer maxit, real tau, real, dimension(*) convlog, real, dimension(*) work, integer ldwork, integer info)

Iterative Refinement for the dual Coupled Generalized Sylvester Equations.

**Purpose:**

SLA_GGCSYLV_DUAL_REFINE solves a coupled generalized Sylvester equation of the following forms op1(A)**T * R + op1(C)**T * L = SCALE * E (1) SGN1 * R * op2(B)**T + SGN2 * L * op2(D)** T = SCALE * F where A and C are M-by-M matrices and B and D are N-by-N matrices. The right hand sides E, F and the solutions R, L are M-by-N matrices. The equation (1) is the dual to the generalized coupled Sylvester equation op1(A) * R + SGN1 * L * op2(B) = SCALE * E (2) op1(C) * R + SGN2 * L * op2(D) = SCALE * F The equation (1) is the dual one to equation (2) with respect to the underlying linear system. Let Z be the matrix formed by rewriting (2) into its Kronecker form. This yields | kron(I, op1(A)) SGN1*kron(op2(B)**T, I) | | Vec R | | Vec E | Z X = | |*| | = | | | kron(I, op1(C)) SGN2*kron(op2(D)**T, I) | | Vec L | | Vec F | Regarding Z**T one obtains | kron(I, op1(A)**T ) kron(I, op1(C)**T) | | Vec R | | Vec E | Z**T X = | |*| | = | | | SGN1*kron(op2(B), I) SGN2*kron(op2(D), I) | | Vec L | | Vec F | which belongs to the Sylvester equation (1). For this reason the parameters TRANSA and TRANSB are expressed in terms of the Sylvester equation (2). The pencils (A,C) and (B,D) need to be given in the original form as well as in their generalized Schur decomposition since both are required in the iterative refinement procedure.

**Parameters***TRANSA*TRANSA is CHARACTER Specifies the form of the system of equations with respect to A and C : == 'N': op1(A) = A == 'T': op1(A) = A**T

*TRANSB*TRANSB is CHARACTER Specifies the form of the system of equations with respect to B and D: == 'N': op2(B) = B, == 'T': op2(B) = B**T

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

*SGN1*SGN1 is REAL, allowed values: +/-1 Specifies the sign between in the first equation.

*SGN2*SGN2 is REAL, allowed values: +/-1 Specifies the sign between in the second equation.

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

*N*N is INTEGER The order of the matrices B and D. N >= 0.

*A*A is REAL 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 REAL array, dimension (LDB,N) The array B contains the original matrix B defining the equation.

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

*C*C is REAL array, dimension (LDC,M) The array C contains the original matrix C defining the equation.

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

*D*D is REAL array, dimension (LDD,N) The array D contains the original matrix D defining the equation.

*LDD*LDD is INTEGER The leading dimension of the array D. LDD >= max(1,N).

*R*R is REAL array, dimension (LDR,N) On input, the array R contains the initial guess R0 for the first solution matrix. On output, the array R contains the refine solution matrix R.

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

*L*L is REAL array, dimension (LDL,N) On input, the array L contains the initial guess for the second solution matrix. On output, the array L contains the solution L.

*LDL*LDL is INTEGER The leading dimension of the array L. LDF >= max(1,M).

*E*E is REAL array, dimension (LDE,N) On input, the array E contains the right hand side E.

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

*F*F is REAL array, dimension (LDF,N) On input, the array F contains the right hand side F.

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

*AS*AS is REAL 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 REAL array, dimension (LDBS,N) The array BS contains the generalized Schur decomposition of the B.

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

*CS*CS is REAL array, dimension (LDCS,M) The array CS contains the generalized Schur decomposition of the C.

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

*DS*DS is REAL array, dimension (LDDS,N) The array DS contains the generalized Schur decomposition of the D.

*LDDS*LDDS is INTEGER The leading dimension of the array DS. LDDS >= max(1,N).

*Q*Q is REAL array, dimension (LDQ,M) The array Q contains the left generalized Schur vectors for (A,C) as returned by SGGES.

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

*Z*Z is REAL array, dimension (LDZ,M) The array Z contains the right generalized Schur vectors for (A,C) as returned by SGGES.

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

*U*U is REAL array, dimension (LDU,N) The array U contains the left generalized Schur vectors for (B,D) as returned by SGGES.

*LDU*LDU is INTEGER The leading dimension of the array U. LDU >= max(1,N).

*V*V is REAL array, dimension (LDV,N) The array V contains the right generalized Schur vectors for (B,D) as returned by SGGES.

*LDV*LDV is INTEGER The leading dimension of the array V. LDV >= max(1,N).

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

*TAU*TAU is REAL 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 REAL array, dimension (MAXIT) The CONVLOG array contains the convergence history of the iterative refinement. CONVLOG(I) contains the maximum relative residual of both equations before it is solved for the I-th time.

*WORK*WORK is REAL array, dimension (MAX(1,LDWORK)) Workspace for the algorithm. The optmimal 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**SLA_TGCSYLV_DUAL_DAG

DLA_TGCSYLV_DUAL_LEVEL3

SLA_TGCSYLV_DUAL_L3_2S

SLA_TGCSYLV_DUAL_L2

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_32

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_64

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_96

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_128

SLA_TGCSYLV_DUAL_L2_LOCAL_COPY

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **399** of file **sla_ggcsylv_dual_refine.f90**.

### subroutine sla_ggcsylv_refine (character, dimension(1) transa, character, dimension(1) transb, character, dimension(1) guess, real sgn1, real sgn2, integer m, integer n, real, dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer ldb, real, dimension(ldc, *) c, integer ldc, real, dimension(ldd, *) d, integer ldd, real, dimension(ldr, *) r, integer ldr, real, dimension(ldl, *) l, integer ldl, real, dimension ( lde , * ) e, integer lde, real, dimension( ldf, *) f, integer ldf, real, dimension(ldas, *) as, integer ldas, real, dimension(ldbs,*) bs, integer ldbs, real, dimension(ldcs, *) cs, integer ldcs, real, dimension(ldds, *) ds, integer ldds, real, dimension(ldq, *) q, integer ldq, real, dimension(ldz, *) z, integer ldz, real, dimension(ldu, *) u, integer ldu, real, dimension(ldv, *) v, integer ldv, integer maxit, real tau, real, dimension(*) convlog, real, dimension(*) work, integer ldwork, integer info)

Iterative Refinement for the Coupled Generalized Sylvester Equations.

**Purpose:**

SLA_GGCSYLV_REFINE solves a coupled generalized Sylvester equation of the following forms op1(A) * R + SGN1 * L * op2(B) = E (1) op1(C) * R + SGN2 * L * op2(D) = F with iterative refinement, Thereby (A,C) is a M-by-M matrix pencil and (B,D) is a N-by-N matrix pencil. The right hand side (E,F) and the solution (R,L) are M-by-N matrices. The pencils (A,C) and (B,D) need to be given in the original form as well as in their generalized Schur decomposition since both are required in the iterative refinement procedure.

**Parameters***TRANSA**TRANSB**GUESS*GUESS is CHARACTER Specifies whether (R,L) contains an initial guess or nor not. = 'I': (R, L) contains an initial guess = 'N': No initial guess, (R,L) is set to zero at the begin of the iteration.

*SGN1*SGN1 is REAL, allowed values: +/-1 Specifies the sign between in the first equation.

*SGN2*SGN2 is REAL, allowed values: +/-1 Specifies the sign between in the second equation.

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

*N*N is INTEGER The order of the matrices B and D. N >= 0.

*A*A is REAL 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 REAL array, dimension (LDB,N) The array B contains the original matrix B defining the equation.

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

*C*C is REAL array, dimension (LDC,M) The array C contains the original matrix C defining the equation.

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

*D*D is REAL array, dimension (LDD,N) The array D contains the original matrix D defining the equation.

*LDD*LDD is INTEGER The leading dimension of the array D. LDD >= max(1,N).

*R*R is REAL array, dimension (LDR,N) On input, the array R contains the initial guess R0 for the first solution matrix. On output, the array R contains the refine solution matrix R.

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

*L*L is REAL array, dimension (LDL,N) On input, the array L contains the initial guess for the second solution matrix. On output, the array L contains the solution L.

*LDL*LDL is INTEGER The leading dimension of the array L. LDF >= max(1,M).

*E*E is REAL array, dimension (LDE,N) On input, the array E contains the right hand side E.

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

*F*F is REAL array, dimension (LDF,N) On input, the array F contains the right hand side F.

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

*AS*AS is REAL 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 REAL array, dimension (LDBS,N) The array BS contains the generalized Schur decomposition of the B.

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

*CS*CS is REAL array, dimension (LDCS,M) The array CS contains the generalized Schur decomposition of the C.

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

*DS*DS is REAL array, dimension (LDDS,N) The array DS contains the generalized Schur decomposition of the D.

*LDDS*LDDS is INTEGER The leading dimension of the array DS. LDDS >= max(1,N).

*Q*Q is REAL array, dimension (LDQ,M) The array Q contains the left generalized Schur vectors for (A,C) as returned by SGGES.

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

*Z*Z is REAL array, dimension (LDZ,M) The array Z contains the right generalized Schur vectors for (A,C) as returned by SGGES.

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

*U*U is REAL array, dimension (LDU,N) The array U contains the left generalized Schur vectors for (B,D) as returned by SGGES.

*LDU*LDU is INTEGER The leading dimension of the array U. LDU >= max(1,N).

*V*V is REAL array, dimension (LDV,N) The array V contains the right generalized Schur vectors for (B,D) as returned by SGGES.

*LDV*LDV is INTEGER The leading dimension of the array V. LDV >= max(1,N).

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

*TAU*TAU is REAL 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 REAL array, dimension (MAXIT) The CONVLOG array contains the convergence history of the iterative refinement. CONVLOG(I) contains the maximum relative residual of both equations before it is solved for the I-th time.

*WORK**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**SLA_TGCSYLV_DAG

DLA_TGCSYLV_LEVEL3

SLA_TGCSYLV_L3_2S

SLA_TGCSYLV_L2_UNOPT

SLA_TGCSYLV_L2

SLA_TGCSYLV_L2_REORDER

SLA_TGCSYLV_L2_LOCAL_COPY_32

SLA_TGCSYLV_L2_LOCAL_COPY_64

SLA_TGCSYLV_L2_LOCAL_COPY_96

SLA_TGCSYLV_L2_LOCAL_COPY_128

SLA_TGCSYLV_L2_LOCAL_COPY

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **381** of file **sla_ggcsylv_refine.f90**.

### subroutine sla_ggsylv (character, dimension(1) facta, character, dimension(1) factb, character, dimension(1) transa, character, dimension(1) transb, real sgn, integer m, integer n, real, dimension(lda,*) a, integer lda, real, dimension(ldb, *) b, integer ldb, real, dimension(ldc, *) c, integer ldc, real, dimension(ldd,*) d, integer ldd, real, dimension(ldqa, *) qa, integer ldqa, real, dimension(ldza, *) za, integer ldza, real, dimension(ldqb, *) qb, integer ldqb, real, dimension(ldzb, *) zb, integer ldzb, real, dimension(ldx, *) x, integer ldx, real scale, real, dimension(*) work, integer ldwork, integer info)

Frontend for the solution of Generalized Sylvester Equations.

**Purpose:**

SLA_GGSYLV solves a generalized Sylvester equation of the following forms op1(A) * X * op2(B) + op1(C) * X * op2(D) = SCALE * Y (1) or op1(A) * X * op2(B) - op1(C) * X * op2(D) = SCALE * Y (2) where (A,C) is a M-by-M matrix pencil and (B,D) is a N-by-N matrix pencil. The right hand side Y and the solution X M-by-N matrices. The pencils (A,C) and (B,D) can be either given as general unreduced matrices or in terms of their generalized Schur decomposition. If they are given as general matrices their generalized Schur decomposition will be computed.

**Parameters***FACTA*FACTA is CHARACTER Specifies how the matrix pencil (A,C) is given. == 'N': The matrix pencil (A,C) is given as a general matrices and its Schur decomposition A = QA*S*ZA**T, C = QA*R*ZA**T will be computed. == 'F': The matrix pencil (A,C) is already in generalized Schur form and S, R, QA, and ZA are given.

*FACTB*FACTB is CHARACTER Specifies how the matrix pencil (B,D) is given. == 'N': The matrix pencil (B,D) is given as a general matrices and its Schur decomposition B = QB*U*ZB**T, D = QB*V*ZB**T will be computed. == 'F': The matrix pencil (B,D) is already in generalized Schur form and U, V, QB, and ZB are given.

*TRANSA**TRANSB**SGN*SGN is REAL, allowed values: +/-1 Specifies the sign between the two parts of the Sylvester equation. = 1 : Solve Equation (1) == -1: Solve Equation (2)

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

*N*N is INTEGER The order of the matrices B and D. N >= 0.

*A*A is REAL array, dimension (LDA,M) If FACT == 'N', the matrix A is a general matrix and it is overwritten with the (quasi-) upper triangular factor S of the Schur decomposition of (A,C). If FACT == 'F', the matrix A contains its (quasi-) upper triangular matrix S of the Schur decomposition of (A,C).

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

*B*B is REAL array, dimension (LDB,N) If FACT == 'N', the matrix B is a general matrix and it is overwritten with the (quasi-) upper triangular factor U of the Schur decomposition of (B,D). If FACT == 'F', the matrix B contains its (quasi-) upper triangular matrix U of the Schur decomposition of (B,D).

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

*C*C is REAL array, dimension (LDC,M) If FACT == 'N', the matrix C is a general matrix and it is overwritten with the upper triangular factor R of the Schur decomposition of (A,C). If FACT == 'F', the matrix C contains its upper triangular matrix R of the Schur decomposition of (A,C).

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

*D*D is REAL array, dimension (LDD,N) If FACT == 'N', the matrix D is a general matrix and it is overwritten with the upper triangular factor V of the Schur decomposition of (B,D). If FACT == 'F', the matrix D contains its upper triangular matrix V of the Schur decomposition of (B,D).

*LDD*LDD is INTEGER The leading dimension of the array D. LDD >= max(1,N).

*QA*QA is REAL array, dimension (LDQA,M) If FACT == 'N', the matrix QA is an empty M-by-M matrix on input and contains the left Schur vectors of (A,C) on output. If FACT == 'F', the matrix QA contains the left Schur vectors of (A,C).

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

*ZA*ZA is REAL array, dimension (LDZA,M) If FACT == 'N', the matrix ZA is an empty M-by-M matrix on input and contains the right Schur vectors of (A,C) on output. If FACT == 'F', the matrix ZA contains the right Schur vectors of (A,C).

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

*QB*QB is REAL array, dimension (LDQB,N) If FACT == 'N', the matrix QB is an empty N-by-N matrix on input and contains the left Schur vectors of (B,D) on output. If FACT == 'F', the matrix QB contains the left Schur vectors of (B,D).

*LDQB*LDQB is INTEGER The leading dimension of the array QB. LDQB >= max(1,N).

*ZB*ZB is REAL array, dimension (LDZB,N) If FACT == 'N', the matrix ZB is an empty N-by-N matrix on input and contains the right Schur vectors of (B,D) on output. If FACT == 'F', the matrix ZB contains the right Schur vectors of (B,D).

*LDZB*LDZB is INTEGER The leading dimension of the array ZB. LDZB >= max(1,N).

*X*X is REAL array, dimension (LDX,N) On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) Right hand side Y and the solution X are M-by-N matrices.

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

*SCALE*SCALE is REAL SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.

*WORK*WORK is REAL array, dimension (MAX(1,LDWORK)) Workspace for the algorithm. The optmimal workspace is given either by \ref mepack_memory_frontend or a previous call to the this routine with LDWORK === -1.

*LDWORK*LDWORK is INTEGER Size of the workspace for the algorithm. This can be determined by a call \ref mepack_memory_frontend . Alternatively, if LDWORK == -1 on input, the subroutine will return the required size of the workspace in LDWORK without performing any computations.

*INFO*INFO is INTEGER == 0: successful exit = 1: SGGES failed = 2: SLA_SORT_GEV failed = 3: Inner solver failed < 0: if INFO = -i, the i-th argument had an illegal value

**See also**SLA_TGSYLV_DAG

SLA_TGSYLV_L3_COLWISE

SLA_TGSYLV_L3_2S

SLA_TGSYLV_L2_REORDER

SLA_TGSYLV_L2

SLA_TGSYLV_L2_COLWISE

SLA_TGSYLV_L2_LOCAL_COPY_32

SLA_TGSYLV_L2_LOCAL_COPY_64

SLA_TGSYLV_L2_LOCAL_COPY_96

SLA_TGSYLV_L2_LOCAL_COPY_128

SLA_TGSYLV_L2_LOCAL_COPY

SLA_TGSYLV_GARDINER_LAUB

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **299** of file **sla_ggsylv.f90**.

### subroutine sla_ggsylv_refine (character, dimension(1) transa, character, dimension(1) transb, character, dimension(1) guess, real sgn, integer m, integer n, real, dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer ldb, real, dimension(ldc, *) c, integer ldc, real, dimension(ldd, *) d, integer ldd, real, dimension ( ldx , * ) x, integer ldx, real, dimension (ldy, *) y, integer ldy, real, dimension(ldas, *) as, integer ldas, real, dimension(ldbs,*) bs, integer ldbs, real, dimension(ldcs, *) cs, integer ldcs, real, dimension(ldds, *) ds, integer ldds, real, dimension(ldq, *) q, integer ldq, real, dimension(ldz, *) z, integer ldz, real, dimension(ldu, *) u, integer ldu, real, dimension(ldv, *) v, integer ldv, integer maxit, real tau, real, dimension(*) convlog, real, dimension(*) work, integer ldwork, integer info)

Iterative Refinement for the Generalized Sylvester Equations.

**Purpose:**

SLA_GGSYLV_REFINE solves a generalized Sylvester equation of the following forms op1(A) * X * op2(B) + SGN * op1(C) * X * op2(D) = Y (1) with iterative refinement, Thereby (A,C) is a M-by-M matrix pencil and (B,D) is a N-by-N matrix pencil. The right hand side Y and the solution X are M-by-N matrices. The pencils (A,C) and (B,D) need to be given in the original form as well as in their generalized Schur decomposition since both are required in the iterative refinement procedure.

**Parameters***TRANSA**TRANSB**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.

*SGN*SGN is REAL, allowed values: +/-1 Specifies the sign between in the first equation.

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

*N*N is INTEGER The order of the matrices B and D. N >= 0.

*A*A is REAL array, dimension (LDA,M) The array A contains the original matrix A defining the eqaution.

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

*B*B is REAL array, dimension (LDB,N) The array B contains the original matrix B defining the eqaution.

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

*C*C is REAL array, dimension (LDC,M) The array C contains the original matrix C defining the eqaution.

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

*D*D is REAL array, dimension (LDD,N) The array D contains the original matrix D defining the eqaution.

*LDD*LDD is INTEGER The leading dimension of the array D. LDD >= max(1,N).

*X*X is REAL array, dimension (LDX,N) 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 REAL array, dimension (LDY,N) 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 REAL 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 REAL array, dimension (LDBS,N) The array BS contains the generalized Schur decomposition of the B.

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

*CS*CS is REAL array, dimension (LDCS,M) The array CS contains the generalized Schur decomposition of the C.

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

*DS*DS is REAL array, dimension (LDDS,N) The array DS contains the generalized Schur decomposition of the D.

*LDDS*LDDS is INTEGER The leading dimension of the array DS. LDDS >= max(1,N).

*Q*Q is REAL array, dimension (LDQ,M) The array Q contains the left generalized Schur vectors for (A,C) as returned by SGGES.

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

*Z*Z is REAL array, dimension (LDZ,M) The array Z contains the right generalized Schur vectors for (A,C) as returned by SGGES.

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

*U*U is REAL array, dimension (LDU,N) The array U contains the left generalized Schur vectors for (B,D) as returned by SGGES.

*LDU*LDU is INTEGER The leading dimension of the array U. LDU >= max(1,N).

*V*V is REAL array, dimension (LDV,N) The array V contains the right generalized Schur vectors for (B,D) as returned by SGGES.

*LDV*LDV is INTEGER The leading dimension of the array V. LDV >= max(1,N).

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

*TAU*TAU is REAL 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 REAL 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**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**SLA_TGSYLV_DAG

DLA_TGSYLV_LEVEL3

SLA_TGSYLV_L3_2S

SLA_TGSYLV_L2_UNOPT

SLA_TGSYLV_L2

SLA_TGSYLV_L2_REORDER

SLA_TGSYLV_L2_LOCAL_COPY_32

SLA_TGSYLV_L2_LOCAL_COPY_64

SLA_TGSYLV_L2_LOCAL_COPY_96

SLA_TGSYLV_L2_LOCAL_COPY_128

SLA_TGSYLV_L2_LOCAL_COPY

SLA_TGSYLV_GARDINER_LAUB

**Author**Martin Koehler, MPI Magdeburg

**Date**Januar 2023

Definition at line **349** of file **sla_ggsylv_refine.f90**.

## Author

Generated automatically by Doxygen for MEPACK from the source code.