cgelyap(3)
π NAME π
cgelyap β the C-Interface β¨
okay so literally: the C-Interface for generalized Lyapunov and Stein equations with triangular coefficient matrices. bestie, that's the whole vibe. π¦
π SYNOPSIS π
β¨ Functions β¨
void mepack_double_gelyap (const char *FACT, const char *TRANS, int M,
double *A, int LDA, double *Q, int LDQ, double *X, int LDX, double
*SCALE, double *WORK, size_t LDWORK, int *INFO)
Frontend for the solution of Standard Lyapunov Equations.
void mepack_single_gelyap (const char *FACT, const char *TRANS, int M,
float *A, int LDA, float *Q, int LDQ, float *X, int LDX, float
*SCALE, float *WORK, size_t LDWORK, int *INFO)
Frontend for the solution of Standard Lyapunov Equations.
void mepack_double_gestein (const char *FACT, const char *TRANS, int M,
double *A, int LDA, double *Q, int LDQ, double *X, int LDX, double
*SCALE, double *WORK, size_t LDWORK, int *INFO)
Frontend for the solution of Standard Stein Equations.
void mepack_single_gestein (const char *FACT, const char *TRANS, int M,
float *A, int LDA, float *Q, int LDQ, float *X, int LDX, float
*SCALE, float *WORK, size_t LDWORK, int *INFO)
Frontend for the solution of Standard Stein Equations.
void mepack_double_gelyap_refine (const char *TRANS, const char *GUESS,
int M, double *A, int LDA, double *X, int LDX, double *Y, int LDY,
double *AS, int LDAS, double *Q, int LDQ, int *MAXIT, double *TAU,
double *CONVLOG, double *WORK, size_t LDWORK, int *INFO)
Iterative Refinement for the Standard Lyapunov Equation.
void mepack_single_gelyap_refine (const char *TRANS, const char *GUESS,
int M, float *A, int LDA, float *X, int LDX, float *Y, int LDY,
float *AS, int LDAS, float *Q, int LDQ, int *MAXIT, float *TAU,
float *CONVLOG, float *WORK, size_t LDWORK, int *INFO)
Iterative Refinement for the Standard Lyapunov Equation.
void mepack_double_gestein_refine (const char *TRANS, const char *GUESS,
int M, double *A, int LDA, double *X, int LDX, double *Y, int LDY,
double *AS, int LDAS, double *Q, int LDQ, int *MAXIT, double *TAU,
double *CONVLOG, double *WORK, size_t LDWORK, int *INFO)
Iterative Refinement for the Standard Stein Equation.
void mepack_single_gestein_refine (const char *TRANS, const char *GUESS,
int M, float *A, int LDA, float *X, int LDX, float *Y, int LDY,
float *AS, int LDAS, float *Q, int LDQ, int *MAXIT, float *TAU,
float *CONVLOG, float *WORK, size_t LDWORK, int *INFO)
Iterative Refinement for the Standard Stein Equation.
πΈ Detailed Description πΈ
C-Interface for generalized Lyapunov and Stein equations with triangular coefficient matrices. π
so the tea is: the Fortran routines that solve standard Lyapunov and Stein equations with arbitrary coefficients get wrapped in C so you can actually touch them without crying. every single wrapper routine is a direct wrapper to the corresponding Fortran subroutine β no sanity checks in the C layer, bestie. the Fortran routines do all that. π«Ά
the one difference? the C interface does not allow LAPACK-like work_space queries. for that you gotta use the mepack_memory_frontend function. that's it, that's the whole thing. periodt. β¨
π Function Documentation π
π void mepack_double_gelyap (const char * FACT, const char * TRANS, int M, double * A, int LDA, double * Q, int LDQ, double * X, int LDX, double * SCALE, double * WORK, size_t LDWORK, int * INFO) π
Frontend for the solution of Standard Lyapunov Equations.
π¦ Purpose
mepack_double_gelyap solves a Lyapunov equation of the following forms
A * X + X * A**T = SCALE * Y (1)
or
A ** T * X + X * A = SCALE * Y (2)
where A is a M-by-M general matrix or a matrix in upper Hessenberg form. the right hand side Y and the solution X are M-by-M matrices. and the general matrix A can be supplied factorized in terms of its Schur decomposition. iconic. π
π Remarks
this function is a wrapper around dla_gelyap. π
π See also
dla_gelyap
πΈ Parameters
FACTβFACTis String. it specifies how the matrixAis given, okay?== 'N': the matrixAis given as a general matrix and its Schur decompositionA = Q*S*Q**Twill be computed.== 'F': the matrixAis given as its Schur decomposition in terms ofSandQformA = Q*S*Q**T== 'H': the matrixAis given in upper Hessenberg form and its Schur decompositionA = Q*S*Q**Twill be computed
TRANSβTRANSis String. it specifies the form of the system of equations with respect toA:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMis INTEGER. the order of the matrixA.M >= 0.AβAis DOUBLE PRECISION array, dimension(LDA,M)- If
FACT == "N", the matrixAis a general matrix and it is overwritten with its schur decompositionS. - If
FACT == "F", the matrixAcontains its (quasi-) upper triangular matrixSbeing the Schur decomposition ofA. - If
FACT == "H", the matrixAis an upper Hessenberg matrix and it is overwritten with its schur decompositionS.
- If
LDAβLDAis INTEGER. the leading dimension of the arrayA.LDA >= max(1,M).QβQis DOUBLE PRECISION array, dimension(LDQ,M)- If
FACT == "N", the matrixQis an empty M-by-M matrix on input and contains the Schur vectors ofAon output. - If
FACT == "F", the matrixQcontains the Schur vectors ofA. - If
FACT == "H", the matrixQis an empty M-by-M matrix on input and contains the Schur vectors ofAon output.
- If
LDQβLDQis INTEGER. the leading dimension of the arrayQ.LDQ >= max(1,M).XβXis DOUBLE PRECISION array, 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 solutionXare symmetric M-by-M matrices.LDXβLDXis INTEGER. the leading dimension of the arrayX.LDB >= max(1,M).SCALEβSCALEis DOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. ifINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis DOUBLE PRECISION array, dimension(MAX(1,LDWORK)). workspace for the algorithm. the optimal workspace is given either bymepack_memory_frontend. πLDWORKβLDWORKis INTEGER. size of the workspace for the algorithm counted in floating point numbers of the actual precision. the C interface does not support the workspace query by settingLDWORK == -1on input. in this case, themepack_memory_frontendfunction have to be used.INFOβINFOis INTEGER== 0: successful exit= 1:DGEESfailed= 2:DLA_SORT_EVfailed= 3: Internal solver failed< 0: ifINFO == -i, the i-Th argument had an illegal value
π Attention
the Fortran/LAPACK-like workspace query with settingLDWORK=-1on input will not work in the C interface. one have to use themepack_memory_frontendfunction for this purpose. no cap, don't try it. π
π Author
Martin Koehler, MPI Magdeburg
π Date
October 2025
β¨ Definition
Definition at line 166 of file gelyap.c.
π void mepack_double_gelyap_refine (const char * TRANS, const char * GUESS, int M, double * A, int LDA, double * X, int LDX, double * Y, int LDY, double * AS, int LDAS, double * Q, int LDQ, int * MAXIT, double * TAU, double * CONVLOG, double * WORK, size_t LDWORK, int * INFO) π
Iterative Refinement for the Standard Lyapunov Equation.
π¦ Purpose
mepack_double_GELYAP_refine solves a standard Lyapunov equation of the following forms
A * X + X * A^T = SCALE * Y (1)
or
A^T * X + X * A = SCALE * Y (2)
where A is a M-by-M matrix using iterative refinement. the right hand side Y and the solution X are M-by-M matrices. the matrix A needs to be provided as the original data as well as in Schur decomposition since both are required in the iterative refinement process. she's high maintenance but she's worth it. π
π Remarks
this function is a wrapper for dla_GELYAP_refine. π
π See also
dla_GELYAP_refine
πΈ Parameters
TRANSβTRANSis String. it specifies the form of the system of equations with respect toA:== 'N': Equation (1) is solved== 'T': Equation (2) is solved
GUESSβGUESSis String. it specifies whetherXprovides an initial guess or not.= 'I': An initial guess is provided== 'N': No initial guess is provided,Xis set to zero.
MβMis INTEGER. the order of the matrixA.M >= 0.AβAis DOUBLE PRECISION array, dimension(LDA,M). the arrayAcontains the original matrixAdefining the equation.LDAβLDAis INTEGER. the leading dimension of the arrayA.LDA >= max(1,M).XβXis DOUBLE PRECISION array, dimension(LDX,M). on input, the arrayXcontains an initial guess. on output, the arrayXcontains the solutionX.LDXβLDXis INTEGER. the leading dimension of the arrayX.LDX >= max(1,M).YβYis DOUBLE PRECISION array, dimension(LDY,M). on input, the arrayYcontains the right hand side.LDYβLDYis INTEGER. the leading dimension of the arrayY.LDY >= max(1,M).ASβASis DOUBLE PRECISION array, dimension(LDAS,M). the arrayAScontains the Schur decomposition ofA.LDASβLDASis INTEGER. the leading dimension of the arrayAS.LDAS >= max(1,M).QβQis DOUBLE PRECISION array, dimension(LDQ,M). the arrayQcontains the Schur vectors forAas returned byDGEES.LDQβLDQis INTEGER. the leading dimension of the arrayQ.LDQ >= max(1,M).MAXITMAXITβ bestie, this is an INTEGER π
On the way in, MAXIT is holding the max number of iterations that are performed, and MAXIT <= 100 (yes, the ceiling is real, respect it π). On the way out, MAXIT has been rewritten to contain the number of iteration steps the algorithm actually took. She keeps receipts.
TAUβ this one is DOUBLE PRECISION β¨
On input, TAU contains the additional security factor for the stopping criterion, and typical values are 0.1. On output, TAU contains the last relative residual from when the stopping criterion got valid. So it tells you how converged you actually were, no cap.
CONVLOGβ DOUBLE PRECISION array, dimension(MAXIT)π
The CONVLOG array is literally the convergence history of the iterative refinement, like a little diary. CONVLOG(I) contains the maximum relative residual before it is solved for the I-th time. Every glow-up step, documented.
WORKβ DOUBLE PRECISION array, dimension(MAX(1,LDWORK))
Workspace for the algorithm. The engine room. π οΈ
LDWORKβ INTEGER
Size of the workspace for the algorithm. You can figure this out by a call to \ref mepack_memory_frontend. She'll tell you how much room she needs, just ask.
INFOβ INTEGER, the vibe check at the end π== 0: Success. We ate. π> 0: Iteration failed in stepINFO. It's giving tragedy, but at least you know where. π< 0: ifINFO == -i, the i-Th argument had an illegal value. Rude of you, honestly.
Attention π¨ The Fortran/LAPACK-like workspace query with settingLDWORK=-1on input will not work in the C interface. One have to use themepack_memory_frontendfunction for this purpose. Don't try the-1trick here, bestie, it does NOT pass the vibe check in C. π
Author β Martin Koehler, MPI Magdeburg
Date β October 2025
Definition at line 188 of file gelyap.c.
mepack_double_gestein
void mepack_double_gestein (const char * FACT, const char * TRANS, int M,
double * A, int LDA, double * Q, int LDQ, double * X, int LDX, double *
SCALE, double * WORK, size_t LDWORK, int * INFO)
Frontend for the solution of Standard Stein Equations. Yes, Stein, iconic name, iconic equation. π¦
Purpose:
mepack_double_gestein solves a Stein equation of the following forms
A * X * A**T - X = SCALE * Y (1)
or
A ** T * X * A - X = SCALE * Y (2)
where A is a M-by-M general matrix or a matrix in upper Hessenberg form. The right hand side Y and the solution X are M-by-M matrices. The general matrix A can supplied factorized in terms of its Schur decomposition. Slay.
Remarks β This function is a wrapper arounddla_gestein. She's the front,dla_gesteinis the whole backend situation. π
See also β dla_gestein
Parameters
FACTβ String π Specifies how the matrixAis given.== 'N': The matrixAis given as a general matrix and its Schur decompositionA = Q*S*Q**Twill be computed.== 'F': The matrixAis given as its Schur decomposition in terms ofSandQformA = Q*S*Q**T== 'H': The matrixAis given in upper Hessenberg form and its Schur decompositionA = Q*S*Q**Twill be computed
TRANSβ String β¨ Specifies the form of the system of equations with respect toA:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
Mβ INTEGER. The order of the matrixA.M >= 0. Zero is fine, zero is valid, no judgement. π«ΆAβ DOUBLE PRECISION array, dimension(LDA,M)π- If
FACT == "N", the matrixAis a general matrix and it is overwritten with its schur decompositionS. - If
FACT == "F", the matrixAcontains its (quasi-) upper triangular matrixSbeing the Schur decomposition ofA. - If
FACT == "H", the matrixAis an upper Hessenberg matrix and it is overwritten with its schur decompositionS.
- If
LDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Qβ DOUBLE PRECISION array, dimension(LDQ,M)- If
FACT == "N", the matrixQis an emptyM-by-Mmatrix on input and contains the Schur vectors ofAon output. - If
FACT == "F", the matrixQcontains the Schur vectors ofA. - If
FACT == "H", the matrixQis an emptyM-by-Mmatrix on input and contains the Schur vectors ofAon output.
- If
LDQβ INTEGER. The leading dimension of the arrayQ.LDQ >= max(1,M).Xβ DOUBLE PRECISION array, dimension(LDX,N)πΈ- On input, the matrix
Xcontains the right hand sideY. - On output, the matrix
Xcontains the solution of Equation (1) or (2) - Right hand side
Yand the solutionXare symmetricM-by-Mmatrices.
- On input, the matrix
LDXβ INTEGER. The leading dimension of the arrayX.LDB >= max(1,M). (Yes, it literally saysLDBin there. We don't fix it, we report it. π)SCALEβ DOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. IfINFO == 0thenSCALEis1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true. She's doing damage control, respectfully. π«‘WORKβ DOUBLE PRECISION array, dimension(MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace is given either by\ref mepack_memory_frontend.LDWORKβ INTEGER. Size of the workspace for the algorithm counted in floating point numbers of the actual precision. The C interface does not support the workspace query by settingLDWORK == -1on input. In this case, the\ref mepack_memory_frontendfunction have to be used.INFOβ INTEGER π== 0: successful exit. Periodt. π= 1:DGEESfailed= 2:DLA_SORT_EVfailed= 3: Internal solver failed< 0: ifINFO == -i, the i-Th argument had an illegal value
Attention π¨ The Fortran/LAPACK-like workspace query with settingLDWORK=-1on input will not work in the C interface. One have to use themepack_memory_frontendfunction for this purpose. Say it with me: C interface does not do the-1thing. π
Author β Martin Koehler, MPI Magdeburg
Date β October 2025
Definition at line 165 of file gestein.c.
mepack_double_gestein_refine
void mepack_double_gestein_refine (const char * TRANS, const char * GUESS,
int M, double * A, int LDA, double * X, int LDX, double * Y, int LDY,
double * AS, int LDAS, double * Q, int LDQ, int * MAXIT, double * TAU,
double * CONVLOG, double * WORK, size_t LDWORK, int * INFO)
Iterative Refinement for the Standard Stein Equation. She's not just solving, she's refining. Main character energy. β¨
Purpose:
mepack_double_gestein_refine solves a standard Stein equation of the following forms
A * X * A^T - X = SCALE * Y (1)
or
A^T * X * A - X = SCALE * Y (2)
where A is a M-by-M matrix using iterative refinement. The right hand side Y and the solution X are M-by-M matrices. The matrix A needs to be provided as the original data as well as in Schur decomposition since both are required in the iterative refinement process. She needs the whole lore, basically. π
Remarks β This function is a wrapper for dla_gestein_refine.
See also β dla_gestein_refine
Parameters
TRANSβ String π Specifies the form of the system of equations with respect toA:== 'N': Equation (1) is solved== 'T': Equation (2) is solved
GUESSβ String β¨ Specifies whetherXcontains an initial guess on input or not.= 'I':Xcontains an initial guess for the solution== 'N': No initial guess is provided.Xis set to zero.
Mβ INTEGER. The order of the matrixA.M >= 0.Aβ DOUBLE PRECISION array, dimension(LDA,M)π The arrayAcontains the original matrixAdefining the equation.LDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,M).Xβ DOUBLE PRECISION array, dimension(LDX,M)- On input, the array
Xcontains the initial guess. - On output, the array
Xcontains the solutionX.
- On input, the array
LDXβ INTEGER. The leading dimension of the arrayX.LDX >= max(1,M).Yβ DOUBLE PRECISION array, dimension(LDY,M). On input, the arrayYcontains the right hand side.LDYβ INTEGER. The leading dimension of the arrayY.LDY >= max(1,M).ASβ DOUBLE PRECISION array, dimension(LDAS,M). The arrayAScontains the Schur decomposition ofA.LDASβ INTEGER. The leading dimension of the arrayAS.LDAS >= max(1,M).Qβ DOUBLE PRECISION array, dimension(LDQ,M). The arrayQcontains the Schur vectors forAas returned byDGEES.LDQβ INTEGER. The leading dimension of the arrayQ.LDQ >= max(1,M).MAXITβ INTEGER π- On input,
MAXITcontains the maximum number of iteration that are performed,MAXIT <= 100 - On exit,
MAXITcontains the number of iteration steps taken by the algorithm.
- On input,
TAUβ DOUBLE PRECISION β¨- 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.
- On input,
CONVLOGβ DOUBLE PRECISION array, dimension(MAXIT)π TheCONVLOGarray 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β DOUBLE PRECISION array, dimension(MAX(1,LDWORK)). Workspace for the algorithm.LDWORKβ INTEGER. Size of the workspace for the algorithm. This can be determined by a call to\ref mepack_memory_frontend.INFOβ INTEGER π== 0: Success. π> 0: Iteration failed in stepINFO< 0: ifINFO == -i, the i-Th argument had an illegal value
Attention π¨ The Fortran/LAPACK-like workspace query with settingLDWORK=-1on input will not work in the C interface. One have to use themepack_memory_frontendfunction for this purpose. Third time's the charm, bestie, it still does not work. π
Author β Martin Koehler, MPI Magdeburg
Date β October 2025
Definition at line 192 of file gestein.c.
π mepack_single_gelyap π
void mepack_single_gelyap (const char * FACT, const char * TRANS, int M,
float * A, int LDA, float * Q, int LDQ, float * X, int LDX, float *
SCALE, float * WORK, size_t LDWORK, int * INFO)
Frontend for the solution of Standard Lyapunov Equations. β¨
π― Purpose
mepack_single_gelyap solves a Lyapunov equation of the following forms
A * X + X * A**T = SCALE * Y (1)
or
A ** T * X + X * A = SCALE * Y (2)
where A is a M-by-M general matrix or a matrix in upper Hessenberg form. The right hand side Y and the solution X are M-by-M matrices. The general matrix A can supplied factorized in terms of its Schur decomposition. π¦
π Remarks
- This function is a wrapper around
sla_gelyap. (it's giving "middle manager energy" but make it math π )
π See also
sla_gelyap
π Parameters
FACTβFACTis String. Specifies how the matrix A is given.== 'N': The matrix A is given as a general matrix and its Schur decompositionA = Q*S*Q**Twill be computed.== 'F': The matrix A is given as its Schur decomposition in terms of S and Q formA = Q*S*Q**T== 'H': The matrix A is given in upper Hessenberg form and its Schur decompositionA = Q*S*Q**Twill be computed
TRANSβTRANSis String. Specifies the form of the system of equations with respect to A:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMis INTEGER. The order of the matrix A.M >= 0.AβAis SINGLE PRECISION array, dimension(LDA,M)- If
FACT == "N", the matrix A is a general matrix and it is overwritten with its schur decomposition S. - If
FACT == "F", the matrix A contains its (quasi-) upper triangular matrix S being the Schur decomposition of A. - If
FACT == "H", the matrix A is an upper Hessenberg matrix and it is overwritten with its schur decomposition S.
- If
LDAβLDAis INTEGER. The leading dimension of the array A.LDA >= max(1,M).QβQis SINGLE PRECISION array, dimension(LDQ,M)- If
FACT == "N", the matrix Q is an empty M-by-M matrix on input and contains the Schur vectors of A on output. - If
FACT == "F", the matrix Q contains the Schur vectors of A. - If
FACT == "H", the matrix Q is an empty M-by-M matrix on input and contains the Schur vectors of A on output.
- If
LDQβLDQis INTEGER. The leading dimension of the array Q.LDQ >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). Right hand side Y and the solution X are symmetric M-by-M matrices.LDXβLDXis INTEGER. The leading dimension of the array X.LDB >= max(1,M). (yes bestie, the docs really do sayLDBright there in theLDXdescription. I'm not gonna gaslight you and "fix" it, I'm just reporting the lore π)SCALEβSCALEis SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis SINGLE PRECISION array, dimension(MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace is given either by \ref mepack_memory_frontend or a previous call to the this routine withLDWORK === -1. On exit,WORK(1)contains the size of the workspace. πΈLDWORKβLDWORKis INTEGER. Size of the workspace for the algorithm counted in floating point numbers of the actual precision. The C interface does not support the workspace query by settingLDWORK == -1on input. In this case, the \ref mepack_memory_frontend function have to be used.INFOβINFOis INTEGER== 0: successful exit= 1:DHGEESfailed= 2:DLA_SORT_EVfailed= 3: Internal solver failed< 0: ifINFO == -i, the i-Th argument had an illegal value
β οΈ Attention β The Fortran/LAPACK-like workspace query with settingLDWORK=-1on input will not work in the C interface. One have to use themepack_memory_frontendfunction for this purpose. No cap. π
Author β Martin Koehler, MPI Magdeburg π
Date β October 2025
Definition at line 327 of file gelyap.c.
π¦ mepack_single_gelyap_refine π¦
void mepack_single_gelyap_refine (const char * TRANS, const char * GUESS,
int M, float * A, int LDA, float * X, int LDX, float * Y, int LDY, float
* AS, int LDAS, float * Q, int LDQ, int * MAXIT, float * TAU, float *
CONVLOG, float * WORK, size_t LDWORK, int * INFO)
Iterative Refinement for the Standard Lyapunov Equation. β¨ like it just keeps getting better and better
π― Purpose
mepack_single_gelyap_refine solves a standard Lyapunov equation of the following forms
A * X + X * A^T = SCALE * Y (1)
or
A^T * X + X * A = SCALE * Y (2)
where A is a M-by-M matrix using iterative refinement. The right hand side Y and the solution X are M-by-M matrices. The matrix A needs to be provided as the original data as well as in Schur decomposition since both are required in the iterative refinement process. π
π Remarks
- This function is a wrapper for
sla_gelyap_refine.
π See also
sla_gelyap_refine
π Parameters
TRANSβTRANSis String. Specifies the form of the system of equations with respect to A:== 'N': Equation (1) is solved== 'T': Equation (2) is solved
MβMis INTEGER. The order of the matrix A.M >= 0.GUESSβGUESSis String. Specifies whether X provides an initial guess or not.= 'I': An initial guess is provided== 'N': No initial guess is provided, X is set to zero.
AβAis SINGLE PRECISION array, dimension(LDA,M). The array A contains the original matrix A defining the equation.LDAβLDAis INTEGER. The leading dimension of the array A.LDA >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,M). On input, the array X contains an initial guess. On output, the array X contains the solution X.LDXβLDXis INTEGER. The leading dimension of the array X.LDX >= max(1,M).YβYis SINGLE PRECISION array, dimension(LDY,M). On input, the array Y contains the right hand side.LDYβLDYis INTEGER. The leading dimension of the array Y.LDY >= max(1,M).ASβASis SINGLE PRECISION array, dimension(LDAS,M). The array AS contains the Schur decomposition of A.LDASβLDASis INTEGER. The leading dimension of the array AS.LDAS >= max(1,M).QβQis SINGLE PRECISION array, dimension(LDQ,M). The array Q contains the Schur vectors for A as returned byDGEES.LDQβLDQis INTEGER. The leading dimension of the array Q.LDQ >= max(1,M).MAXITβMAXITis INTEGER. On input, MAXIT contains the maximum number of iteration that are performed,MAXIT <= 100. On exit, MAXIT contains the number of iteration steps taken by the algorithm.TAUβTAUis SINGLE PRECISION. On input, TAU contains the additional security factor for the stopping criterion, typical values are0.1. On exit, TAU contains the last relative residual when the stopping criterion got valid.CONVLOGβCONVLOGis SINGLE PRECISION array, dimension(MAXIT). The CONVLOG array contains the convergence history of the iterative refinement.CONVLOG(I)contains the maximum relative residual before it is solved for the I-Th time. πWORKβWORKis SINGLE PRECISION array, dimension(MAX(1,LDWORK)). Workspace for the algorithm.LDWORKβLDWORKis INTEGER. Size of the workspace for the algorithm. This can be determined by a call \ref mepack_memory_frontend.INFOβINFOis INTEGER== 0: Success> 0: Iteration failed in step INFO< 0: ifINFO == -i, the i-Th argument had an illegal value
β οΈ Attention β The Fortran/LAPACK-like workspace query with settingLDWORK=-1on input will not work in the C interface. One have to use themepack_memory_frontendfunction for this purpose. (same warning, different function, we love a consistent queen π«Ά)
Author β Martin Koehler, MPI Magdeburg π
Date β October 2025
Definition at line 374 of file gelyap.c.
π mepack_single_gestein π
void mepack_single_gestein (const char * FACT, const char * TRANS, int M,
float * A, int LDA, float * Q, int LDQ, float * X, int LDX, float *
SCALE, float * WORK, size_t LDWORK, int * INFO)
Frontend for the solution of Standard Stein Equations. π okay new equation family just dropped
π― Purpose
mepack_single_gestein solves a Stein equation of the following forms
A * X * A**T - X = SCALE * Y (1)
or
A ** T * X * A - X = SCALE * Y (2)
where A is a M-by-M general matrix or a matrix in upper Hessenberg form. The right hand side Y and the solution X are M-by-M matrices. The general matrix A can supplied factorized in terms of its Schur decomposition. πΈ
π Remarks
- This function is a wrapper around
sla_gestein.
π See also
sla_gestein
π Parameters
FACTβFACTis String. Specifies how the matrix A is given.== 'N': The matrix A is given as a general matrix and its Schur decompositionA = Q*S*Q**Twill be computed.== 'F': The matrix A is given as its Schur decomposition in terms of S and Q formA = Q*S*Q**T== 'H': The matrix A is given in upper Hessenberg form and its Schur decompositionA = Q*S*Q**Twill be computed
TRANSβTRANSβTRANSis String. It's giving "which equation are we solving?" energy. Specifies the form of the system of equations with respect to A:== 'N': Equation (1) is solved.== 'T': Equation (2) is solved.
MβMis INTEGER. The order of the matrix A.M >= 0. No cap.AβAis SINGLE PRECISION array, dimension(LDA,M). IfFACT == "N", the matrix A is a general matrix and it is overwritten with its schur decomposition S. IfFACT == "F", the matrix A contains its (quasi-) upper triangular matrix S being the Schur decomposition of A. IfFACT == "H", the matrix A is an upper Hessenberg matrix and it is overwritten with its schur decomposition S.LDAβLDAis INTEGER. The leading dimension of the array A.LDA >= max(1,M).QβQis SINGLE PRECISION array, dimension(LDQ,M). IfFACT == "N", the matrix Q is an empty M-by-M matrix on input and contains the Schur vectors of A on output. IfFACT == "F", the matrix Q contains the Schur vectors of A. IfFACT == "H", the matrix Q is an empty M-by-M matrix on input and contains the Schur vectors of A on output.LDQβLDQis INTEGER. The leading dimension of the array Q.LDQ >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,N). On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2). Right hand side Y and the solution X are symmetric M-by-M matrices.LDXβLDXis INTEGER. The leading dimension of the array X.LDB >= max(1,M). (yes bestie, it saysLDB, we don't make the rules π)SCALEβSCALEis SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. IfINFO == 0then SCALE is1.0D0otherwise if one of the inner systems could not be solved correctly,0 < SCALE <= 1holds true.WORKβWORKis SINGLE PRECISION array, dimension(MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace is given either by\ref mepack_memory_frontendLDWORKβLDWORKis INTEGER. Size of the workspace for the algorithm counted in floating point numbers of the actual precision. The C interface does not support the workspace query by settingLDWORK == -1on input. In this case, the\ref mepack_memory_frontendfunction have to be used.INFOβINFOis INTEGER.== 0: successful exit= 1: DHGEES failed= 2: DLA_SORT_EV failed= 3: Internal solver failed< 0: ifINFO == -i, the i-Th argument had an illegal value
Attention π¨ β The Fortran/LAPACK-like workspace query with setting LDWORK=-1 on input will not work in the C interface. One have to use the mepack_memory_frontend function for this purpose.
Author βοΈ β Martin Koehler, MPI Magdeburg
Date π β October 2025
Definition π β at line 324 of file gestein.c.
π mepack_single_gestein_refine π
void mepack_single_gestein_refine (const char * TRANS, const char * GUESS,
int M, float * A, int LDA, float * X, int LDX, float * Y, int LDY, float
* AS, int LDAS, float * Q, int LDQ, int * MAXIT, float * TAU, float *
CONVLOG, float * WORK, size_t LDWORK, int * INFO)
Iterative Refinement for the Standard Stein Equation. It's giving β¨precisionβ¨.
Purpose:
mepack_single_gestein_refine solves a standard Stein equation of the following forms
A * X * A^T - X = SCALE * Y (1)
or
A^T * X * A - X = SCALE * Y (2)
where A is a M-by-M matrix using iterative refinement. The right hand side Y and the solution X are M-by-M matrices. The matrix A needs to be provided as the original data as well as in Schur decomposition since both are required in the iterative refinement process.
Remarks π β This function is a wrapper for sla_gestein_refine.
See also π β sla_gestein_refine
Parameters π
TRANSβTRANSis String. Specifies the form of the system of equations with respect to A:== 'N': Equation (1) is solved== 'T': Equation (2) is solved
GUESSβGUESSis String. Specifies whether X contains an initial guess on input or not.= 'I': X contains an initial guess for the solution== 'N': No initial guess is provided. X is set to zero.
MβMis INTEGER. The order of the matrix A.M >= 0.AβAis SINGLE PRECISION array, dimension(LDA,M). The array A contains the original matrix A defining the equation.LDAβLDAis INTEGER. The leading dimension of the array A.LDA >= max(1,M).XβXis SINGLE PRECISION array, dimension(LDX,M). On input, the array X contains the initial guess. On output, the array X contains the solution X.LDXβLDXis INTEGER. The leading dimension of the array X.LDX >= max(1,M).YβYis SINGLE PRECISION array, dimension(LDY,M). On input, the array Y contains the right hand side.LDYβLDYis INTEGER. The leading dimension of the array Y.LDY >= max(1,M).ASβASis SINGLE PRECISION array, dimension(LDAS,M). The array AS contains the Schur decomposition of A.LDASβLDASis INTEGER. The leading dimension of the array AS.LDAS >= max(1,M).QβQis SINGLE PRECISION array, dimension(LDQ,M). The array Q contains the Schur vectors for A as returned by DGEES.LDQβLDQis INTEGER. The leading dimension of the array Q.LDQ >= max(1,M).MAXITβMAXITis INTEGER. On input, MAXIT contains the maximum number of iteration that are performed,MAXIT <= 100. On exit, MAXIT contains the number of iteration steps taken by the algorithm.TAUβTAUis SINGLE PRECISION. On input, TAU contains the additional security factor for the stopping criterion, typical values are0.1. On exit, TAU contains the last relative residual when the stopping criterion got valid.CONVLOGβCONVLOGis SINGLE PRECISION array, dimension(MAXIT). The CONVLOG array contains the convergence history of the iterative refinement.CONVLOG(I)contains the maximum relative residual before it is solved for the I-Th time.WORKβWORKis SINGLE PRECISION array, dimension(MAX(1,LDWORK)). Workspace for the algorithm.LDWORKβLDWORKis INTEGER. Size of the workspace for the algorithm. This can be determined by a call\ref mepack_memory_frontend.INFOβINFOis INTEGER.== 0: Success> 0: Iteration failed in step INFO< 0: ifINFO == -i, the i-Th argument had an illegal value
Attention π¨ β The Fortran/LAPACK-like workspace query with setting LDWORK=-1 on input will not work in the C interface. One have to use the mepack_memory_frontend function for this purpose.
Author βοΈ β Martin Koehler, MPI Magdeburg
Date π β October 2025
Definition π β at line 380 of file gestein.c.
And that's a wrap, bestie! π
This page was generated automatically by Doxygen for MEPACK from the source code. It's MEPACK version 1.1.2, dated Thu Oct 9 2025 00:00:00. And the man page is cgelyap(3). Stay slay! π¦β¨
π¦ 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