cresidual(3)
πΈ cresidual β C-Interface π
okay bestie, come SIT. this is cresidual(3), part of the MEPACK manual, and it's the C-Interface page for residual computations. yes, residuals. the "did my solver actually do the thing" check. main character energy fr fr π«Ά
β¨ NAME β¨
cresidual β C-Interface
- C-Interface for the residual computations.
β¨ SYNOPSIS β¨
π Functions π
okay so here's the whole roster, and every single one of these is a real signature, character for character, no notes:
double mepack_double_residual_csylv (const char *TRANSA, const char *TRANSB, double sgn1, double sgn2, int M, int N, double *A, int LDA, double *B, int LDB, double *C, int LDC, double *D, int LDD, double *R, int LDR, double *L, int LDL, double *E, int LDE, double *F, int LDF, double SCALE)
Compute the relative residual for the coupled Sylvester equation.
float mepack_single_residual_csylv (const char *TRANSA, const char *TRANSB, float sgn1, float sgn2, int M, int N, float *A, int LDA, float *B, int LDB, float *C, int LDC, float *D, int LDD, float *R, int LDR, float *L, int LDL, float *E, int LDE, float *F, int LDF, float SCALE)
Compute the relative residual for the coupled Sylvester equation.
double mepack_double_residual_csylv_dual (const char *TRANSA, const char *TRANSB, double sgn1, double sgn2, int M, int N, double *A, int LDA, double *B, int LDB, double *C, int LDC, double *D, int LDD, double *R, int LDR, double *L, int LDL, double *E, int LDE, double *F, int LDF, double SCALE)
Compute the relative residual for the coupled Sylvester equation.
float mepack_single_residual_csylv_dual (const char *TRANSA, const char *TRANSB, float sgn1, float sgn2, int M, int N, float *A, int LDA, float *B, int LDB, float *C, int LDC, float *D, int LDD, float *R, int LDR, float *L, int LDL, float *E, int LDE, float *F, int LDF, float SCALE)
Compute the relative residual for the coupled Sylvester equation.
double mepack_double_residual_glyap (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *Y, int LDY, double SCALE)
Compute the relative residual for the generalized Lyapunov equation.
float mepack_single_residual_glyap (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *Y, int LDY, float SCALE)
Compute the relative residual for the generalized Lyapunov equation.
double mepack_double_residual_gstein (const char *TRANS, int M, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *Y, int LDY, double SCALE)
Compute the relative residual for the generalized Stein equation.
float mepack_single_residual_gstein (const char *TRANS, int M, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *Y, int LDY, float SCALE)
Compute the relative residual for the generalized Stein equation.
double mepack_double_residual_gsylv (const char *TRANSA, const char *TRANSB, double sgn, int M, int N, double *A, int LDA, double *B, int LDB, double *C, int LDC, double *D, int LDD, double *X, int LDX, double *Y, int LDY, double SCALE)
Compute the relative residual for the generalized Sylvester equation.
float mepack_single_residual_gsylv (const char *TRANSA, const char *TRANSB, float sgn, int M, int N, float *A, int LDA, float *B, int LDB, float *C, int LDC, float *D, int LDD, float *X, int LDX, float *Y, int LDY, float SCALE)
Compute the relative residual for the generalized Sylvester equation.
double mepack_double_residual_lyap (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *Y, int LDY, double SCALE)
Compute the relative residual for the Lyapunov equation.
float mepack_single_residual_lyap (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *Y, int LDY, float SCALE)
Compute the relative residual for the Lyapunov equation.
double mepack_double_residual_stein (const char *TRANS, int M, double *A, int LDA, double *X, int LDX, double *Y, int LDY, double SCALE)
Compute the relative residual for the Stein equation.
float mepack_single_residual_stein (const char *TRANS, int M, float *A, int LDA, float *X, int LDX, float *Y, int LDY, float SCALE)
Compute the relative residual for the Stein equation.
double mepack_double_residual_sylv (const char *TRANSA, const char *TRANSB, double sgn, int M, int N, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *Y, int LDY, double SCALE)
Compute the relative residual for the Sylvester equation.
float mepack_single_residual_sylv (const char *TRANSA, const char *TRANSB, float sgn, int M, int N, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *Y, int LDY, float SCALE)
Compute the relative residual for the Sylvester equation.
double mepack_double_residual_sylv2 (const char *TRANSA, const char *TRANSB, double sgn, int M, int N, double *A, int LDA, double *B, int LDB, double *X, int LDX, double *Y, int LDY, double SCALE)
Compute the relative residual for the discrete-time Sylvester equation.
float mepack_single_residual_sylv2 (const char *TRANSA, const char *TRANSB, float sgn, int M, int N, float *A, int LDA, float *B, int LDB, float *X, int LDX, float *Y, int LDY, float SCALE)
Compute the relative residual for the discrete-time Sylvester equation.
π Detailed Description π
C-Interface for the residual computations.
The routines in this group are wrappers around the Fortran routines from Residual Computations. so like, the Fortran girlies did the heavy lifting, and these are the C besties holding the door open π«Ά
π Function Documentation π
β mepack_double_residual_csylv β
double mepack_double_residual_csylv (const char * TRANSA, const char * TRANSB, double sgn1, double sgn2, int M, int N, double * A, int LDA, double * B, int LDB, double * C, int LDC, double * D, int LDD, double * R, int LDR, double * L, int LDL, double * E, int LDE, double * F, int LDF, double SCALE)
Compute the relative residual for the coupled Sylvester equation.
Purpose:
Compute the relative residual of the coupled Sylvester equation
RelRes = max( || SCALE*E - opA(A)*R - SGN1 * L *opB(B) || / ( (||A||*||R||+||B||*||L||) + SCALE * ||E|| ),
|| SCALE*F - opA(C)*R - SGN2 * L *opB(D) || / ( (||C||*||R||+||D||*||L||) + SCALE * ||F|| )) (1)
The norms are evaluated in terms of the Frobenius norm.
Remarks
Auxiliary memory is managed by the function itself. so you don't gotta malloc anything, she handles it π
Parameters
TRANSAβTRANSAisCHARACTER(1). 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βTRANSBisCHARACTER(1). 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)
SGN1βSGN1isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign in the first equation.SGN2βSGN2isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign in the second equation.MβMisINTEGER. The order of the matrixA.M >= 0.NβNisINTEGER. The order of the matrixB.N >= 0.AβAisDOUBLE PRECISIONarray, dimension(LDA,M). The coefficient matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisDOUBLE PRECISIONarray, dimension(LDB,N). The coefficient matrixB.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).CβCisDOUBLE PRECISIONarray, dimension(LDC,M). The coefficient matrixC.LDCβLDCisINTEGER. The leading dimension of the arrayC.LDC >= max(1,M).DβDisDOUBLE PRECISIONarray, dimension(LDD,N). The coefficient matrixD.LDDβLDDisINTEGER. The leading dimension of the arrayD.LDD >= max(1,N).RβRisDOUBLE PRECISIONarray, dimension(LDR,N). The first of the Sylvester Equation.LDRβLDRisINTEGER. The leading dimension of the arrayR.LDX >= max(1,M).
ngl bestie, thatLDXin theLDRdescription is straight from the source β it saysLDXeven though we're talking aboutRhere. i'm not fixing it, i'm just reporting it π
LβLisDOUBLE PRECISIONarray, dimension(LDL,N). The second solution the Sylvester Equation.LDLβLDLisINTEGER. The leading dimension of the arrayL.LDL >= max(1,M).EβEisDOUBLE PRECISIONarray, dimension(LDE,N). The first right hand side of the Sylvester Equation.LDEβLDEisINTEGER. The leading dimension of the arrayE.LDE >= max(1,M).FβFisDOUBLE PRECISIONarray, dimension(LDF,N). The second right hand side of the Sylvester Equation.LDFβLDFisINTEGER. The leading dimension of the arrayF.LDF >= max(1,M).SCALEβSCALEisDOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. she's the safety net β¨
Returns
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.
See also
dla_residual_csylv
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 201 of file csylv.c.
β mepack_double_residual_csylv_dual β
double mepack_double_residual_csylv_dual (const char * TRANSA, const char * TRANSB, double sgn1, double sgn2, int M, int N, double * A, int LDA, double * B, int LDB, double * C, int LDC, double * D, int LDD, double * R, int LDR, double * L, int LDL, double * E, int LDE, double * F, int LDF, double SCALE)
Compute the relative residual for the coupled Sylvester equation.
Purpose:
Compute the relative residual of the coupled Sylvester equation
RelRes = max( || SCALE*E - opA(A)**T *R - opA(C) ** T *L || / ( (||A||*||R||+||C||*||L||) + SCALE * ||E|| ),
|| SCALE*F - SGN1 * R * opB(B)**T - SGN2 * L * opB(D) **T || / ( (||B||*||R||+||D||*||L||) + SCALE * ||F||)) (1)
The norms are evaluated in terms of the Frobenius norm.
Remarks
Auxiliary memory is managed by the function itself. again, she's got it, you don't π
Parameters
TRANSAβTRANSAisCHARACTER(1). 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)
TRANSBTRANSBβTRANSBisCHARACTER(1). Specifies the form of the system of equations with respect to B, bestie π:== 'N': opB(B) = B (No transpose for B)== 'T': opB(B) = B**T (Transpose B)
SGN1βSGN1isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign in the first equation. periodt.SGN2βSGN2isDOUBLE PRECISION, allowed values:+/-1. Specifies the sign in the second equation. no cap.MβMisINTEGER. The order of the matrix A.M >= 0. gotta be non-negative, fr fr.NβNisINTEGER. The order of the matrix B.N >= 0. same energy.AβAisDOUBLE PRECISION array, dimension(LDA,M). The coefficient matrix A.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M). iconic.BβBisDOUBLE PRECISION array, dimension(LDB,N). The coefficient matrix B.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).CβCisDOUBLE PRECISION array, dimension(LDC,M). The coefficient matrix C.LDCβLDCisINTEGER. The leading dimension of the array C.LDC >= max(1,M).DβDisDOUBLE PRECISION array, dimension(LDD,N). The coefficient matrix D.LDDβLDDisINTEGER. The leading dimension of the array D.LDD >= max(1,N).RβRisDOUBLE PRECISION array, dimension(LDR,N). The first of the Sylvester Equation.LDRβLDRisINTEGER. The leading dimension of the array R.LDX >= max(1,M). (yes bestie, it saysLDXhere, notLDRβ we donβt make the rules π)LβLisDOUBLE PRECISION array, dimension(LDL,N). The second solution the Sylvester Equation.LDLβLDLisINTEGER. The leading dimension of the array L.LDL >= max(1,M).EβEisDOUBLE PRECISION array, 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βFisDOUBLE PRECISION array, 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βSCALEisDOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result. sheβs just here to keep things from going feral π₯.
Returns π
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated. so if you see a negative number, somethingβs sus π.
See also π
dla_residual_csylv_dual
Author βοΈ
Martin Koehler, MPI Magdeburg
Date π
October 2025
Definition π
Definition at line 201 of file csylv_dual.c.
β¨ mepack_double_residual_glyap β¨
double mepack_double_residual_glyap (const char * TRANS, int M, double * A,
int LDA, double * B, int LDB, double * X, int LDX, double * Y, int LDY,
double SCALE)
Compute the relative residual for the generalized Lyapunov equation.
Purpose π―
Compute the relative residual of the generalized Lyapunov equation
RelRes = || SCALE*Y - op(A)*X*op(B)**T - op(B) * X * op(A)**T || / ( 2*||A||*||B||*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm.
Remarks π
Auxiliary memory is managed by the function itself.
Parameters π
TRANSβTRANSisCHARACTER(1). Specifies the form of the system of equations with respect to A, bestie:== 'N': op(A) = A (No transpose for A)== 'T': op(A) = A**T (Transpose A)
MβMisINTEGER. The order of the matrices A.M >= 0.AβAisDOUBLE PRECISION array, dimension(LDA,M). The coefficient matrix A.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BβBisDOUBLE PRECISION array, dimension(LDB,M). The coefficient matrix B.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,M).XβXisDOUBLE PRECISION array, dimension(LDX,M). Solution of the Lyapunov Equation.LDXβLDXisINTEGER. The leading dimension of the array X.LDX >= max(1,M).YβYisDOUBLE PRECISION array, dimension(LDX,M). The right hand side of the Lyapunov 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.
Returns π
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.
See also π
dla_residual_glyap
Author βοΈ
Martin Koehler, MPI Magdeburg
Date π
October 2025
Definition π
Definition at line 126 of file glyap.c.
β¨ mepack_double_residual_gstein β¨
double mepack_double_residual_gstein (const char * TRANS, int M, double * A,
int LDA, double * B, int LDB, double * X, int LDX, double * Y, int LDY,
double SCALE)
Compute the relative residual for the generalized Stein equation.
Purpose π―
Compute the relative residual of the generalized Stein equation
RelRes = || SCALE*Y - op(A)*X*op(A)**T + op(B) * X * op(B)**T || / ( (||A||**2+||B||**2)*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm.
Remarks π
Auxiliary memory is managed by the function itself.
Parameters π
TRANSβTRANSisCHARACTER(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βMisINTEGER. The order of the matrices A.M >= 0.AβAisDOUBLE PRECISION array, dimension(LDA,M). The coefficient matrix A.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BβBisDOUBLE PRECISION array, dimension(LDB,M). The coefficient matrix B.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,M).XβXisDOUBLE PRECISION array, dimension(LDX,M). Solution of the Stein Equation.LDXβLDXisINTEGER. The leading dimension of the array X.LDX >= max(1,M).YβYisDOUBLE PRECISION array, dimension(LDX,M). The right hand side of the Stein 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.
Returns π
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.
See also π
dla_residual_gstein
Author βοΈ
Martin Koehler, MPI Magdeburg
Date π
October 2025
Definition π
Definition at line 126 of file gstein.c.
β¨ mepack_double_residual_gsylv β¨
double mepack_double_residual_gsylv (const char * TRANSA, const char *
TRANSB, double sgn, int M, int N, double * A, int LDA, double * B, int
LDB, double * C, int LDC, double * D, int LDD, double * X, int LDX,
double * Y, int LDY, double SCALE)
Compute the relative residual for the generalized Sylvester equation.
Purpose π―
Compute the relative residual of the generalized Sylvester equation
RelRes = || SCALE*Y - opA(A)*X *opB(B) - SGN * opA(C) * X * opB(D) || / ( (||A||*||B||+||C||*||D||)*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm.
Remarks π
Auxiliary memory is managed by the function itself.
Parameters π
TRANSAβ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.MβMisINTEGER. The order of the matrix A.M >= 0.NβNisINTEGER. The order of the matrix B.N >= 0.AβAisDOUBLE PRECISION array, dimension(LDA,M). The coefficient matrix A.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,M).BβBisDOUBLE PRECISION array, dimension(LDB,N). The coefficient matrix B.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).CβCisDOUBLE PRECISION array, dimension(LDC,M). The coefficient matrix C.LDCβLDCisINTEGER. The leading dimension of the array C.LDC >= max(1,M).DβDisDOUBLE PRECISION array, dimension(LDD,N). The coefficient matrix D.LDDβLDDisINTEGER. The leading dimension of the array D.LDD >= max(1,N).XβXisDOUBLE PRECISION array, dimension(LDX,N). Solution of the Sylvester Equation.LDXβLDXisINTEGER. The leading dimension of the array X.LDX >= max(1,M).YYβ bestie,Yis aDOUBLE PRECISION array, dimension(LDY,N). It's the right hand side of the Sylvester Equation. πLDYβLDYisINTEGER. The leading dimension of the arrayY.LDY >= max(1,M). πSCALEβSCALEisDOUBLE PRECISION.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. π
See also
dla_residual_gsylv
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 170 of file gsylv.c.
π
double mepack_double_residual_lyap (const char * TRANS, int M, double * A, int LDA, double * X, int LDX, double * Y, int LDY, double SCALE)
Compute the relative residual for the Lyapunov equation. π¦
β¨ Purpose β¨
Compute the relative residual of the Lyapunov equation
RelRes = || SCALE*Y - op(A)*X - X * op(A)**T || / ( 2*||A||*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm. πΈ
π‘ Remarks π‘
Auxiliary memory is managed by the function itself. no cap.
π Parameters π
TRANSβ TRANS isCHARACTER(1). 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βMisINTEGER. The order of the matricesA.M >= 0.AβAisDOUBLE PRECISION array, dimension(LDA,M). The coefficient matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXisDOUBLE PRECISION array, dimension(LDX,M). Solution of the Lyapunov Equation.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).YβYisDOUBLE PRECISION array, dimension(LDX,M). The right hand side of the Lyapunov Equation.LDYβLDYisINTEGER. The leading dimension of the arrayY.LDY >= max(1,M).SCALEβSCALEisDOUBLE PRECISION.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.
π See also π dla_residual_lyap
βοΈ Author βοΈ Martin Koehler, MPI Magdeburg
π Date π October 2025
π Definition at line 114 of file lyap.c.
π double mepack_double_residual_stein (const char * TRANS, int M, double * A, int LDA, double * X, int LDX, double * Y, int LDY, double SCALE)
Compute the relative residual for the Stein equation. π
β¨ Purpose β¨
Compute the relative residual of the Stein equation
RelRes = || SCALE*Y - op(A)*X*op(A)**T + X || / ( (||A||**2+1) * ||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm. πΈ
π‘ Remarks π‘
Auxiliary memory is managed by the function itself. no cap.
π Parameters π
TRANSβ TRANS isCHARACTER(1). 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βMisINTEGER. The order of the matricesA.M >= 0.AβAisDOUBLE PRECISION array, dimension(LDA,M). The coefficient matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).XβXisDOUBLE PRECISION array, dimension(LDX,M). Solution of the Stein Equation.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).YβYisDOUBLE PRECISION array, dimension(LDX,M). The right hand side of the Stein Equation.LDYβLDYisINTEGER. The leading dimension of the arrayY.LDY >= max(1,M).SCALEβSCALEisDOUBLE PRECISION.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.
π See also π dla_residual_stein
βοΈ Author βοΈ Martin Koehler, MPI Magdeburg
π Date π October 2025
π Definition at line 114 of file stein.c.
π₯ double mepack_double_residual_sylv (const char * TRANSA, const char * TRANSB, double sgn, int M, int N, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * Y, int LDY, double SCALE)
Compute the relative residual for the Sylvester equation. π
β¨ Purpose β¨
Compute the relative residual of the Sylvester equation
RelRes = || SCALE*Y - opA(A)*X - SGN * X * opB(B) || / ( (||A||+||B||)*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm. πΈ
π‘ Remarks π‘
Auxiliary memory is managed by the function itself. no cap.
π Parameters π
TRANSAβTRANSAisCHARACTER(1). 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βTRANSBisCHARACTER(1). 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βSGNisDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.MβMisINTEGER. The order of the matrixA.M >= 0.NβNisINTEGER. The order of the matrixB.N >= 0.AβAisDOUBLE PRECISION array, dimension(LDA,M). The coefficient matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisDOUBLE PRECISION array, dimension(LDB,N). The coefficient matrixB.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisDOUBLE PRECISION array, dimension(LDX,M). Solution of the Sylvester Equation.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).YβYisDOUBLE PRECISION array, dimension(LDX,M). The right hand side of the Sylvester Equation.LDYβLDYisINTEGER. The leading dimension of the arrayY.LDY >= max(1,M).SCALEβSCALEisDOUBLE PRECISION.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.
π See also π dla_residual_sylv
βοΈ Author βοΈ Martin Koehler, MPI Magdeburg
π Date π October 2025
π Definition at line 147 of file sylv.c.
π double mepack_double_residual_sylv2 (const char * TRANSA, const char * TRANSB, double sgn, int M, int N, double * A, int LDA, double * B, int LDB, double * X, int LDX, double * Y, int LDY, double SCALE)
Compute the relative residual for the discrete-time Sylvester equation. π¦
β¨ Purpose β¨
Compute the relative residual of the discrete-time Sylvester equation
RelRes = || SCALE*Y - opA(A)*X*op(B) - SGN*X || / ( (||A||*||B||+1)*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm. πΈ
π‘ Remarks π‘
Auxiliary memory is managed by the function itself. no cap.
π Parameters π
TRANSAβTRANSAisCHARACTER(1). 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βTRANSBisCHARACTER(1). 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βSGNisDOUBLE PRECISION, allowed values:+/-1. Specifies the sign between the two parts of the Sylvester equation.MβMisINTEGER. The order of the matrixA.M >= 0.NβNisINTEGER. The order of the matrixB.N >= 0.AβAisDOUBLE PRECISION array, dimension(LDA,M). The coefficient matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,M).BβBisDOUBLE PRECISION array, dimension(LDB,N). The coefficient matrixB.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).XβXisDOUBLE PRECISION array, dimension(LDX,M). Solution of the Sylvester Equation.LDXβLDXisINTEGER. The leading dimension of the arrayX.LDX >= max(1,M).YβYisDOUBLE PRECISION array, dimension(LDX,M). The right hand side of the Sylvester Equation.LDYβLDYisINTEGER. The leading dimension of the arrayY.LDY >= max(1,M).SCALEβSCALEisDOUBLE PRECISION.SCALEis a scaling factor to prevent the overflow in the result.
Returns
...and yeah, that's the relative residual, exactly as defined in that (1) up there. π
If something goes wrong it hands you back a negative integer I, which is basically the function screaming "bestie, parameter -I is illegal/wrong, fix it." π And if I = -1000? That means the auxiliary memory could not be allocated. Rude, but at least it's honest. π
See also
dla_residual_sylv2
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition
At line 147 of file sylv2.c.
β¨ float mepack_single_residual_csylv (const char * TRANSA, const char * TRANSB, float sgn1, float sgn2, int M, int N, float * A, int LDA, float * B, int LDB, float * C, int LDC, float * D, int LDD, float * R, int LDR, float * L, int LDL, float * E, int LDE, float * F, int LDF, float SCALE) β¨
Compute the relative residual for the coupled Sylvester equation. π¦
Purpose
So like, it computes the relative residual of the coupled Sylvester equation, and it's giving:
RelRes = max( || SCALE*E - opA(A)*R - SGN1 * L *opB(B) || / ( (||A||*||R||+||B||*||L||) + SCALE * ||E|| ),
|| SCALE*F - opA(C)*R - SGN2 * L *opB(D) || / ( (||C||*||R||+||D||*||L||) + SCALE * ||F|| )) (1)
The norms are evaluated in terms of the Frobenius norm. Periodt. π
Remarks
Auxiliary memory is managed by the function itself. It's independent, it handles its own business, main character energy honestly. π
Parameters
TRANSAβ TRANSA isCHARACTER(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 isCHARACTER(1). Specifies the form of the system of equations with respect to B:== 'N': opB(B) = B (No transpose for B)== 'T': opB(B) = B**T (Transpose B)
SGN1β SGN1 is SINGLE PRECISION, allowed values:+/-1. Specifies the sign in the first equation.SGN2β SGN2 is SINGLE PRECISION, allowed values:+/-1. Specifies the sign in the second equation.Mβ M is INTEGER. The order of the matrix A.M >= 0.Nβ N is INTEGER. The order of the matrix B.N >= 0.Aβ A is SINGLE PRECISION array, dimension(LDA,M). The coefficient matrix A.LDAβ LDA is INTEGER. The leading dimension of the array A.LDA >= max(1,M).Bβ B is SINGLE PRECISION array, dimension(LDB,N). The coefficient matrix B.LDBβ LDB is INTEGER. The leading dimension of the array B.LDB >= max(1,N).Cβ C is SINGLE PRECISION array, dimension(LDC,M). The coefficient matrix C.LDCβ LDC is INTEGER. The leading dimension of the array C.LDC >= max(1,M).Dβ D is SINGLE PRECISION array, dimension(LDD,N). The coefficient matrix D.LDDβ LDD is INTEGER. The leading dimension of the array D.LDD >= max(1,N).Rβ R is SINGLE PRECISION array, dimension(LDR,N). The first of the Sylvester Equation.LDRβ LDR is INTEGER. The leading dimension of the array R.LDX >= max(1,M).Lβ L is SINGLE PRECISION array, dimension(LDL,N). The second solution the Sylvester Equation.LDLβ LDL is INTEGER. The leading dimension of the array L.LDL >= max(1,M).Eβ E is SINGLE PRECISION array, dimension(LDE,N). The first right hand side of the Sylvester Equation.LDEβ LDE is INTEGER. The leading dimension of the array E.LDE >= max(1,M).Fβ F is SINGLE PRECISION array, dimension(LDF,N). The second right hand side of the Sylvester Equation.LDFβ LDF is INTEGER. The leading dimension of the array F.LDF >= max(1,M).SCALEβ SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.
Returns
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated. π
See also
sla_residual_csylv
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition
At line 397 of file csylv.c.
β¨ float mepack_single_residual_csylv_dual (const char * TRANSA, const char * TRANSB, float sgn1, float sgn2, int M, int N, float * A, int LDA, float * B, int LDB, float * C, int LDC, float * D, int LDD, float * R, int LDR, float * L, int LDL, float * E, int LDE, float * F, int LDF, float SCALE) β¨
Compute the relative residual for the coupled Sylvester equation. π (yes, the dual one, we're doing it again but transposed-ily, iykyk)
Purpose
Compute the relative residual of the coupled Sylvester equation:
RelRes = max( || SCALE*E - opA(A)**T *R - opA(C) ** T *L || / ( (||A||*||R||+||C||*||L||) + SCALE * ||E|| ),
|| SCALE*F - SGN1 * R * opB(B)**T - SGN2 * L * opB(D) **T || / ( (||B||*||R||+||D||*||L||) + SCALE * ||F||)) (1)
The norms are evaluated in terms of the Frobenius norm. π§
Remarks
Auxiliary memory is managed by the function itself.
Parameters
TRANSAβ TRANSA isCHARACTER(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 isCHARACTER(1). Specifies the form of the system of equations with respect to B:== 'N': opB(B) = B (No transpose for B)== 'T': opB(B) = B**T (Transpose B)
SGN1β SGN1 is SINGLE PRECISION, allowed values:+/-1. Specifies the sign in the first equation.SGN2β SGN2 is SINGLE PRECISION, allowed values:+/-1. Specifies the sign in the second equation.Mβ M is INTEGER. The order of the matrix A.M >= 0.Nβ N is INTEGER. The order of the matrix B.N >= 0.Aβ A is SINGLE PRECISION array, dimension(LDA,M). The coefficient matrix A.LDAβ LDA is INTEGER. The leading dimension of the array A.LDA >= max(1,M).Bβ B is SINGLE PRECISION array, dimension(LDB,N). The coefficient matrix B.LDBβ LDB is INTEGER. The leading dimension of the array B.LDB >= max(1,N).Cβ C is SINGLE PRECISION array, dimension(LDC,M). The coefficient matrix C.LDCβ LDC is INTEGER. The leading dimension of the array C.LDC >= max(1,M).Dβ D is SINGLE PRECISION array, dimension(LDD,N). The coefficient matrix D.LDDβ LDD is INTEGER. The leading dimension of the array D.LDD >= max(1,N).Rβ R is SINGLE PRECISION array, dimension(LDR,N). The first of the Sylvester Equation.LDRβ LDR is INTEGER. The leading dimension of the array R.LDX >= max(1,M).Lβ L is SINGLE PRECISION array, dimension(LDL,N). The second solution the Sylvester Equation.LDLβ LDL is INTEGER. The leading dimension of the array L.LDL >= max(1,M).Eβ E is SINGLE PRECISION array, dimension(LDE,N). The first right hand side of the Sylvester Equation.LDEβ LDE is INTEGER. The leading dimension of the array E.LDE >= max(1,M).Fβ F is SINGLE PRECISION array, dimension(LDF,N). The second right hand side of the Sylvester Equation.LDFβ LDF is INTEGER. The leading dimension of the array F.LDF >= max(1,M).SCALEβ SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.
Returns
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.
See also
sla_residual_csylv_dual
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition
At line 397 of file csylv_dual.c.
β¨ float mepack_single_residual_glyap (const char * TRANS, int M, float * A, int LDA, float * B, int LDB, float * X, int LDX, float * Y, int LDY, float SCALE) β¨
Compute the relative residual for the generalized Lyapunov equation. πΈ
Purpose
Compute the relative residual of the generalized Lyapunov equation:
RelRes = || SCALE*Y - op(A)*X*op(B)**T - op(B) * X * op(A)**T || / ( 2*||A||*||B||*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm. β¨
Remarks
Auxiliary memory is managed by the function itself. She's self-sufficient, she's thriving. π«Ά
Parameters
TRANSβ TRANS isCHARACTER(1). Specifies the form of the system of equations with respect to A:== 'N': op(A) = A (No transpose for A)== 'T': op(A) = A**T (Transpose A)
Mβ M is INTEGER. The order of the matrices A.M >= 0.Aβ A is SINGLE PRECISION array, dimension(LDA,M). The coefficient matrix A.LDAβ LDA is INTEGER. The leading dimension of the array A.LDA >= max(1,M).Bβ B is SINGLE PRECISION array, dimension(LDB,M). The coefficient matrix B.LDBβ LDB is INTEGER. The leading dimension of the array B.LDB >= max(1,M).Xβ X is SINGLE PRECISION array, dimension(LDX,M). Solution of the Lyapunov Equation.LDXβ LDX is INTEGER. The leading dimension of the array X.LDX >= max(1,M).Yβ Y is SINGLE PRECISION array, dimension(LDX,M). The right hand side of the Lyapunov Equation.LDYβ LDY is INTEGER. The leading dimension of the array Y.LDY >= max(1,M).SCALESCALEβSCALE</p> isSINGLE PRECISION. It's literally a scaling factor that stops the result from overflowing bestie, she's doing the lord's work π
Returns
The function hands you back the relative residual like we defined in (1) up there π. But if something goes sideways, you get a negative integer I back instead, which is the function's way of being like "bestie, the parameter -I is giving wrong/illegal value energy π". And if I = -1000? That means the auxiliary memory could not be allocated. Tragic. No cap. π
See also
sla_residual_glyap
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 239 of file glyap.c.
π¦ mepack_single_residual_gstein
float mepack_single_residual_gstein (const char * TRANS, int M, float * A,
int LDA, float * B, int LDB, float * X, int LDX, float * Y, int LDY,
float SCALE)
Compute the relative residual for the generalized Stein equation. Okay so this one is lowkey iconic, let's get into it πΈ
Purpose:
Compute the relative residual of the generalized Stein equation:
RelRes = || SCALE*Y - op(A)*X*op(A)**T + op(B) * X * op(B)**T || / ( (||A||**2+||B||**2)*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm. Periodt. β¨
Remarks
Auxiliary memory is managed by the function itself. She's independent, she doesn't need you to babysit her memory π«Ά
Parameters
TRANS
TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:
== 'N':op(A) = A(No transpose for A)== 'T':op(A) = A**T(Transpose A)
M
M is INTEGER. The order of the matrices A. M >= 0.
A
A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
B
B is SINGLE PRECISION array, dimension (LDB,M). The coefficient matrix B.
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,M).
X
X is SINGLE PRECISION array, dimension (LDX,M). Solution of the Stein Equation. She's the answer bestie π
LDX
LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
Y
Y is SINGLE PRECISION array, dimension (LDX,M). The right hand side of the Stein Equation.
LDY
LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
SCALE
SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.
Returns
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.
See also
sla_residual_gstein
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 239 of file gstein.c.
π mepack_single_residual_gsylv
float mepack_single_residual_gsylv (const char * TRANSA, const char *
TRANSB, float sgn, int M, int N, float * A, int LDA, float * B, int LDB,
float * C, int LDC, float * D, int LDD, float * X, int LDX, float * Y,
int LDY, float SCALE)
Compute the relative residual for the generalized Sylvester equation. This one has a LOT of parameters bestie, hydrate first π§
Purpose:
Compute the relative residual of the generalized Sylvester equation:
RelRes = || SCALE*Y - opA(A)*X *opB(B) - SGN * opA(C) * X * opB(D) || / ( (||A||*||B||+||C||*||D||)*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm. Slay. β¨
Remarks
Auxiliary memory is managed by the function itself.
Parameters
TRANSA
TRANSA is CHARACTER(1). Specifies the form of the system of equations with respect to A:
== 'N':opA(A) = A(No transpose for A)== 'T':opA(A) = A**T(Transpose A)
TRANSB
TRANSB is CHARACTER(1). Specifies the form of the system of equations with respect to B:
== 'N':opB(B) = B(No transpose for B)== 'T':opB(B) = B**T(Transpose B)
SGN
SGN is SINGLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation. Pick your fighter: plus or minus π
M
M is INTEGER. The order of the matrix A. M >= 0.
N
N is INTEGER. The order of the matrix B. N >= 0.
A
A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
B
B is SINGLE PRECISION array, dimension (LDB,N). The coefficient matrix B.
LDB
LDB is INTEGER. The leading dimension of the array B. LDB >= max(1,N).
C
C is SINGLE PRECISION array, dimension (LDC,M). The coefficient matrix C.
LDC
LDC is INTEGER. The leading dimension of the array C. LDC >= max(1,M).
D
D is SINGLE PRECISION array, dimension (LDD,N). The coefficient matrix D.
LDD
LDD is INTEGER. The leading dimension of the array D. LDD >= max(1,N).
X
X is SINGLE PRECISION array, dimension (LDY,M). Solution of the Sylvester Equation.
LDX
LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
Y
Y is SINGLE PRECISION array, dimension (LDY,N). The right hand side of the Sylvester Equation.
LDY
LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
SCALE
SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.
Returns
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.
See also
sla_residual_gsylv
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 331 of file gsylv.c.
πΈ mepack_single_residual_lyap
float mepack_single_residual_lyap (const char * TRANS, int M, float * A, int
LDA, float * X, int LDX, float * Y, int LDY, float SCALE)
Compute the relative residual for the Lyapunov equation. Classic. The main character of matrix equations, honestly π
Purpose:
Compute the relative residual of the Lyapunov equation:
RelRes = || SCALE*Y - op(A)*X - X * op(A)**T || / ( 2*||A||*||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm. Periodt π
Remarks
Auxiliary memory is managed by the function itself.
Parameters
TRANS
TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:
== 'N':op(A) = A(No transpose for A)== 'T':op(A) = A**T(Transpose A)
M
M is INTEGER. The order of the matrices A. M >= 0.
A
A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
X
X is SINGLE PRECISION array, dimension (LDX,M). Solution of the Lyapunov Equation.
LDX
LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
Y
Y is SINGLE PRECISION array, dimension (LDX,M). The right hand side of the Lyapunov Equation.
LDY
LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
SCALE
SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.
Returns
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.
See also
sla_residual_lyap
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 213 of file lyap.c.
π¦ mepack_single_residual_stein
float mepack_single_residual_stein (const char * TRANS, int M, float * A,
int LDA, float * X, int LDX, float * Y, int LDY, float SCALE)
Compute the relative residual for the Stein equation. Not to be confused with her generalized sister up there, this is the classic Stein and she's serving β¨
Purpose:
Compute the relative residual of the Stein equation:
RelRes = || SCALE*Y - op(A)*X*op(A)**T + X || / ( (||A||**2+1) * ||X|| + SCALE * ||Y|| ) (1)
The norms are evaluated in terms of the Frobenius norm. Iykyk π
Remarks
Auxiliary memory is managed by the function itself.
Parameters
TRANS
TRANS is CHARACTER(1). Specifies the form of the system of equations with respect to A:
== 'N':op(A) = A(No transpose for A)== 'T':op(A) = A**T(Transpose A)
M
M is INTEGER. The order of the matrices A. M >= 0.
A
A is SINGLE PRECISION array, dimension (LDA,M). The coefficient matrix A.
LDA
LDA is INTEGER. The leading dimension of the array A. LDA >= max(1,M).
X
X is SINGLE PRECISION array, dimension (LDX,M). Solution of the Stein Equation.
LDX
LDX is INTEGER. The leading dimension of the array X. LDX >= max(1,M).
Y
Y is SINGLE PRECISION array, dimension (LDX,M). The right hand side of the Stein Equation.
LDY
LDY is INTEGER. The leading dimension of the array Y. LDY >= max(1,M).
SCALE
SCALE is SINGLE PRECISION. SCALE is a scaling factor to prevent the overflow in the result.
Returns
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated.
See also
sla_residual_stein
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 213 of file stein.c.
π mepack_single_residual_sylv π
float mepack_single_residual_sylv (const char * TRANSA, const char * TRANSB,
float sgn, int M, int N, float * A, int LDA, float * B, int LDB, float *
X, int LDX, float * Y, int LDY, float SCALE)
okay bestie, this one computes the relative residual for the Sylvester equation. yes. we're doing residuals now. slay. β¨
Purpose:
so basically it computes the relative residual of the Sylvester equation
RelRes = || SCALE*Y - opA(A)*X - SGN * X * opB(B) || / ( (||A||+||B||)*||X|| + SCALE * ||Y|| ) (1)
and heads up β the norms here are evaluated in terms of the Frobenius norm. that's the whole vibe. π
Remarks
- the auxiliary memory is managed by the function itself, so you don't have to do a single thing about it π«Ά
Parameters
TRANSATRANSAisCHARACTER(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)
TRANSBTRANSBisCHARACTER(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)
SGNSGNisDOUBLE PRECISION, allowed values:+/-1- Specifies the sign between the two parts of the Sylvester equation.
MMisINTEGER- The order of the matrix A.
M >= 0.
NNisINTEGER- The order of the matrix B.
N >= 0.
AAisDOUBLE PRECISIONarray, dimension(LDA,M)- The coefficient matrix A.
LDALDAisINTEGER- The leading dimension of the array A.
LDA >= max(1,M).
BBisDOUBLE PRECISIONarray, dimension(LDB,N)- The coefficient matrix B.
LDBLDBisINTEGER- The leading dimension of the array B.
LDB >= max(1,N).
XXisDOUBLE PRECISIONarray, dimension(LDX,M)- Solution of the Sylvester Equation.
LDXLDXisINTEGER- The leading dimension of the array X.
LDX >= max(1,M).
YYisDOUBLE PRECISIONarray, dimension(LDX,M)- The right hand side of the Sylvester Equation.
LDYLDYisINTEGER- The leading dimension of the array Y.
LDY >= max(1,M).
SCALESCALEisDOUBLE PRECISIONSCALEis a scaling factor to prevent the overflow in the result.
Returns
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated. π (and yes, -1000 is the "girl we couldn't even get the memory" signal, no cap.)
See also
sla_residual_sylv
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 282 of file sylv.c.
π¦ mepack_single_residual_sylv2 π¦
float mepack_single_residual_sylv2 (const char * TRANSA, const char *
TRANSB, float sgn, int M, int N, float * A, int LDA, float * B, int LDB,
float * X, int LDX, float * Y, int LDY, float SCALE)
and this one? this one is the discrete-time Sylvester residual. the sequel. the second album. and honestly it ate. π
Purpose:
Compute the relative residual of the discrete-time Sylvester equation
RelRes = || SCALE*Y - opA(A)*X*opB(B) - SGN* X || / ( (||A||*||B||+1)*||X|| + SCALE * ||Y|| ) (1)
norms again evaluated in terms of the Frobenius norm, same as before, no surprises. π
Remarks
- the auxiliary memory is managed by the function itself β it's giving independent. it's giving main character. you literally don't lift a finger. β¨
Parameters
TRANSATRANSAisCHARACTER(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)
TRANSBTRANSBisCHARACTER(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)
SGNSGNisSINGLE PRECISION, allowed values:+/-1- Specifies the sign between the two parts of the Sylvester equation.
MMisINTEGER- The order of the matrix A.
M >= 0.
NNisINTEGER- The order of the matrix B.
N >= 0.
AAisSINGLE PRECISIONarray, dimension(LDA,M)- The coefficient matrix A.
LDALDAisINTEGER- The leading dimension of the array A.
LDA >= max(1,M).
BBisSINGLE PRECISIONarray, dimension(LDB,N)- The coefficient matrix B.
LDBLDBisINTEGER- The leading dimension of the array B.
LDB >= max(1,N).
XXisSINGLE PRECISIONarray, dimension(LDX,M)- Solution of the Sylvester Equation.
LDXLDXisINTEGER- The leading dimension of the array X.
LDX >= max(1,M).
YYisSINGLE PRECISIONarray, dimension(LDX,M)- The right hand side of the Sylvester Equation.
LDYLDYisINTEGER- The leading dimension of the array Y.
LDY >= max(1,M).
SCALESCALEisSINGLE PRECISIONSCALEis a scaling factor to prevent the overflow in the result.
Returns
The function returns the relative residual as defined in (1). If an error occurs a negative integer I is returned, signalizing that the parameter -I has a wrong/illegal value. If I = -1000, the auxiliary memory could not be allocated. π same energy as its sibling, same -1000 heartbreak.
See also
sla_residual_sylv2
Author
Martin Koehler, MPI Magdeburg
Date
October 2025
Definition at line 282 of file sylv2.c.
quick vibe check bestie: these two are literally the same layout of args, but the first one is allDOUBLE PRECISIONand the second is allSINGLE PRECISION, and the second is the discrete-time flavor withopA(A)*X*opB(B)in the formula. don't mix them up, i'm begging. π
π Author π
this page was generated automatically by Doxygen for MEPACK from the source code. yes, a robot wrote the skeleton, and i just gave it a glow-up. periodt. π β¨
π Version π
you're reading Version 1.1.2, dated Thu Oct 9 2025 00:00:00 β that's the whole cresidual(3) page, start to finish, and yes you read all six parts. iconic behavior honestly. obsessed. go compute some residuals bestie, you've got this π«ΆπΈπ
π¦ where this page comes from
- 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