cresidual(3)

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

🌸 cresidual β€” C-Interface πŸ’…

okay bestie, come SIT. this is cresidual(3), part of the MEPACK manual, and it's the C-Interface page for residual computations. yes, residuals. the "did my solver actually do the thing" check. main character energy fr fr 🫢


✨ NAME ✨

cresidual β€” C-Interface

  • C-Interface for the residual computations.

✨ SYNOPSIS ✨

πŸŽ€ Functions πŸŽ€

okay so here's the whole roster, and every single one of these is a real signature, character for character, no notes:

double mepack_double_residual_csylv (const char *TRANSA, const char *TRANSB, double sgn1, double sgn2, int M, int N, double *A, int LDA, double *B, int LDB, double *C, int LDC, double *D, int LDD, double *R, int LDR, double *L, int LDL, double *E, int LDE, double *F, int LDF, double SCALE)

Compute the relative residual for the coupled Sylvester equation.

float mepack_single_residual_csylv (const char *TRANSA, const char *TRANSB, float sgn1, float sgn2, int M, int N, float *A, int LDA, float *B, int LDB, float *C, int LDC, float *D, int LDD, float *R, int LDR, float *L, int LDL, float *E, int LDE, float *F, int LDF, float SCALE)

Compute the relative residual for the coupled Sylvester equation.

double mepack_double_residual_csylv_dual (const char *TRANSA, const char *TRANSB, double sgn1, double sgn2, int M, int N, double *A, int LDA, double *B, int LDB, double *C, int LDC, double *D, int LDD, double *R, int LDR, double *L, int LDL, double *E, int LDE, double *F, int LDF, double SCALE)

Compute the relative residual for the coupled Sylvester equation.

float mepack_single_residual_csylv_dual (const char *TRANSA, const char *TRANSB, float sgn1, float sgn2, int M, int N, float *A, int LDA, float *B, int LDB, float *C, int LDC, float *D, int LDD, float *R, int LDR, float *L, int LDL, float *E, int LDE, float *F, int LDF, float SCALE)

Compute the relative residual for the coupled Sylvester equation.

double mepack_double_residual_glyap (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *Y, int LDY, double SCALE)

Compute the relative residual for the generalized Lyapunov equation.

float mepack_single_residual_glyap (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *Y, int LDY, float SCALE)

Compute the relative residual for the generalized Lyapunov equation.

double mepack_double_residual_gstein (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *Y, int LDY, double SCALE)

Compute the relative residual for the generalized Stein equation.

float mepack_single_residual_gstein (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *Y, int LDY, float SCALE)

Compute the relative residual for the generalized Stein equation.

double mepack_double_residual_gsylv (const char *TRANSA, const char *TRANSB, double sgn, int M, int N, double *A, int LDA, double *B, int LDB, double *C, int LDC, double *D, int LDD, double *X, int LDX, double *Y, int LDY, double SCALE)

Compute the relative residual for the generalized Sylvester equation.

float mepack_single_residual_gsylv (const char *TRANSA, const char *TRANSB, float sgn, int M, int N, float *A, int LDA, float *B, int LDB, float *C, int LDC, float *D, int LDD, float *X, int LDX, float *Y, int LDY, float SCALE)

Compute the relative residual for the generalized Sylvester equation.

double mepack_double_residual_lyap (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *Y, int LDY, double SCALE)

Compute the relative residual for the Lyapunov equation.

float mepack_single_residual_lyap (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *Y, int LDY, float SCALE)

Compute the relative residual for the Lyapunov equation.

double mepack_double_residual_stein (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *Y, int LDY, double SCALE)

Compute the relative residual for the Stein equation.

float mepack_single_residual_stein (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *Y, int LDY, float SCALE)

Compute the relative residual for the Stein equation.

double mepack_double_residual_sylv (const char *TRANSA, const char *TRANSB, double sgn, int M, int N, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *Y, int LDY, double SCALE)

Compute the relative residual for the Sylvester equation.

float mepack_single_residual_sylv (const char *TRANSA, const char *TRANSB, float sgn, int M, int N, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *Y, int LDY, float SCALE)

Compute the relative residual for the Sylvester equation.

double mepack_double_residual_sylv2 (const char *TRANSA, const char *TRANSB, double sgn, int M, int N, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *Y, int LDY, double SCALE)

Compute the relative residual for the discrete-time Sylvester equation.

float mepack_single_residual_sylv2 (const char *TRANSA, const char *TRANSB, float sgn, int M, int N, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *Y, int LDY, float SCALE)

Compute the relative residual for the discrete-time Sylvester equation.


🌈 Detailed Description 🌈

C-Interface for the residual computations.

The routines in this group are wrappers around the Fortran routines from Residual Computations. so like, the Fortran girlies did the heavy lifting, and these are the C besties holding the door open 🫢


πŸ’– Function Documentation πŸ’–

⭐ mepack_double_residual_csylv ⭐

double mepack_double_residual_csylv (const char * TRANSA, const char * TRANSB, double sgn1, double sgn2, int M, int N, double * A, int LDA, double * B, int LDB, double * C, int LDC, double * D, int LDD, double * R, int LDR, double * L, int LDL, double * E, int LDE, double * F, int LDF, double SCALE)

Compute the relative residual for the coupled Sylvester equation.

Purpose:

Compute the relative residual of the coupled Sylvester equation

RelRes = max( || SCALE*E - opA(A)*R - SGN1 * L *opB(B) || / ( (||A||*||R||+||B||*||L||) + SCALE * ||E|| ),
              || SCALE*F - opA(C)*R - SGN2 * L *opB(D) || / ( (||C||*||R||+||D||*||L||) + SCALE * ||F|| ))    (1)

The norms are evaluated in terms of the Frobenius norm.

Remarks

Auxiliary memory is managed by the function itself. so you don't gotta malloc anything, she handles it πŸ’…

Parameters

  • TRANSA β€” TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': opA(A) = A (No transpose for A)
    • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB β€” TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B:
    • == 'N': opB(B) = B (No transpose for B)
    • == 'T': opB(B) = B**T (Transpose B)
  • SGN1 β€” SGN1 is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign in the first equation.
  • SGN2 β€” SGN2 is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign in the second equation.
  • M β€” M is INTEGER. The order of the matrix A. M >= 0.
  • N β€” N is INTEGER. The order of the matrix B. N >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is DOUBLE PRECISION array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • C β€” C is DOUBLE PRECISION array, dimension (LDC,M). The coefficient matrix C.
  • LDC β€” LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
  • D β€” D is DOUBLE PRECISION array, dimension (LDD,N). The coefficient matrix D.
  • LDD β€” LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
  • R β€” R is DOUBLE PRECISION array, dimension (LDR,N). The first of the Sylvester Equation.
  • LDR β€” LDR is INTEGER. The leading dimension of the array R. LDX >= max(1,M).
ngl bestie, that LDX in the LDR description is straight from the source β€” it says LDX even though we're talking about R here. i'm not fixing it, i'm just reporting it πŸ™ˆ
  • L β€” L is DOUBLE PRECISION array, dimension (LDL,N). The second solution the Sylvester Equation.
  • LDL β€” LDL is INTEGER. The leading dimension of the array L. LDL >= max(1,M).
  • E β€” E is DOUBLE PRECISION array, dimension (LDE,N). The first right hand side of the Sylvester Equation.
  • LDE β€” LDE is INTEGER. The leading dimension of the array E. LDE >= max(1,M).
  • F β€” F is DOUBLE PRECISION array, dimension (LDF,N). The second right hand side of the Sylvester Equation.
  • LDF β€” LDF is INTEGER. The leading dimension of the array F. LDF >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. she's the safety net ✨

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

See also

dla_residual_csylv

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 201 of file csylv.c.


⭐ mepack_double_residual_csylv_dual ⭐

double mepack_double_residual_csylv_dual (const char * TRANSA, const char * TRANSB, double sgn1, double sgn2, int M, int N, double * A, int LDA, double * B, int LDB, double * C, int LDC, double * D, int LDD, double * R, int LDR, double * L, int LDL, double * E, int LDE, double * F, int LDF, double SCALE)

Compute the relative residual for the coupled Sylvester equation.

Purpose:

Compute the relative residual of the coupled Sylvester equation

RelRes = max( || SCALE*E - opA(A)**T *R - opA(C) ** T *L || / ( (||A||*||R||+||C||*||L||) + SCALE * ||E|| ),
              || SCALE*F - SGN1 * R  * opB(B)**T - SGN2 * L * opB(D) **T || / ( (||B||*||R||+||D||*||L||) + SCALE * ||F||)) (1)

The norms are evaluated in terms of the Frobenius norm.

Remarks

Auxiliary memory is managed by the function itself. again, she's got it, you don't πŸ’…

Parameters

  • TRANSA β€” TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': opA(A) = A (No transpose for A)
    • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB
  • TRANSB β€” TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B, bestie πŸ’–:
    • == 'N': opB(B) = B (No transpose for B)
    • == 'T': opB(B) = B**T (Transpose B)
  • SGN1 β€” SGN1 is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign in the first equation. periodt.
  • SGN2 β€” SGN2 is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign in the second equation. no cap.
  • M β€” M is INTEGER. The order of the matrix A. M >= 0. gotta be non-negative, fr fr.
  • N β€” N is INTEGER. The order of the matrix B. N >= 0. same energy.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). iconic.
  • B β€” B is DOUBLE PRECISION array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • C β€” C is DOUBLE PRECISION array, dimension (LDC,M). The coefficient matrix C.
  • LDC β€” LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
  • D β€” D is DOUBLE PRECISION array, dimension (LDD,N). The coefficient matrix D.
  • LDD β€” LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
  • R β€” R is DOUBLE PRECISION array, dimension (LDR,N). The first of the Sylvester Equation.
  • LDR β€” LDR is INTEGER. The leading dimension of the array R. LDX >= max(1,M). (yes bestie, it says LDX here, not LDR β€” we don’t make the rules πŸ’€)
  • L β€” L is DOUBLE PRECISION array, dimension (LDL,N). The second solution the Sylvester Equation.
  • LDL β€” LDL is INTEGER. The leading dimension of the array L. LDL >= max(1,M).
  • E β€” E is DOUBLE PRECISION array, dimension (LDE,N). The first right hand side of the Sylvester Equation.
  • LDE β€” LDE is INTEGER. The leading dimension of the array E. LDE >= max(1,M).
  • F β€” F is DOUBLE PRECISION array, dimension (LDF,N). The second right hand side of the Sylvester Equation.
  • LDF β€” LDF is INTEGER. The leading dimension of the array F. LDF >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. she’s just here to keep things from going feral πŸ”₯.

Returns πŸ’–

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated. so if you see a negative number, something’s sus πŸ‘€.

See also πŸ‘€

  • dla_residual_csylv_dual

Author ✍️

Martin Koehler, MPI Magdeburg

Date πŸ“…

October 2025

Definition πŸ“

Definition at line 201 of file csylv_dual.c.


✨ mepack_double_residual_glyap ✨

double mepack_double_residual_glyap (const char * TRANS, int M, double * A,
    int LDA, double * B, int LDB, double * X, int LDX, double * Y, int LDY,
    double SCALE)

Compute the relative residual for the generalized Lyapunov equation.

Purpose 🎯

Compute the relative residual of the generalized Lyapunov equation

RelRes = || SCALE*Y - op(A)*X*op(B)**T - op(B) * X * op(A)**T || / ( 2*||A||*||B||*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm.

Remarks πŸ“

Auxiliary memory is managed by the function itself.

Parameters πŸ“‹

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A, bestie:
    • == 'N': op(A) = A (No transpose for A)
    • == 'T': op(A) = A**T (Transpose A)
  • M β€” M is INTEGER. The order of the matrices A. M >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is DOUBLE PRECISION array, dimension (LDB,M). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,M). Solution of the Lyapunov Equation.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is DOUBLE PRECISION array, dimension (LDX,M). The right hand side of the Lyapunov Equation.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

Returns πŸ’–

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

See also πŸ‘€

  • dla_residual_glyap

Author ✍️

Martin Koehler, MPI Magdeburg

Date πŸ“…

October 2025

Definition πŸ“

Definition at line 126 of file glyap.c.


✨ mepack_double_residual_gstein ✨

double mepack_double_residual_gstein (const char * TRANS, int M, double * A,
    int LDA, double * B, int LDB, double * X, int LDX, double * Y, int LDY,
    double SCALE)

Compute the relative residual for the generalized Stein equation.

Purpose 🎯

Compute the relative residual of the generalized Stein equation

RelRes = || SCALE*Y - op(A)*X*op(A)**T + op(B) * X * op(B)**T || / ( (||A||**2+||B||**2)*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm.

Remarks πŸ“

Auxiliary memory is managed by the function itself.

Parameters πŸ“‹

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': op(A) = A (No transpose for A)
    • == 'T': op(A) = A**T (Transpose A)
  • M β€” M is INTEGER. The order of the matrices A. M >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is DOUBLE PRECISION array, dimension (LDB,M). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,M). Solution of the Stein Equation.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is DOUBLE PRECISION array, dimension (LDX,M). The right hand side of the Stein Equation.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

Returns πŸ’–

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

See also πŸ‘€

  • dla_residual_gstein

Author ✍️

Martin Koehler, MPI Magdeburg

Date πŸ“…

October 2025

Definition πŸ“

Definition at line 126 of file gstein.c.


✨ mepack_double_residual_gsylv ✨

double mepack_double_residual_gsylv (const char * TRANSA, const char *
    TRANSB, double sgn, int M, int N, double * A, int LDA, double * B, int
    LDB, double * C, int LDC, double * D, int LDD, double * X, int LDX,
    double * Y, int LDY, double SCALE)

Compute the relative residual for the generalized Sylvester equation.

Purpose 🎯

Compute the relative residual of the generalized Sylvester equation

RelRes = || SCALE*Y - opA(A)*X *opB(B) - SGN * opA(C) * X * opB(D) || / ( (||A||*||B||+||C||*||D||)*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm.

Remarks πŸ“

Auxiliary memory is managed by the function itself.

Parameters πŸ“‹

  • TRANSA β€” TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': opA(A) = A (No transpose for A)
    • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB β€” TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B:
    • == 'N': opB(B) = B (No transpose for B)
    • == 'T': opB(B) = B**T (Transpose B)
  • SGN β€” SGN is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation.
  • M β€” M is INTEGER. The order of the matrix A. M >= 0.
  • N β€” N is INTEGER. The order of the matrix B. N >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is DOUBLE PRECISION array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • C β€” C is DOUBLE PRECISION array, dimension (LDC,M). The coefficient matrix C.
  • LDC β€” LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
  • D β€” D is DOUBLE PRECISION array, dimension (LDD,N). The coefficient matrix D.
  • LDD β€” LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,N). Solution of the Sylvester Equation.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y
  • Y β€” bestie, Y is a DOUBLE PRECISION array, dimension (LDY,N). It's the right hand side of the Sylvester Equation. πŸ’–
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M). πŸ‘‘
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. ✨

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated. 😭

See also

dla_residual_gsylv

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 170 of file gsylv.c.


πŸ’… double mepack_double_residual_lyap (const char * TRANS, int M, double * A, int LDA, double * X, int LDX, double * Y, int LDY, double SCALE)

Compute the relative residual for the Lyapunov equation. πŸ¦‹

✨ Purpose ✨

Compute the relative residual of the Lyapunov equation

RelRes = || SCALE*Y - op(A)*X - X * op(A)**T || / ( 2*||A||*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm. 🌸

πŸ’‘ Remarks πŸ’‘

Auxiliary memory is managed by the function itself. no cap.

πŸ“ Parameters πŸ“

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': op(A) = A (No transpose for A)
    • == 'T': op(A) = A**T (Transpose A)
  • M β€” M is INTEGER. The order of the matrices A. M >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,M). Solution of the Lyapunov Equation.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is DOUBLE PRECISION array, dimension (LDX,M). The right hand side of the Lyapunov Equation.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

πŸ”™ Returns πŸ”™

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

πŸ‘€ See also πŸ‘€ dla_residual_lyap

✍️ Author ✍️ Martin Koehler, MPI Magdeburg

πŸ“… Date πŸ“… October 2025

πŸ“ Definition at line 114 of file lyap.c.


🌟 double mepack_double_residual_stein (const char * TRANS, int M, double * A, int LDA, double * X, int LDX, double * Y, int LDY, double SCALE)

Compute the relative residual for the Stein equation. πŸŽ€

✨ Purpose ✨

Compute the relative residual of the Stein equation

RelRes = || SCALE*Y - op(A)*X*op(A)**T + X || / ( (||A||**2+1) * ||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm. 🌸

πŸ’‘ Remarks πŸ’‘

Auxiliary memory is managed by the function itself. no cap.

πŸ“ Parameters πŸ“

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': op(A) = A (No transpose for A)
    • == 'T': op(A) = A**T (Transpose A)
  • M β€” M is INTEGER. The order of the matrices A. M >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,M). Solution of the Stein Equation.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is DOUBLE PRECISION array, dimension (LDX,M). The right hand side of the Stein Equation.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

πŸ”™ Returns πŸ”™

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

πŸ‘€ See also πŸ‘€ dla_residual_stein

✍️ Author ✍️ Martin Koehler, MPI Magdeburg

πŸ“… Date πŸ“… October 2025

πŸ“ Definition at line 114 of file stein.c.


πŸ”₯ double mepack_double_residual_sylv (const char * TRANSA, const char * TRANSB, double sgn, int M, int N, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * Y, int LDY, double SCALE)

Compute the relative residual for the Sylvester equation. πŸ‘‘

✨ Purpose ✨

Compute the relative residual of the Sylvester equation

RelRes = || SCALE*Y - opA(A)*X - SGN * X * opB(B) || / ( (||A||+||B||)*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm. 🌸

πŸ’‘ Remarks πŸ’‘

Auxiliary memory is managed by the function itself. no cap.

πŸ“ Parameters πŸ“

  • TRANSA β€” TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': opA(A) = A (No transpose for A)
    • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB β€” TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B:
    • == 'N': opB(B) = B (No transpose for B)
    • == 'T': opB(B) = B**T (Transpose B)
  • SGN β€” SGN is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation.
  • M β€” M is INTEGER. The order of the matrix A. M >= 0.
  • N β€” N is INTEGER. The order of the matrix B. N >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is DOUBLE PRECISION array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,M). Solution of the Sylvester Equation.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is DOUBLE PRECISION array, dimension (LDX,M). The right hand side of the Sylvester Equation.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

πŸ”™ Returns πŸ”™

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

πŸ‘€ See also πŸ‘€ dla_residual_sylv

✍️ Author ✍️ Martin Koehler, MPI Magdeburg

πŸ“… Date πŸ“… October 2025

πŸ“ Definition at line 147 of file sylv.c.


🌈 double mepack_double_residual_sylv2 (const char * TRANSA, const char * TRANSB, double sgn, int M, int N, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * Y, int LDY, double SCALE)

Compute the relative residual for the discrete-time Sylvester equation. πŸ¦‹

✨ Purpose ✨

Compute the relative residual of the discrete-time Sylvester equation

RelRes = || SCALE*Y - opA(A)*X*op(B) - SGN*X || / ( (||A||*||B||+1)*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm. 🌸

πŸ’‘ Remarks πŸ’‘

Auxiliary memory is managed by the function itself. no cap.

πŸ“ Parameters πŸ“

  • TRANSA β€” TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': opA(A) = A (No transpose for A)
    • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB β€” TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B:
    • == 'N': opB(B) = B (No transpose for B)
    • == 'T': opB(B) = B**T (Transpose B)
  • SGN β€” SGN is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation.
  • M β€” M is INTEGER. The order of the matrix A. M >= 0.
  • N β€” N is INTEGER. The order of the matrix B. N >= 0.
  • A β€” A is DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is DOUBLE PRECISION array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • X β€” X is DOUBLE PRECISION array, dimension (LDX,M). Solution of the Sylvester Equation.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is DOUBLE PRECISION array, dimension (LDX,M). The right hand side of the Sylvester Equation.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • SCALE β€” SCALE is DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

Returns

...and yeah, that's the relative residual, exactly as defined in that (1) up there. πŸ’–

If something goes wrong it hands you back a negative integer I, which is basically the function screaming "bestie, parameter -I is illegal/wrong, fix it." πŸ™ˆ And if I = -1000? That means the auxiliary memory could not be allocated. Rude, but at least it's honest. πŸ’€

See also

dla_residual_sylv2

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition

At line 147 of file sylv2.c.


✨ float mepack_single_residual_csylv (const char * TRANSA, const char * TRANSB, float sgn1, float sgn2, int M, int N, float * A, int LDA, float * B, int LDB, float * C, int LDC, float * D, int LDD, float * R, int LDR, float * L, int LDL, float * E, int LDE, float * F, int LDF, float SCALE) ✨

Compute the relative residual for the coupled Sylvester equation. πŸ¦‹

Purpose

So like, it computes the relative residual of the coupled Sylvester equation, and it's giving:

RelRes = max( || SCALE*E - opA(A)*R - SGN1 * L *opB(B) || / ( (||A||*||R||+||B||*||L||) + SCALE * ||E|| ),
              || SCALE*F - opA(C)*R - SGN2 * L *opB(D) || / ( (||C||*||R||+||D||*||L||) + SCALE * ||F|| ))    (1)

The norms are evaluated in terms of the Frobenius norm. Periodt. πŸ’…

Remarks

Auxiliary memory is managed by the function itself. It's independent, it handles its own business, main character energy honestly. πŸ‘‘

Parameters

  • TRANSA β€” TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': opA(A) = A (No transpose for A)
    • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB β€” TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B:
    • == 'N': opB(B) = B (No transpose for B)
    • == 'T': opB(B) = B**T (Transpose B)
  • SGN1 β€” SGN1 is SINGLE PRECISION, allowed values: +/-1. Specifies the sign in the first equation.
  • SGN2 β€” SGN2 is SINGLE PRECISION, allowed values: +/-1. Specifies the sign in the second equation.
  • M β€” M is INTEGER. The order of the matrix A. M >= 0.
  • N β€” N is INTEGER. The order of the matrix B. N >= 0.
  • A β€” A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is SINGLE PRECISION array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • C β€” C is SINGLE PRECISION array, dimension (LDC,M). The coefficient matrix C.
  • LDC β€” LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
  • D β€” D is SINGLE PRECISION array, dimension (LDD,N). The coefficient matrix D.
  • LDD β€” LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
  • R β€” R is SINGLE PRECISION array, dimension (LDR,N). The first of the Sylvester Equation.
  • LDR β€” LDR is INTEGER. The leading dimension of the array R. LDX >= max(1,M).
  • L β€” L is SINGLE PRECISION array, dimension (LDL,N). The second solution the Sylvester Equation.
  • LDL β€” LDL is INTEGER. The leading dimension of the array L. LDL >= max(1,M).
  • E β€” E is SINGLE PRECISION array, dimension (LDE,N). The first right hand side of the Sylvester Equation.
  • LDE β€” LDE is INTEGER. The leading dimension of the array E. LDE >= max(1,M).
  • F β€” F is SINGLE PRECISION array, dimension (LDF,N). The second right hand side of the Sylvester Equation.
  • LDF β€” LDF is INTEGER. The leading dimension of the array F. LDF >= max(1,M).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated. 😭

See also

sla_residual_csylv

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition

At line 397 of file csylv.c.


✨ float mepack_single_residual_csylv_dual (const char * TRANSA, const char * TRANSB, float sgn1, float sgn2, int M, int N, float * A, int LDA, float * B, int LDB, float * C, int LDC, float * D, int LDD, float * R, int LDR, float * L, int LDL, float * E, int LDE, float * F, int LDF, float SCALE) ✨

Compute the relative residual for the coupled Sylvester equation. πŸ’œ (yes, the dual one, we're doing it again but transposed-ily, iykyk)

Purpose

Compute the relative residual of the coupled Sylvester equation:

RelRes = max( || SCALE*E - opA(A)**T *R - opA(C) ** T *L || / ( (||A||*||R||+||C||*||L||) + SCALE * ||E|| ),
              || SCALE*F - SGN1 * R  * opB(B)**T - SGN2 * L * opB(D) **T || / ( (||B||*||R||+||D||*||L||) + SCALE * ||F||)) (1)

The norms are evaluated in terms of the Frobenius norm. 🧚

Remarks

Auxiliary memory is managed by the function itself.

Parameters

  • TRANSA β€” TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': opA(A) = A (No transpose for A)
    • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB β€” TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B:
    • == 'N': opB(B) = B (No transpose for B)
    • == 'T': opB(B) = B**T (Transpose B)
  • SGN1 β€” SGN1 is SINGLE PRECISION, allowed values: +/-1. Specifies the sign in the first equation.
  • SGN2 β€” SGN2 is SINGLE PRECISION, allowed values: +/-1. Specifies the sign in the second equation.
  • M β€” M is INTEGER. The order of the matrix A. M >= 0.
  • N β€” N is INTEGER. The order of the matrix B. N >= 0.
  • A β€” A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is SINGLE PRECISION array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
  • C β€” C is SINGLE PRECISION array, dimension (LDC,M). The coefficient matrix C.
  • LDC β€” LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
  • D β€” D is SINGLE PRECISION array, dimension (LDD,N). The coefficient matrix D.
  • LDD β€” LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
  • R β€” R is SINGLE PRECISION array, dimension (LDR,N). The first of the Sylvester Equation.
  • LDR β€” LDR is INTEGER. The leading dimension of the array R. LDX >= max(1,M).
  • L β€” L is SINGLE PRECISION array, dimension (LDL,N). The second solution the Sylvester Equation.
  • LDL β€” LDL is INTEGER. The leading dimension of the array L. LDL >= max(1,M).
  • E β€” E is SINGLE PRECISION array, dimension (LDE,N). The first right hand side of the Sylvester Equation.
  • LDE β€” LDE is INTEGER. The leading dimension of the array E. LDE >= max(1,M).
  • F β€” F is SINGLE PRECISION array, dimension (LDF,N). The second right hand side of the Sylvester Equation.
  • LDF β€” LDF is INTEGER. The leading dimension of the array F. LDF >= max(1,M).
  • SCALE β€” SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

See also

sla_residual_csylv_dual

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition

At line 397 of file csylv_dual.c.


✨ float mepack_single_residual_glyap (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * Y, int LDY, float SCALE) ✨

Compute the relative residual for the generalized Lyapunov equation. 🌸

Purpose

Compute the relative residual of the generalized Lyapunov equation:

RelRes = || SCALE*Y - op(A)*X*op(B)**T - op(B) * X * op(A)**T || / ( 2*||A||*||B||*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm. ✨

Remarks

Auxiliary memory is managed by the function itself. She's self-sufficient, she's thriving. 🫢

Parameters

  • TRANS β€” TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:
    • == 'N': op(A) = A (No transpose for A)
    • == 'T': op(A) = A**T (Transpose A)
  • M β€” M is INTEGER. The order of the matrices A. M >= 0.
  • A β€” A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is SINGLE PRECISION array, dimension (LDB,M). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
  • X β€” X is SINGLE PRECISION array, dimension (LDX,M). Solution of the Lyapunov Equation.
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
  • Y β€” Y is SINGLE PRECISION array, dimension (LDX,M). The right hand side of the Lyapunov Equation.
  • LDY β€” LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
  • SCALE
  • SCALE β€” SCALE</p> is SINGLE PRECISION. It's literally a scaling factor that stops the result from overflowing bestie, she's doing the lord's work πŸ’…

Returns

The function hands you back the relative residual like we defined in (1) up there πŸ‘†. But if something goes sideways, you get a negative integer I back instead, which is the function's way of being like "bestie, the parameter -I is giving wrong/illegal value energy 😭". And if I = -1000? That means the auxiliary memory could not be allocated. Tragic. No cap. πŸ’€

See also

sla_residual_glyap

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 239 of file glyap.c.


πŸ¦‹ mepack_single_residual_gstein

float mepack_single_residual_gstein (const char * TRANS, int M, float * A,
    int LDA, float * B, int LDB, float * X, int LDX, float * Y, int LDY,
    float SCALE)

Compute the relative residual for the generalized Stein equation. Okay so this one is lowkey iconic, let's get into it 🌸

Purpose:

Compute the relative residual of the generalized Stein equation:

RelRes = || SCALE*Y - op(A)*X*op(A)**T + op(B) * X * op(B)**T || / ( (||A||**2+||B||**2)*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm. Periodt. ✨

Remarks

Auxiliary memory is managed by the function itself. She's independent, she doesn't need you to babysit her memory 🫢

Parameters

  • TRANS

TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:

  • == 'N': op(A) = A (No transpose for A)
  • == 'T': op(A) = A**T (Transpose A)
  • M

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

  • A

A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.

  • LDA

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

  • B

B is SINGLE PRECISION array, dimension (LDB,M). The coefficient matrix B.

  • LDB

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

  • X

X is SINGLE PRECISION array, dimension (LDX,M). Solution of the Stein Equation. She's the answer bestie πŸ’–

  • LDX

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

  • Y

Y is SINGLE PRECISION array, dimension (LDX,M). The right hand side of the Stein Equation.

  • LDY

LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).

  • SCALE

SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

See also

sla_residual_gstein

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 239 of file gstein.c.


πŸŽ€ mepack_single_residual_gsylv

float mepack_single_residual_gsylv (const char * TRANSA, const char *
    TRANSB, float sgn, int M, int N, float * A, int LDA, float * B, int LDB,
    float * C, int LDC, float * D, int LDD, float * X, int LDX, float * Y,
    int LDY, float SCALE)

Compute the relative residual for the generalized Sylvester equation. This one has a LOT of parameters bestie, hydrate first πŸ’§

Purpose:

Compute the relative residual of the generalized Sylvester equation:

RelRes = || SCALE*Y - opA(A)*X *opB(B) - SGN * opA(C) * X * opB(D) || / ( (||A||*||B||+||C||*||D||)*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm. Slay. ✨

Remarks

Auxiliary memory is managed by the function itself.

Parameters

  • TRANSA

TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A:

  • == 'N': opA(A) = A (No transpose for A)
  • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB

TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B:

  • == 'N': opB(B) = B (No transpose for B)
  • == 'T': opB(B) = B**T (Transpose B)
  • SGN

SGN is SINGLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation. Pick your fighter: plus or minus πŸ’…

  • M

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

  • N

N is INTEGER. The order of the matrix B. N >= 0.

  • A

A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.

  • LDA

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

  • B

B is SINGLE PRECISION array, dimension (LDB,N). The coefficient matrix B.

  • LDB

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

  • C

C is SINGLE PRECISION array, dimension (LDC,M). The coefficient matrix C.

  • LDC

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

  • D

D is SINGLE PRECISION array, dimension (LDD,N). The coefficient matrix D.

  • LDD

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

  • X

X is SINGLE PRECISION array, dimension (LDY,M). Solution of the Sylvester Equation.

  • LDX

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

  • Y

Y is SINGLE PRECISION array, dimension (LDY,N). The right hand side of the Sylvester Equation.

  • LDY

LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).

  • SCALE

SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

See also

sla_residual_gsylv

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 331 of file gsylv.c.


🌸 mepack_single_residual_lyap

float mepack_single_residual_lyap (const char * TRANS, int M, float * A, int
    LDA, float * X, int LDX, float * Y, int LDY, float SCALE)

Compute the relative residual for the Lyapunov equation. Classic. The main character of matrix equations, honestly πŸ‘‘

Purpose:

Compute the relative residual of the Lyapunov equation:

RelRes = || SCALE*Y - op(A)*X - X * op(A)**T || / ( 2*||A||*||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm. Periodt πŸ’œ

Remarks

Auxiliary memory is managed by the function itself.

Parameters

  • TRANS

TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:

  • == 'N': op(A) = A (No transpose for A)
  • == 'T': op(A) = A**T (Transpose A)
  • M

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

  • A

A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.

  • LDA

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

  • X

X is SINGLE PRECISION array, dimension (LDX,M). Solution of the Lyapunov Equation.

  • LDX

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

  • Y

Y is SINGLE PRECISION array, dimension (LDX,M). The right hand side of the Lyapunov Equation.

  • LDY

LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).

  • SCALE

SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

See also

sla_residual_lyap

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 213 of file lyap.c.


πŸ¦‹ mepack_single_residual_stein

float mepack_single_residual_stein (const char * TRANS, int M, float * A,
    int LDA, float * X, int LDX, float * Y, int LDY, float SCALE)

Compute the relative residual for the Stein equation. Not to be confused with her generalized sister up there, this is the classic Stein and she's serving ✨

Purpose:

Compute the relative residual of the Stein equation:

RelRes = || SCALE*Y - op(A)*X*op(A)**T + X || / ( (||A||**2+1) * ||X|| + SCALE * ||Y|| )     (1)

The norms are evaluated in terms of the Frobenius norm. Iykyk πŸ’–

Remarks

Auxiliary memory is managed by the function itself.

Parameters

  • TRANS

TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:

  • == 'N': op(A) = A (No transpose for A)
  • == 'T': op(A) = A**T (Transpose A)
  • M

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

  • A

A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.

  • LDA

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

  • X

X is SINGLE PRECISION array, dimension (LDX,M). Solution of the Stein Equation.

  • LDX

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

  • Y

Y is SINGLE PRECISION array, dimension (LDX,M). The right hand side of the Stein Equation.

  • LDY

LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).

  • SCALE

SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.

See also

sla_residual_stein

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 213 of file stein.c.

πŸ’– mepack_single_residual_sylv πŸ’–

float mepack_single_residual_sylv (const char * TRANSA, const char * TRANSB,
    float sgn, int M, int N, float * A, int LDA, float * B, int LDB, float *
    X, int LDX, float * Y, int LDY, float SCALE)

okay bestie, this one computes the relative residual for the Sylvester equation. yes. we're doing residuals now. slay. ✨

Purpose:

so basically it computes the relative residual of the Sylvester equation

RelRes = || SCALE*Y - opA(A)*X - SGN * X * opB(B) || / ( (||A||+||B||)*||X|| + SCALE * ||Y|| )     (1)

and heads up β€” the norms here are evaluated in terms of the Frobenius norm. that's the whole vibe. πŸ’…

Remarks

  • the auxiliary memory is managed by the function itself, so you don't have to do a single thing about it 🫢

Parameters

  • TRANSA
    • TRANSA is CHARACTER(1)
    • Specifies the form of the system of equations with respect to A :
    • == 'N': opA(A) = A (No transpose for A)
    • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB
    • TRANSB is CHARACTER(1)
    • Specifies the form of the system of equations with respect to B :
    • == 'N': opB(B) = B (No transpose for B)
    • == 'T': opB(B) = B**T (Transpose B)
  • SGN
    • SGN is DOUBLE PRECISION, allowed values: +/-1
    • Specifies the sign between the two parts of the Sylvester equation.
  • M
    • M is INTEGER
    • The order of the matrix A. M >= 0.
  • N
    • N is INTEGER
    • The order of the matrix B. N >= 0.
  • A
    • A is DOUBLE PRECISION array, dimension (LDA,M)
    • The coefficient matrix A.
  • LDA
    • LDA is INTEGER
    • The leading dimension of the array A. LDA >= max(1,M).
  • B
    • B is DOUBLE PRECISION array, dimension (LDB,N)
    • The coefficient matrix B.
  • LDB
    • LDB is INTEGER
    • The leading dimension of the array B. LDB >= max(1,N).
  • X
    • X is DOUBLE PRECISION array, dimension (LDX,M)
    • Solution of the Sylvester Equation.
  • LDX
    • LDX is INTEGER
    • The leading dimension of the array X. LDX >= max(1,M).
  • Y
    • Y is DOUBLE PRECISION array, dimension (LDX,M)
    • The right hand side of the Sylvester Equation.
  • LDY
    • LDY is INTEGER
    • The leading dimension of the array Y. LDY >= max(1,M).
  • SCALE
    • SCALE is DOUBLE PRECISION
    • SCALE is a scaling factor to prevent the overflow in the result.

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated. 😭 (and yes, -1000 is the "girl we couldn't even get the memory" signal, no cap.)

See also

sla_residual_sylv

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 282 of file sylv.c.


πŸ¦‹ mepack_single_residual_sylv2 πŸ¦‹

float mepack_single_residual_sylv2 (const char * TRANSA, const char *
    TRANSB, float sgn, int M, int N, float * A, int LDA, float * B, int LDB,
    float * X, int LDX, float * Y, int LDY, float SCALE)

and this one? this one is the discrete-time Sylvester residual. the sequel. the second album. and honestly it ate. πŸŽ€

Purpose:

Compute the relative residual of the discrete-time Sylvester equation

RelRes = || SCALE*Y - opA(A)*X*opB(B) - SGN* X  || / ( (||A||*||B||+1)*||X|| + SCALE * ||Y|| )     (1)

norms again evaluated in terms of the Frobenius norm, same as before, no surprises. πŸ’œ

Remarks

  • the auxiliary memory is managed by the function itself β€” it's giving independent. it's giving main character. you literally don't lift a finger. ✨

Parameters

  • TRANSA
    • TRANSA is CHARACTER(1)
    • Specifies the form of the system of equations with respect to A :
    • == 'N': opA(A) = A (No transpose for A)
    • == 'T': opA(A) = A**T (Transpose A)
  • TRANSB
    • TRANSB is CHARACTER(1)
    • Specifies the form of the system of equations with respect to B :
    • == 'N': opB(B) = B (No transpose for B)
    • == 'T': opB(B) = B**T (Transpose B)
  • SGN
    • SGN is SINGLE PRECISION, allowed values: +/-1
    • Specifies the sign between the two parts of the Sylvester equation.
  • M
    • M is INTEGER
    • The order of the matrix A. M >= 0.
  • N
    • N is INTEGER
    • The order of the matrix B. N >= 0.
  • A
    • A is SINGLE PRECISION array, dimension (LDA,M)
    • The coefficient matrix A.
  • LDA
    • LDA is INTEGER
    • The leading dimension of the array A. LDA >= max(1,M).
  • B
    • B is SINGLE PRECISION array, dimension (LDB,N)
    • The coefficient matrix B.
  • LDB
    • LDB is INTEGER
    • The leading dimension of the array B. LDB >= max(1,N).
  • X
    • X is SINGLE PRECISION array, dimension (LDX,M)
    • Solution of the Sylvester Equation.
  • LDX
    • LDX is INTEGER
    • The leading dimension of the array X. LDX >= max(1,M).
  • Y
    • Y is SINGLE PRECISION array, dimension (LDX,M)
    • The right hand side of the Sylvester Equation.
  • LDY
    • LDY is INTEGER
    • The leading dimension of the array Y. LDY >= max(1,M).
  • SCALE
    • SCALE is SINGLE PRECISION
    • SCALE is a scaling factor to prevent the overflow in the result.

Returns

The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated. πŸ’€ same energy as its sibling, same -1000 heartbreak.

See also

sla_residual_sylv2

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 282 of file sylv2.c.


quick vibe check bestie: these two are literally the same layout of args, but the first one is all DOUBLE PRECISION and the second is all SINGLE PRECISION, and the second is the discrete-time flavor with opA(A)*X*opB(B) in the formula. don't mix them up, i'm begging. πŸ™ˆ

πŸ‘‘ Author πŸ‘‘

this page was generated automatically by Doxygen for MEPACK from the source code. yes, a robot wrote the skeleton, and i just gave it a glow-up. periodt. πŸ’…βœ¨

🌈 Version 🌈

you're reading Version 1.1.2, dated Thu Oct 9 2025 00:00:00 β€” that's the whole cresidual(3) page, start to finish, and yes you read all six parts. iconic behavior honestly. obsessed. go compute some residuals bestie, you've got this πŸ«ΆπŸŒΈπŸ’–

πŸ“¦ where this page comes from