residual(3)

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

🌸 NAME 🌸

okay so this is residual(3) from MEPACK β€” yes bestie, the math library manual, section 3, we're doing this πŸ’–

Residual Computations

  • This collection computes the relative residuals of the matrix equations.

✨ SYNOPSIS ✨

πŸŽ€ Topics πŸŽ€

πŸ¦‹ C-Interface πŸ¦‹

C-Interface for the residual computations.

🌈 Functions 🌈

  • double precision function dla_residual_csylv (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, r, ldr, l, ldl, e, lde, f, ldf, scale) β€” Compute the relative residual for the coupled Sylvester equation.
  • double precision function dla_residual_csylv_dual (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, r, ldr, l, ldl, e, lde, f, ldf, scale) β€” Compute the relative residual for the dual coupled Sylvester equation.
  • double precision function dla_residual_glyap (trans, m, a, lda, b, ldb, x, ldx, y, ldy, scale) β€” Compute the relative residual for the generalized Lyapunov equation.
  • double precision function dla_residual_gstein (trans, m, a, lda, b, ldb, x, ldx, y, ldy, scale) β€” Compute the relative residual for the generalized Stein equation.
  • double precision function dla_residual_gsylv (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, y, ldy, scale) β€” Compute the relative residual for the generalized Sylvester equation.
  • double precision function dla_residual_lyap (trans, m, a, lda, x, ldx, y, ldy, scale) β€” Compute the relative residual for the Lyapunov equation.
  • double precision function dla_residual_stein (trans, m, a, lda, x, ldx, y, ldy, scale) β€” Compute the relative residual for the Stein equation.
  • double precision function dla_residual_sylv (transa, transb, sgn, m, n, a, lda, b, ldb, x, ldx, y, ldy, scale) β€” Compute the relative residual for the Sylvester equation.
  • double precision function dla_residual_sylv2 (transa, transb, sgn, m, n, a, lda, b, ldb, x, ldx, y, ldy, scale) β€” Compute the relative residual for the discrete-time Sylvester equation.
  • real function sla_residual_csylv (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, r, ldr, l, ldl, e, lde, f, ldf, scale) β€” Compute the relative residual for the coupled Sylvester equation.
  • real function sla_residual_csylv_dual (transa, transb, sgn1, sgn2, m, n, a, lda, b, ldb, c, ldc, d, ldd, r, ldr, l, ldl, e, lde, f, ldf, scale) β€” Compute the relative residual for the dual coupled Sylvester equation.
  • real function sla_residual_glyap (trans, m, a, lda, b, ldb, x, ldx, y, ldy, scale) β€” Compute the relative residual for the generalized Lyapunov equation.
  • real function sla_residual_gstein (trans, m, a, lda, b, ldb, x, ldx, y, ldy, scale) β€” Compute the relative residual for the generalized Stein equation.
  • real function sla_residual_gsylv (transa, transb, sgn, m, n, a, lda, b, ldb, c, ldc, d, ldd, x, ldx, y, ldy, scale) β€” Compute the relative residual for the generalized Sylvester equation.
  • real function sla_residual_lyap (trans, m, a, lda, x, ldx, y, ldy, scale) β€” Compute the relative residual for the Lyapunov equation.
  • real function sla_residual_stein (trans, m, a, lda, x, ldx, y, ldy, scale) β€” Compute the relative residual for the Stein equation.
  • real function sla_residual_sylv (transa, transb, sgn, m, n, a, lda, b, ldb, x, ldx, y, ldy, scale) β€” Compute the relative residual for the Sylvester equation.
  • real function sla_residual_sylv2 (transa, transb, sgn, m, n, a, lda, b, ldb, x, ldx, y, ldy, scale) β€” Compute the relative residual for the discrete-time Sylvester equation.
ok so real quick: the dla_ ones are the double precision girlies and the sla_ ones are the single precision girlies. same energy, different precision πŸ’…

🌺 Detailed Description 🌺

This collection computes the relative residuals of the matrix equations.

So basically, the routines in this group compute the relative residuals of the matrix equations. And here's the part that ate πŸ’… β€” unlike the computational routines, these ones manage the memory on their own, which makes them way easier to use from both Fortran and C. No manual allocation drama, no cap. πŸŽ€


πŸ‘‘ Function Documentation πŸ‘‘

πŸ’– double precision function dla_residual_csylv πŸ’–

double precision function dla_residual_csylv (character transa, character
    transb, double precision sgn1, double precision sgn2, integer m, integer
    n, double precision, dimension(lda, *) a, integer lda, double precision,
    dimension(ldb, *) b, integer ldb, double precision, dimension(ldc,*) c,
    integer ldc, double precision, dimension(ldd, *) d, integer ldd, double
    precision, dimension(ldr, *) r, integer ldr, double precision,
    dimension(ldl, *) l, integer ldl, double precision, dimension(lde, *) e,
    integer lde, double precision, dimension(ldf, *) f, integer ldf, double
    precision 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. (iconic behaviour honestly, she handles her own business ✨)

πŸŽ€ 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 between the two parts of the first equation.
!>

SGN2

!>          SGN2 is DOUBLE PRECISION, allowed values: +/-1
!>          Specifies the sign between the two parts of 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 A.  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 A.  LDD >= max(1,N).
!>

R

!>          R is DOUBLE PRECISION array, dimension (LDR,N)
!>          First part of the solution of the Sylvester Equation.
!>

LDR

!>          LDR is INTEGER
!>          The leading dimension of the array R.  LDR >= max(1,M).
!>

L

!>          L is DOUBLE PRECISION array, dimension (LDL,N)
!>          Second part of the solution of 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.
!>

🌟 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.
!> .fi
ok so heads up bestie 🚨 if you get a negative number back that's NOT a residual, that's a cry for help. -I means the parameter I was wrong/illegal, and specifically I = -1000 means the auxiliary memory could not be allocated. read the room and check your args πŸ’€

🧚 Author

Martin Koehler, MPI Magdeburg

πŸŽ€ Date

October 2025

Definition at line 204 of file res_csylv.f90.


πŸ’– double precision function dla_residual_csylv_dual πŸ’–

double precision function dla_residual_csylv_dual (character transa,
    character transb, double precision sgn1, double precision sgn2, integer
    m, integer n, double precision, dimension(lda, *) a, integer lda, double
    precision, dimension(ldb, *) b, integer ldb, double precision,
    dimension(ldc,*) c, integer ldc, double precision, dimension(ldd, *) d,
    integer ldd, double precision, dimension(ldr, *) r, integer ldr, double
    precision, dimension(ldl, *) l, integer ldl, double precision,
    dimension(lde, *) e, integer lde, double precision, dimension(ldf, *) f,
    integer ldf, double precision scale)

Compute the relative residual for the dual coupled Sylvester equation.

⭐ Purpose:

!>
!> Compute the relative residual of the dual 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. (she's independent, she's self-sufficient, she allocates her own aux memory πŸ’…βœ¨)

πŸŽ€ 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 β€” DOUBLE PRECISION, and the only values allowed are +/-1. It sets the sign that sits between the two parts of the first equation. That's the whole job. Slay. ✨
  • SGN2 β€” DOUBLE PRECISION, allowed values +/-1 again. This one is the sign between the two parts of the second equation.
  • M β€” INTEGER, the order of the matrix A. And it's M >= 0, no negatives bestie. πŸŽ€
  • N β€” INTEGER, the order of the matrix B. N >= 0.
  • A β€” DOUBLE PRECISION array, dimension (LDA,M). It's the coefficient matrix A, obviously. πŸ’…
  • LDA β€” INTEGER, the leading dimension of the array A. LDA >= max(1,M).
  • B β€” DOUBLE PRECISION array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€” INTEGER, the leading dimension of the array A (that's literally what the page says β€” it means the one paired with B, we are NOT editing the source πŸ™ˆ). LDB >= max(1,N).
  • C β€” DOUBLE PRECISION array, dimension (LDC,M). The coefficient matrix C.
  • LDC β€” INTEGER, the leading dimension of the array C. LDC >= max(1,M).
  • D β€” DOUBLE PRECISION array, dimension (LDD,N). The coefficient matrix D.
  • LDD β€” INTEGER, and yes, the text here says "the leading dimension of the array A" again β€” quoted faithfully, no cap. LDD >= max(1,N).
  • R β€” DOUBLE PRECISION array, dimension (LDR,N). First part of the solution of the Sylvester Equation. main character part, honestly. πŸ‘‘
  • LDR β€” INTEGER, the leading dimension of the array R. LDR >= max(1,M).
  • L β€” DOUBLE PRECISION array, dimension (LDL,N). Second part of the solution of the Sylvester Equation.
  • LDL β€” INTEGER, the leading dimension of the array L. LDL >= max(1,M).
  • E β€” DOUBLE PRECISION array, dimension (LDE,N). The first right hand side of the Sylvester Equation.
  • LDE β€” INTEGER, the leading dimension of the array E. LDE >= max(1,M).
  • F β€” DOUBLE PRECISION array, dimension (LDF,N). The second right hand side of the Sylvester Equation.
  • LDF β€” INTEGER, the leading dimension of the array F. LDF >= max(1,M).
  • SCALE β€” DOUBLE PRECISION. It's a scaling factor, and its whole personality is preventing overflow in the result. 🫢

Returns

The function hands you back the relative residual, exactly as defined in (1). But if something goes wrong, it returns a negative integer I, which is its way of signalizing that the parameter -I has a wrong/illegal value. And if I = -1000, the auxiliary memory could not be allocated. 😭

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 204 of file res_csylv_dual.f90.


πŸ’– dla_residual_glyap πŸ’–

double precision function dla_residual_glyap (character trans, integer m,
    double precision, dimension(lda, *) a, integer lda, double precision,
    dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x,
    integer ldx, double precision, dimension(ldy, *) y, integer ldy, double
    precision scale)

Compute the relative residual for the generalized Lyapunov equation. 🌸

Purpose

It computes the relative residual of the Lyapunov equation:

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

And the norms? All evaluated in terms of the Frobenius norm. Periodt. ✨

Remarks

Auxiliary memory is managed by the function itself. It's giving self-sufficient. πŸ’…

Parameters

  • TRANS β€” 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 β€” INTEGER, the order of the matrix A. M >= 0.
  • A β€” DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” INTEGER, the leading dimension of the array A. LDA >= max(1,M).
  • B β€” DOUBLE PRECISION array, dimension (LDB,M). The coefficient matrix B.
  • LDB β€” INTEGER, the leading dimension of the array B. LDB >= max(1,M).
  • X β€” DOUBLE PRECISION array, dimension (LDX,M). Solution of the Lyapunov Equation. πŸ’–
  • LDX β€” INTEGER, the leading dimension of the array X. LDX >= max(1,M).
  • Y β€” DOUBLE PRECISION array, dimension (LDY,M). The right hand side of the Lyapunov Equation.
  • LDY β€” INTEGER, the leading dimension of the array Y. LDY >= max(1,M).
  • SCALE β€” DOUBLE PRECISION. A scaling factor to prevent the overflow in the result. 🫢

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. πŸ’€

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 129 of file res_glyap.f90.


πŸ¦‹ dla_residual_gstein πŸ¦‹

double precision function dla_residual_gstein (character trans, integer m,
    double precision, dimension(lda, *) a, integer lda, double precision,
    dimension(ldb, *) b, integer ldb, double precision, dimension(ldx, *) x,
    integer ldx, double precision, dimension(ldy, *) y, integer ldy, double
    precision scale)

Compute the relative residual for the generalized Stein equation. 🌈

Purpose

It computes the relative residual of the 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)

Norms? Frobenius norm, always. ⭐

Remarks

Auxiliary memory is managed by the function itself. Again. Iconic behaviour. πŸ’…

Parameters

  • TRANS β€” 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 β€” INTEGER, the order of the matrix A. M >= 0.
  • A β€” DOUBLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” INTEGER, the leading dimension of the array A. LDA >= max(1,M).
  • B β€” DOUBLE PRECISION array, dimension (LDB,M). The coefficient matrix B.
  • LDB β€” INTEGER, the leading dimension of the array B. LDB >= max(1,M).
  • X β€” DOUBLE PRECISION array, dimension (LDX,M). Solution of the Stein Equation. πŸŽ€
  • LDX β€” INTEGER, the leading dimension of the array X. LDX >= max(1,M).
  • Y β€” DOUBLE PRECISION array, dimension (LDY,M). The right hand side of the Stein Equation.
  • LDY β€” INTEGER, the leading dimension of the array Y. LDY >= max(1,M).
  • SCALE β€” DOUBLE PRECISION. A scaling factor to prevent the overflow in the result. 🫢

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. 😭

Author

Martin Koehler, MPI Magdeburg

Date

October 2025

Definition at line 129 of file res_gstein.f90.


✨ dla_residual_gsylv ✨

double precision function dla_residual_gsylv (character transa, character
    transb, double precision sgn, integer m, integer n, double precision,
    dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b,
    integer ldb, double precision, dimension(ldc,*) c, integer ldc, double
    precision, dimension(ldd, *) d, integer ldd, double precision,
    dimension(ldx, *) x, integer ldx, double precision, dimension(ldy, *) y,
    integer ldy, double precision scale)

Compute the relative residual for the generalized Sylvester equation. πŸ”₯

Purpose

It computes 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)

Frobenius norm for all the norms, iykyk. πŸ’œ

Remarks

Auxiliary memory is managed by the function itself.

Parameters

  • TRANSA β€” 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 β€” 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 β€” DOUBLE PRECISION, allowed values +/-1. Specifies the sign between the two parts of the Sylvester equation.
  • M β€” INTEGER, the order of the matrix A. M >= 0.
  • N β€” and this is where the page hands off to the next part, bestie β€” the file literally stops right here mid-list, so we pick it back up in the next chunk πŸ’…
  • N β€” INTEGER, bestie. The order of the matrix B. And N >= 0, obviously, we don't do negative orders here πŸ’…

A

  • DOUBLE PRECISION array, dimension (LDA,M) β€” the coefficient matrix A. That's her.

LDA

  • INTEGER β€” the leading dimension of the array A. LDA >= max(1,M).

B

  • DOUBLE PRECISION array, dimension (LDB,N) β€” the coefficient matrix B. Iconic.

LDB

  • INTEGER β€” "the leading dimension of the array A." LDB >= max(1,N). Yes, it literally says A. Not me, not my business, moving on 🫢

C

  • DOUBLE PRECISION array, dimension (LDC,M) β€” the coefficient matrix C.

LDC

  • INTEGER β€” the leading dimension of the array C. LDC >= max(1,M).

D

  • DOUBLE PRECISION array, dimension (LDD,N) β€” the coefficient matrix D.

LDD

  • INTEGER β€” again "the leading dimension of the array A." LDD >= max(1,N). Same energy as LDB. Whatever, we keep it πŸ’€

X

  • DOUBLE PRECISION array, dimension (LDX,N) β€” the solution of the Sylvester Equation. The main character fr.

LDX

  • INTEGER β€” the leading dimension of the array X. LDX >= max(1,M).

Y

  • DOUBLE PRECISION array, dimension (LDY,N) β€” the right hand side of the Sylvester Equation.

LDY

  • INTEGER β€” the leading dimension of the array Y. LDY >= max(1,M).

SCALE

  • DOUBLE PRECISION β€” a scaling factor, and the whole point of her existence is preventing overflow in the result. A true guardian angel 🧚

✨ 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.
!> .fi

πŸ‘‘ Author πŸ‘‘

Martin Koehler, MPI Magdeburg

πŸŽ€ Date πŸŽ€

October 2025

πŸ¦‹ Definition πŸ¦‹

At line 172 of file res_gsylv.f90.


πŸ’œ And now… the rest of the double precision functions πŸ’œ

double precision function dla_residual_lyap (character trans, integer m,
    double precision, dimension(lda, *) a, integer lda, double precision,
    dimension(ldx, *) x, integer ldx, double precision, dimension(ldy, *) y,
    integer ldy, double precision scale)

Compute the relative residual for the Lyapunov equation. Obsessed.

🌸 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. She handles her own business, no cap.

✨ Parameters ✨

TRANS

  • 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

  • INTEGER β€” the order of the matrix A. M >= 0.

A

  • DOUBLE PRECISION array, dimension (LDA,M) β€” the coefficient matrix A.

LDA

  • INTEGER β€” the leading dimension of the array A. LDA >= max(1,M).

X

  • DOUBLE PRECISION array, dimension (LDX,M) β€” the solution of the Lyapunov Equation.

LDX

  • INTEGER β€” the leading dimension of the array X. LDX >= max(1,M).

Y

  • DOUBLE PRECISION array, dimension (LDY,M) β€” the right hand side of the Lyapunov Equation.

LDY

  • INTEGER β€” the leading dimension of the array Y. LDY >= max(1,M).

SCALE

  • DOUBLE PRECISION β€” a scaling factor to prevent the overflow in the result. Again, the overflow-prevention queen πŸ’…

✨ 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.
!> .fi

πŸ‘‘ Author πŸ‘‘

Martin Koehler, MPI Magdeburg

πŸŽ€ Date πŸŽ€

October 2025

πŸ¦‹ Definition πŸ¦‹

At line 116 of file res_lyap.f90.


double precision function dla_residual_stein (character trans, integer m,
    double precision, dimension(lda, *) a, integer lda, double precision,
    dimension(ldx, *) x, integer ldx, double precision, dimension(ldy, *) y,
    integer ldy, double precision scale)

Compute the relative residual for the Stein equation. She's here and she ate ✨

🌸 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. Self-sufficient, as she should be.

✨ Parameters ✨

TRANS

  • 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

  • INTEGER β€” the order of the matrix A. M >= 0.

A

  • DOUBLE PRECISION array, dimension (LDA,M) β€” the coefficient matrix A.

LDA

  • INTEGER β€” the leading dimension of the array A. LDA >= max(1,M).

X

  • DOUBLE PRECISION array, dimension (LDX,M) β€” the solution of the Stein Equation.

LDX

  • INTEGER β€” the leading dimension of the array X. LDX >= max(1,M).

Y

  • DOUBLE PRECISION array, dimension (LDY,M) β€” the right hand side of the Stein Equation.

LDY

  • INTEGER β€” the leading dimension of the array Y. LDY >= max(1,M).

SCALE

  • DOUBLE PRECISION β€” 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.
!> .fi

πŸ‘‘ Author πŸ‘‘

Martin Koehler, MPI Magdeburg

πŸŽ€ Date πŸŽ€

October 2025

πŸ¦‹ Definition πŸ¦‹

At line 116 of file res_stein.f90.


double precision function dla_residual_sylv (character transa, character
    transb, double precision sgn, integer m, integer n, double precision,
    dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b,
    integer ldb, double precision, dimension(ldx, *) x, integer ldx, double
    precision, dimension(ldy, *) y, integer ldy, double precision scale)

Compute the relative residual for the Sylvester equation. THE one, THE only, THE Sylvester πŸ”₯

🌸 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.

✨ Parameters ✨

TRANSA

  • 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

  • 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

  • DOUBLE PRECISION, allowed values: +/-1 β€” specifies the sign between the two parts of the Sylvester equation. Pick a lane bestie, plus or minus, no in-between πŸ’…

M

  • INTEGER β€” the order of the matrix A. M >= 0.

N

  • INTEGER β€” the order of the matrix B. N >= 0.

A

  • DOUBLE PRECISION array, dimension (LDA,M) β€” the coefficient matrix A.

LDA

  • INTEGER β€” the leading dimension of the array A. LDA >= max(1,M).

B

  • DOUBLE PRECISION array, dimension (LDB,N) β€” the coefficient matrix B.

LDB

  • INTEGER β€” "the leading dimension of the array A." LDB >= max(1,N). It said A again. We've made peace with it πŸ™ˆ

X

  • DOUBLE PRECISION array, dimension (LDX,N) β€” the solution of the Sylvester Equation.

LDX

  • INTEGER β€” the leading dimension of the array X. LDX >= max(1,M).

Y

  • DOUBLE PRECISION array, dimension (LDY,N) β€” the right hand side of the Sylvester Equation.

LDY

  • INTEGER β€” the leading dimension of the array Y. LDY >= max(1,M).

SCALE

  • DOUBLE PRECISION β€” a scaling factor to prevent the overflow in the result. She stays protecting the result, periodt ✨

✨ 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.
!> .fi

πŸ‘‘ Author πŸ‘‘

Martin Koehler, MPI Magdeburg

πŸŽ€ Date πŸŽ€

October 2025

πŸ¦‹ Definition πŸ¦‹

At line 148 of file res_sylv.f90.

πŸ’– dla_residual_sylv2 πŸ’–

okay bestie, first up we got the double precision girly that checks the relative residual for the discrete-time Sylvester equation. she's giving quality control energy fr fr πŸ’…

double precision function dla_residual_sylv2 (character transa, character
    transb, double precision sgn, integer m, integer n, double precision,
    dimension(lda, *) a, integer lda, double precision, dimension(ldb, *) b,
    integer ldb, double precision, dimension(ldx, *) x, integer ldx, double
    precision, dimension(ldy, *) y, integer ldy, double precision scale)

🎯 Purpose

okay so she computes 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)

and bestie, the norms are evaluated in terms of the Frobenius norm. no cap ✨

πŸ“ Remarks

Auxiliary memory is managed by the function itself. she handles her own business, iconic behavior 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)
  • SGN β€” SGN is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation. she's literally just a lil plus-or-minus queen πŸ’…
  • 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 A. LDB >= 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 is DOUBLE 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 DOUBLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result. keeping things from going feral, we love a stabilizer 🌸

πŸ“¬ 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. 😭

✍️ Author

Martin Koehler, MPI Magdeburg

πŸ“… Date

October 2025

Definition at line 148 of file res_sylv2.f90.


πŸ¦‹ sla_residual_csylv πŸ¦‹

next up: the real (single precision, not the ✨romantic✨ kind) version for the coupled Sylvester equation. she's got TWO equations to babysit and she's thriving πŸ”₯

real function sla_residual_csylv (character transa, character transb, real
    sgn1, real sgn2, integer m, integer n, real, dimension(lda, *) a,
    integer lda, real, dimension(ldb, *) b, integer ldb, real,
    dimension(ldc,*) c, integer ldc, real, dimension(ldd, *) d, integer ldd,
    real, dimension(ldr, *) r, integer ldr, real, dimension(ldl, *) l,
    integer ldl, real, dimension(lde, *) e, integer lde, real,
    dimension(ldf, *) f, integer ldf, real scale)

🎯 Purpose

she computes 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)

and again bestie, the norms are evaluated in terms of the Frobenius norm. periodt πŸ’œ

πŸ“ Remarks

Auxiliary memory is managed by the function itself. self-sufficient queen 🫢

πŸ”§ 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 REAL, allowed values: +/-1. Specifies the sign between the two parts of the first equation.
  • SGN2 β€” SGN2 is REAL, allowed values: +/-1. Specifies the sign between the two parts of the second equation. two signs, two vibes, we stay organized ✨
  • M β€” M is INTEGER. The order of the matrix A. M >= 0.
  • N β€” N is INTEGER. The order of the matrix B. N >= 0.
  • A β€” A is REAL array, dimension (LDA,M). The coefficient matrix A.
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€” LDB is INTEGER. The leading dimension of the array A. LDB >= max(1,N).
  • C β€” C is REAL 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 REAL array, dimension (LDD,N). The coefficient matrix D.
  • LDD β€” LDD is INTEGER. The leading dimension of the array A. LDD >= max(1,N).
  • R β€” R is REAL array, dimension (LDR,N). First part of the solution of the Sylvester Equation.
  • LDR β€” LDR is INTEGER. The leading dimension of the array R. LDR >= max(1,M).
  • L β€” L is REAL array, dimension (LDL,N). Second part of the solution of the Sylvester Equation.
  • LDL β€” LDL is INTEGER. The leading dimension of the array L. LDL >= max(1,M).
  • E β€” E is REAL 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 REAL 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 REAL. SCALE is a scaling factor to prevent the overflow in the result. again, the anti-overflow bodyguard, we stan πŸŽ€

πŸ“¬ 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. πŸ’€

✍️ Author

Martin Koehler, MPI Magdeburg

πŸ“… Date

October 2025

Definition at line 204 of file res_csylv.f90.


🌈 sla_residual_csylv_dual 🌈

and now the dual version of the coupled Sylvester residual, still in REAL. she's the twin sister, same energy, different equations πŸ’…

real function sla_residual_csylv_dual (character transa, character transb,
    real sgn1, real sgn2, integer m, integer n, real, dimension(lda, *) a,
    integer lda, real, dimension(ldb, *) b, integer ldb, real,
    dimension(ldc,*) c, integer ldc, real, dimension(ldd, *) d, integer ldd,
    real, dimension(ldr, *) r, integer ldr, real, dimension(ldl, *) l,
    integer ldl, real, dimension(lde, *) e, integer lde, real,
    dimension(ldf, *) f, integer ldf, real scale)

🎯 Purpose

she computes the relative residual of the dual 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)

and yep, the norms are evaluated in terms of the Frobenius norm. ✨

πŸ“ Remarks

Auxiliary memory is managed by the function itself. independent icon behavior 🫢

πŸ”§ 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 REAL, allowed values: +/-1. Specifies the sign between the two parts of the first equation.
  • SGN2 β€” SGN2 is REAL, allowed values: +/-1. Specifies the sign between the two parts of 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 REAL 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 REAL array, dimension (LDB,N). The coefficient matrix B.
  • LDB β€”
  • LDB β€” LDB is INTEGER, bestie. It's the leading dimension of the array A (yes, the docs rly say A here, we're just the messenger πŸ’€). Rule: LDB >= max(1,N).
  • C β€” C is REAL array, dimension (LDC,M) β€” the coefficient matrix C. ✨
  • LDC β€” LDC is INTEGER β€” the leading dimension of the array C. You need LDC >= max(1,M).
  • D β€” D is REAL array, dimension (LDD,N) β€” the coefficient matrix D. πŸ’…
  • LDD β€” LDD is INTEGER β€” the leading dimension of the array A (again, the manpage says A, we are simply not going to argue with the manpage πŸ™ˆ). Constraint: LDD >= max(1,N).
  • R β€” R is REAL array, dimension (LDR,N) β€” the first part of the solution of the Sylvester Equation. First half of the glow-up πŸ’–
  • LDR β€” LDR is INTEGER β€” the leading dimension of the array R. Needs LDR >= max(1,M).
  • L β€” L is REAL array, dimension (LDL,N) β€” the second part of the solution of the Sylvester Equation. The other half, we love a duo 🫢
  • LDL β€” LDL is INTEGER β€” the leading dimension of the array L. Needs LDL >= max(1,M).
  • E β€” E is REAL array, dimension (LDE,N) β€” the first right hand side of the Sylvester Equation. ✨
  • LDE β€” LDE is INTEGER β€” the leading dimension of the array E. Needs LDE >= max(1,M).
  • F β€” F is REAL array, dimension (LDF,N) β€” the second right hand side of the Sylvester Equation. ✨
  • LDF β€” LDF is INTEGER β€” the leading dimension of the array F. Needs LDF >= max(1,M).
  • SCALE β€” SCALE is REAL β€” SCALE is a scaling factor to prevent the overflow in the result. She's literally there so your numbers don't explode πŸ”₯

Returns

ok so here's the tea πŸŽ€ 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. 😭

Translation for the besties: negative I = something is wrong, and -I tells you which parameter is sus. And if you get I = -1000, the allocator ghosted you and there was no memory. Not your math's fault, bestie.

Author

Martin Koehler, MPI Magdeburg πŸ‘‘

Date

October 2025 🌸

Definition at line 204 of file res_csylv_dual.f90.


sla_residual_glyap 🌈

real function sla_residual_glyap (character trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
    ldb, real, dimension(ldx, *) x, integer ldx, real, dimension(ldy, *) y,
    integer ldy, real scale)

Compute the relative residual for the generalized Lyapunov equation. Yesss generalized, we're leveling up πŸ’…

Purpose

!>
!> Compute the relative residual of the 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.
!>

Frobenius norm, no cap β€” that's the one being used here, so don't come at her with a different norm and expect the same numbers πŸ™ˆ

Remarks

Auxiliary memory is managed by the function itself. She handles her own business, we love a self-sufficient queen πŸ‘‘

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 matrix A. Constraint: M >= 0.
  • A β€” A is REAL array, dimension (LDA,M) β€” the coefficient matrix A. ✨
  • LDA β€” LDA is INTEGER β€” the leading dimension of the array A. Needs LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,M) β€” the coefficient matrix B. ✨
  • LDB β€” LDB is INTEGER β€” the leading dimension of the array B. Needs LDB >= max(1,M).
  • X β€” X is REAL array, dimension (LDX,M) β€” solution of the Lyapunov Equation. The main character of this whole operation πŸ’–
  • LDX β€” LDX is INTEGER β€” the leading dimension of the array X. Needs LDX >= max(1,M).
  • Y β€” Y is REAL array, dimension (LDY,M) β€” the right hand side of the Lyapunov Equation. ✨
  • LDY β€” LDY is INTEGER β€” the leading dimension of the array Y. Needs LDY >= max(1,M).
  • SCALE β€” SCALE is REAL β€” 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 deal as before, bestie β€” negative I = bad param, -1000 = memory said no 😭

Author

Martin Koehler, MPI Magdeburg πŸ‘‘

Date

October 2025 🌸

Definition at line 129 of file res_glyap.f90.


sla_residual_gstein πŸ¦‹

real function sla_residual_gstein (character trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldb, *) b, integer
    ldb, real, dimension(ldx, *) x, integer ldx, real, dimension(ldy, *) y,
    integer ldy, real scale)

Compute the relative residual for the generalized Stein equation. Stein equation girlies rise up πŸŽ€

Purpose

!>
!> Compute the relative residual of the 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.
!>

Notice the + in there, not a minus β€” it's giving Stein, not Lyapunov, and the denominator is (||A||**2+||B||**2)*||X|| because squares are her whole brand ✨

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 matrix A. Constraint: M >= 0.
  • A β€” A is REAL array, dimension (LDA,M) β€” the coefficient matrix A. ✨
  • LDA β€” LDA is INTEGER β€” the leading dimension of the array A. Needs LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,M) β€” the coefficient matrix B. ✨
  • LDB β€” LDB is INTEGER β€” the leading dimension of the array B. Needs LDB >= max(1,M).
  • X β€” X is REAL array, dimension (LDX,M) β€” solution of the Stein Equation. πŸ‘‘
  • LDX β€” LDX is INTEGER β€” the leading dimension of the array X. Needs LDX >= max(1,M).
  • Y β€” Y is REAL array, dimension (LDY,M) β€” the right hand side of the Stein Equation. ✨
  • LDY β€” LDY is INTEGER β€” the leading dimension of the array Y. Needs LDY >= max(1,M).
  • SCALE β€” SCALE is REAL β€” 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. Yeah, same error protocol, she keeps it consistent πŸ’€

Author

Martin Koehler, MPI Magdeburg πŸ‘‘

Date

October 2025 🌸

Definition at line 129 of file res_gstein.f90.


sla_residual_gsylv πŸŒˆπŸ’–

real function sla_residual_gsylv (character transa, character transb, real
    sgn, integer m, integer n, real, dimension(lda, *) a, integer lda, real,
    dimension(ldb, *) b, integer ldb, real, dimension(ldc,*) c, integer ldc,
    real, dimension(ldd, *) d, integer ldd, real, dimension(ldx, *) x,
    integer ldx, real, dimension(ldy, *) y, integer ldy, real scale)

Compute the relative residual for the generalized Sylvester equation. FOUR coefficient matrices, two transposes, one sign β€” she's doing the absolute most and honestly? Slay. πŸ‘‘

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.
!>

Copy that formula exactly, bestie β€” she wrote it, she owns it, and every paren in there is load-bearing πŸ™ˆ

Remarks

Auxiliary memory is managed by the function itself. Self-sufficient, as always πŸ’…

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 REAL, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation. It's the vibe check on whether the two halves add or subtract, and it only accepts +/-1 β€” no freelancing πŸ”₯
  • M β€” M is INTEGER β€” the order of the matrix A. Constraint: M >= 0.
  • N β€” N is INTEGER β€” the order of the matrix B. Constraint: N >= 0.
  • A β€” A is REAL array, dimension (LDA,M) β€” the coefficient matrix A. ✨
  • LDA β€” LDA is INTEGER β€” the leading dimension of the array A. Needs LDA >= max(1,M).
  • B β€” B is REAL array, dimension (LDB,N) β€” the coefficient matrix B. ✨
  • LDB β€” LDB is INTEGER β€” the leading dimension of the array A (yes, A again β€” the manpage is committed to this bit πŸ’€). Needs LDB >= max(1,N).
  • C β€” C is REAL array, dimension (LDC,M) β€” the coefficient matrix C. ✨
  • LDC β€” LDC is INTEGER β€” the leading dimension of the array C. Needs LDC >= max(1,M).
  • D β€” D is REAL array, dimension (LDD,N) β€” the coefficient matrix D. ✨
  • LDD β€” LDD is INTEGER β€” the leading dimension of the array A (third time's the charm πŸ™ˆ). Needs LDD >= max(1,N).
  • X β€” X is REAL array, dimension (LDX,N) β€” solution of the Sylvester Equation. πŸ’–
  • LDX β€” LDX is INTEGER β€” the leading dimension of the array X. Needs LDX >= max(1,M).
  • Y β€”
  • Y β€” Y is a REAL array, dimension (LDY,N) πŸ’– it's literally the right hand side of the Sylvester Equation, bestie, no notes. 🫢
  • LDY β€” LDY is INTEGER. It's the leading dimension of the array Y, and the vibe check here is strict: LDY >= max(1,M). πŸ’…
  • SCALE β€” SCALE is REAL. It's the scaling factor that stops your result from overflowing β€” like the little seatbelt keeping everything cute and contained. πŸŽ€

✨ Returns ✨

The function hands you back the relative residual as defined in (1). But if an error happens, a negative integer I comes back instead, signalizing that the parameter -I has a wrong/illegal value 😭 and if I = -1000, bestie, the auxiliary memory could not be allocated. tragic.

.fi

✨ Author ✨

Martin Koehler, MPI Magdeburg πŸ‘‘

✨ Date ✨

October 2025 πŸ—“οΈ

Definition at line 172 of file res_gsylv.f90.


🌸 sla_residual_lyap 🌸

real function sla_residual_lyap (character trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldx, *) x, integer
    ldx, real, dimension(ldy, *) y, integer ldy, real scale)

Compute the relative residual for the Lyapunov equation. that's the whole assignment, and she ate. ✨

πŸ¦‹ 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. no cap. 🧚

πŸŽ€ Remarks

Auxiliary memory is managed by the function itself β€” she handles her own business, you don't have to. πŸ’…

πŸ’– Parameters

  • TRANS β€” TRANS is CHARACTER(1). It 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 matrix A. M >= 0. πŸ“
  • A β€” A is a REAL array, dimension (LDA,M). It's the coefficient matrix A, the main character of this equation. πŸ‘‘
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). 🫢
  • X β€” X is a REAL array, dimension (LDX,M). Solution of the Lyapunov Equation. the moment. ✨
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M). πŸ’…
  • Y β€” Y is a REAL array, dimension (LDY,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 REAL. A scaling factor to prevent the overflow in the result. keeping it contained, keeping it cute. 🌸

✨ 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 😭 and if I = -1000, the auxiliary memory could not be allocated. not the allocated-memory L. πŸ’€

.fi

✨ Author ✨

Martin Koehler, MPI Magdeburg πŸ‘‘

✨ Date ✨

October 2025 πŸ—“οΈ

Definition at line 116 of file res_lyap.f90.


🌈 sla_residual_stein 🌈

real function sla_residual_stein (character trans, integer m, real,
    dimension(lda, *) a, integer lda, real, dimension(ldx, *) x, integer
    ldx, real, dimension(ldy, *) y, integer ldy, real scale)

Compute the relative residual for the Stein equation. periodt. πŸ’…

πŸ¦‹ 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. fr fr. 🧚

πŸŽ€ Remarks

Auxiliary memory is managed by the function itself β€” self-sufficient queen behavior. πŸ‘‘

πŸ’– Parameters

  • TRANS β€” TRANS is CHARACTER(1). It 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 matrix A. M >= 0. πŸ“
  • A β€” A is a REAL array, dimension (LDA,M). It's the coefficient matrix A. πŸ‘‘
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). 🫢
  • X β€” X is a REAL array, dimension (LDX,M). Solution of the Stein Equation. iconic. ✨
  • LDX β€” LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M). πŸ’…
  • Y β€” Y is a REAL array, dimension (LDY,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 REAL. A scaling factor to prevent the overflow in the result. your lil 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 😭 and if I = -1000, the auxiliary memory could not be allocated. πŸ’€

.fi

✨ Author ✨

Martin Koehler, MPI Magdeburg πŸ‘‘

✨ Date ✨

October 2025 πŸ—“οΈ

Definition at line 116 of file res_stein.f90.


πŸ¦‹ sla_residual_sylv πŸ¦‹

real function sla_residual_sylv (character transa, character transb, real
    sgn, integer m, integer n, real, dimension(lda, *) a, integer lda, real,
    dimension(ldb, *) b, integer ldb, real, dimension(ldx, *) x, integer
    ldx, real, dimension(ldy, *) y, integer ldy, real scale)

Compute the relative residual for the Sylvester equation. the way she just does that. πŸ’…

πŸ¦‹ 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. πŸ’–

πŸ’– Parameters

  • TRANSA β€” TRANSA is CHARACTER(1). It 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). It 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 REAL, allowed values: +/-1. It 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 a REAL array, dimension (LDA,M). It's the coefficient matrix A. πŸ‘‘
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). 🫢
  • B β€” B is a REAL array, dimension (LDB,N). It's the coefficient matrix B. πŸ‘‘
  • LDB β€” LDB is INTEGER. The leading dimension of the array A. LDB >= max(1,N). πŸ’…
  • X β€” X is a REAL 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 is a REAL 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 REAL. 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 😭 and if I = -1000, the auxiliary memory could not be allocated. πŸ’€

.fi

✨ Author ✨

Martin Koehler, MPI Magdeburg πŸ‘‘

✨ Date ✨

October 2025 πŸ—“οΈ

Definition at line 148 of file res_sylv.f90.


🌈 sla_residual_sylv2 🌈

real function sla_residual_sylv2 (character transa, character transb, real
    sgn, integer m, integer n, real, dimension(lda, *) a, integer lda, real,
    dimension(ldb, *) b, integer ldb, real, dimension(ldx, *) x, integer
    ldx, real, dimension(ldy, *) y, integer ldy, real scale)

Compute the relative residual for the discrete-time Sylvester equation. she's the sequel and she understood the assignment. πŸ‘‘

πŸ¦‹ 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)

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). It 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). It 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 REAL, allowed values: +/-1. It 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 a REAL array, dimension (LDA,M). It's the coefficient matrix A. πŸ‘‘
  • LDA β€” LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M). 🫢
  • B

B

  • B is a REAL array, dimension (LDB,N).
  • It's the coefficient matrix B. πŸ’–

LDB

  • LDB is an INTEGER.
  • It's the leading dimension of the array A. And yes bestie, the original really does say A here, we're just reporting the lore: LDB >= max(1,N). πŸ‘‘

X

  • X is a REAL array, dimension (LDX,N).
  • It's the solution of the Sylvester Equation. The whole point of the mission, honestly. ✨

LDX

  • LDX is an INTEGER.
  • Leading dimension of the array X. Rule of the land: LDX >= max(1,M).

Y

  • Y is a REAL array, dimension (LDY,N).
  • It's the right hand side of the Sylvester Equation. The lil' input that gets fed in. πŸ“

LDY

  • LDY is an INTEGER.
  • Leading dimension of the array Y. And: LDY >= max(1,M).

SCALE

  • SCALE is a REAL.
  • It's a scaling factor whose entire job is to stop the result from overflowing. Not all heroes wear capes, some just multiply things down so your numbers don't explode. πŸ’…

Returns 🌈

The function returns the relative residual as defined in (1). That's the whole vibe. If something goes wrong, a negative integer I comes back instead β€” which is the function's way of saying "the parameter -I has a wrong/illegal value," i.e. it's pointing at whichever argument you fumbled.

And one special case, so pay attention: if I = -1000, it means the auxiliary memory could not be allocated. Not your args, not your math β€” just no room at the inn. 😭


Author πŸ‘‘

Martin Koehler, MPI Magdeburg

Date πŸ“…

October 2025

Definition at line 148 of file res_sylv2.f90.


Author (the robot one) πŸ€–

Generated automatically by Doxygen for MEPACK from the source code. It did not write this, it just birthed the raw material. Slay, Doxygen.


And that's a wrap, bestie! πŸŽ€ This page is Version 1.1.2, dated Thu Oct 9 2025 00:00:00, and yes, it's the residual(3) page you've been reading this whole time. Go forth and compute your residuals responsibly. No cap. πŸ’–βœ¨

πŸ“¦ where this page comes from