residual(3)
πΈ 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: thedla_ones are the double precision girlies and thesla_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.-Imeans the parameterIwas wrong/illegal, and specificallyI = -1000means 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+/-1again. This one is the sign between the two parts of the second equation.Mβ INTEGER, the order of the matrixA. And it'sM >= 0, no negatives bestie. πNβ INTEGER, the order of the matrixB.N >= 0.Aβ DOUBLE PRECISION array, dimension(LDA,M). It's the coefficient matrixA, obviously. πLDAβ INTEGER, the leading dimension of the arrayA.LDA >= max(1,M).Bβ DOUBLE PRECISION array, dimension(LDB,N). The coefficient matrixB.LDBβ INTEGER, the leading dimension of the arrayA(that's literally what the page says β it means the one paired withB, we are NOT editing the source π).LDB >= max(1,N).Cβ DOUBLE PRECISION array, dimension(LDC,M). The coefficient matrixC.LDCβ INTEGER, the leading dimension of the arrayC.LDC >= max(1,M).Dβ DOUBLE PRECISION array, dimension(LDD,N). The coefficient matrixD.LDDβ INTEGER, and yes, the text here says "the leading dimension of the arrayA" 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 arrayR.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 arrayL.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 arrayE.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 arrayF.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 toA:== 'N':op(A) = A(No transpose forA)== 'T':op(A) = A**T(TransposeA)
Mβ INTEGER, the order of the matrixA.M >= 0.Aβ DOUBLE PRECISION array, dimension(LDA,M). The coefficient matrixA.LDAβ INTEGER, the leading dimension of the arrayA.LDA >= max(1,M).Bβ DOUBLE PRECISION array, dimension(LDB,M). The coefficient matrixB.LDBβ INTEGER, the leading dimension of the arrayB.LDB >= max(1,M).Xβ DOUBLE PRECISION array, dimension(LDX,M). Solution of the Lyapunov Equation. πLDXβ INTEGER, the leading dimension of the arrayX.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 arrayY.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 toA:== 'N':op(A) = A(No transpose forA)== 'T':op(A) = A**T(TransposeA)
Mβ INTEGER, the order of the matrixA.M >= 0.Aβ DOUBLE PRECISION array, dimension(LDA,M). The coefficient matrixA.LDAβ INTEGER, the leading dimension of the arrayA.LDA >= max(1,M).Bβ DOUBLE PRECISION array, dimension(LDB,M). The coefficient matrixB.LDBβ INTEGER, the leading dimension of the arrayB.LDB >= max(1,M).Xβ DOUBLE PRECISION array, dimension(LDX,M). Solution of the Stein Equation. πLDXβ INTEGER, the leading dimension of the arrayX.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 arrayY.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 toA:== 'N':opA(A) = A(No transpose forA)== 'T':opA(A) = A**T(TransposeA)
TRANSBβ CHARACTER(1). Specifies the form of the system of equations with respect toB:== 'N':opB(B) = B(No transpose forB)== 'T':opB(B) = B**T(TransposeB)
SGNβ DOUBLE PRECISION, allowed values+/-1. Specifies the sign between the two parts of the Sylvester equation.Mβ INTEGER, the order of the matrixA.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. AndN >= 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βTRANSAisCHARACTER(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βTRANSBisCHARACTER(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βSGNisDOUBLE 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βMisINTEGER. The order of the matrix A.M >= 0.NβNisINTEGER. The order of the matrix B.N >= 0.AβAisDOUBLE PRECISIONarray, dimension(LDA,M). The coefficient matrix A.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BβBisDOUBLE PRECISIONarray, dimension(LDB,N). The coefficient matrix B.LDBβLDBisINTEGER. The leading dimension of the array A.LDB >= max(1,N).XβXisDOUBLE PRECISIONarray, dimension(LDX,N). Solution of the Sylvester Equation.LDXβLDXisINTEGER. The leading dimension of the array X.LDX >= max(1,M).YβYisDOUBLE PRECISIONarray, dimension(LDY,N). The right hand side of the Sylvester Equation.LDYβLDYisINTEGER. The leading dimension of the array Y.LDY >= max(1,M).SCALEβSCALEisDOUBLE PRECISION.SCALEis 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βTRANSAisCHARACTER(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βTRANSBisCHARACTER(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βSGN1isREAL, allowed values:+/-1. Specifies the sign between the two parts of the first equation.SGN2βSGN2isREAL, allowed values:+/-1. Specifies the sign between the two parts of the second equation. two signs, two vibes, we stay organized β¨MβMisINTEGER. The order of the matrix A.M >= 0.NβNisINTEGER. The order of the matrix B.N >= 0.AβAisREALarray, dimension(LDA,M). The coefficient matrix A.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BβBisREALarray, dimension(LDB,N). The coefficient matrix B.LDBβLDBisINTEGER. The leading dimension of the array A.LDB >= max(1,N).CβCisREALarray, dimension(LDC,M). The coefficient matrix C.LDCβLDCisINTEGER. The leading dimension of the array C.LDC >= max(1,M).DβDisREALarray, dimension(LDD,N). The coefficient matrix D.LDDβLDDisINTEGER. The leading dimension of the array A.LDD >= max(1,N).RβRisREALarray, dimension(LDR,N). First part of the solution of the Sylvester Equation.LDRβLDRisINTEGER. The leading dimension of the array R.LDR >= max(1,M).LβLisREALarray, dimension(LDL,N). Second part of the solution of the Sylvester Equation.LDLβLDLisINTEGER. The leading dimension of the array L.LDL >= max(1,M).EβEisREALarray, dimension(LDE,N). The first right hand side of the Sylvester Equation.LDEβLDEisINTEGER. The leading dimension of the array E.LDE >= max(1,M).FβFisREALarray, dimension(LDF,N). The second right hand side of the Sylvester Equation.LDFβLDFisINTEGER. The leading dimension of the array F.LDF >= max(1,M).SCALEβSCALEisREAL.SCALEis 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βTRANSAisCHARACTER(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βTRANSBisCHARACTER(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βSGN1isREAL, allowed values:+/-1. Specifies the sign between the two parts of the first equation.SGN2βSGN2isREAL, allowed values:+/-1. Specifies the sign between the two parts of the second equation.MβMisINTEGER. The order of the matrix A.M >= 0.NβNisINTEGER. The order of the matrix B.N >= 0.AβAisREALarray, dimension(LDA,M). The coefficient matrix A.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BβBisREALarray, dimension(LDB,N). The coefficient matrix B.LDBβLDBβLDBis 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βCis REAL array, dimension (LDC,M) β the coefficient matrixC. β¨LDCβLDCis INTEGER β the leading dimension of the arrayC. You needLDC >= max(1,M).DβDis REAL array, dimension (LDD,N) β the coefficient matrixD. πLDDβLDDis 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βRis REAL array, dimension (LDR,N) β the first part of the solution of the Sylvester Equation. First half of the glow-up πLDRβLDRis INTEGER β the leading dimension of the arrayR. NeedsLDR >= max(1,M).LβLis REAL array, dimension (LDL,N) β the second part of the solution of the Sylvester Equation. The other half, we love a duo π«ΆLDLβLDLis INTEGER β the leading dimension of the arrayL. NeedsLDL >= max(1,M).EβEis REAL array, dimension (LDE,N) β the first right hand side of the Sylvester Equation. β¨LDEβLDEis INTEGER β the leading dimension of the arrayE. NeedsLDE >= max(1,M).FβFis REAL array, dimension (LDF,N) β the second right hand side of the Sylvester Equation. β¨LDFβLDFis INTEGER β the leading dimension of the arrayF. NeedsLDF >= max(1,M).SCALEβSCALEis REAL βSCALEis 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: negativeI= something is wrong, and-Itells you which parameter is sus. And if you getI = -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βTRANSis 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βMis INTEGER β the order of the matrix A. Constraint:M >= 0.AβAis REAL array, dimension (LDA,M) β the coefficient matrix A. β¨LDAβLDAis INTEGER β the leading dimension of the array A. NeedsLDA >= max(1,M).BβBis REAL array, dimension (LDB,M) β the coefficient matrix B. β¨LDBβLDBis INTEGER β the leading dimension of the array B. NeedsLDB >= max(1,M).XβXis REAL array, dimension (LDX,M) β solution of the Lyapunov Equation. The main character of this whole operation πLDXβLDXis INTEGER β the leading dimension of the array X. NeedsLDX >= max(1,M).YβYis REAL array, dimension (LDY,M) β the right hand side of the Lyapunov Equation. β¨LDYβLDYis INTEGER β the leading dimension of the array Y. NeedsLDY >= max(1,M).SCALEβSCALEis REAL βSCALEis 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βTRANSis 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βMis INTEGER β the order of the matrix A. Constraint:M >= 0.AβAis REAL array, dimension (LDA,M) β the coefficient matrix A. β¨LDAβLDAis INTEGER β the leading dimension of the array A. NeedsLDA >= max(1,M).BβBis REAL array, dimension (LDB,M) β the coefficient matrix B. β¨LDBβLDBis INTEGER β the leading dimension of the array B. NeedsLDB >= max(1,M).XβXis REAL array, dimension (LDX,M) β solution of the Stein Equation. πLDXβLDXis INTEGER β the leading dimension of the array X. NeedsLDX >= max(1,M).YβYis REAL array, dimension (LDY,M) β the right hand side of the Stein Equation. β¨LDYβLDYis INTEGER β the leading dimension of the array Y. NeedsLDY >= max(1,M).SCALEβSCALEis REAL βSCALEis 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βTRANSAis 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βTRANSBis 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βSGNis 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βMis INTEGER β the order of the matrix A. Constraint:M >= 0.NβNis INTEGER β the order of the matrix B. Constraint:N >= 0.AβAis REAL array, dimension (LDA,M) β the coefficient matrix A. β¨LDAβLDAis INTEGER β the leading dimension of the array A. NeedsLDA >= max(1,M).BβBis REAL array, dimension (LDB,N) β the coefficient matrix B. β¨LDBβLDBis INTEGER β the leading dimension of the array A (yes, A again β the manpage is committed to this bit π). NeedsLDB >= max(1,N).CβCis REAL array, dimension (LDC,M) β the coefficient matrix C. β¨LDCβLDCis INTEGER β the leading dimension of the array C. NeedsLDC >= max(1,M).DβDis REAL array, dimension (LDD,N) β the coefficient matrix D. β¨LDDβLDDis INTEGER β the leading dimension of the array A (third time's the charm π). NeedsLDD >= max(1,N).XβXis REAL array, dimension (LDX,N) β solution of the Sylvester Equation. πLDXβLDXis INTEGER β the leading dimension of the array X. NeedsLDX >= max(1,M).YβYβYis a REAL array, dimension(LDY,N)π it's literally the right hand side of the Sylvester Equation, bestie, no notes. π«ΆLDYβLDYis INTEGER. It's the leading dimension of the arrayY, and the vibe check here is strict:LDY >= max(1,M). πSCALEβSCALEis 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βTRANSis CHARACTER(1). It specifies the form of the system of equations with respect toA:== 'N': op(A) = A(No transpose for A)== 'T': op(A) = A**T(Transpose A)
MβMis INTEGER. The order of the matrixA.M >= 0. πAβAis a REAL array, dimension(LDA,M). It's the coefficient matrixA, the main character of this equation. πLDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M). π«ΆXβXis a REAL array, dimension(LDX,M). Solution of the Lyapunov Equation. the moment. β¨LDXβLDXis INTEGER. The leading dimension of the arrayX.LDX >= max(1,M). πYβYis a REAL array, dimension(LDY,M). The right hand side of the Lyapunov Equation. π«ΆLDYβLDYis INTEGER. The leading dimension of the arrayY.LDY >= max(1,M). πSCALEβSCALEis 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βTRANSis CHARACTER(1). It specifies the form of the system of equations with respect toA:== 'N': op(A) = A(No transpose for A)== 'T': op(A) = A**T(Transpose A)
MβMis INTEGER. The order of the matrixA.M >= 0. πAβAis a REAL array, dimension(LDA,M). It's the coefficient matrixA. πLDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M). π«ΆXβXis a REAL array, dimension(LDX,M). Solution of the Stein Equation. iconic. β¨LDXβLDXis INTEGER. The leading dimension of the arrayX.LDX >= max(1,M). πYβYis a REAL array, dimension(LDY,M). The right hand side of the Stein Equation. π«ΆLDYβLDYis INTEGER. The leading dimension of the arrayY.LDY >= max(1,M). πSCALEβSCALEis 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βTRANSAis CHARACTER(1). It specifies the form of the system of equations with respect toA:== 'N': opA(A) = A(No transpose for A)== 'T': opA(A) = A**T(Transpose A)
TRANSBβTRANSBis CHARACTER(1). It specifies the form of the system of equations with respect toB:== 'N': opB(B) = B(No transpose for B)== 'T': opB(B) = B**T(Transpose B)
SGNβSGNis REAL, allowed values:+/-1. It specifies the sign between the two parts of the Sylvester equation. πMβMis INTEGER. The order of the matrixA.M >= 0. πNβNis INTEGER. The order of the matrixB.N >= 0. πAβAis a REAL array, dimension(LDA,M). It's the coefficient matrixA. πLDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M). π«ΆBβBis a REAL array, dimension(LDB,N). It's the coefficient matrixB. πLDBβLDBis INTEGER. The leading dimension of the arrayA.LDB >= max(1,N). πXβXis a REAL array, dimension(LDX,N). Solution of the Sylvester Equation. β¨LDXβLDXis INTEGER. The leading dimension of the arrayX.LDX >= max(1,M). πYβYis a REAL array, dimension(LDY,N). The right hand side of the Sylvester Equation. π«ΆLDYβLDYis INTEGER. The leading dimension of the arrayY.LDY >= max(1,M). πΈSCALEβSCALEis 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βTRANSAis CHARACTER(1). It specifies the form of the system of equations with respect toA:== 'N': opA(A) = A(No transpose for A)== 'T': opA(A) = A**T(Transpose A)
TRANSBβTRANSBis CHARACTER(1). It specifies the form of the system of equations with respect toB:== 'N': opB(B) = B(No transpose for B)== 'T': opB(B) = B**T(Transpose B)
SGNβSGNis REAL, allowed values:+/-1. It specifies the sign between the two parts of the Sylvester equation. πMβMis INTEGER. The order of the matrixA.M >= 0. πNβNis INTEGER. The order of the matrixB.N >= 0. πAβAis a REAL array, dimension(LDA,M). It's the coefficient matrixA. πLDAβLDAis INTEGER. The leading dimension of the arrayA.LDA >= max(1,M). π«ΆB
B
Bis a REAL array, dimension(LDB,N).- It's the coefficient matrix
B. π
LDB
LDBis an INTEGER.- It's the leading dimension of the array
A. And yes bestie, the original really does sayAhere, we're just reporting the lore:LDB >= max(1,N). π
X
Xis a REAL array, dimension(LDX,N).- It's the solution of the Sylvester Equation. The whole point of the mission, honestly. β¨
LDX
LDXis an INTEGER.- Leading dimension of the array
X. Rule of the land:LDX >= max(1,M).
Y
Yis a REAL array, dimension(LDY,N).- It's the right hand side of the Sylvester Equation. The lil' input that gets fed in. π
LDY
LDYis an INTEGER.- Leading dimension of the array
Y. And:LDY >= max(1,M).
SCALE
SCALEis 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
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- fedora 43: mepack-devel 1.1.2-1.fc43 Β· GPL-3.0-or-later and LGPL-2.1-or-later and BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms