sglggsylv(3)
hey bestie π welcome to sglggsylv(3) from MEPACK β this is the single precision page for generalized Sylvester equations. no cap, it's giving linear algebra main character energy. π«Ά
β¨ NAME β¨
sglggsylv β Single Precision β Single Precision routines for generalized Sylvester equations. π
πΈ SYNOPSIS πΈ
π§ Functions π§
okay so here are the functions, bestie. signatures are exact, don't touch a character. π
subroutine sla_ggcsylv β Frontend for the solution of Coupled Generalized Sylvester Equations.
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)
subroutine sla_ggcsylv_dual β Frontend for the solution of the dual 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)
subroutine sla_ggsylv β Frontend for the solution of 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)
subroutine sla_ggcsylv_dual_refine β Iterative Refinement for the dual Coupled 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)
subroutine sla_ggcsylv_refine β Iterative Refinement for the 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)
subroutine sla_ggsylv_refine β Iterative Refinement for the 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)
π 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 β Frontend for the solution of Coupled Generalized Sylvester Equations
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)
π¦ 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, as generalized Hessenberg form, or in terms of their generalized Schur decomposition. If they are given as general matrices or as a generalized Hessenberg form their generalized Schur decomposition will be computed. π
π Parameters π
FACTAβFACTAisCHARACTER. Specifies how the matrix pencil(A,C)is given.== 'N': The matrix pencil(A,C)is given as a general matrices and its Schur decompositionA = QA*S*ZA**T,C = QA*R*ZA**Twill be computed.== 'F': The matrix pencil(A,C)is already in generalized Schur form andS,R,QA, andZAare given.== 'H': The matrix pencil(A,C)is given in generalized Hessenberg form and its Schur decompositionA = QA*S*ZA**T,C = QA*R*ZA**Twill be computed.
FACTBβFACTBisCHARACTER. Specifies how the matrix pencil(B,D)is given.== 'N': The matrix pencil(B,D)is given as a general matrices and its Schur decompositionB = QB*U*ZB**T,D = QB*V*ZB**Twill be computed.== 'F': The matrix pencil(B,D)is already in generalized Schur form andU,V,QB, andZBare given.== 'H': The matrix pencil(B,D)is given in generalized Hessenberg form and its Schur decompositionB = QB*U*ZB**T,D = QB*V*ZB**Twill be computed.
TRANSAβTRANSAisCHARACTER. Specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβTRANSBisCHARACTER. Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,== 'T':op2(B) = B**T
SGN1βSGN1isREAL, allowed values:+/-1. Specifies the sign between in the first equation.SGN2βSGN2isREAL, allowed values:+/-1. Specifies the sign between in the second equation.MβMisINTEGER. The order of the matricesAandC.M >= 0.NβNisINTEGER. The order of the matricesBandD.N >= 0.AβAisREALarray, dimension(LDA,M).- If
FACT ==, the matrixAis a general matrix and it is overwritten with the(quasi-) upper triangularfactorSof the Schur decomposition of(A,C). - If
FACT ==, the matrixAcontains its(quasi-) upper triangularmatrixSof the Schur decomposition of(A,C). - If
FACT ==, the matrixAis an upper Hessenberg matrix of the generalized Hessenberg form(A,C)and it is overwritten with the(quasi-) upper triangularfactorSof the Schur decomposition of(A,C).
- If
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisREALarray, dimension(LDB,N).- If
FACT ==, the matrixBis a general matrix and it is overwritten with the(quasi-) upper triangularfactorUof the Schur decomposition of(B,D). - If
FACT ==, the matrixBcontains its(quasi-) upper triangularmatrixUof the Schur decomposition of(B,D). - If
FACT ==, the matrixBis an upper Hessenberg matrix of the generalized Hessenberg form(B,D)and it is overwritten with the(quasi-) upper triangularfactorUof the Schur decomposition of(B,D).
- If
LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CβCisREALarray, dimension(LDC,M).- If
FACT ==, the matrixCis a general matrix and it is overwritten with the upper triangular factorRof the Schur decomposition of(A,C). - If
FACT ==, the matrixCcontains its upper triangular matrixRof the Schur decomposition of(A,C). - If
FACT ==, the matrixCis the upper triangular matrix of the generalized Hessenberg form(A,C)and it is overwritten with the upper triangular factorRof the Schur decomposition of(A,C).
- If
LDCβLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DβDisREALarray, dimension(LDD,N).- If
FACT ==, the matrixDis a general matrix and it is overwritten with the upper triangular factorVof the Schur decomposition of(B,D). - If
FACT ==, the matrixDcontains its upper triangular matrixVof the Schur decomposition of(B,D). - If
FACT ==, the matrixDis the upper triangular matrix of the generalized Hessenberg form(B,D)and it is overwritten with the upper triangular factorVof the Schur decomposition of(B,D).
- If
LDDβLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).QAβQAisREALarray, dimension(LDQA,M).- If
FACT ==, the matrixQAis an emptyM-by-Mmatrix on input and contains the left Schur vectors of(A,C)on output. - If
FACT ==, the matrixQAcontains the left Schur vectors of(A,C). - If
FACT ==, the matrixQAis an emptyM-by-Mmatrix on input and contains the left Schur vectors of(A,C)on output.
- If
LDQAβLDQAisINTEGER. The leading dimension of the arrayQA.LDQA >= max(1,M).ZAβZAisREALarray, dimension(LDZA,M).- If
FACT ==, the matrixZAis an emptyM-by-Mmatrix on input and contains the right Schur vectors of(A,C)on output. - If
FACT ==, the matrixZAcontains the right Schur vectors of(A,C). - If
FACT ==, the matrixZAis an emptyM-by-Mmatrix on input and contains the right Schur vectors of(A,C)on output.
- If
LDZAβLDZAisINTEGER. The leading dimension of the arrayZA.LDZA >= max(1,M).QBβQBisREALarray, dimension(LDQB,N).- If
FACT ==, the matrixQBis an emptyN-by-Nmatrix on input and contains the left Schur vectors of(B,D)on output. - If
FACT ==, the matrixQBcontains the left Schur vectors of(B,D). - If
FACT ==, the matrixQBis an emptyM-by-Mmatrix on input and contains the left Schur vectors of(B,D)on output.
- If
LDQBβ and that's where part 1 wraps, bestie. part 2 is coming, don't worry. πLDQBβLDQBisINTEGER. It's the leading dimension of the arrayQB, and the vibe check saysLDQB >= max(1,N). Non-negotiable bestie πZBβZBis aREAL array, dimension(LDZB,N). She's a shapeshifter depending onFACT, so pay attention:- If
FACT ==, the matrixZBis an empty N-by-N matrix on input and contains the right Schur vectors of(B,D)on output. β¨ - If
FACT ==, the matrixZBcontains the right Schur vectors of(B,D). π¦ - If
FACT ==, the matrixZBis an empty M-by-M matrix on input and contains the right Schur vectors of(B,D)on output. πΈ
- If
LDZBβLDZBisINTEGER. Leading dimension of the arrayZB, andLDZB >= max(1,N). Periodt. πEβEis aREAL array, dimension(LDE,N). On input, the matrixEcontains the right hand sideE. On output, the matrixEcontains the solutionR. Glow-up complete πLDEβLDEisINTEGER. Leading dimension of the arrayE, andLDE >= max(1,M). No cap.FβFis aREAL array, dimension(LDF,N). On input, the matrixFcontains the right hand sideF. On output, the matrixFcontains the solutionL. Main character arc fr fr πLDFβLDFisINTEGER. Leading dimension of the arrayF, andLDF >= max(1,M). π«ΆSCALEβSCALEisREAL. It's the scaling factor that keeps the result from overflowing β the bodyguard of this whole operation. IfINFO == 0thenSCALEis1.0; otherwise, if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. πWORKβWORKis aREAL array, dimension(MAX(1,LDWORK)). Workspace for the algorithm. The optmimal workspace is returned inLDWORK, ifLDWORK == -1on input. In this case no computations are performed. Literally zero βLDWORKβLDWORKisINTEGER. IfLDWORK == -1on input the subroutine will return the required size of the workspace inLDWORKon exit. No computations are performed and none of the arrays are referenced. She's just peeking, not touching πINFOβINFOisINTEGER, and she is the messenger:== 0: successful exit π= 1:SHGGESfailed π= 2:SLA_SORT_GEVfailed π= 3: Inner solver failed π΅< 0: ifINFO = -i, the i-th argument had an illegal value π¨
π See also
SLA_TGCSYLV_DAGDLA_TGCSYLV_LEVEL3SLA_TGCSYLV_L3_2SSLA_TGCSYLV_L2_UNOPTSLA_TGCSYLV_L2SLA_TGCSYLV_L2_REORDERSLA_TGCSYLV_L2_LOCAL_COPY_32SLA_TGCSYLV_L2_LOCAL_COPY_64SLA_TGCSYLV_L2_LOCAL_COPY_96SLA_TGCSYLV_L2_LOCAL_COPY_128SLA_TGCSYLV_L2_LOCAL_COPY
π Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
Definition at line 333 of file sla_ggcsylv.f90.
π«Ά sla_ggcsylv_dual π«Ά
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. Okay so she's the front desk of the dual operation, got it π
β¨ 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). iykyk π
πΈ Parameters πΈ
FACTAβFACTAisCHARACTER. Specifies how the matrix pencil(A,C)is given. π== 'N': The matrix pencil(A,C)is given as a general matrices and its Schur decompositionA = QA*S*ZA**T,C = QA*R*ZA**Twill be computed.== 'F': The matrix pencil(A,C)is already in generalized Schur form andS,R,QA, andZAare given.== 'H': The matrix pencil(A,C)is given in generalized Hessenberg form and its Schur decompositionA = QA*S*ZA**T,C = QA*R*ZA**Twill be computed.
FACTBβFACTBisCHARACTER. Specifies how the matrix pencil(B,D)is given. π¦== 'N': The matrix pencil(B,D)is given as a general matrices and its Schur decompositionB = QB*U*ZB**T,D = QB*V*ZB**Twill be computed.== 'F': The matrix pencil(B,D)is already in generalized Schur form andU,V,QB, andZBare given.== 'H': The matrix pencil(B,D)is given in generalized Hessenberg form and its Schur decompositionB = QB*U*ZB**T,D = QB*V*ZB**Twill be computed.
TRANSAβTRANSAisCHARACTER. Specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβTRANSBisCHARACTER. Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,== 'T':op2(B) = B**T
SGN1βSGN1isREAL, allowed values:+/-1. Specifies the sign between in the first equation. β¨SGN2βSGN2isREAL, allowed values:+/-1. Specifies the sign between in the second equation. β¨MβMisINTEGER. The order of the matricesAandC.M >= 0. π«ΆNβNisINTEGER. The order of the matricesBandD.N >= 0. π«ΆAβAis aREAL array, dimension(LDA,M). She's got three moods:- If
FACT ==, the matrixAis a general matrix and it is overwritten with the (quasi-) upper triangular factorSof the Schur decomposition of(A,C). - If
FACT ==, the matrixAcontains its (quasi-) upper triangular matrixSof the Schur decomposition of(A,C). - If
FACT ==, the matrixAis an upper Hessenberg matrix of the generalized Hessenberg form(A,C)and it is overwritten with the (quasi-) upper triangular factorSof the Schur decomposition of(A,C).
- If
LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M). πBβBis aREAL array, dimension(LDB,N). Same energy, different pencil:- If
FACT ==, the matrixBis a general matrix and it is overwritten with the (quasi-) upper triangular factorUof the Schur decomposition of(B,D). - If
FACT ==, the matrixBcontains its (quasi-) upper triangular matrixUof the Schur decomposition of(B,D). - If
FACT ==, the matrixBis an upper Hessenberg matrix of the generalized Hessenberg form(B,D)and it is overwritten with the (quasi-) upper triangular factorUof the Schur decomposition of(B,D).
- If
LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N). πCβCis aREAL array, dimension(LDC,M).- If
FACT ==, the matrixCis a general matrix and it is overwritten with the upper triangular factorRof the Schur decomposition of(A,C). - If
FACT ==, the matrixCcontains its upper triangular matrixRof the Schur decomposition of(A,C). - If
FACT ==, the matrixCis the upper triangular matrix of the generalized Hessenberg form(A,C)and it is overwritten with the upper triangular factorRof the Schur decomposition of(A,C).
- If
LDCβLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M). πDβDis aREAL array, dimension(LDD,N).- If
FACT ==, the matrixDis a general matrix and it is overwritten with the upper triangular factorVof the Schur decomposition of(B,D). - If
FACT ==, the matrixDcontains its upper triangular matrixVof the Schur decomposition of(B,D). - If
FACT ==, the matrixDis the upper triangular matrix of the generalized Hessenberg form(B,D)and it is overwritten with the upper triangular factorVof the Schur decomposition of(B,D).
- If
LDDβLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N). πQAQAβ REAL array, dimension(LDQA,M). okay so bestie, whatQAactually holds depends on what you toldFACTto do:- If
FACT ==, thenQAcomes in as an empty M-by-M matrix, and on the way out it's holding the left Schur vectors of(A,C). π¦ - If
FACT ==, thenQAalready contains those left Schur vectors of(A,C). - If
FACT ==, then again: empty M-by-M on input, left Schur vectors of(A,C)on output. periodt.
- If
LDQAβ INTEGER. The leading dimension of the arrayQA. And it has rules, bestie:LDQA >= max(1,M). no negotiating πZAβ REAL array, dimension(LDZA,M). Same energy, different matrix, the right Schur vectors this time:- If
FACT ==,ZAis an empty M-by-M matrix on input and on output it holds the right Schur vectors of(A,C). - If
FACT ==,ZAalready contains those right Schur vectors of(A,C). - If
FACT ==, empty M-by-M going in, right Schur vectors of(A,C)coming out. β¨
- If
LDZAβ INTEGER. Leading dimension of the arrayZA.LDZA >= max(1,M). iykyk.QBβ REAL array, dimension(LDQB,N). And now for the other pencil:- If
FACT ==,QBarrives as an empty N-by-N matrix and leaves holding the left Schur vectors of(B,D). - If
FACT ==,QBalready contains the left Schur vectors of(B,D). - If
FACT ==, it's an empty M-by-M matrix on input and on output it holds the left Schur vectors of(B,D). π (yes, M-by-M, that's literally what the manpage says, don't come for me)
- If
LDQBβ INTEGER. Leading dimension of the arrayQB.LDQB >= max(1,N). πZBβ REAL array, dimension(LDZB,N). The right Schur vectors of the second pencil, serving looks:- If
FACT ==,ZBis an empty N-by-N matrix on input, and on output it contains the right Schur vectors of(B,D). - If
FACT ==,ZBalready contains the right Schur vectors of(B,D). - If
FACT ==, it comes in as an empty M-by-M matrix and leaves with the right Schur vectors of(B,D). π
- If
LDZBβ INTEGER. Leading dimension of the arrayZB.LDZB >= max(1,N). lowkey essential.Eβ REAL array, dimension(LDE,N).- On input:
Eis the right hand sideE. π - On output:
Eis the solutionR. glow-up fr fr
- On input:
LDEβ INTEGER. Leading dimension of the arrayE.LDE >= max(1,M).Fβ REAL array, dimension(LDF,N).- On input:
Fholds the right hand sideF. - On output:
Fholds the solutionL. slay π
- On input:
LDFβ INTEGER. Leading dimension of the arrayF.LDF >= max(1,M).SCALEβ REAL. The vibe-protection factor:SCALEkeeps the result from overflowing. IfINFO == 0thenSCALEis1.0. Otherwise, if one of the inner systems couldn't be solved correctly, then0 < SCALE <= 1holds true. π«ΆWORKβ REAL array, dimension(MAX(1,LDWORK)).- If
FACT ==, the matrixZBis an empty M-by-M matrix on input and contains the right Schur vectors of(B,D)on output. (yes, that line is living in theWORKdocs, we don't make the rules π) - Also: workspace for the algorithm. The optmimal workspace is returned in
LDWORKifLDWORK == -1on input β and in that case, no computations are performed. just a lil size check, no math, no drama.
- If
LDWORKβ INTEGER. IfLDWORK == -1on input, the subroutine will return the required size of the workspace inLDWORKon exit. No computations are performed and none of the arrays are referenced. it's giving "just tell me how much room you need" energy π§INFOβ INTEGER. The receipts:== 0: successful exit. we ate. π= 1:SHGGESfailed.= 2:SLA_SORT_GEVfailed.= 3: Inner solver failed.< 0: ifINFO = -i, the i-th argument had an illegal value. π¨
π See also (the extended universe)
SLA_TGCSYLV_DUAL_DAGDLA_TGCSYLV_DUAL_LEVEL3SLA_TGCSYLV_DUAL_L3_2SSLA_TGCSYLV_DUAL_L2SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_32SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_64SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_96SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_128SLA_TGCSYLV_DUAL_L2_LOCAL_COPY
π«Ά Author
Martin Koehler, MPI Magdeburg
ποΈ Date
October 2025
π Definition
Definition at line 350 of file sla_ggcsylv_dual.f90.
β¨ subroutine sla_ggcsylv_dual_refine β¨
okay bestie, deep breath, because the signature is LONG and she is serving:
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.
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
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 (yes, more of them, we're committed π )
TRANSAβ CHARACTER. Specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβ CHARACTER. Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,== 'T':op2(B) = B**T
GUESSβ 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. starting from scratch bestie πΈ
SGN1β REAL, allowed values:+/-1. Specifies the sign between in the first equation. πSGN2β REAL, allowed values:+/-1. Specifies the sign between in the second equation. πMβ INTEGER. The order of the matricesAandC.M >= 0.Nβ INTEGER. The order of the matricesBandD.N >= 0.Aβ REAL array, dimension(LDA,M). The arrayAcontains the original matrixAdefining the equation. β¨LDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Bβ REAL array, dimension(LDB,N). The arrayBcontains the original matrixBdefining the equation. β¨LDBβ INTEGER. The leading dimension of the arrayA.LDB >= max(1,N). (yes, it says "arrayA" right there in theLDBdocs β iconic, we keep it π)Cβ REAL array, dimension(LDC,M). The arrayCcontains the original matrixCdefining the equation. β¨LDCβ INTEGER. The leading dimension of the arrayC.LDC >= max(1,M).Dβ REAL array, dimension(LDD,N). The arrayDcontains the original matrixDdefining the equation. β¨LDDβ INTEGER. The leading dimension of the arrayD.LDD >= max(1,N).Rβ REAL array, dimension(LDR,N).- On input, the array
Rcontains the initial guessR0for the first solution matrix. - On output, the array
Rcontains the refine solution matrixR. π
- On input, the array
LDRβ INTEGER. The leading dimension of the arrayR.LDR >= max(1,M).Lβ REAL array, dimension(LDL,N).- On input, the array
Lcontains the initial guess for the second solution matrix. - On output, the array
Lcontains the solutionL. π¦
- On input, the array
LDLβ INTEGER, bestie. The leading dimension of the arrayL. And the rule as written isLDF >= max(1,M)β yes, it saysLDF, that's literally what's in the source, I don't make the rules, I just report them. πEβ REAL array, dimension(LDE,N). On input, the arrayEholds the right hand sideE. That's it, that's the whole job. β¨LDEβ INTEGER. Leading dimension of the arrayE, and you needLDE >= max(1,M). πFβ REAL array, dimension(LDF,N). On input, the arrayFcarries the right hand sideF. The other half of the RHS duo. π«ΆLDFβ INTEGER. Leading dimension of the arrayF, withLDF >= max(1,M). πASβ REAL array, dimension(LDAS,M). The arrayASholds the generalized Schur decomposition of theA. Handed to you already decomposed, no extra work needed. πΈLDASβ INTEGER. Leading dimension of the arrayAS. Requirement:LDAS >= max(1,M). βBSβ REAL array, dimension(LDBS,N). The arrayBScontains the generalized Schur decomposition of theB. π¦LDBSβ INTEGER. Leading dimension of the arrayBS. And it'sLDBS >= max(1,N)β note theN, notM, becauseBlives inN-land. πCSβ REAL array, dimension(LDCS,M). The arrayCSholds the generalized Schur decomposition of theC. πLDCSβ INTEGER. Leading dimension of the arrayCS. Requirement:LDCS >= max(1,M). πDSβ REAL array, dimension(LDDS,N). The arrayDScontains the generalized Schur decomposition of theD. π₯LDDSβ INTEGER. Leading dimension of the arrayDS. Requirement:LDDS >= max(1,N). πQβ REAL array, dimension(LDQ,M). The arrayQholds the left generalized Schur vectors for(A,C), exactly as returned bySGGES. Don't hand it anything homemade. πLDQβ INTEGER. Leading dimension of the arrayQ. Requirement:LDQ >= max(1,M). πZβ REAL array, dimension(LDZ,M). The arrayZcarries the right generalized Schur vectors for(A,C)as returned bySGGES. π§LDZβ INTEGER. Leading dimension of the arrayZ. Requirement:LDZ >= max(1,M). β¨Uβ REAL array, dimension(LDU,N). The arrayUholds the left generalized Schur vectors for(B,D)as returned bySGGES. πLDUβ INTEGER. Leading dimension of the arrayU. Requirement:LDU >= max(1,N). πVβ REAL array, dimension(LDV,N). The arrayVcontains the right generalized Schur vectors for(B,D)as returned bySGGES. πLDVβ INTEGER. Leading dimension of the arrayV. Requirement:LDV >= max(1,N). πΈMAXITβ INTEGER, and it does double duty, main character energy honestly. On input it's the maximum number of iterations that get performed, and the range is2 <= MAXIT <= 100. On exit it's been overwritten with the actual number of iteration steps the algorithm took. πTAUβ REAL, also a glow-up-on-exit situation. On input,TAUis the extra security factor for the stopping criterion, and typical values are0.1. On exit,TAUholds the last relative residual from the moment the stopping criterion became valid. π«ΆCONVLOGβ REAL array, dimension(MAXIT). This is the receipts, bestie: the convergence history of the iterative refinement.CONVLOG(I)gives you the maximum relative residual of both equations before it gets solved for theI-th time. πWORKβ REAL array, dimension(MAX(1,LDWORK)). Workspace for the algorithm. And here's the cute trick: the optimal workspace size gets returned inLDWORKifLDWORK == -1on input, and in that case no computations are performed. It's a vibe check, not a solve. πLDWORKβ INTEGER. IfLDWORK == -1the subroutine returns the required workspace size inLDWORKon exit. No computations run and none of the arrays get referenced. Zero touching, zero drama. β¨INFOβ INTEGER, the final verdict:== 0: Success π> 0: Iteration failed in stepINFOπ< 0: ifINFO = -i, thei-th argument had an illegal value π¨= -50: Some of the internal settings likeNB,... are incorrect. π
π See also
SLA_TGCSYLV_DUAL_DAGDLA_TGCSYLV_DUAL_LEVEL3SLA_TGCSYLV_DUAL_L3_2SSLA_TGCSYLV_DUAL_L2SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_32SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_64SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_96SLA_TGCSYLV_DUAL_L2_LOCAL_COPY_128SLA_TGCSYLV_DUAL_L2_LOCAL_COPY
π Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
π Definition
At line 399 of file sla_ggcsylv_dual_refine.f90.
π§ subroutine sla_ggcsylv_refine
Okay okay okay, new function, new era. Here's the whole signature, verbatim, no edits, no notes:
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. Say that five times fast, I dare you. π
π― 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
...and it does it with iterative refinement. The way that (A,C) is an M-by-M matrix pencil and (B,D) is an N-by-N matrix pencil, and the right hand side (E,F) and the solution (R,L) are both M-by-N matrices. β¨
And here's the important bit: the pencils (A,C) and (B,D) have to be given in the original form and in their generalized Schur decomposition, because the iterative refinement procedure literally needs both. You can't just pick one, bestie, it's a two-outfit situation. π
π Parameters
TRANSAβ CHARACTER. Tells us the form of the system of equations with respect toAandC:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβ CHARACTER. Same deal but forBandD:== 'N':op2(B) = B,== 'T':op2(B) = B**T
GUESSβ CHARACTER. Decides whether(R,L)already contains an initial guess or not. (Yes, the typo is "nor not" in the source. We move. π)= 'I':(R, L)contains an initial guess= 'N': No initial guess, so(R,L)gets set to zero at the beginning of the iteration
SGN1β REAL, allowed values+/-1. Specifies the sign between in the first equation. Pick your fighter. βοΈSGN2β REAL, allowed values+/-1. Specifies the sign between in the second equation. πΈMβ INTEGER. The order of the matricesAandC.M >= 0. π«ΆNβ INTEGER. The order of the matricesBandD.N >= 0. πAβ REAL array, dimension(LDA,M). The arrayAcontains the original matrixAdefining the equation. πLDAβ INTEGER. The leading dimension of the arrayA. Requirement:LDA >= max(1,M). βBβ REAL array, dimension(LDB,N). The arrayBcontains the original matrixBdefining the equation. π¦LDBβ INTEGER. The leading dimension of the arrayA. Yes, it saysA, and the rule isLDB >= max(1,N). That's what the source says, I'm just the messenger. πCβ REAL array, dimension(LDC,M). The arrayCcontains the original matrixCdefining the equation. πLDCβ INTEGER. The leading dimension of the arrayC. Requirement:LDC >= max(1,M). β¨Dβ REAL array, dimension(LDD,N). The arrayDcontains the original matrixDdefining the equation. π₯LDDβ INTEGER. The leading dimension of the arrayD. Requirement:LDD >= max(1,N). πRβ REAL array, dimension(LDR,N). On input,Rholds the initial guessR0for the first solution matrix. On output,Rholds the refined solution matrixR. Glow up on exit, we love to see it. πLDRβ INTEGER. The leading dimension of the arrayR. Requirement:LDR >= max(1,M). πΈLβ REAL array, dimension(LDL,N). On input,Lcarries the initial guess for the second solution matrix. On output,Lcontains the solutionL. Same arc, different matrix. π«ΆLDLβ INTEGER. The leading dimension of the arrayL. And as written,LDF >= max(1,M)β yes,LDFagain. The source has a whole thing going on with this. πEβ REAL array, dimension(LDE,N). On input, the arrayEcontains the right hand sideE. π₯LDEβ INTEGER. The leading dimension of the arrayE. Requirement:LDE >= max(1,M). βFβ REAL array, dimension(LDF,N). On input, the arrayFcontains the right hand sideF. π₯LDFβ INTEGER. The leading dimension of the arrayF. Requirement:LDF >= max(1,M). πLDFβLDFis INTEGER. The leading dimension of the array F.LDF >= max(1,M). πASβASis REAL array, dimension(LDAS,M). The arrayAScontains the generalized Schur decomposition of the A. π¦LDASβLDASis INTEGER. The leading dimension of the array AS.LDAS >= max(1,M). β¨BSβBSis REAL array, dimension(LDBS,N). The arrayBScontains the generalized Schur decomposition of the B. πΈLDBSβLDBSis INTEGER. The leading dimension of the array BS.LDBS >= max(1,N). πCSβCSis REAL array, dimension(LDCS,M). The arrayCScontains the generalized Schur decomposition of the C. πLDCSβLDCSis INTEGER. The leading dimension of the array CS.LDCS >= max(1,M). πDSβDSis REAL array, dimension(LDDS,N). The arrayDScontains the generalized Schur decomposition of the D. π¦LDDSβLDDSis INTEGER. The leading dimension of the array DS.LDDS >= max(1,N). β¨QβQis REAL array, dimension(LDQ,M). The arrayQcontains the left generalized Schur vectors for(A,C)as returned bySGGES. πLDQβLDQis INTEGER. The leading dimension of the array Q.LDQ >= max(1,M). πZβZis REAL array, dimension(LDZ,M). The arrayZcontains the right generalized Schur vectors for(A,C)as returned bySGGES. π¦LDZβLDZis INTEGER. The leading dimension of the array Z.LDZ >= max(1,M). β¨UβUis REAL array, dimension(LDU,N). The arrayUcontains the left generalized Schur vectors for(B,D)as returned bySGGES. πΈLDUβLDUis INTEGER. The leading dimension of the array U.LDU >= max(1,N). πVβVis REAL array, dimension(LDV,N). The arrayVcontains the right generalized Schur vectors for(B,D)as returned bySGGES. πLDVβLDVis INTEGER. The leading dimension of the array V.LDV >= max(1,N). πMAXITβMAXITis INTEGER. On input,MAXITcontains the maximum number of iteration that are performed,2 <= MAXIT <= 100. On exit,MAXITcontains the number of iteration steps taken by the algorithm. π₯TAUβTAUis REAL. On input,TAUcontains the additional security factor for the stopping criterion, typical values are0.1. On exit,TAUcontains the last relative residual when the stopping criterion got valid. β¨CONVLOGβCONVLOGis REAL array, dimension(MAXIT). TheCONVLOGarray 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βWORKis REAL array, dimension(MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace is returned inLDWORK, ifLDWORK == -1on input. In this case no computations are performed. πLDWORKβLDWORKis INTEGER. IfLDWORK == -1the subroutine will return the required size of the workspace inLDWORKon exit. No computations are performed and none of the arrays are referenced. πINFOβINFOis INTEGER.== 0: Success π> 0: Iteration failed in stepINFOπ< 0: ifINFO = -i, the i-th argument had an illegal value π= -50: Some of the internal settings likeNB,...are incorrect. π¨
π See also π
SLA_TGCSYLV_DAGDLA_TGCSYLV_LEVEL3SLA_TGCSYLV_L3_2SSLA_TGCSYLV_L2_UNOPTSLA_TGCSYLV_L2SLA_TGCSYLV_L2_REORDERSLA_TGCSYLV_L2_LOCAL_COPY_32SLA_TGCSYLV_L2_LOCAL_COPY_64SLA_TGCSYLV_L2_LOCAL_COPY_96SLA_TGCSYLV_L2_LOCAL_COPY_128SLA_TGCSYLV_L2_LOCAL_COPY
β¨ Author β¨
Martin Koehler, MPI Magdeburg
π Date π
October 2025
Definition at line 381 of file sla_ggcsylv_refine.f90.
β¨ subroutine sla_ggsylv β¨
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, as generalized Hessenberg form, or in terms of their generalized Schur decomposition. If they are given as general matrices or as a generalized Hessenberg form their generalized Schur decomposition will be computed.
π οΈ Parameters π οΈ
FACTAβFACTAis 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 decompositionA = QA*S*ZA**T,C = QA*R*ZA**Twill be computed.== 'F': The matrix pencil(A,C)is already in generalized Schur form andS,R,QA, andZAare given.== 'H': The matrix pencil(A,C)is given in generalized Hessenberg form and its Schur decompositionA = QA*S*ZA**T,C = QA*R*ZA**Twill be computed.
FACTBβFACTBis 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 decompositionB = QB*U*ZB**T,D = QB*V*ZB**Twill be computed.== 'F': The matrix pencil(B,D)is already in generalized Schur form andU,V,QB, andZBare given.== 'H': The matrix pencil(B,D)is given in generalized Hessenberg form and its Schur decompositionB = QB*U*ZB**T,D = QB*V*ZB**Twill be computed.
TRANSAβTRANSAis CHARACTER. Specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβTRANSBis CHARACTER. Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,== 'T':op2(B) = B**T
SGNβSGNis REAL, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.= 1: Solve Equation (1)== -1: Solve Equation (2)
MβMis INTEGER. The order of the matricesAandC.M >= 0.NβNis INTEGER. The order of the matricesBandD.N >= 0.AβAis REAL array, dimension(LDA,M). IfFACT == ,the matrixAis a general matrix and it is overwritten with the (quasi-) upper triangular factorSof the Schur decomposition of(A,C). IfFACT == ,the matrixAcontains its (quasi-) upper triangular matrixSof the Schur decomposition of(A,C). IfFACT == ,the matrixAis an upper Hessenberg matrix of the generalized Hessenberg form(A,C)and it is overwritten with the (quasi-) upper triangular factorSof the Schur decomposition of(A,C).LDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBis REAL array, dimension(LDB,N). IfFACT == ,the matrixBis a general matrix and it is overwritten with the (quasi-) upper triangular factorUof the Schur decomposition of(B,D). IfFACT == ,the matrixBcontains its (quasi-) upper triangular matrixUof the Schur decomposition of(B,D). IfFACT == ,the matrixBis an upper Hessenberg matrix of the generalized Hessenberg form(B,D)and it is overwritten with the (quasi-) upper triangular factorUof the Schur decomposition of(B,D).LDBβLDBis INTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CβCis REAL array, dimension(LDC,M). IfFACT == ,the matrixCis a general matrix and it is overwritten with the upper triangular factorRof the Schur decomposition of(A,C). IfFACT == ,the matrixCcontains its upper triangular matrixRof the Schur decomposition of(A,C). IfFACT == ,the matrixCis the upper triangular matrix of the generalized Hessenberg form(A,C)and it is overwritten with the upper triangular factorRof the Schur decomposition of(A,C).LDCβLDCβLDCisINTEGER. The leading dimension of the arrayC. Bestie, the rule isLDC >= max(1,M). πDβDis aREALarray, dimension(LDD,N). What it means depends onFACT, so pay attention:- If
FACT ==, the matrixDis a general matrix and it is overwritten with the upper triangular factorVof the Schur decomposition of(B,D). π¦ - If
FACT ==, the matrixDcontains its upper triangular matrixVof the Schur decomposition of(B,D). - If
FACT ==, the matrixDis the upper triangular matrix of the generalized Hessenberg form(B,D)and it is overwritten with the upper triangular factorVof the Schur decomposition of(B,D). β¨
- If
LDDβLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).QAβQAis aREALarray, dimension(LDQA,M).- If
FACT ==, the matrixQAis an emptyM-by-Mmatrix on input and contains the left Schur vectors of(A,C)on output. - If
FACT ==, the matrixQAcontains the left Schur vectors of(A,C). - If
FACT ==, the matrixQAis an emptyM-by-Mmatrix on input and contains the left Schur vectors of(A,C)on output. π
- If
LDQAβLDQAisINTEGER. The leading dimension of the arrayQA.LDQA >= max(1,M).ZAβZAis aREALarray, dimension(LDZA,M).- If
FACT ==, the matrixZAis an emptyM-by-Mmatrix on input and contains the right Schur vectors of(A,C)on output. - If
FACT ==, the matrixZAcontains the right Schur vectors of(A,C). - If
FACT ==, the matrixZAis an emptyM-by-Mmatrix on input and contains the right Schur vectors of(A,C)on output. πΈ
- If
LDZAβLDZAisINTEGER. The leading dimension of the arrayZA.LDZA >= max(1,M).QBβQBis aREALarray, dimension(LDQB,N).- If
FACT ==, the matrixQBis an emptyN-by-Nmatrix on input and contains the left Schur vectors of(B,D)on output. - If
FACT ==, the matrixQBcontains the left Schur vectors of(B,D). - If
FACT ==, the matrixQBis an emptyM-by-Mmatrix on input and contains the left Schur vectors of(B,D)on output. π«Ά
- If
LDQBβLDQBisINTEGER. The leading dimension of the arrayQB.LDQB >= max(1,N).ZBβZBis aREALarray, dimension(LDZB,N).- If
FACT ==, the matrixZBis an emptyN-by-Nmatrix on input and contains the right Schur vectors of(B,D)on output. - If
FACT ==, the matrixZBcontains the right Schur vectors of(B,D). - If
FACT ==, the matrixZBis an emptyM-by-Mmatrix on input and contains the right Schur vectors of(B,D)on output. π
- If
LDZBβLDZBisINTEGER. The leading dimension of the arrayZB.LDZB >= max(1,N).XβXis aREALarray, dimension(LDX,N). On input, the matrixXcontains the right hand sideY. On output, the matrixXcontains the solution of Equation (1) or (2). Right hand sideYand the solutionXareM-by-Nmatrices. π₯LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).SCALEβSCALEisREAL.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. πWORKβWORKis aREALarray, dimension(MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace is given either by\ref mepack_memory_frontendor a previous call to this routine withLDWORK === -1. π§LDWORKβLDWORKisINTEGER. Size of the workspace for the algorithm. This can be determined by a call\ref mepack_memory_frontend. Alternatively, ifLDWORK == -1on input, the subroutine will return the required size of the workspace inLDWORKwithout performing any computations. π«INFOβINFOisINTEGER.== 0: successful exit β¨= 1:SHGGESfailed= 2:SLA_SORT_GEVfailed= 3: Inner solver failed< 0: ifINFO = -i, thei-th argument had an illegal value
π¦ See also π¦
Like, the whole girl gang of related routines:
SLA_TGSYLV_DAGSLA_TGSYLV_L3_COLWISESLA_TGSYLV_L3_2SSLA_TGSYLV_L2_REORDERSLA_TGSYLV_L2SLA_TGSYLV_L2_COLWISESLA_TGSYLV_L2_LOCAL_COPY_32SLA_TGSYLV_L2_LOCAL_COPY_64SLA_TGSYLV_L2_LOCAL_COPY_96SLA_TGSYLV_L2_LOCAL_COPY_128SLA_TGSYLV_L2_LOCAL_COPYSLA_TGSYLV_GARDINER_LAUB
π Author π
Martin Koehler, MPI Magdeburg
πΈ Date πΈ
October 2025
π Definition
Definition at line 322 of file sla_ggsylv.f90.
π subroutine sla_ggsylv_refine π
okay so here's the whole signature, bestie, every single argument, no skips:
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βTRANSAisCHARACTER. Specifies the form of the system of equations with respect toAandC:== 'N':op1(A) = A== 'T':op1(A) = A**T
TRANSBβTRANSBisCHARACTER. Specifies the form of the system of equations with respect toBandD:== 'N':op2(B) = B,== 'T':op2(B) = B**T
GUESSβGUESSisCHARACTER. Specifies whetherXcontains an initial guess or not.= 'I':Xcontains an initial guess= 'N': No initial guess,Xis set to zero at the begin of the iteration. π«Ά
SGNβSGNisREAL, allowed values:+/-1. Specifies the sign between in the first equation. πMβMisINTEGER. The order of the matricesAandC.M >= 0.NβNisINTEGER. The order of the matricesBandD.N >= 0.AβAis aREALarray, dimension(LDA,M). The arrayAcontains the original matrixAdefining the equation. π¦LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBis aREALarray, dimension(LDB,N). The arrayBcontains the original matrixBdefining the equation.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CβCis aREALarray, dimension(LDC,M). The arrayCcontains the original matrixCdefining the equation.LDCβLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DβDis aREALarray, dimension(LDD,N). The arrayDcontains the original matrixDdefining the equation.LDDβLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).XβXis aREALarray, dimension(LDX,N). On input, the arrayXcontains the initial guess, ifGUESS = 'I'. On output, the arrayXcontains the solutionX. π₯LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).YβYis aREALarray, dimension(LDY,N). On input, the arrayYcontains the right hand sideY. The array stays unchanged during the iteration. β¨LDYβLDYisINTEGER. The leading dimension of the arrayY.LDY >= max(1,M).ASβASis aREALarray, dimension(LDAS,M). The arrayAScontains the generalized Schur decomposition of theA. πΈLDASβLDASisINTEGER. The leading dimension of the arrayAS.LDAS >= max(1,M).BSβBSis aREALarray, dimension(LDBS,N). The arrayBScontains the generalized Schur decomposition of theB. πLDBSβLDBSisINTEGER. The leading dimension of the arrayBS.LDBS >= max(1,N).CSβCSis aREALarray, dimension(LDCS,M). The arrayCScontains the generalized Schur decomposition of theC. π«LDCSLDCSβ INTEGER. It's the leading dimension of the arrayCS. Keep it legal bestie:LDCS >= max(1,M).DSβ REAL array, dimension(LDDS,N). This one's holding the generalized Schur decomposition of theD. β¨LDDSβ INTEGER. Leading dimension of the arrayDS. You already know the drill:LDDS >= max(1,N).Qβ REAL array, dimension(LDQ,M). Contains the left generalized Schur vectors for(A,C), exactly as handed back bySGGES. π«ΆLDQβ INTEGER. Leading dimension of the arrayQ.LDQ >= max(1,M).Zβ REAL array, dimension(LDZ,M). Contains the right generalized Schur vectors for(A,C), as returned bySGGES.LDZβ INTEGER. Leading dimension of the arrayZ.LDZ >= max(1,M).Uβ REAL array, dimension(LDU,N). Contains the left generalized Schur vectors for(B,D), straight fromSGGES.LDUβ INTEGER. Leading dimension of the arrayU.LDU >= max(1,N).Vβ REAL array, dimension(LDV,N). Contains the right generalized Schur vectors for(B,D), as returned bySGGES.LDVβ INTEGER. Leading dimension of the arrayV.LDV >= max(1,N).MAXITβ INTEGER. On input, this is the max number of iterations that get performed, and it's gotta stay in range:2 <= MAXIT <= 100. On exit,MAXITbecomes the actual number of iteration steps the algorithm took. She reports back fr fr. πTAUβ REAL. On input, the extra security factor for the stopping criterion β typical values are0.1. On exit, it holds the last relative residual from the moment the stopping criterion got valid.CONVLOGβ REAL array, dimension(MAXIT). This is the receipts: the convergence history of the iterative refinement.CONVLOG(I)contains the maximum relative residual before it is solved for the I-th time. Obsessed with the transparency ngl. πWORKβ REAL array, dimension(MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace gets returned inLDWORKifLDWORK == -1on input β and in that case, no computations are performed at all. It's just vibes and math, no work. πLDWORKβ INTEGER. IfLDWORK == -1, the subroutine will return the required size of the workspace inLDWORKon exit. No computations are performed and none of the arrays are referenced. Zero touching, just measuring.INFOβ INTEGER. The status report, and it's giving very specific:== 0: Success π> 0: Iteration failed in stepINFO< 0: ifINFO = -i, the i-th argument had an illegal value= -50: Some of the internal settings likeNB,... are incorrect.
Heads up bestie:INFO = -50means internal settings (likeNB,...) are wrong β that's not a you-typo situation, that's a settings situation. And anINFO > 0means the iteration bailed at stepINFO, so check your convergence history inCONVLOG.
π SEE ALSO π
SLA_TGSYLV_DAGDLA_TGSYLV_LEVEL3SLA_TGSYLV_L3_2SSLA_TGSYLV_L2_UNOPTSLA_TGSYLV_L2SLA_TGSYLV_L2_REORDERSLA_TGSYLV_L2_LOCAL_COPY_32SLA_TGSYLV_L2_LOCAL_COPY_64SLA_TGSYLV_L2_LOCAL_COPY_96SLA_TGSYLV_L2_LOCAL_COPY_128SLA_TGSYLV_L2_LOCAL_COPYSLA_TGSYLV_GARDINER_LAUB
πΈ AUTHOR πΈ
Martin Koehler, MPI Magdeburg
π DATE π
October 2025
Definition at line 349 of file sla_ggsylv_refine.f90.
Generated automatically by Doxygen for MEPACK from the source code.
And that's a wrap on sglggsylv(3) bestie β Version 1.1.2, dated Thu Oct 9 2025 00:00:00, from the MEPACK girlies at Doxygen. Go slay some generalized Sylvester equations. πβ¨π¦
π¦ where this page comes from
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms