cgelyap(3)

πŸ“¦
version 1.1.2 Β· 3 versions
, in fedora 43

πŸ’– 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 β€” FACT is String. it specifies how the matrix A is given, okay?
    • == 'N': the matrix A is given as a general matrix and its Schur decomposition A = Q*S*Q**T will be computed.
    • == 'F': the matrix A is given as its Schur decomposition in terms of S and Q form A = Q*S*Q**T
    • == 'H': the matrix A is given in upper Hessenberg form and its Schur decomposition A = Q*S*Q**T will be computed
  • TRANS β€” TRANS is String. it specifies the form of the system of equations with respect to A:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. the order of the matrix A. M >= 0.
  • A β€” A is DOUBLE 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.
  • LDA β€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,M).
  • Q β€” Q is DOUBLE 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.
  • LDQ β€” LDQ is INTEGER. the leading dimension of the array Q. LDQ >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). on input, the matrix X contains the right hand side Y. on output, the matrix X contains the solution of Equation (1) or (2). right hand side Y and the solution X are symmetric M-by-M matrices.
  • LDX β€” LDX is INTEGER. the leading dimension of the array X. LDB >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. if INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is DOUBLE PRECISION array, dimension (MAX(1,LDWORK)). workspace for the algorithm. the optimal workspace is given either by mepack_memory_frontend. πŸ‘‘
  • LDWORK β€” LDWORK is 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 setting LDWORK == -1 on input. in this case, the mepack_memory_frontend function have to be used.
  • INFO β€” INFO is INTEGER
    • == 0: successful exit
    • = 1: DGEES failed
    • = 2: DLA_SORT_EV failed
    • = 3: Internal solver failed
    • < 0: if INFO == -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. 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 β€” TRANS is String. it specifies the form of the system of equations with respect to A:
    • == 'N': Equation (1) is solved
    • == 'T': Equation (2) is solved
  • GUESS β€” GUESS is String. it 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.
  • M β€” M is INTEGER. the order of the matrix A. M >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). the array A contains the original matrix A defining the equation.
  • LDA β€” LDA is INTEGER. the leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,M). on input, the array X contains an initial guess. on output, the array X contains the solution X.
  • LDX β€” LDX is INTEGER. the leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is DOUBLE PRECISION array, dimension (LDY,M). on input, the array Y contains the right hand side.
  • LDY β€” LDY is INTEGER. the leading dimension of the array Y. LDY >= max(1,M).
  • AS β€” AS is DOUBLE PRECISION array, dimension (LDAS,M). the array AS contains the Schur decomposition of A.
  • LDAS β€” LDAS is INTEGER. the leading dimension of the array AS. LDAS >= max(1,M).
  • Q β€” Q is DOUBLE PRECISION array, dimension (LDQ,M). the array Q contains the Schur vectors for A as returned by DGEES.
  • LDQ β€” LDQ is INTEGER. the leading dimension of the array Q. LDQ >= max(1,M).
  • MAXIT
  • MAXIT β€” 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 step INFO. It's giving tragedy, but at least you know where. 😭
    • < 0: if INFO == -i, the i-Th argument had an illegal value. Rude of you, honestly.
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. Don't try the -1 trick 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 around dla_gestein. She's the front, dla_gestein is the whole backend situation. πŸ’…

See also β€” dla_gestein

Parameters

  • FACT β€” String πŸ’œ Specifies how the matrix A is given.
    • == 'N': The matrix A is given as a general matrix and its Schur decomposition A = Q*S*Q**T will be computed.
    • == 'F': The matrix A is given as its Schur decomposition in terms of S and Q form A = Q*S*Q**T
    • == 'H': The matrix A is given in upper Hessenberg form and its Schur decomposition A = Q*S*Q**T will be computed
  • TRANS β€” String ✨ Specifies the form of the system of equations with respect to A:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” INTEGER. The order of the matrix A. M >= 0. Zero is fine, zero is valid, no judgement. 🫢
  • A β€” DOUBLE 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.
  • LDA β€” INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • Q β€” DOUBLE 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.
  • LDQ β€” INTEGER. The leading dimension of the array Q. LDQ >= max(1,M).
  • X β€” DOUBLE PRECISION array, dimension (LDX,N) 🌸
    • On input, the matrix X contains the right hand side Y.
    • On output, the matrix X contains the solution of Equation (1) or (2)
    • Right hand side Y and the solution X are symmetric M-by-M matrices.
  • LDX β€” INTEGER. The leading dimension of the array X. LDB >= max(1,M). (Yes, it literally says LDB in there. We don't fix it, we report it. πŸ’€)
  • SCALE β€” DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true. 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 setting LDWORK == -1 on input. In this case, the \ref mepack_memory_frontend function have to be used.
  • INFO β€” INTEGER πŸ’…
    • == 0: successful exit. Periodt. πŸ‘‘
    • = 1: DGEES failed
    • = 2: DLA_SORT_EV failed
    • = 3: Internal solver failed
    • < 0: if INFO == -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. Say it with me: C interface does not do the -1 thing. πŸ™ˆ

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 to A:
    • == 'N': Equation (1) is solved
    • == 'T': Equation (2) is solved
  • GUESS β€” 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 β€” INTEGER. The order of the matrix A. M >= 0.
  • A β€” DOUBLE PRECISION array, dimension (LDA,M) πŸŽ€ The array A contains the original matrix A defining the equation.
  • LDA β€” INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” DOUBLE PRECISION array, dimension (LDX,M)
    • On input, the array X contains the initial guess.
    • On output, the array X contains the solution X.
  • LDX β€” INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” DOUBLE PRECISION array, dimension (LDY,M). On input, the array Y contains the right hand side.
  • LDY β€” INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • AS β€” DOUBLE PRECISION array, dimension (LDAS,M). The array AS contains the Schur decomposition of A.
  • LDAS β€” INTEGER. The leading dimension of the array AS. LDAS >= max(1,M).
  • Q β€” DOUBLE PRECISION array, dimension (LDQ,M). The array Q contains the Schur vectors for A as returned by DGEES.
  • LDQ β€” INTEGER. The leading dimension of the array Q. LDQ >= max(1,M).
  • MAXIT β€” 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 β€” DOUBLE PRECISION ✨
    • On input, TAU contains the additional security factor for the stopping criterion, typical values are 0.1
    • On exit, TAU contains the last relative residual when the stopping criterion got valid.
  • CONVLOG β€” DOUBLE PRECISION array, dimension (MAXIT) πŸŽ€ The CONVLOG array contains the convergence history of the iterative refinement. CONVLOG(I) contains the maximum relative residual before it is solved for the I-Th time.
  • WORK β€” 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 step INFO
    • < 0: if INFO == -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. 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 β€” FACT is String. Specifies how the matrix A is given.
    • == 'N': The matrix A is given as a general matrix and its Schur decomposition A = Q*S*Q**T will be computed.
    • == 'F': The matrix A is given as its Schur decomposition in terms of S and Q form A = Q*S*Q**T
    • == 'H': The matrix A is given in upper Hessenberg form and its Schur decomposition A = Q*S*Q**T will be computed
  • TRANS β€” TRANS is String. Specifies the form of the system of equations with respect to A:
    • == 'N': Equation (1) is solved.
    • == 'T': Equation (2) is solved.
  • M β€” M is INTEGER. The order of the matrix A. M >= 0.
  • A β€” A is 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.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • Q β€” Q is 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.
  • LDQ β€” LDQ is INTEGER. The leading dimension of the array Q. LDQ >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDB >= max(1,M). (yes bestie, the docs really do say LDB right there in the LDX description. I'm not gonna gaslight you and "fix" it, I'm just reporting the lore πŸ’€)
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is 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 with LDWORK === -1. On exit, WORK(1) contains the size of the workspace. 🌸
  • LDWORK β€” LDWORK is 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 setting LDWORK == -1 on input. In this case, the \ref mepack_memory_frontend function have to be used.
  • INFO β€” INFO is INTEGER
    • == 0: successful exit
    • = 1: DHGEES failed
    • = 2: DLA_SORT_EV failed
    • = 3: Internal solver failed
    • < 0: if INFO == -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. 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 β€” TRANS is String. Specifies the form of the system of equations with respect to A:
    • == 'N': Equation (1) is solved
    • == 'T': Equation (2) is solved
  • M β€” M is INTEGER. The order of the matrix A. M >= 0.
  • GUESS β€” GUESS is 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 β€” A is SINGLE PRECISION array, dimension (LDA,M). The array A contains the original matrix A defining the equation.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is SINGLE PRECISION array, dimension (LDY,M). On input, the array Y contains the right hand side.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • AS β€” AS is SINGLE PRECISION array, dimension (LDAS,M). The array AS contains the Schur decomposition of A.
  • LDAS β€” LDAS is INTEGER. The leading dimension of the array AS. LDAS >= max(1,M).
  • Q β€” Q is SINGLE PRECISION array, dimension (LDQ,M). The array Q contains the Schur vectors for A as returned by DGEES.
  • LDQ β€” LDQ is INTEGER. The leading dimension of the array Q. LDQ >= max(1,M).
  • MAXIT β€” MAXIT is INTEGER. On input, MAXIT contains the maximum number of iteration that are performed, MAXIT <= 100. On exit, MAXIT contains the number of iteration steps taken by the algorithm.
  • TAU β€” TAU is SINGLE PRECISION. On input, TAU contains the additional security factor for the stopping criterion, typical values are 0.1. On exit, TAU contains the last relative residual when the stopping criterion got valid.
  • CONVLOG β€” CONVLOG is 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 β€” WORK is SINGLE PRECISION array, dimension (MAX(1,LDWORK)). Workspace for the algorithm.
  • LDWORK β€” LDWORK is INTEGER. Size of the workspace for the algorithm. This can be determined by a call \ref mepack_memory_frontend.
  • INFO β€” INFO is INTEGER
    • == 0: Success
    • > 0: Iteration failed in step INFO
    • < 0: if INFO == -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. (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 β€” FACT is String. Specifies how the matrix A is given.
    • == 'N': The matrix A is given as a general matrix and its Schur decomposition A = Q*S*Q**T will be computed.
    • == 'F': The matrix A is given as its Schur decomposition in terms of S and Q form A = Q*S*Q**T
    • == 'H': The matrix A is given in upper Hessenberg form and its Schur decomposition A = Q*S*Q**T will be computed
  • TRANS β€”
  • TRANS β€” TRANS is 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 β€” M is INTEGER. The order of the matrix A. M >= 0. No cap.
  • A β€” A is 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.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • Q β€” Q is 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.
  • LDQ β€” LDQ is INTEGER. The leading dimension of the array Q. LDQ >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDB >= max(1,M). (yes bestie, it says LDB, we don't make the rules πŸ’€)
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. If INFO == 0 then SCALE is 1.0D0 otherwise if one of the inner systems could not be solved correctly, 0 < SCALE <= 1 holds true.
  • WORK β€” WORK is SINGLE PRECISION array, dimension (MAX(1,LDWORK)). Workspace for the algorithm. The optimal workspace is given either by \ref mepack_memory_frontend
  • LDWORK β€” LDWORK is 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 setting LDWORK == -1 on input. In this case, the \ref mepack_memory_frontend function have to be used.
  • INFO β€” INFO is INTEGER.
    • == 0: successful exit
    • = 1: DHGEES failed
    • = 2: DLA_SORT_EV failed
    • = 3: Internal solver failed
    • < 0: if INFO == -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 β€” TRANS is String. Specifies the form of the system of equations with respect to A:
    • == 'N': Equation (1) is solved
    • == 'T': Equation (2) is solved
  • GUESS β€” GUESS is 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 β€” M is INTEGER. The order of the matrix A. M >= 0.
  • A β€” A is SINGLE PRECISION array, dimension (LDA,M). The array A contains the original matrix A defining the equation.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is 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 β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is SINGLE PRECISION array, dimension (LDY,M). On input, the array Y contains the right hand side.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • AS β€” AS is SINGLE PRECISION array, dimension (LDAS,M). The array AS contains the Schur decomposition of A.
  • LDAS β€” LDAS is INTEGER. The leading dimension of the array AS. LDAS >= max(1,M).
  • Q β€” Q is SINGLE PRECISION array, dimension (LDQ,M). The array Q contains the Schur vectors for A as returned by DGEES.
  • LDQ β€” LDQ is INTEGER. The leading dimension of the array Q. LDQ >= max(1,M).
  • MAXIT β€” MAXIT is INTEGER. On input, MAXIT contains the maximum number of iteration that are performed, MAXIT <= 100. On exit, MAXIT contains the number of iteration steps taken by the algorithm.
  • TAU β€” TAU is SINGLE PRECISION. On input, TAU contains the additional security factor for the stopping criterion, typical values are 0.1. On exit, TAU contains the last relative residual when the stopping criterion got valid.
  • CONVLOG β€” CONVLOG is 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 β€” WORK is SINGLE PRECISION array, dimension (MAX(1,LDWORK)). Workspace for the algorithm.
  • LDWORK β€” LDWORK is INTEGER. Size of the workspace for the algorithm. This can be determined by a call \ref mepack_memory_frontend.
  • INFO β€” INFO is INTEGER.
    • == 0: Success
    • > 0: Iteration failed in step INFO
    • < 0: if INFO == -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