# sglgesylv - Man Page

## Name

sglgesylv — Single Precision

— Single Precision routines for standard Sylvester equations.

## Synopsis

### Functions

subroutine **sla_gesylv** (facta, factb, transa, transb, sgn, m, n, a, lda, b, ldb, qa, ldqa, qb, ldqb, x, ldx, scale, work, ldwork, info)

Frontend for the solution of Standard Sylvester Equations.

subroutine **sla_gesylv2** (facta, factb, transa, transb, sgn, m, n, a, lda, b, ldb, qa, ldqa, qb, ldqb, x, ldx, scale, work, ldwork, info)

Frontend for the solution of Standard Sylvester Equations.

subroutine **sla_gesylv2_refine** (transa, transb, guess, sgn, m, n, a, lda, b, ldb, x, ldx, y, ldy, as, ldas, bs, ldbs, q, ldq, u, ldu, maxit, tau, convlog, work, ldwork, info)

Iterative Refinement for the standard Sylvester Equations.

subroutine **sla_gesylv_refine** (transa, transb, guess, sgn, m, n, a, lda, b, ldb, x, ldx, y, ldy, as, ldas, bs, ldbs, q, ldq, u, ldu, maxit, tau, convlog, work, ldwork, info)

Iterative Refinement for the standard Sylvester Equations.

## Detailed Description

Single Precision routines for standard Sylvester equations.

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

## Function Documentation

### subroutine sla_gesylv (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(ldqa, *) qa, integer ldqa, real, dimension(ldqb, *) qb, integer ldqb, real, dimension(ldx, *) x, integer ldx, real scale, real, dimension(*) work, integer ldwork, integer info)

Frontend for the solution of Standard Sylvester Equations.

**Purpose:**

SLA_GESYLV solves a Sylvester equation of the following forms op1(A) * X + X * op2(B) = SCALE * Y (1) or op1(A) * X - X * op2(B) = SCALE * Y (2) where A is a M-by-M matrix and B is a N-by-N matrix. The right hand side Y and the solution X are M-by-N matrices. The matrices A and B can be either a general unreduced matrix or an upper Hessenberg form or a (quasi-) upper triangular factor. In the later case QA and QB provide the Schur-vectors of the matrices A and B.

**Parameters***FACTA*FACTA is CHARACTER Specifies how the matrix A is given. == 'N': The matrix A is given as a general matrix and its Schur decomposition A = QA*S*QA**T will be computed. == 'F': The matrix A is given as its Schur decomposition in terms of S and QA form A = QA*S*QA**T == 'H': The matrix A is given as an upper Hessenberg form and its Schur decomposition A = QA*S*QA**T will be computed

*FACTB*FACTB is CHARACTER Specifies how the matrix B is given. == 'N': The matrix B is given as a general matrix and its Schur decomposition B = QB*R*QB**T will be computed. == 'F': The matrix B is given as its Schur decomposition in terms of R and QB form B = QB*R*QB**T == 'H': The matrix B is given as an upper Hessenberg form and its Schur decomposition B = QB*R*QB**T will be computed

*TRANSA*TRANSA is CHARACTER Specifies the form of the system of equations with respect to A: == '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: == 'N': op2(B) = B, == 'T': op2(B) = B**T

*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 FACTA == 'N', the matrix A is a general matrix and it is overwritten with its schur decomposition S. If FACTA == 'F', the matrix A contains its (quasi-) upper triangular matrix S being the Schur decomposition of A. If FACTA == 'H', the matrix A is an upper Hessenberg matrix and it is overwritten with its schur decomposition S.

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

*B*B is REAL array, dimension (LDB,N) If FACTB == 'N', the matrix B is a general matrix and it is overwritten with its schur decomposition R. If FACTB == 'F', the matrix B contains its (quasi-) upper triangular matrix R being the Schur decomposition of B. If FACTB == 'H', the matrix B is an upper Hessenberg matrix and it is overwritten with its schur decomposition R.

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

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

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

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

*LDQB*LDQB is INTEGER The leading dimension of the array QB. LDQB >= 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: SHGEES failed = 2: SLA_SORT_EV failed = 3: SLA_TRLYAP_DAG failed < 0: if INFO = -i, the i-th argument had an illegal value

**See also**SLA_TRSYLV_L3

SLA_TRSYLV_L3_2S

SLA_TRSYLV_DAG

SLA_TRSYLV_L2_UNOPT

SLA_TRSYLV_L2

SLA_TRSYLV_L2_REORDER

SLA_TRSYLV_L2_LOCAL_COPY

SLA_TRSYLV_L2_LOCAL_COPY_32

SLA_TRSYLV_L2_LOCAL_COPY_64

SLA_TRSYLV_L2_LOCAL_COPY_96

SLA_TRSYLV_L2_LOCAL_COPY_128

**Author**Martin Koehler, MPI Magdeburg

**Date**January 2024

Definition at line **250** of file **sla_gesylv.f90**.

### subroutine sla_gesylv2 (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(ldqa, *) qa, integer ldqa, real, dimension(ldqb, *) qb, integer ldqb, real, dimension(ldx, *) x, integer ldx, real scale, real, dimension(*) work, integer ldwork, integer info)

Frontend for the solution of Standard Sylvester Equations.

**Purpose:**

SLA_GESYLV2 solves a Sylvester equation of the following forms op1(A) * X * op2(B) + X = SCALE * Y (1) or op1(A) * X * op2(B) - X = SCALE * Y (2) where A is a M-by-M matrix and B is a N-by-N matrix. The right hand side Y and the solution X are M-by-N matrices. The matrices A and B can be either a general unreduced matrix or an upper Hessenberg form or a (quasi-) upper triangular factor. In the later case QA and QB provide the Schur-vectors of the matrices A and B.

**Parameters***FACTA*FACTA is CHARACTER Specifies how the matrix A is given. == 'N': The matrix A is given as a general matrix and its Schur decomposition A = QA*S*QA**T will be computed. == 'F': The matrix A is given as its Schur decomposition in terms of S and QA form A = QA*S*QA**T == 'H': The matrix A is given as an upper Hessenberg form and its Schur decomposition A = QA*S*QA**T will be computed

*FACTB*FACTB is CHARACTER Specifies how the matrix B is given. == 'N': The matrix B is given as a general matrix and its Schur decomposition B = QB*R*QB**T will be computed. == 'F': The matrix B is given as its Schur decomposition in terms of R and QB form B = QB*R*QB**T == 'H': The matrix B is given as an upper Hessenberg form and its Schur decomposition B = QB*R*QB**T will be computed

*TRANSA*TRANSA is CHARACTER Specifies the form of the system of equations with respect to A: == '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: == 'N': op2(B) = B, == 'T': op2(B) = B**T

*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 FACTA == 'N', the matrix A is a general matrix and it is overwritten with its schur decomposition S. If FACTA == 'F', the matrix A contains its (quasi-) upper triangular matrix S being the Schur decomposition of A. If FACTA == 'H', the matrix A is an upper Hessenberg matrix and it is overwritten with its schur decomposition S.

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

*B*B is REAL array, dimension (LDB,N) If FACTB == 'N', the matrix B is a general matrix and it is overwritten with its schur decomposition R. If FACTB == 'F', the matrix B contains its (quasi-) upper triangular matrix R being the Schur decomposition of B. If FACTB == 'H', the matrix B is an upper Hessenberg matrix and it is overwritten with its schur decomposition R.

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

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

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

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

*LDQB*LDQB is INTEGER The leading dimension of the array QB. LDQB >= 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: SHGEES failed = 2: SLA_SORT_EV failed = 3: SLA_TRLYAP_DAG failed < 0: if INFO = -i, the i-th argument had an illegal value

**See also**SLA_TRSYLV2_L3

SLA_TRSYLV2_L3_2S

SLA_TRSYLV2_DAG

SLA_TRSYLV2_L2_UNOPT

SLA_TRSYLV2_L2

SLA_TRSYLV2_L2_REORDER

SLA_TRSYLV2_L2_LOCAL_COPY

SLA_TRSYLV2_L2_LOCAL_COPY_32

SLA_TRSYLV2_L2_LOCAL_COPY_64

SLA_TRSYLV2_L2_LOCAL_COPY_96

SLA_TRSYLV2_L2_LOCAL_COPY_128

**Author**Martin Koehler, MPI Magdeburg

**Date**January 2024

Definition at line **250** of file **sla_gesylv2.f90**.

### subroutine sla_gesylv2_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 ( ldx , * ) x, integer ldx, real, dimension(ldy, *) y, integer ldy, real, dimension(ldas, *) as, integer ldas, real, dimension(ldbs,*) bs, integer ldbs, real, dimension(ldq, *) q, integer ldq, real, dimension(ldu, *) u, integer ldu, integer maxit, real tau, real, dimension(*) convlog, real, dimension(*) work, integer ldwork, integer info)

Iterative Refinement for the standard Sylvester Equations.

**Purpose:**

SLA_GESYLV2_REFINE solves a Sylvester equation of the following forms op1(A) * X * op2(B) + X = Y (1) or op1(A) * X * op2(B) - X = Y (2) where A is a M-by-M matrix and B is a N-by-N matrix using iterative refinement. The right hand side Y and the solution X are M-by-N matrices. The matrix A and B need to be given in the original form as well as in their 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: == '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: == 'N': op2(B) = B, == 'T': op2(B) = B**T

*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 both terms.

*M*M is INTEGER The order of the matrix A. M >= 0.

*N*N is INTEGER The order of the matrix B. 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).

*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 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 Schur decomposition of B.

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

*Q*Q is REAL array, dimension (LDQ,M) The array Q contains the Schur vectors of A as returned by SGEES.

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

*U*U is REAL array, dimension (LDU,N) The array U contains the Schur vectors of B as returned by SGEES.

*LDU*LDU is INTEGER The leading dimension of the array U. LDU >= 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*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_TRSYLV2_DAG

DLA_TRSYLV2_LEVEL3

SLA_TRSYLV2_L3_2S

SLA_TRSYLV2_L2_UNOPT

SLA_TRSYLV2_L2

SLA_TRSYLV2_L2_REORDER

SLA_TRSYLV2_L2_LOCAL_COPY_32

SLA_TRSYLV2_L2_LOCAL_COPY_64

SLA_TRSYLV2_L2_LOCAL_COPY_96

SLA_TRSYLV2_L2_LOCAL_COPY_128

SLA_TRSYLV2_L2_LOCAL_COPY

**Author**Martin Koehler, MPI Magdeburg

**Date**January 2024

Definition at line **271** of file **sla_gesylv2_refine.f90**.

### subroutine sla_gesylv_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 ( ldx , * ) x, integer ldx, real, dimension(ldy, *) y, integer ldy, real, dimension(ldas, *) as, integer ldas, real, dimension(ldbs,*) bs, integer ldbs, real, dimension(ldq, *) q, integer ldq, real, dimension(ldu, *) u, integer ldu, integer maxit, real tau, real, dimension(*) convlog, real, dimension(*) work, integer ldwork, integer info)

Iterative Refinement for the standard Sylvester Equations.

**Purpose:**

SLA_GESYLV_REFINE solves a Sylvester equation of the following forms op1(A) * X + X * op2(B) = Y (1) or op1(A) * X - X * op2(B) = Y (2) where A is a M-by-M matrix and B is a N-by-N matrix using iterative refinement. The right hand side Y and the solution X are M-by-N matrices. The matrix A and B need to be given in the original form as well as in their 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 both terms.

*M*M is INTEGER The order of the matrix A. M >= 0.

*N*N is INTEGER The order of the matrix B. 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 B. LDB >= 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 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 Schur decomposition of B.

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

*Q*Q is REAL array, dimension (LDQ,M) The array Q contains the Schur vectors of A as returned by SGEES.

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

*U*U is REAL array, dimension (LDU,N) The array U contains the Schur vectors of B as returned by SGEES.

*LDU*LDU is INTEGER The leading dimension of the array U. LDU >= 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*WORK is REAL 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**SLA_TRSYLV_DAG

DLA_TRSYLV_LEVEL3

SLA_TRSYLV_L3_2S

SLA_TRSYLV_L2_UNOPT

SLA_TRSYLV_L2

SLA_TRSYLV_L2_REORDER

SLA_TRSYLV_L2_LOCAL_COPY_32

SLA_TRSYLV_L2_LOCAL_COPY_64

SLA_TRSYLV_L2_LOCAL_COPY_96

SLA_TRSYLV_L2_LOCAL_COPY_128

SLA_TRSYLV_L2_LOCAL_COPY

**Author**Martin Koehler, MPI Magdeburg

**Date**January 2024

Definition at line **272** of file **sla_gesylv_refine.f90**.

## Author

Generated automatically by Doxygen for MEPACK from the source code.