ctrsylv(3)
β¨ NAME β¨
okay so bestie, meet ctrsylv π β she lives in MEPACK, she's a ctrsylv(3) manual page (section 3, library calls, iykyk), and she is literally the C-Interface π«Ά
and not just any C-Interface, no ma'am β she's the C-Interface for triangular standard Sylvester equations πβ¨
like. that's her whole thing. that's the vibe. triangular standard Sylvester equations, but make it C. periodt π
β¨ SYNOPSIS β¨
okay bestie, buckle UP π because this is the part where we list every single function this library is serving, and there are a lot of them. Don't panic β they're all the same vibe, just different precision (double vs single), different algorithm level (level2 vs level3), and different lil flavour variants. Let's get into it β¨
πΈ Functions πΈ
mepack_double_trsylv_dag β Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG parallelization. π
void mepack_double_trsylv_dag (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 *SCALE, double *WORK, int *INFO)
mepack_single_trsylv_dag β Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG parallelization. β¨
void mepack_single_trsylv_dag (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 *SCALE, float *WORK, int *INFO)
mepack_double_trsylv2_dag β Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG parallelization. π
void mepack_double_trsylv2_dag (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 *SCALE, double *WORK, int *INFO)
mepack_single_trsylv2_dag β Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG parallelization. π
void mepack_single_trsylv2_dag (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 *SCALE, float *WORK, int *INFO)
mepack_double_trsylv_level2 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. π¦
void mepack_double_trsylv_level2 (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 *SCALE, double *WORK, int *INFO)
mepack_double_trsylv_level2_reorder β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Reordered variant) π
void mepack_double_trsylv_level2_reorder (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 *SCALE, double *WORK, int *INFO)
mepack_double_trsylv_level2_unopt β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant) π
void mepack_double_trsylv_level2_unopt (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 *SCALE, double *WORK, int *INFO)
mepack_double_trsylv_level2_local_copy β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant) π
void mepack_double_trsylv_level2_local_copy (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 *SCALE, double *WORK, int
*INFO)
mepack_double_trsylv_level2_local_copy_32 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 32) π₯
void mepack_double_trsylv_level2_local_copy_32 (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 *SCALE, double *WORK,
int *INFO)
mepack_double_trsylv_level2_local_copy_64 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 64) π
void mepack_double_trsylv_level2_local_copy_64 (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 *SCALE, double *WORK,
int *INFO)
mepack_double_trsylv_level2_local_copy_96 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N<=96) π
void mepack_double_trsylv_level2_local_copy_96 (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 *SCALE, double *WORK,
int *INFO)
mepack_double_trsylv_level2_local_copy_128 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 128) β
void mepack_double_trsylv_level2_local_copy_128 (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 *SCALE, double *WORK,
int *INFO)
and now we switch to single precision bestie, don't blink π
mepack_single_trsylv_level2 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. πΈ
void mepack_single_trsylv_level2 (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 *SCALE, float *WORK, int *INFO)
mepack_single_trsylv_level2_reorder β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Reordered variant) π
void mepack_single_trsylv_level2_reorder (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 *SCALE, float *WORK, int *INFO)
mepack_single_trsylv_level2_unopt β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant) π
void mepack_single_trsylv_level2_unopt (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 *SCALE, float *WORK, int *INFO)
mepack_single_trsylv_level2_local_copy β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant) π
void mepack_single_trsylv_level2_local_copy (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 *SCALE, float *WORK, int *INFO)
mepack_single_trsylv_level2_local_copy_32 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 32 ) π₯
void mepack_single_trsylv_level2_local_copy_32 (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 *SCALE, float *WORK, int
*INFO)
mepack_single_trsylv_level2_local_copy_64 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 64) π
void mepack_single_trsylv_level2_local_copy_64 (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 *SCALE, float *WORK, int
*INFO)
mepack_single_trsylv_level2_local_copy_96 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 96) π
void mepack_single_trsylv_level2_local_copy_96 (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 *SCALE, float *WORK, int
*INFO)
mepack_single_trsylv_level2_local_copy_128 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 128) β
void mepack_single_trsylv_level2_local_copy_128 (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 *SCALE, float *WORK, int
*INFO)
and NOW we get into the trsylv2 family β same vibe, second flavour π
mepack_double_trsylv2_level2 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. π¦
void mepack_double_trsylv2_level2 (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 *SCALE, double *WORK, int *INFO)
mepack_double_trsylv2_level2_reorder β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Reordered variant) π
void mepack_double_trsylv2_level2_reorder (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 *SCALE, double *WORK, int
*INFO)
mepack_double_trsylv2_level2_unopt β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant) π
void mepack_double_trsylv2_level2_unopt (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 *SCALE, double *WORK, int *INFO)
mepack_double_trsylv2_level2_local_copy β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant) π
void mepack_double_trsylv2_level2_local_copy (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 *SCALE, double *WORK, int
*INFO)
mepack_double_trsylv2_level2_local_copy_32 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 32) π₯
void mepack_double_trsylv2_level2_local_copy_32 (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 *SCALE, double *WORK,
int *INFO)
mepack_double_trsylv2_level2_local_copy_64 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 64) π
void mepack_double_trsylv2_level2_local_copy_64 (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 *SCALE, double *WORK,
int *INFO)
mepack_double_trsylv2_level2_local_copy_96 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N<=96) π
void mepack_double_trsylv2_level2_local_copy_96 (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 *SCALE, double *WORK,
int *INFO)
mepack_double_trsylv2_level2_local_copy_128 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 128) β
void mepack_double_trsylv2_level2_local_copy_128 (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 *SCALE, double *WORK,
int *INFO)
single precision trsylv2 crew, this is your moment π
mepack_single_trsylv2_level2 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. πΈ
void mepack_single_trsylv2_level2 (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 *SCALE, float *WORK, int *INFO)
mepack_single_trsylv2_level2_reorder β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Reordered variant) π
void mepack_single_trsylv2_level2_reorder (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 *SCALE, float *WORK, int *INFO)
mepack_single_trsylv2_level2_unopt β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant) π
void mepack_single_trsylv2_level2_unopt (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 *SCALE, float *WORK, int *INFO)
mepack_single_trsylv2_level2_local_copy β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant) π
void mepack_single_trsylv2_level2_local_copy (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 *SCALE, float *WORK, int *INFO)
mepack_single_trsylv2_level2_local_copy_32 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 32 ) π₯
void mepack_single_trsylv2_level2_local_copy_32 (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 *SCALE, float *WORK, int
*INFO)
mepack_single_trsylv2_level2_local_copy_64 β Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 64) π
void mepack_single_trsylv2_level2_local_copy_64 (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 *SCALE, float *WORK, int *INFO)
okay so this right here is the tail end of a signature that started in the last chunk bestie, don't panic, nothing's missing π It's the <pink>Level-2 Bartels-Stewart Algorithm</pink> for the generalized Sylvester equation, and it's the <yellow>(Local copy variant, M,N <= 64)</yellow> flavor. Local copy, 64 and under, iconic behavior.
void mepack_single_trsylv2_level2_local_copy_96 (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 *SCALE, float *WORK, int *INFO)
<cyan>Level-2 Bartels-Stewart Algorithm</cyan> for the generalized Sylvester equation. <yellow>(Local copy variant, M,N <= 96)</yellow> β¨ same vibe, bigger ceiling.
void mepack_single_trsylv2_level2_local_copy_128 (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 *SCALE, float *WORK, int *INFO)
<cyan>Level-2 Bartels-Stewart Algorithm</cyan> for the generalized Sylvester equation. <yellow>(Local copy variant, M,N <= 128)</yellow> π the local copy trio is complete, we love a set.
void mepack_double_trsylv_level3 (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 *SCALE, double *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> for the generalized Sylvester equation. level THREE? we're ascending, periodt π₯
void mepack_double_trsylv_level3_unopt (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 *SCALE, double *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> for the generalized Sylvester equation. <purple>(Unoptimized variant)</purple> β it's giving "the reference version, no makeup, still slays."
void mepack_double_trsylv_level3_2stage (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 *SCALE, double *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> <mint>with sub-blocking</mint> for the generalized Sylvester equation. sub-blocking?? she's doing the most and honestly? correct.
void mepack_single_trsylv_level3 (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 *SCALE, float *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> for the generalized Sylvester equation. single precision, same energy π
void mepack_single_trsylv_level3_unopt (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 *SCALE, float *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> for the generalized Sylvester equation. <purple>(Unoptimized variant)</purple> raw, unfiltered, still valid.
void mepack_single_trsylv_level3_2stage (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 *SCALE, float *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> <mint>with blocking</mint> for the generalized Sylvester equation. note: the double version said "sub-blocking," this one says "blocking" β we are NOT paraphrasing, we are reporting exactly what the manpage said, bestie π«Ά
void mepack_double_trsylv2_level3 (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 *SCALE, double *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> for the generalized Sylvester equation β and yes, that's the `trsylv2` family this time, not `trsylv`. one digit, whole different girlie.
void mepack_double_trsylv2_level3_unopt (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 *SCALE, double *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> for the generalized Sylvester equation. <purple>(Unoptimized variant)</purple>
void mepack_double_trsylv2_level3_2stage (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 *SCALE, double *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> <mint>with blocking</mint> for the generalized Sylvester equation.
void mepack_single_trsylv2_level3 (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 *SCALE, float *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> for the generalized Sylvester equation.
void mepack_single_trsylv2_level3_unopt (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 *SCALE, float *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> for the generalized Sylvester equation. <purple>(Unoptimized variant)</purple>
void mepack_single_trsylv2_level3_2stage (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 *SCALE, float *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> <mint>with sub-blocking</mint> for the generalized Sylvester equation.
void mepack_double_trsylv_recursive (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 *SCALE, double *WORK, int *INFO)
<rainbow>Recursive blocking Level-3 Bartels-Stewart Algorithm</rainbow> for the generalized Sylvester equation. RECURSIVE. she calls herself. main character energy fr fr π
void mepack_single_trsylv_recursive (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 *SCALE, float *WORK, int *INFO)
<rainbow>Recursive blocking Level-3 Bartels-Stewart Algorithm</rainbow> for the generalized Sylvester equation.
void mepack_double_trsylv2_recursive (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 *SCALE, double *WORK, int *INFO)
<rainbow>Recursive blocking Level-3 Bartels-Stewart Algorithm</rainbow> for the generalized Sylvester equation. (the `2` is back, we stan a consistent naming scheme)
void mepack_single_trsylv2_recursive (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 *SCALE, float *WORK, int *INFO)
<rainbow>Recursive blocking Level-3 Bartels-Stewart Algorithm</rainbow> for the generalized Sylvester equation. and that's the last one of the list, we made it π
---
# πΈ Detailed Description πΈ
okay so what IS all this. gather round.
<pink>C-Interface for triangular standard Sylvester equations.</pink>
The Fortran routines that solve the standard Sylvester equation with triangular coefficients got wrapped in C so you don't have to suffer, bestie. Easier access, that's the whole point π
> Heads up, this matters: <red>All wrapper routines are direct wrappers to the corresponding Fortran subroutines without sanity checks.</red> The sanity checks are performed by the Fortran routines instead. So the wrappers are not here to hold your hand.
Also, since these routines use `int` values to pass sizes, <red>the `work_space` query will fail for large scale problems</red>. For this reason you should use the function `mepack_memory` to query the required `work_space` from a C code. That function is aware of 64 bit integers if MEPACK is compiled with it. noted, saved, screenshotted πΈ
---
# π Function Documentation π
## `mepack_double_trsylv2_dag`
void mepack_double_trsylv2_dag (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 *SCALE, double *WORK, int *INFO)
<hotpink>Level-3 Bartels-Stewart Algorithm</hotpink> for the generalized Sylvester equation <rainbow>with DAG parallelization</rainbow>. she's parallel, she's a DAG, she's booked and busy π₯
### Purpose
`mepack_double_trsylv2_dag` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK. (yes it says "form", we're quoting, don't come for me π)
### Remarks
This function is a wrapper around `dla_trsylv2_dag`.
### See also
`dla_trsylv2_dag`
### Parameters
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N': op1(A) = A`
- `== 'T': op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N': op2(B) = B,`
- `== 'T': op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1 : Solve Equation (1)`
- `== -1: Solve Equation (2)`
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array `X`. `LDB >= max(1,M)`.
> β οΈ bestie look at that again β the manpage literally says `LDB >= max(1,M)` in the `LDX` description. That is what it says. I am not fixing it, I am reporting it. iykyk π
- **`SCALE`** β `SCALE` is DOUBLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is DOUBLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
- On input:
- `== -1 : Perform a workspace query`
- `<> -1 : normal operation`
- On exit, workspace query:
- `< 0 : if INFO == -i, the i-Th argument had an illegal value`
- `>= 0: The value of INFO is the required number of elements in the workspace.`
- On exit, normal operation:
- `== 0: successful exit`
- `< 0: if INFO == -i, the i-Th argument had an illegal value`
- `> 0: The equation is not solved correctly. One of the arising inner system got singular.`
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
### Definition at line 166 of file `trsylv2.c`.
## π `mepack_double_trsylv2_level2` π
void mepack_double_trsylv2_level2 (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 * SCALE, double * WORK, int * INFO)
<purple>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation.</purple> bestie we are SO back in linear algebra land β¨
**Purpose:**
`mepack_double_trsylv2_level2` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via `DGEES` form LAPACK. π
**Remarks**
- This function is a wrapper around `dla_trsylv2_l2`.
**See also**
- `dla_trsylv2_l2`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation.
- `= 1`: Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`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 matrix B must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is DOUBLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is DOUBLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
- On input:
- `== -1`: Perform a workspace query
- `<> -1`: normal operation
- On exit, workspace query:
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 165 of file `trsylv2.c`.
---
## π¦ `mepack_double_trsylv2_level2_local_copy` π¦
void mepack_double_trsylv2_level2_local_copy (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 * SCALE, double * WORK, int * INFO)
<purple>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant)</purple> β yes she has a variant, and honestly? iconic of her. π
**Purpose:**
`mepack_double_trsylv2_level2_local_copy` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via `DGEES` form LAPACK. πΈ
**Remarks**
- This function is a wrapper around `dla_trsylv2_l2_local_copy`.
**See also**
- `dla_trsylv2_l2_local_copy`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation.
- `= 1`: Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`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 matrix B must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is DOUBLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is DOUBLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
- On input:
- `== -1`: Perform a workspace query
- `<> -1`: normal operation
- On exit, workspace query:
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 637 of file `trsylv2.c`.
---
## π `mepack_double_trsylv2_level2_local_copy_128` π
void mepack_double_trsylv2_level2_local_copy_128 (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 * SCALE, double * WORK, int * INFO)
<purple>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 128)</purple> β she comes with a size limit and she's not sorry about it. 128 is her whole personality. β¨
**Purpose:**
`mepack_double_trsylv2_level2_local_copy_128` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via `DGEES` form LAPACK. π
**Remarks**
- This function is a wrapper around `dla_trsylv2_l2_local_copy_128`.
**See also**
- `dla_trsylv2_l2_local_copy_128`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: +/-1. Specifies the sign between the two parts of the Sylvester equation.
- `= 1`: Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`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 matrix B must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array X. `LDB >= max(1,M)`.
- <purple>**`LDX`**</purple> β `LDX` is <cyan>INTEGER</cyan>. It's the leading dimension of the array `X`. The page says `LDB >= max(1,M)` here and bestie I am <hotpink>not</hotpink> gonna "fix" that for you, I'm just telling you exactly what it says. π
- <purple>**`SCALE`**</purple> β `SCALE` is <cyan>DOUBLE PRECISION</cyan>. It's the lil scaling factor that keeps your result from <red>overflowing</red> into the void π. If `INFO == 0` then `SCALE` is `1.0D0`. Otherwise, if one of the inner systems couldn't be solved correctly, then `0 < SCALE <= 1` holds true.
- <purple>**`WORK`**</purple> β `WORK` is a <cyan>DOUBLE PRECISION</cyan> array, dimension `LDWORK`. It's the workspace for the algorithm β¨. And no cap: <yellow>the workspace needs to be queried before running the computation</yellow>. You do the query by calling the subroutine with `INFO == -1` on input, and then the required workspace gets handed back to you in `INFO`. π
- <purple>**`INFO`**</purple> β `INFO` is <cyan>INTEGER</cyan>. She's the main character of the status reporting, fr fr.
On input:
== -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query:
< 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit < 0: if INFO == -i, the i-Th argument had an illegal value
0: The equation is not solved correctly. One of the arising inner
system got singular.
### <rainbow>Author</rainbow> π
<peach>Martin Koehler, MPI Magdeburg</peach>
### <rainbow>Date</rainbow> ποΈ
<peach>October 2025</peach>
### <rainbow>Definition</rainbow> π
Definition at line <yellow>1269</yellow> of file `trsylv2.c`.
---
### <hotpink>`void mepack_double_trsylv2_level2_local_copy_32 (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 * SCALE, double * WORK, int * INFO)`</hotpink>
void mepack_double_trsylv2_level2_local_copy_32 (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 * SCALE, double * WORK, int * INFO)
<rainbow>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 32)</rainbow> π¦
### <purple>Purpose:</purple>
`mepack_double_trsylv2_level2_local_copy_32` solves a Sylvester equation of the following forms π
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK. β¨
### <purple>Remarks</purple>
This function is a wrapper around `dla_trsylv2_l2_local_copy_32`. π«Ά
### <purple>See also</purple>
`dla_trsylv2_l2_local_copy_32`
### <purple>Parameters</purple>
- <purple>**`TRANSA`**</purple> β `TRANSA` is <cyan>string</cyan>. Specifies the form of the system of equations with respect to `A`:
== 'N': op1(A) = A == 'T': op1(A) = A**T
- <purple>**`TRANSB`**</purple> β `TRANSB` is <cyan>string</cyan>. Specifies the form of the system of equations with respect to `B`:
== 'N': op2(B) = B, == 'T': op2(B) = B**T
- <purple>**`SGN`**</purple> β `SGN` is <cyan>DOUBLE PRECISION</cyan>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
= 1 : Solve Equation (1) == -1: Solve Equation (2)
- <purple>**`M`**</purple> β `M` is <cyan>INTEGER</cyan>. The order of the matrices `A` and `C`. `M >= 0`.
- <purple>**`N`**</purple> β `N` is <cyan>INTEGER</cyan>. The order of the matrices `B` and `D`. `N >= 0`.
- <purple>**`A`**</purple> β `A` is a <cyan>DOUBLE PRECISION</cyan> array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular. π
- <purple>**`LDA`**</purple> β `LDA` is <cyan>INTEGER</cyan>. The leading dimension of the array `A`. `LDA >= max(1,M)`.
- <purple>**`B`**</purple> β `B` is a <cyan>DOUBLE PRECISION</cyan> array, dimension `(LDB,N)`. The matrix `B` must be (quasi-) upper triangular. π
- <purple>**`LDB`**</purple> β `LDB` is <cyan>INTEGER</cyan>. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- <purple>**`X`**</purple> β `X` is a <cyan>DOUBLE PRECISION</cyan> array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices. π
- <purple>**`LDX`**</purple> β `LDX` is <cyan>INTEGER</cyan>. The leading dimension of the array `X`. The page says `LDB >= max(1,M)` and, again, that is <hotpink>literally what it says</hotpink>, so here it stays. π
- <purple>**`SCALE`**</purple> β `SCALE` is <cyan>DOUBLE PRECISION</cyan>. It's the scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- <purple>**`WORK`**</purple> β `WORK` is a <cyan>DOUBLE PRECISION</cyan> array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to be queried before running the computation β the query is performed by calling the subroutine with `INFO == -1` on input, and the required workspace is then returned in `INFO`. π
- <purple>**`INFO`**</purple> β `INFO` is <cyan>INTEGER</cyan>.
On input:
== -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query:
< 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit < 0: if INFO == -i, the i-Th argument had an illegal value
0: The equation is not solved correctly. One of the arising inner
system got singular.
### <rainbow>Author</rainbow> π
<peach>Martin Koehler, MPI Magdeburg</peach>
### <rainbow>Date</rainbow> ποΈ
<peach>October 2025</peach>
### <rainbow>Definition</rainbow> π
Definition at line <yellow>795</yellow> of file `trsylv2.c`.
---
### <hotpink>`void mepack_double_trsylv2_level2_local_copy_64 (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 * SCALE, double * WORK, int * INFO)`</hotpink>
void mepack_double_trsylv2_level2_local_copy_64 (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 * SCALE, double * WORK, int * INFO)
<rainbow>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 64)</rainbow> π¦
### <purple>Purpose:</purple>
`mepack_double_trsylv2_level2_local_copy_64` solves a Sylvester equation of the following forms π
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK. β¨
### <purple>Remarks</purple>
This function is a wrapper around `dla_trsylv2_l2_local_copy_64`. π«Ά
### <purple>See also</purple>
`dla_trsylv2_l2_local_copy_64`
### <purple>Parameters</purple>
- <purple>**`TRANSA`**</purple> β `TRANSA` is <cyan>string</cyan>. Specifies the form of the system of equations with respect to `A`:
== 'N': op1(A) = A == 'T': op1(A) = A**T
- <purple>**`TRANSB`**</purple> β `TRANSB` is <cyan>string</cyan>. Specifies the form of the system of equations with respect to `B`:
== 'N': op2(B) = B, == 'T': op2(B) = B**T
- <purple>**`SGN`**</purple> β `SGN` is <cyan>DOUBLE PRECISION</cyan>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
= 1 : Solve Equation (1) == -1: Solve Equation (2)
- <purple>**`M`**</purple> β `M` is <cyan>INTEGER</cyan>. The order of the matrices `A` and `C`. `M >= 0`.
- <purple>**`N`**</purple> β `N` is <cyan>INTEGER</cyan>. The order of the matrices `B` and `D`. `N >= 0`.
- <purple>**`A`**</purple> β `A` is a <cyan>DOUBLE PRECISION</cyan> array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular. π
- <purple>**`LDA`**</purple> β `LDA` is <cyan>INTEGER</cyan>. The leading dimension of the array `A`. `LDA >= max(1,M)`.
- <purple>**`B`**</purple> β `B` is a <cyan>DOUBLE PRECISION</cyan> array, dimension `(LDB,N)`. The matrix `B` must be (quasi-) upper triangular. π
- <purple>**`LDB`**</purple> β `LDB` is <cyan>INTEGER</cyan>. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- <purple>**`X`**</purple> β `X` is a <cyan>DOUBLE PRECISION</cyan> array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices. π
- <purple>**`LDX`**</purple> β `LDX` is <cyan>INTEGER</cyan>. The leading dimension of the array `X`. And yes, the page says `LDB >= max(1,M)` here too β I'm just the messenger, bestie. π
- <purple>**`SCALE`**</purple> β `SCALE` is <cyan>DOUBLE PRECISION</cyan>. It's the scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- <purple>**`WORK`**</purple> β `WORK` is a <cyan>DOUBLE PRECISION</cyan> array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to be queried before running the computation β the query is performed by calling the subroutine with `INFO == -1` on input, and the required workspace is then returned in `INFO`. π
- <purple>**`INFO`**</purple> β `INFO` is <cyan>INTEGER</cyan>.
On input:
== -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query:
< 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit < 0: if INFO == -i, the i-Th argument had an illegal value
0: The equation is not solved correctly. One of the arising inner
system got singular.
### <rainbow>Author</rainbow> π
<peach>Martin Koehler, MPI Magdeburg</peach>
### <rainbow>Date</rainbow> ποΈ
<peach>October 2025</peach>
### <rainbow>Definition</rainbow> π
Definition at line <yellow>953</yellow> of file `trsylv2.c`.
---
### <hotpink>`void mepack_double_trsylv2_level2_local_copy_96 (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 * SCALE, double * WORK, int * INFO)`</hotpink>
void mepack_double_trsylv2_level2_local_copy_96 (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 * SCALE, double * WORK, int * INFO)
<rainbow>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N<=96)</rainbow> π¦
### <purple>Purpose:</purple>
`mepack_double_trsylv2_level2_local_copy_96` solves a Sylvester equation of the following forms π
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
so like, <pink>`A`</pink> is a <purple>`M`</purple>-by-<purple>`M`</purple> quasi upper triangular matrix, and <pink>`B`</pink> is a <purple>`N`</purple>-by-<purple>`N`</purple> quasi upper triangular matrix. The right hand side <pink>`Y`</pink> and the solution <pink>`X`</pink> are <purple>`M`</purple>-by-<purple>`N`</purple> matrices. Typically the matrices <pink>`A`</pink> and <pink>`B`</pink> are generated via `DGEES` form LAPACK. π
## Remarks π
lowkey this function is just a wrapper around `dla_trsylv2_l2_local_copy_96`. no cap. π«Ά
## See also π
`dla_trsylv2_l2_local_copy_96` β go check it out if you want the real tea. β¨
## Parameters π
### `TRANSA`
`TRANSA` is a string. It specifies the form of the system of equations with respect to A:
- `== 'N': op1(A) = A`
- `== 'T': op1(A) = A**T`
### `TRANSB`
`TRANSB` is a string. It specifies the form of the system of equations with respect to B:
- `== 'N': op2(B) = B,`
- `== 'T': op2(B) = B**T`
### `SGN`
`SGN` is `DOUBLE PRECISION`, allowed values: `+/-1`. It specifies the sign between the two parts of the Sylvester equation.
- `= 1 : Solve Equation (1)`
- `== -1: Solve Equation (2)`
### `M`
`M` is `INTEGER`. The order of the matrices A and C. `M >= 0`.
### `N`
`N` is `INTEGER`. The order of the matrices B and D. `N >= 0`.
### `A`
`A` is `DOUBLE PRECISION` array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
### `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 matrix B must be (quasi-) upper triangular.
### `LDB`
`LDB` is `INTEGER`. The leading dimension of the array B. `LDB >= max(1,N)`.
### `X`
`X` is `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
### `LDX`
`LDX` is `INTEGER`. The leading dimension of the array X. `LDB >= max(1,M)`.
### `SCALE`
`SCALE` is `DOUBLE PRECISION`. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
### `WORK`
`WORK` is `DOUBLE PRECISION` array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
### `INFO`
`INFO` is `INTEGER`.
On input:
- `== -1 : Perform a workspace query`
- `<> -1 : normal operation`
On exit, workspace query:
- `< 0 : if INFO == -i, the i-Th argument had an illegal value`
- `>= 0: The value of INFO is the required number of elements in the workspace.`
On exit, normal operation:
- `== 0: successful exit`
- `< 0: if INFO == -i, the i-Th argument had an illegal value`
- `> 0: The equation is not solved correctly. One of the arising inner system got singular.`
## Author π«Ά
Martin Koehler, MPI Magdeburg
## Date π
October 2025
**Definition at line 1111 of file trsylv2.c.**
---
void mepack_double_trsylv2_level2_reorder (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 * SCALE, double * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Reordered variant) π¦
### Purpose β¨
`mepack_double_trsylv2_level2_reorder` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where <pink>`A`</pink> is a <purple>`M`</purple>-by-<purple>`M`</purple> quasi upper triangular matrix, and <pink>`B`</pink> is a <purple>`N`</purple>-by-<purple>`N`</purple> quasi upper triangular matrix. The right hand side <pink>`Y`</pink> and the solution <pink>`X`</pink> are <purple>`M`</purple>-by-<purple>`N`</purple> matrices. Typically the matrices <pink>`A`</pink> and <pink>`B`</pink> are generated via `DGEES` form LAPACK. π
## Remarks π
lowkey this function is just a wrapper around `dla_trsylv2_l2_reorder`. no cap. π«Ά
## See also π
`dla_trsylv2_l2_reorder` β go check it out if you want the real tea. β¨
## Parameters π
### `TRANSA`
`TRANSA` is a string. It specifies the form of the system of equations with respect to A:
- `== 'N': op1(A) = A`
- `== 'T': op1(A) = A**T`
### `TRANSB`
`TRANSB` is a string. It specifies the form of the system of equations with respect to B:
- `== 'N': op2(B) = B,`
- `== 'T': op2(B) = B**T`
### `SGN`
`SGN` is `DOUBLE PRECISION`, allowed values: `+/-1`. It specifies the sign between the two parts of the Sylvester equation.
- `= 1 : Solve Equation (1)`
- `== -1: Solve Equation (2)`
### `M`
`M` is `INTEGER`. The order of the matrices A and C. `M >= 0`.
### `N`
`N` is `INTEGER`. The order of the matrices B and D. `N >= 0`.
### `A`
`A` is `DOUBLE PRECISION` array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
### `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 matrix B must be (quasi-) upper triangular.
### `LDB`
`LDB` is `INTEGER`. The leading dimension of the array B. `LDB >= max(1,N)`.
### `X`
`X` is `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
### `LDX`
`LDX` is `INTEGER`. The leading dimension of the array X. `LDB >= max(1,M)`.
### `SCALE`
`SCALE` is `DOUBLE PRECISION`. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
### `WORK`
`WORK` is `DOUBLE PRECISION` array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
### `INFO`
`INFO` is `INTEGER`.
On input:
- `== -1 : Perform a workspace query`
- `<> -1 : normal operation`
On exit, workspace query:
- `< 0 : if INFO == -i, the i-Th argument had an illegal value`
- `>= 0: The value of INFO is the required number of elements in the workspace.`
On exit, normal operation:
- `== 0: successful exit`
- `< 0: if INFO == -i, the i-Th argument had an illegal value`
- `> 0: The equation is not solved correctly. One of the arising inner system got singular.`
## Author π«Ά
Martin Koehler, MPI Magdeburg
## Date π
October 2025
**Definition at line 323 of file trsylv2.c.**
---
void mepack_double_trsylv2_level2_unopt (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 * SCALE, double * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant) π§
### Purpose β¨
`mepack_double_trsylv2_level2_unopt` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where <pink>`A`</pink> is a <purple>`M`</purple>-by-<purple>`M`</purple> quasi upper triangular matrix, and <pink>`B`</pink> is a <purple>`N`</purple>-by-<purple>`N`</purple> quasi upper triangular matrix. The right hand side <pink>`Y`</pink> and the solution <pink>`X`</pink> are <purple>`M`</purple>-by-<purple>`N`</purple> matrices. Typically the matrices <pink>`A`</pink> and <pink>`B`</pink> are generated via `DGEES` form LAPACK. π
## Remarks π
lowkey this function is just a wrapper around `dla_trsylv2_l2_unopt`. no cap. π«Ά
## See also π
`dla_trsylv2_l2_unopt` β go check it out if you want the real tea. β¨
## Parameters π
### `TRANSA`
`TRANSA` is a string. It specifies the form of the system of equations with respect to A:
- `== 'N': op1(A) = A`
- `== 'T': op1(A) = A**T`
### `TRANSB`
`TRANSB` is a string. It specifies the form of the system of equations with respect to B:
- `== 'N': op2(B) = B,`
- `== 'T': op2(B) = B**T`
### `SGN`
`SGN` is `DOUBLE PRECISION`, allowed values: `+/-1`. It specifies the sign between the two parts of the Sylvester equation.
- `= 1 : Solve Equation (1)`
- `== -1: Solve Equation (2)`
### `M`
`M` is `INTEGER`. The order of the matrices A and C. `M >= 0`.
### `N`
`N` is `INTEGER`. The order of the matrices B and D. `N >= 0`.
### `A`
`A` is `DOUBLE PRECISION` array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
### `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 matrix B must be (quasi-) upper triangular.
### `LDB`
`LDB` is `INTEGER`. The leading dimension of the array B. `LDB >= max(1,N)`.
### `X`
`X` is `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
### `LDX`
`LDX` is `INTEGER`. The leading dimension of the array X. `LDB >= max(1,M)`.
### `SCALE`
**<pink>SCALE</pink>** is `DOUBLE PRECISION`, bestie β it's a scaling factor whose whole job is to prevent overflow in the result. Protective queen behavior, we love to see it π
. If `INFO == 0` then `SCALE` is `1.0D0`, otherwise if one of the inner systems couldn't be solved correctly, then `0 < SCALE <= 1` holds true. That's it, that's the vibe.
**<pink>WORK</pink>** is a `DOUBLE PRECISION` array, dimension `LDWORK`. It's the workspace for the algorithm, and ngl you have to query it *before* you run the computation π. You do the query by calling the subroutine with `INFO == -1` on input, and the required workspace comes right back to you in `INFO`. So convenient of her honestly.
**<pink>INFO</pink>** is `INTEGER`.
On input:
- `== -1` β perform a workspace query
- `<> -1` β normal operation
On exit, workspace query:
- `< 0` β if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0` β the value of `INFO` is the required number of elements in the workspace
On exit, normal operation:
- `== 0` β successful exit π
- `< 0` β if `INFO == -i`, the i-Th argument had an illegal value
- `> 0` β the equation is not solved correctly. One of the arising inner system got singular π
### <cyan>Author</cyan>
Martin Koehler, MPI Magdeburg
### <cyan>Date</cyan>
October 2025
Definition at line 480 of file `trsylv2.c`.
---
## <rainbow>mepack_double_trsylv2_level3</rainbow>
void mepack_double_trsylv2_level3 (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 * SCALE, double * WORK, int * INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. She's giving optimized, she's giving level-3, she's giving main character energy β¨
### <purple>Purpose</purple>
`mepack_double_trsylv2_level3` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via DGEES form LAPACK. π¦
### <purple>Remarks</purple>
This function is a wrapper around `dla_trsylv2_l3`. So she's cute, she's a friendly lil front for the real one, periodt.
### <purple>See also</purple>
`dla_trsylv2_l3`
### <purple>Parameters</purple>
**<pink>TRANSA</pink>** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'` β `op1(A) = A`
- `== 'T'` β `op1(A) = A**T`
**<pink>TRANSB</pink>** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'` β `op2(B) = B,`
- `== 'T'` β `op2(B) = B**T`
**<pink>SGN</pink>** β `SGN` is `DOUBLE PRECISION`, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` β Solve Equation (1)
- `== -1` β Solve Equation (2)
**<pink>M</pink>** β `M` is `INTEGER`. The order of the matrices A and C. `M >= 0`.
**<pink>N</pink>** β `N` is `INTEGER`. The order of the matrices B and D. `N >= 0`.
**<pink>A</pink>** β `A` is `DOUBLE PRECISION` array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular. No exceptions bestie.
**<pink>LDA</pink>** β `LDA` is `INTEGER`. The leading dimension of the array A. `LDA >= max(1,M)`.
**<pink>B</pink>** β `B` is `DOUBLE PRECISION` array, dimension `(LDB,N)`. The matrix B must be (quasi-) upper triangular.
**<pink>LDB</pink>** β `LDB` is `INTEGER`. The leading dimension of the array B. `LDB >= max(1,N)`.
**<pink>X</pink>** β `X` is `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices. She goes in as Y and comes out as the solution β glow up fr fr π
**<pink>LDX</pink>** β `LDX` is `INTEGER`. The leading dimension of the array X. `LDB >= max(1,M)`.
**<pink>SCALE</pink>** β `SCALE` is `DOUBLE PRECISION`. Scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
**<pink>WORK</pink>** β `WORK` is `DOUBLE PRECISION` array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
**<pink>INFO</pink>** β `INFO` is `INTEGER`.
On input:
- `== -1` β Perform a workspace query
- `<> -1` β normal operation
On exit, workspace query:
- `< 0` β if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0` β The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0` β successful exit
- `< 0` β if `INFO == -i`, the i-Th argument had an illegal value
- `> 0` β The equation is not solved correctly. One of the arising inner system got singular.
### <cyan>Author</cyan>
Martin Koehler, MPI Magdeburg
### <cyan>Date</cyan>
October 2025
Definition at line 168 of file `trsylv2.c`.
---
## <rainbow>mepack_double_trsylv2_level3_2stage</rainbow>
void mepack_double_trsylv2_level3_2stage (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 * SCALE, double * WORK, int * INFO)
Level-3 Bartels-Stewart Algorithm **with blocking** for the generalized Sylvester equation. Blocking?? She said let me handle this in chunks and stay efficient π
π₯
### <purple>Purpose</purple>
`mepack_double_trsylv2_level3_2stage` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via DGEES form LAPACK. π
### <purple>Remarks</purple>
This function is a wrapper around `dla_trsylv2_l3_2s`.
### <purple>See also</purple>
`dla_trsylv2_l3_2s`
### <purple>Parameters</purple>
**<pink>TRANSA</pink>** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'` β `op1(A) = A`
- `== 'T'` β `op1(A) = A**T`
**<pink>TRANSB</pink>** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'` β `op2(B) = B,`
- `== 'T'` β `op2(B) = B**T`
**<pink>SGN</pink>** β `SGN` is `DOUBLE PRECISION`, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` β Solve Equation (1)
- `== -1` β Solve Equation (2)
**<pink>M</pink>** β `M` is `INTEGER`. The order of the matrices A and C. `M >= 0`.
**<pink>N</pink>** β `N` is `INTEGER`. The order of the matrices B and D. `N >= 0`.
**<pink>A</pink>** β `A` is `DOUBLE PRECISION` array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
**<pink>LDA</pink>** β `LDA` is `INTEGER`. The leading dimension of the array A. `LDA >= max(1,M)`.
**<pink>B</pink>** β `B` is `DOUBLE PRECISION` array, dimension `(LDB,N)`. The matrix B must be (quasi-) upper triangular.
**<pink>LDB</pink>** β `LDB` is `INTEGER`. The leading dimension of the array B. `LDB >= max(1,N)`.
**<pink>X</pink>** β `X` is `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices. β¨
**<pink>LDX</pink>** β `LDX` is `INTEGER`. The leading dimension of the array X. `LDB >= max(1,M)`.
**<pink>SCALE</pink>** β `SCALE` is `DOUBLE PRECISION`. Scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
**<pink>WORK</pink>** β `WORK` is `DOUBLE PRECISION` array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
**<pink>INFO</pink>** β `INFO` is `INTEGER`.
On input:
- `== -1` β Perform a workspace query
- `<> -1` β normal operation
On exit, workspace query:
- `< 0` β if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0` β The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0` β successful exit
- `< 0` β if `INFO == -i`, the i-Th argument had an illegal value
- `> 0` β The equation is not solved correctly. One of the arising inner system got singular.
### <cyan>Author</cyan>
Martin Koehler, MPI Magdeburg
### <cyan>Date</cyan>
October 2025
Definition at line 483 of file `trsylv2.c`.
---
## <rainbow>mepack_double_trsylv2_level3_unopt</rainbow>
void mepack_double_trsylv2_level3_unopt (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 * SCALE, double * WORK, int * INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. **(Unoptimized variant)** β she's the no-frills, no-makeup, still-gorgeous version, and honestly? Respect π«Ά
### <purple>Purpose</purple>
`mepack_double_trsylv2_level3_unopt` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via DGEES form LAPACK. π§
### <purple>Remarks</purple>
This function is a wrapper around `dla_trsylv2_l3_unopt`.
### <purple>See also</purple>
`dla_trsylv2_l3_unopt`
### <purple>Parameters</purple>
**<pink>TRANSA</pink>** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'` β `op1(A) = A`
- `== 'T'` β `op1(A) = A**T`
- **`TRANSB`** β <cyan>`TRANSB` is string</cyan>. Bestie, this one says which form the system of equations takes, but for B this time:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β <cyan>`SGN` is DOUBLE PRECISION</cyan>, allowed values: `+/-1`. It picks the sign sitting between the two halves of the Sylvester equation:
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β <cyan>`M` is INTEGER</cyan>. The order of the matrices A and C. `M >= 0`. π«Ά
- **`N`** β <cyan>`N` is INTEGER</cyan>. The order of the matrices B and D. `N >= 0`.
- **`A`** β <cyan>`A` is DOUBLE PRECISION array, dimension `(LDA,M)`</cyan>. The matrix A must be (quasi-) upper triangular. no cap.
- **`LDA`** β <cyan>`LDA` is INTEGER</cyan>. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`** β <cyan>`B` is DOUBLE PRECISION array, dimension `(LDB,N)`</cyan>. The matrix B must be (quasi-) upper triangular.
- **`LDB`** β <cyan>`LDB` is INTEGER</cyan>. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β <cyan>`X` is DOUBLE PRECISION array, dimension `(LDX,N)`</cyan>. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices. β¨
- **`LDX`** β <cyan>`LDX` is INTEGER</cyan>. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β <cyan>`SCALE` is DOUBLE PRECISION</cyan>. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then SCALE is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true. π
- **`WORK`** β <cyan>`WORK` is DOUBLE PRECISION array, dimension `LDWORK`</cyan>. Workspace for the algorithm. <yellow>You gotta query the workspace *before* running the computation</yellow> β that query happens by calling the subroutine with `INFO == -1` on input, and the required workspace comes back in `INFO`.
- **`INFO`** β <cyan>`INFO` is INTEGER</cyan>.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
### Author
<lavender>Martin Koehler, MPI Magdeburg</lavender>
### Date
<lavender>October 2025</lavender>
Definition at line 326 of file `trsylv2.c`.
---
## `mepack_double_trsylv2_recursive`
void mepack_double_trsylv2_recursive (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 * SCALE, double * WORK, int * INFO)
<rainbow>Recursive blocking Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation.</rainbow> π
**Purpose:**
`mepack_double_trsylv2_recursive` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via DGEES form LAPACK. π
**Remarks**
This function is a wrapper around `dla_trsylv2_recursive`. iykyk.
**See also**
`dla_trsylv2_recursive`
### Parameters
- **`TRANSA`** β <cyan>`TRANSA` is string</cyan>. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β <cyan>`TRANSB` is string</cyan>. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β <cyan>`SGN` is DOUBLE PRECISION</cyan>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β <cyan>`M` is INTEGER</cyan>. The order of the matrices A and C. `M >= 0`.
- **`N`** β <cyan>`N` is INTEGER</cyan>. The order of the matrices B and D. `N >= 0`.
- **`A`** β <cyan>`A` is DOUBLE PRECISION array, dimension `(LDA,M)`</cyan>. The matrix A must be (quasi-) upper triangular.
- **`LDA`** β <cyan>`LDA` is INTEGER</cyan>. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`** β <cyan>`B` is DOUBLE PRECISION array, dimension `(LDB,N)`</cyan>. The matrix B must be (quasi-) upper triangular.
- **`LDB`** β <cyan>`LDB` is INTEGER</cyan>. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β <cyan>`X` is DOUBLE PRECISION array, dimension `(LDX,N)`</cyan>. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β <cyan>`LDX` is INTEGER</cyan>. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β <cyan>`SCALE` is DOUBLE PRECISION</cyan>. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then SCALE is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β <cyan>`WORK` is DOUBLE PRECISION array, dimension `LDWORK`</cyan>. Workspace for the algorithm. <yellow>The workspace needs to be queried before running the computation</yellow> β you do that by calling the subroutine with `INFO == -1` on input, and the required workspace gets returned in `INFO`.
- **`INFO`** β <cyan>`INFO` is INTEGER</cyan>.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
### Author
<lavender>Martin Koehler, MPI Magdeburg</lavender>
### Date
<lavender>October 2025</lavender>
Definition at line 168 of file `trsylv2.c`.
---
## `mepack_double_trsylv_dag`
void mepack_double_trsylv_dag (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 * SCALE, double * WORK, int * INFO)
<rainbow>Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG parallelization.</rainbow> π₯ DAG girlies rise up.
**Purpose:**
`mepack_double_trsylv_dag` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via DGEES form LAPACK. π
**Remarks**
This function is a wrapper around `dla_trsylv_dag`.
**See also**
`dla_trsylv_dag`
### Parameters
- **`TRANSA`** β <cyan>`TRANSA` is string</cyan>. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β <cyan>`TRANSB` is string</cyan>. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β <cyan>`SGN` is DOUBLE PRECISION</cyan>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β <cyan>`M` is INTEGER</cyan>. The order of the matrices A and C. `M >= 0`.
- **`N`** β <cyan>`N` is INTEGER</cyan>. The order of the matrices B and D. `N >= 0`.
- **`A`** β <cyan>`A` is DOUBLE PRECISION array, dimension `(LDA,M)`</cyan>. The matrix A must be (quasi-) upper triangular.
- **`LDA`** β <cyan>`LDA` is INTEGER</cyan>. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`** β <cyan>`B` is DOUBLE PRECISION array, dimension `(LDB,N)`</cyan>. The matrix B must be (quasi-) upper triangular.
- **`LDB`** β <cyan>`LDB` is INTEGER</cyan>. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β <cyan>`X` is DOUBLE PRECISION array, dimension `(LDX,N)`</cyan>. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β <cyan>`LDX` is INTEGER</cyan>. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β <cyan>`SCALE` is DOUBLE PRECISION</cyan>. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then SCALE is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β <cyan>`WORK` is DOUBLE PRECISION array, dimension `LDWORK`</cyan>. Workspace for the algorithm. <yellow>The workspace needs to be queried before running the computation</yellow> β the query is performed by calling the subroutine with `INFO == -1` on input, and the required workspace is then returned in `INFO`.
- **`INFO`** β <cyan>`INFO` is INTEGER</cyan>.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
**On exit, workspace query:**
- `< 0` β if `INFO == -i`, the i-Th argument had an illegal value π¬
- `>= 0` β the value of `INFO` is the required number of elements in the workspace β¨
**On exit, normal operation:**
- `== 0` β successful exit π
- `< 0` β if `INFO == -i`, the i-Th argument had an illegal value π
- `> 0` β the equation is not solved correctly. One of the arising inner system got singular π
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
### Definition
Definition at line 166 of file `trsylv.c`.
---
## <purple>**`void mepack_double_trsylv_level2 (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 * SCALE, double * WORK, int * INFO)`**</purple>
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. π¦
### Purpose
okay bestie, `mepack_double_trsylv_level2` solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK. no cap π
### Remarks
This function is a wrapper around `dla_trsylv_l2`.
### See also
`dla_trsylv_l2`
### Parameters
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'` : `op1(A) = A`
- `== 'T'` : `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'` : `op2(B) = B`,
- `== 'T'` : `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1` : Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`.
On input, the matrix `X` contains the right hand side `Y`.
On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`.
Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array `X`. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is DOUBLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is DOUBLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0` : The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0` : successful exit
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `> 0` : The equation is not solved correctly. One of the arising inner system got singular.
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
### Definition
Definition at line 165 of file `trsylv.c`.
---
## <purple>**`void mepack_double_trsylv_level2_local_copy (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 * SCALE, double * WORK, int * INFO)`**</purple>
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant) π
### Purpose
`mepack_double_trsylv_level2_local_copy` solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK. β¨
### Remarks
This function is a wrapper around `dla_trsylv_l2_local_copy`.
### See also
`dla_trsylv_l2_local_copy`
### Parameters
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'` : `op1(A) = A`
- `== 'T'` : `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'` : `op2(B) = B`,
- `== 'T'` : `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1` : Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`.
On input, the matrix `X` contains the right hand side `Y`.
On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`.
Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array `X`. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is DOUBLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is DOUBLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0` : The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0` : successful exit
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `> 0` : The equation is not solved correctly. One of the arising inner system got singular.
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
### Definition
Definition at line 637 of file `trsylv.c`.
---
## <purple>**`void mepack_double_trsylv_level2_local_copy_128 (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 * SCALE, double * WORK, int * INFO)`**</purple>
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, `M,N <= 128`) πΈ
### Purpose
`mepack_double_trsylv_level2_local_copy_128` solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK. π₯
### Remarks
This function is a wrapper around `dla_trsylv_l2_local_copy_128`.
### See also
`dla_trsylv_l2_local_copy_128`
### Parameters
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'` : `op1(A) = A`
- `== 'T'` : `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'` : `op2(B) = B`,
- `== 'T'` : `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1` : Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β
- **`A`** β a `DOUBLE PRECISION` array, dimension `(LDA,M)`. Lowkey the star of the show: this matrix **must** be (quasi-) upper triangular. No exceptions bestie π«Ά
- **`LDA`** β `INTEGER`. The leading dimension of the array `A`. Gotta be `LDA >= max(1,M)`.
- **`B`** β `DOUBLE PRECISION` array, dimension `(LDB,N)`. Same energy as `A`: it **must** be (quasi-) upper triangular β¨
- **`LDB`** β `INTEGER`. The leading dimension of the array `B`. Needs `LDB >= max(1,N)`.
- **`X`** β `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, `X` is holding the right hand side `Y`. On output, `X` is holding the solution of Equation (1) or (2) β whichever one you picked with `TRANSA`, `TRANSB`, and `SGN`. Both the right hand side `Y` and the solution `X` are M-by-N matrices π
- **`LDX`** β `INTEGER`. The leading dimension of the array `X`. Condition: `LDB >= max(1,M)`. (Yes, it literally says `LDB` there, we're just relaying the lore fr fr.)
- **`SCALE`** β `DOUBLE PRECISION`. It's the scaling factor that keeps your result from overflowing, so basically the bodyguard of your numbers π€. If `INFO == 0` then `SCALE` is `1.0D0`; otherwise, if one of the inner systems couldn't be solved correctly, then `0 < SCALE <= 1` holds true.
- **`WORK`** β `DOUBLE PRECISION` array, dimension `LDWORK`. Workspace for the algorithm. Heads up: you **gotta** query the workspace *before* running the computation. You do that by calling the subroutine with `INFO == -1` on input, and then the required workspace comes back to you in `INFO` π
- **`INFO`** β `INTEGER`. The receipts π
On input:
== -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query:
< 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit < 0: if INFO == -i, the i-Th argument had an illegal value
0: The equation is not solved correctly. One of the arising inner
system got singular.
### <pink>Author</pink> π
Martin Koehler, MPI Magdeburg
### <pink>Date</pink> πΈ
October 2025
Definition at line 1269 of file `trsylv.c`.
---
### `void mepack_double_trsylv_level2_local_copy_32 (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 * SCALE, double * WORK, int * INFO)`
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, `M,N <= 32`) π
**Purpose:**
`mepack_double_trsylv_level2_local_copy_32` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK. No cap, that's the whole vibe π
### <cyan>Remarks</cyan>
This function is a wrapper around `dla_trsylv_l2_local_copy_32`.
### <cyan>See also</cyan>
`dla_trsylv_l2_local_copy_32`
### <purple>Parameters</purple>
- **`TRANSA`** β `TRANSA` is string. It specifies the form of the system of equations with respect to `A`:
== 'N': op1(A) = A == 'T': op1(A) = A**T
- **`TRANSB`** β `TRANSB` is string. It specifies the form of the system of equations with respect to `B`:
== 'N': op2(B) = B, == 'T': op2(B) = B**T
- **`SGN`** β `SGN` is `DOUBLE PRECISION`, allowed values: `+/-1`. It specifies the sign between the two parts of the Sylvester equation.
= 1 : Solve Equation (1) == -1: Solve Equation (2)
- **`M`** β `M` is `INTEGER`. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is `INTEGER`. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is `DOUBLE PRECISION` array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is `INTEGER`. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is `INTEGER`. The leading dimension of the array `X`. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is `DOUBLE PRECISION`. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is `DOUBLE PRECISION` array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is `INTEGER`.
On input:
== -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query:
< 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit < 0: if INFO == -i, the i-Th argument had an illegal value
0: The equation is not solved correctly. One of the arising inner
system got singular.
### <pink>Author</pink> π
Martin Koehler, MPI Magdeburg
### <pink>Date</pink> πΈ
October 2025
Definition at line 795 of file `trsylv.c`.
---
### `void mepack_double_trsylv_level2_local_copy_64 (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 * SCALE, double * WORK, int * INFO)`
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, `M,N <= 64`) π¦
**Purpose:**
`mepack_double_trsylv_level2_local_copy_64` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK. Periodt π
### <cyan>Remarks</cyan>
This function is a wrapper around `dla_trsylv_l2_local_copy_64`.
### <cyan>See also</cyan>
`dla_trsylv_l2_local_copy_64`
### <purple>Parameters</purple>
- **`TRANSA`** β `TRANSA` is string. It specifies the form of the system of equations with respect to `A`:
== 'N': op1(A) = A == 'T': op1(A) = A**T
- **`TRANSB`** β `TRANSB` is string. It specifies the form of the system of equations with respect to `B`:
== 'N': op2(B) = B, == 'T': op2(B) = B**T
- **`SGN`** β `SGN` is `DOUBLE PRECISION`, allowed values: `+/-1`. It specifies the sign between the two parts of the Sylvester equation.
= 1 : Solve Equation (1) == -1: Solve Equation (2)
- **`M`** β `M` is `INTEGER`. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is `INTEGER`. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is `DOUBLE PRECISION` array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is `INTEGER`. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is `INTEGER`. The leading dimension of the array `X`. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is `DOUBLE PRECISION`. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is `DOUBLE PRECISION` array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is `INTEGER`.
On input:
== -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query:
< 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit < 0: if INFO == -i, the i-Th argument had an illegal value
0: The equation is not solved correctly. One of the arising inner
system got singular.
### <pink>Author</pink> π
Martin Koehler, MPI Magdeburg
### <pink>Date</pink> πΈ
October 2025
Definition at line 953 of file `trsylv.c`.
### π¦ `mepack_double_trsylv_level2_local_copy_96`
void mepack_double_trsylv_level2_local_copy_96 (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 * SCALE, double * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, `M,N<=96`)
**Purpose:**
`mepack_double_trsylv_level2_local_copy_96` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK. <pink>bestie this is the whole plot of the function π</pink>
**Remarks**
This function is a wrapper around `dla_trsylv_l2_local_copy_96`. <lavender>it's giving "middle management", but make it math π
</lavender>
**See also**
`dla_trsylv_l2_local_copy_96`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array `X`. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is DOUBLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is DOUBLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`. <cyan>yes you HAVE to ask first, no skipping the vibe check π«Ά</cyan>
- **`INFO`** β `INFO` is INTEGER.
- On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
- On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 1111 of file `trsylv.c`.
---
### π `mepack_double_trsylv_level2_reorder`
void mepack_double_trsylv_level2_reorder (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 * SCALE, double * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Reordered variant) <rainbow>the reordered girlie β¨</rainbow>
**Purpose:**
`mepack_double_trsylv_level2_reorder` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK.
**Remarks**
This function is a wrapper around `dla_trsylv_l2_reorder`.
**See also**
`dla_trsylv_l2_reorder`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array `X`. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is DOUBLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is DOUBLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
- On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
- On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 323 of file `trsylv.c`.
---
### π `mepack_double_trsylv_level2_unopt`
void mepack_double_trsylv_level2_unopt (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 * SCALE, double * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant) <peach>the raw, unfiltered, no-makeup version β and we respect her for it π</peach>
**Purpose:**
`mepack_double_trsylv_level2_unopt` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK.
**Remarks**
This function is a wrapper around `dla_trsylv_l2_unopt`.
**See also**
`dla_trsylv_l2_unopt`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`**
- **`LDX`** β `LDX` is `INTEGER`. It's the leading dimension of the array `X`. The rule is `LDB >= max(1,M)`. <yellow>(yes bestie, that's literally what it says in the source, we don't make the rules π
)</yellow>
- **`SCALE`** β `SCALE` is `DOUBLE PRECISION`. It's the lil scaling factor that keeps your result from overflowing, okay? If `INFO == 0` then `SCALE` is `1.0D0`, otherwise if one of the inner systems couldn't be solved correctly, `0 < SCALE <= 1` holds true. <cyan>no cap.</cyan>
- **`WORK`** β `WORK` is a `DOUBLE PRECISION` array, dimension `LDWORK`. It's the workspace for the algorithm. <peach>Important:</peach> the workspace needs to be queried **before** running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`. <purple>(it's giving "ask first, then act" energy β¨)</purple>
- **`INFO`** β `INFO` is `INTEGER`.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
### Author π
Martin Koehler, MPI Magdeburg
### Date ποΈ
October 2025
### Definition π
Definition at line 480 of file trsylv.c.
---
## π¦ `void mepack_double_trsylv_level3 (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 * SCALE, double * WORK, int * INFO)`
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. <rainbow>β¨ the upgraded one β¨</rainbow>
### Purpose π―
`mepack_double_trsylv_level3` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK.
### Remarks π
This function is a wrapper around `dla_trsylv_l3`.
### See also π
`dla_trsylv_l3`
### Parameters π
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is `DOUBLE PRECISION`, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is `INTEGER`. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is `INTEGER`. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is `DOUBLE PRECISION` array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is `INTEGER`. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is `INTEGER`. The leading dimension of the array `X`. `LDB >= max(1,M)`. <lavender>(again, verbatim from the source, we're just the messenger π«Ά)</lavender>
- **`SCALE`** β `SCALE` is `DOUBLE PRECISION`. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is `DOUBLE PRECISION` array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is `INTEGER`.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
### Author π
Martin Koehler, MPI Magdeburg
### Date ποΈ
October 2025
### Definition π
Definition at line 168 of file trsylv.c.
---
## πΈ `void mepack_double_trsylv_level3_2stage (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 * SCALE, double * WORK, int * INFO)`
Level-3 Bartels-Stewart Algorithm with sub-blocking for the generalized Sylvester equation. <mint>sub-blocking?? she's fancy β¨</mint>
### Purpose π―
`mepack_double_trsylv_level3_2stage` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `DGEES` form LAPACK.
### Remarks π
This function is a wrapper around `dla_trsylv_l3_2s`.
### See also π
`dla_trsylv_l3_2s`
### Parameters π
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is `DOUBLE PRECISION`, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is `INTEGER`. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is `INTEGER`. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is `DOUBLE PRECISION` array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is `INTEGER`. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is `DOUBLE PRECISION` array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is `INTEGER`. The leading dimension of the array `X`. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is `DOUBLE PRECISION`. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is `DOUBLE PRECISION` array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is `INTEGER`.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
### Author π
Martin Koehler, MPI Magdeburg
### Date ποΈ
October 2025
### Definition π
Definition at line 483 of file trsylv.c.
---
## π
`void mepack_double_trsylv_level3_unopt (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 * SCALE, double * WORK, int * INFO)`
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant) <peach>she's the unoptimized one and she's still serving π«Ά</peach>
### Purpose π―
`mepack_double_trsylv_level3_unopt` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via DGEES form LAPACK.
### π Remarks π
This function is literally just a wrapper around `dla_trsylv_l3_unopt`. No cap. π«Ά
### π See also π
- `dla_trsylv_l3_unopt`
### π Parameters π
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1`: Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`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 matrix B must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is DOUBLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is DOUBLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
- On input:
- `== -1`: Perform a workspace query
- `<> -1`: normal operation
- On exit, workspace query:
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
### πΈ Author πΈ
Martin Koehler, MPI Magdeburg
### π Date π
October 2025
Definition at line 326 of file `trsylv.c`.
---
## π mepack_double_trsylv_recursive π
void mepack_double_trsylv_recursive (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 * SCALE, double * WORK, int * INFO)
Recursive blocking Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. π¦
### β¨ Purpose: β¨
`mepack_double_trsylv_recursive` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via DGEES form LAPACK.
### π Remarks π
This function is a wrapper around `dla_trsylv_recursive`. Bestie it just hands off the work. π
### π See also π
- `dla_trsylv_recursive`
### π Parameters π
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is DOUBLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1`: Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is DOUBLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`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 matrix B must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is DOUBLE PRECISION array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is DOUBLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is DOUBLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
- On input:
- `== -1`: Perform a workspace query
- `<> -1`: normal operation
- On exit, workspace query:
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
### πΈ Author πΈ
Martin Koehler, MPI Magdeburg
### π Date π
October 2025
Definition at line 168 of file `trsylv.c`.
---
## π₯ mepack_single_trsylv2_dag π₯
void mepack_single_trsylv2_dag (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 * SCALE, float * WORK, int * INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG parallelization. Parallel girlies rise up. π
β¨
### β¨ Purpose: β¨
`mepack_single_trsylv2_dag` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK.
### π Remarks π
This function is a wrapper around `sla_trsylv2_dag`. Yep, another handoff. π«Ά
### π See also π
- `sla_trsylv2_dag`
### π Parameters π
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1`: Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is SINGLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`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 matrix B must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is SINGLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β
#### `WORK`
**`WORK`** is a <cyan>SINGLE PRECISION</cyan> array, dimension `LDWORK` πΈ β it's the lil scratchpad the algorithm does its thing in.
okay bestie, this part is <hotpink>important</hotpink>: you have to **query** the workspace *before* running the computation. The query happens when you call the subroutine with `INFO == -1` on input, and the required workspace then comes back to you in `INFO`. π
#### `INFO`
**`INFO`** is `INTEGER` β the lil status messenger keeping you posted π¬
On input:
- `== -1` : Perform a workspace query π
- `<> -1` : normal operation πββοΈ
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value π
- `>= 0`: The value of `INFO` is the required number of elements in the workspace β¨
On exit, normal operation:
- `== 0`: successful exit π
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value π
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular π«
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
*Definition at line 324 of file `trsylv2.c`.*
---
## `mepack_single_trsylv2_level2`
void mepack_single_trsylv2_level2 (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 * SCALE, float * WORK, int * INFO)
<rainbow>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation.</rainbow> π¦β¨
### Purpose
`mepack_single_trsylv2_level2` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via `SGEES` form LAPACK. π«Ά
### Remarks
This function is a wrapper around `sla_trsylv2_l2`. π
### See also
`sla_trsylv2_l2`
### Parameters
#### `TRANSA`
`TRANSA` is string π β it specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
#### `TRANSB`
`TRANSB` is string π β it specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
#### `SGN`
`SGN` is <cyan>SINGLE PRECISION</cyan>, allowed values: `+/-1`. It specifies the sign between the two parts of the Sylvester equation. π
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
#### `M`
`M` is `INTEGER`. The order of the matrices A and C. `M >= 0`.
#### `N`
`N` is `INTEGER`. The order of the matrices B and D. `N >= 0`.
#### `A`
`A` is <cyan>SINGLE PRECISION</cyan> array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular. π
#### `LDA`
`LDA` is `INTEGER`. The leading dimension of the array A. `LDA >= max(1,M)`.
#### `B`
`B` is <cyan>SINGLE PRECISION</cyan> array, dimension `(LDB,N)`. The matrix B must be (quasi-) upper triangular. π
#### `LDB`
`LDB` is `INTEGER`. The leading dimension of the array B. `LDB >= max(1,N)`.
#### `X`
`X` is <cyan>SINGLE PRECISION</cyan> array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices. π₯
#### `LDX`
`LDX` is `INTEGER`. The leading dimension of the array X. `LDB >= max(1,M)`.
#### `SCALE`
`SCALE` is <cyan>SINGLE PRECISION</cyan>. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true. π
#### `WORK`
`WORK` is <cyan>SINGLE PRECISION</cyan> array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
#### `INFO`
`INFO` is `INTEGER`
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
*Definition at line 1428 of file `trsylv2.c`.*
---
## `mepack_single_trsylv2_level2_local_copy`
void mepack_single_trsylv2_level2_local_copy (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 * SCALE, float * WORK, int * INFO)
<rainbow>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation.</rainbow> (Local copy variant) π¦β¨
### Purpose
`mepack_single_trsylv2_level2_local_copy` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via `SGEES` form LAPACK. π«Ά
### Remarks
This function is a wrapper around `sla_trsylv2_l2_local_copy`. π
### See also
`sla_trsylv2_l2_local_copy`
### Parameters
#### `TRANSA`
`TRANSA` is string π β it specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
#### `TRANSB`
`TRANSB` is string π β it specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
#### `SGN`
`SGN` is <cyan>SINGLE PRECISION</cyan>, allowed values: `+/-1`. It specifies the sign between the two parts of the Sylvester equation. π
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
#### `M`
`M` is `INTEGER`. The order of the matrices A and C. `M >= 0`.
#### `N`
`N` is `INTEGER`. The order of the matrices B and D. `N >= 0`.
#### `A`
`A` is <cyan>SINGLE PRECISION</cyan> array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular. π
#### `LDA`
`LDA` is `INTEGER`. The leading dimension of the array A. `LDA >= max(1,M)`.
#### `B`
`B` is <cyan>SINGLE PRECISION</cyan> array, dimension `(LDB,N)`. The matrix B must be (quasi-) upper triangular. π
#### `LDB`
`LDB` is `INTEGER`. The leading dimension of the array B. `LDB >= max(1,N)`.
#### `X`
`X` is <cyan>SINGLE PRECISION</cyan> array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices. π₯
#### `LDX`
`LDX` is `INTEGER`. The leading dimension of the array X. `LDB >= max(1,M)`.
#### `SCALE`
`SCALE` is <cyan>SINGLE PRECISION</cyan>. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true. π
#### `WORK`
`WORK` is <cyan>SINGLE PRECISION</cyan> array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
#### `INFO`
`INFO` is `INTEGER`
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
*Definition at line 1903 of file `trsylv2.c`.*
---
## `mepack_single_trsylv2_level2_local_copy_128`
void mepack_single_trsylv2_level2_local_copy_128 (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 * SCALE, float * WORK, int * INFO)
<rainbow>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation.</rainbow> (Local copy variant, `M,N <= 128`) π¦β¨
### Purpose
`mepack_single_trsylv2_level2_local_copy_128` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via `SGEES` form LAPACK. π«Ά
### Remarks
This function is a wrapper around `sla_trsylv2_l2_local_copy_128`. π
### See also
`sla_trsylv2_l2_local_copy_128`
### Parameters
#### `TRANSA`
`TRANSA` is string π β it specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
#### `TRANSB`
`TRANSB` is string π β it specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
#### `SGN`
- **`SGN`** β <pink>SGN is SINGLE PRECISION</pink>, allowed values: `+/-1`. It's the <hotpink>sign</hotpink> living between the two halves of the Sylvester equation:
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β <cyan>M is INTEGER</cyan>. The order of the matrices A and C. `M >= 0`.
- **`N`** β <cyan>N is INTEGER</cyan>. The order of the matrices B and D. `N >= 0`.
- **`A`** β <mint>A is SINGLE PRECISION array</mint>, dimension `(LDA,M)`. The matrix A must be <yellow>(quasi-) upper triangular</yellow>. no exceptions bestie π
- **`LDA`** β <cyan>LDA is INTEGER</cyan>. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`** β <mint>B is SINGLE PRECISION array</mint>, dimension `(LDB,N)`. The matrix B must be <yellow>(quasi-) upper triangular</yellow>. same energy, same rules.
- **`LDB`** β <cyan>LDB is INTEGER</cyan>. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β <mint>X is SINGLE PRECISION array</mint>, dimension `(LDX,N)`. On input, the matrix X contains the <purple>right hand side Y</purple>. On output, the matrix X contains the <green>solution</green> of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β <cyan>LDX is INTEGER</cyan>. The leading dimension of the array X. `LDB >= max(1,M)`. (yes, it literally says `LDB` in there β we do not fix the docs, we <rainbow>transcribe</rainbow> them β¨)
- **`SCALE`** β <pink>SCALE is SINGLE PRECISION</pink>. SCALE is a scaling factor to prevent the <red>overflow</red> in the result. If `INFO == 0` then SCALE is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β <mint>WORK is SINGLE PRECISION array</mint>, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in INFO. π«Ά
- **`INFO`** β <cyan>INFO is INTEGER</cyan>
On input: == -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query: < 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation: == 0: successful exit < 0: if INFO == -i, the i-Th argument had an illegal value
0: The equation is not solved correctly. One of the arising inner
system got singular.
### π Author
Martin Koehler, MPI Magdeburg
### π
Date
October 2025
<purple>Definition at line 2535 of file `trsylv2.c`.</purple>
---
## β¨ `void mepack_single_trsylv2_level2_local_copy_32 (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 * SCALE, float * WORK, int * INFO)` β¨
void mepack_single_trsylv2_level2_local_copy_32 (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 * SCALE, float * WORK, int * INFO)
<hotpink>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation.</hotpink> <yellow>(Local copy variant, M,N <= 32 )</yellow> π
### π¦ Purpose:
<green>`mepack_single_trsylv2_level2_local_copy_32`</green> solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via <purple>SGEES</purple> form LAPACK.
### π
Remarks
This function is a <pink>wrapper</pink> around `sla_trsylv2_l2_local_copy_32`.
### π See also
`sla_trsylv2_l2_local_copy_32`
### π Parameters
- **`TRANSA`** β <cyan>TRANSA is string</cyan>. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β <cyan>TRANSB is string</cyan>. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β <pink>SGN is SINGLE PRECISION</pink>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β <cyan>M is INTEGER</cyan>. The order of the matrices A and C. `M >= 0`.
- **`N`** β <cyan>N is INTEGER</cyan>. The order of the matrices B and D. `N >= 0`.
- **`A`** β <mint>A is SINGLE PRECISION array</mint>, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`LDA`** β <cyan>LDA is INTEGER</cyan>. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`** β <mint>B is SINGLE PRECISION array</mint>, dimension `(LDB,N)`. The matrix B must be (quasi-) upper triangular.
- **`LDB`** β <cyan>LDB is INTEGER</cyan>. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β <mint>X is SINGLE PRECISION array</mint>, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β <cyan>LDX is INTEGER</cyan>. The leading dimension of the array X. `LDB >= max(1,M)`. (still says `LDB`, still not our problem π)
- **`SCALE`** β <pink>SCALE is SINGLE PRECISION</pink>. SCALE is a scaling factor to prevent the overflow in the result. If `INFO == 0` then SCALE is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β <mint>WORK is SINGLE PRECISION array</mint>, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in INFO.
- **`INFO`** β <cyan>INFO is INTEGER</cyan>
On input: == -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query: < 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation: == 0: successful exit < 0: if INFO == -i, the i-Th argument had an illegal value
0: The equation is not solved correctly. One of the arising inner
system got singular.
### π Author
Martin Koehler, MPI Magdeburg
### π
Date
October 2025
<purple>Definition at line 2060 of file `trsylv2.c`.</purple>
---
## β¨ `void mepack_single_trsylv2_level2_local_copy_64 (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 * SCALE, float * WORK, int * INFO)` β¨
void mepack_single_trsylv2_level2_local_copy_64 (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 * SCALE, float * WORK, int * INFO)
<hotpink>Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation.</hotpink> <yellow>(Local copy variant, M,N <= 64 )</yellow> π¦
### π Purpose:
<green>`mepack_double_trsylv2_level2_local_copy_64`</green> solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via <purple>DGEES</purple> form LAPACK.
> <red>not me</red> noticing the Purpose line says <yellow>`mepack_double_...`</yellow> and DGEES inside a <cyan>`single`</cyan> function β that is <rainbow>verbatim</rainbow> from the source docs, iykyk, we keep every word π
### π
Remarks
This function is a <pink>wrapper</pink> around `dla_trsylv2_l2_local_copy_64`.
### π See also
`dla_trsylv2_l2_local_copy_64`
### π Parameters
- **`TRANSA`** β <cyan>TRANSA is string</cyan>. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β <cyan>TRANSB is string</cyan>. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β <pink>SGN is DOUBLE PRECISION</pink>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β <cyan>M is INTEGER</cyan>. The order of the matrices A and C. `M >= 0`.
- **`N`** β <cyan>N is INTEGER</cyan>. The order of the matrices B and D. `N >= 0`.
- **`A`** β <mint>A is DOUBLE PRECISION array</mint>, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`LDA`** β <cyan>LDA is INTEGER</cyan>. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`** β <mint>B is DOUBLE PRECISION array</mint>, dimension `(LDB,N)`. The matrix B must be (quasi-) upper triangular.
- **`LDB`** β <cyan>LDB is INTEGER</cyan>. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β <mint>X is DOUBLE PRECISION array</mint>, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by TRANSA, TRANSB, and SGN. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β <cyan>LDX is INTEGER</cyan>. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β <pink>SCALE is DOUBLE PRECISION</pink>. SCALE is a scaling factor to prevent the overflow in the result. If `INFO == 0` then SCALE is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β <mint>WORK is DOUBLE PRECISION array</mint>, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in INFO.
- **`INFO`** β <cyan>INFO is INTEGER</cyan>
On input: == -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query: < 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit, we love a happy ending π
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value (you fed it something cursed bestie π)
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular. (not slay. the math said no π)
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
### Definition
Definition at line 2217 of file `trsylv2.c`.
---
### `void mepack_single_trsylv2_level2_reorder (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 * SCALE, float * WORK, int * INFO)`
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Reordered variant) β it's giving organized, it's giving *reordered*, okay?? β¨
**Purpose:**
`mepack_single_trsylv2_level2_reorder` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. (iykyk πΈ)
**Remarks**
This function is a wrapper around `sla_trsylv2_l2_reorder`. Just a cute little middle-man π
**See also**
`sla_trsylv2_l2_reorder`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
== 'N': op1(A) = A == 'T': op1(A) = A**T
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
== 'N': op2(B) = B, == 'T': op2(B) = B**T
- **`SGN`** β `SGN` is SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
= 1 : Solve Equation (1) == -1: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is SINGLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular. no funny business π
- **`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 matrix B must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is SINGLE PRECISION array, dimension `(LDX,N)`.
On input, the matrix X contains the right hand side Y.
On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`.
Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array X. `LDB >= max(1,M)`. (yes it says `LDB` there. we are simply reporting the lore, don't come for me π)
- **`SCALE`** β `SCALE` is SINGLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is SINGLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
On input:
== -1 : Perform a workspace query <> -1 : normal operation
On exit, workspace query:
< 0 : if INFO == -i, the i-Th argument had an illegal value
= 0: The value of INFO is the required number of elements in the workspace.
On exit, normal operation:
== 0: successful exit < 0: if INFO == -i, the i-Th argument had an illegal value
0: The equation is not solved correctly. One of the arising inner
system got singular.
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
### Definition
Definition at line 1587 of file `trsylv2.c`.
---
### `void mepack_single_trsylv2_level2_unopt (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 * SCALE, float * WORK, int * INFO)`
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant) β it's the raw, unbothered, no-frills version. the *unopt* era π
**Purpose:**
`mepack_single_trsylv2_level2_unopt` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. π¦
**Remarks**
This function is a wrapper around `sla_trsylv2_l2_unopt`.
**See also**
`sla_trsylv2_l2_unopt`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
== 'N': op1(A) = A == 'T': op1(A) = A**T
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
== 'N': op2(B) = B, == 'T': op2(B) = B**T
- **`SGN`** β `SGN` is SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
= 1 : Solve Equation (1) == -1: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is SINGLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`LDA`** β `LDA` is INTEGER. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`**
- **`B`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `(LDB,N)`. Bestie, this matrix **must** be (quasi-) upper triangular. No exceptions. π
- **`LDB`** β <yellow>INTEGER</yellow>. It's the leading dimension of the array `B`, and `LDB >= max(1,N)`. Periodt.
- **`X`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `(LDX,N)`. On input, `X` is carrying the right hand side `Y`. On output, `X` holds the solution of Equation (1) or (2), whichever one you picked with `TRANSA`, `TRANSB`, and `SGN`. Both the right hand side `Y` and the solution `X` are `M`-by-`N` matrices. She contains multitudes π¦
- **`LDX`** β <yellow>INTEGER</yellow>. The leading dimension of the array `X`, and `LDB >= max(1,M)`. (Yes it says `LDB` there. That's what the page says, so that's what we're saying. π)
- **`SCALE`** β <cyan>SINGLE PRECISION</cyan>. It's a scaling factor whose whole job is preventing overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0`, otherwise β if one of the inner systems could not be solved correctly β `0 < SCALE <= 1` holds true. She's doing damage control and she's serving β¨
- **`WORK`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `LDWORK`. It's the workspace for the algorithm. And listen: the workspace **needs to be queried before running the computation**. You do that query by calling the subroutine with `INFO == -1` on input. The required workspace then gets returned in `INFO`. Do not skip the query, I'm begging π
- **`INFO`** β <yellow>INTEGER</yellow>. The whole vibe report:
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the `i`-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit π
- `< 0`: if `INFO == -i`, the `i`-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular. <red>She's broken, bestie.</red>
**Author** β Martin Koehler, MPI Magdeburg
**Date** β October 2025
Definition at line 1744 of file `trsylv2.c`.
---
### π `mepack_single_trsylv2_level3` π
void mepack_single_trsylv2_level3 (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 * SCALE, float * WORK, int * INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. Say it with me: <rainbow>Bartels-Stewart</rainbow>. π
**Purpose:**
`mepack_single_trsylv2_level3` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form LAPACK. Iconic behavior, honestly π
**Remarks**
This function is a wrapper around `sla_trsylv2_l3`. She's the glamorous front end, the other one does the cardio πββοΈ
**See also**
`sla_trsylv2_l3`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is <cyan>SINGLE PRECISION</cyan>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β <yellow>INTEGER</yellow>. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β <yellow>INTEGER</yellow>. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`LDA`** β <yellow>INTEGER</yellow>. The leading dimension of the array `A`. `LDA >= max(1,M)`.
- **`B`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `(LDB,N)`. The matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β <yellow>INTEGER</yellow>. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β <yellow>INTEGER</yellow>. The leading dimension of the array `X`. `LDB >= max(1,M)`. (Again, that's `LDB` on the page. Not my business, I just report. π«Ά)
- **`SCALE`** β <cyan>SINGLE PRECISION</cyan>. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β <yellow>INTEGER</yellow>
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the `i`-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit β¨
- `< 0`: if `INFO == -i`, the `i`-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular. <red>tragique</red> π
**Author** β Martin Koehler, MPI Magdeburg
**Date** β October 2025
Definition at line 640 of file `trsylv2.c`.
---
### π¦ `mepack_single_trsylv2_level3_2stage` π¦
void mepack_single_trsylv2_level3_2stage (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 * SCALE, float * WORK, int * INFO)
Level-3 Bartels-Stewart Algorithm with sub-blocking for the generalized Sylvester equation. Sub-blocking! She's doing it in *stages*, she's organized, she has a planner, she's the main character πβ¨
**Purpose:**
`mepack_single_trsylv2_level3_2stage` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form LAPACK.
**Remarks**
This function is a wrapper around `sla_trsylv2_l3_2s`.
**See also**
`sla_trsylv2_l3_2s`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is <cyan>SINGLE PRECISION</cyan>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β <yellow>INTEGER</yellow>. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β <yellow>INTEGER</yellow>. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`LDA`** β <yellow>INTEGER</yellow>. The leading dimension of the array `A`. `LDA >= max(1,M)`.
- **`B`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `(LDB,N)`. The matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β <yellow>INTEGER</yellow>. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β <yellow>INTEGER</yellow>. The leading dimension of the array `X`. `LDB >= max(1,M)`. (Same little typo cameo as before. We love consistency π
)
- **`SCALE`** β <cyan>SINGLE PRECISION</cyan>. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β a <cyan>SINGLE PRECISION</cyan> array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β <yellow>INTEGER</yellow>
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the `i`-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit πΈ
- `< 0`: if `INFO == -i`, the `i`-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author** β Martin Koehler, MPI Magdeburg
**Date** β October 2025
Definition at line 956 of file `trsylv2.c`.
---
### π `mepack_single_trsylv2_level3_unopt` π
void mepack_single_trsylv2_level3_unopt (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 * SCALE, float * WORK, int * INFO)
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant) β she's the no-makeup, hair-in-a-bun version. Still does the job, still valid, just not here for the aesthetics π
**Purpose:**
`mepack_single_trsylv2_level3_unopt` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form `LAPACK`. π
## π«Ά Remarks
This function is a wrapper around `sla_trsylv2_l3_unopt`. Bestie, it's literally just handing the work off β the real one doing the cardio is over there. πββοΈ
## π See also
`sla_trsylv2_l3_unopt`
## π Parameters
- **`TRANSA`** β ok so this one's a string, and it tells us the *form* of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β same energy, but a string for the `B` side of things:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β this one is SINGLE PRECISION, allowed values: `+/-1`. It picks the sign chillin' between the two parts of the Sylvester equation:
- `= 1`: Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β INTEGER, the order of the matrices `A` and `C`. Constraint: `M >= 0`.
- **`N`** β INTEGER, the order of the matrices `B` and `D`. Constraint: `N >= 0`.
- **`A`** β SINGLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular. no cap. π
- **`LDA`** β INTEGER, the leading dimension of the array `A`. Constraint: `LDA >= max(1,M)`.
- **`B`** β SINGLE PRECISION array, dimension `(LDB,N)`. The matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β INTEGER, the leading dimension of the array `B`. Constraint: `LDB >= max(1,N)`.
- **`X`** β SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices. It goes in as the problem and comes out as the answer, we love a glow-up. β¨
- **`LDX`** β INTEGER, the leading dimension of the array `X`. Constraint: `LDB >= max(1,M)`. (yes, it says `LDB`, we're just reporting the lore exactly as it is π)
- **`SCALE`** β SINGLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true. It's the lil safety net so your numbers don't yeet themselves into infinity. π«Ά
- **`WORK`** β SINGLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`. So like, ask first, allocate second. π
- **`INFO`** β INTEGER. Here's the whole situation:
- On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
- On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit π
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
## π Author
Martin Koehler, MPI Magdeburg
## πΈ Date
October 2025
Definition at line 799 of file `trsylv2.c`.
---
### π `void mepack_single_trsylv2_recursive (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 * SCALE, float * WORK, int * INFO)`
Recursive blocking Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. Ok it's giving *recursion*, it's giving *blocking*, it's giving Level-3. iconic behavior. π
**Purpose:**
`mepack_single_trsylv2_recursive` solves a Sylvester equation of the following forms
op1(A) * X * op2(B) + X = SCALE * Y (1)
or
op1(A) * X * op2(B) - X = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form `LAPACK`. π¦
**Remarks**
This function is a wrapper around `sla_trsylv2_recursive`. Just passing the aux cord along, fr fr. π§
**See also**
`sla_trsylv2_recursive`
**Parameters**
- **`TRANSA`** β a string, specifying the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β a string, specifying the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation:
- `= 1`: Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β INTEGER, the order of the matrices `A` and `C`. Constraint: `M >= 0`.
- **`N`** β INTEGER, the order of the matrices `B` and `D`. Constraint: `N >= 0`.
- **`A`** β SINGLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`LDA`** β INTEGER, the leading dimension of the array `A`. Constraint: `LDA >= max(1,M)`.
- **`B`** β SINGLE PRECISION array, dimension `(LDB,N)`. The matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β INTEGER, the leading dimension of the array `B`. Constraint: `LDB >= max(1,N)`.
- **`X`** β SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β INTEGER, the leading dimension of the array `X`. Constraint: `LDB >= max(1,M)`. (again with the `LDB`, I know, I know, we stay faithful π)
- **`SCALE`** β SINGLE PRECISION. A scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β SINGLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β INTEGER.
- On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
- On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 327 of file `trsylv2.c`.
---
### π `void mepack_single_trsylv_dag (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 * SCALE, float * WORK, int * INFO)`
Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation with DAG parallelization. DAG parallelization?? the *way* it's giving directed acyclic graph, the way it's giving multithreaded main character energy. π₯
**Purpose:**
`mepack_single_trsylv_dag` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form `LAPACK`. π
**Remarks**
This function is a wrapper around `sla_trsylv_dag`. Just a lil handoff, iykyk. π«Ά
**See also**
`sla_trsylv_dag`
**Parameters**
- **`TRANSA`** β a string, specifying the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β a string, specifying the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation:
- `= 1`: Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β INTEGER, the order of the matrices `A` and `C`. Constraint: `M >= 0`.
- **`N`** β INTEGER, the order of the matrices `B` and `D`. Constraint: `N >= 0`.
- **`A`** β SINGLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`LDA`** β INTEGER, the leading dimension of the array `A`. Constraint: `LDA >= max(1,M)`.
- **`B`** β SINGLE PRECISION array, dimension `(LDB,N)`. The matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β INTEGER, the leading dimension of the array `B`. Constraint: `LDB >= max(1,N)`.
- **`X`** β SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β INTEGER, the leading dimension of the array `X`. Constraint: `LDB >= max(1,M)`. (yep, `LDB` again β we do not editorialize, we transcribe π)
- **`SCALE`** β
### SCALE π
`SCALE` is <hotpink>SINGLE PRECISION</hotpink>.
`SCALE` is a scaling factor, and bestie its whole job is to stop the result from overflowing, okay? If `INFO == 0` then `SCALE` is `1.0D0`. Otherwise, if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true. π«Ά
### WORK πΈ
`WORK` is <hotpink>SINGLE PRECISION</hotpink> array, dimension `LDWORK`.
It's the workspace for the algorithm. And no, you can't just guess the size β the workspace needs to queried before the running the computation, periodt. You do the query by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`. β¨
### INFO π
`INFO` is <hotpink>INTEGER</hotpink>.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the `i`-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the `i`-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
> Not the inner system catching a case of the singulars π watch that `> 0` like a hawk.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 324 of file trsylv.c.
---
## <purple>`void mepack_single_trsylv_level2 (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 * SCALE, float * WORK, int * INFO)`</purple> π¦
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. It's giving *level two* and it's giving *iconic*.
**Purpose:**
`mepack_single_trsylv_level2` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form LAPACK. π
**Remarks**
This function is a wrapper around `sla_trsylv_l2`. Bestie is just the middleman fr fr.
**See also**
`sla_trsylv_l2`
**Parameters**
### TRANSA π
`TRANSA` is string.
Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
### TRANSB π
`TRANSB` is string.
Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
### SGN β¨
`SGN` is <hotpink>SINGLE PRECISION</hotpink>, allowed values: `+/-1`.
Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
### M π
`M` is <hotpink>INTEGER</hotpink>.
The order of the matrices `A` and `C`. `M >= 0`.
### N π
`N` is <hotpink>INTEGER</hotpink>.
The order of the matrices `B` and `D`. `N >= 0`.
### A π¦
`A` is <hotpink>SINGLE PRECISION</hotpink> array, dimension `(LDA,M)`.
The matrix `A` must be (quasi-) upper triangular. No cap.
### LDA π
`LDA` is <hotpink>INTEGER</hotpink>.
The leading dimension of the array `A`. `LDA >= max(1,M)`.
### B πΈ
`B` is <hotpink>SINGLE PRECISION</hotpink> array, dimension `(LDB,N)`.
The matrix `B` must be (quasi-) upper triangular. Again, no cap.
### LDB π§
`LDB` is <hotpink>INTEGER</hotpink>.
The leading dimension of the array `B`. `LDB >= max(1,N)`.
### X π
`X` is <hotpink>SINGLE PRECISION</hotpink> array, dimension `(LDX,N)`.
On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices. Glow up complete. π
### LDX π«Ά
`LDX` is <hotpink>INTEGER</hotpink>.
The leading dimension of the array `X`. `LDB >= max(1,M)`.
### SCALE π₯
`SCALE` is <hotpink>SINGLE PRECISION</hotpink>.
`SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
### WORK π
`WORK` is <hotpink>SINGLE PRECISION</hotpink> array, dimension `LDWORK`.
Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
### INFO π
`INFO` is <hotpink>INTEGER</hotpink>.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the `i`-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the `i`-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 1428 of file trsylv.c.
---
## <purple>`void mepack_single_trsylv_level2_local_copy (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 * SCALE, float * WORK, int * INFO)`</purple> π
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant) β yes bestie, it's the *local copy* one, we're doing remixes now. π
**Purpose:**
`mepack_single_trsylv_level2_local_copy` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form LAPACK. π
**Remarks**
This function is a wrapper around `sla_trsylv_l2_local_copy`. Passing the aux cord, literally.
**See also**
`sla_trsylv_l2_local_copy`
**Parameters**
### TRANSA π
`TRANSA` is string.
Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
### TRANSB π
`TRANSB` is string.
Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
### SGN β¨
`SGN` is <hotpink>SINGLE PRECISION</hotpink>, allowed values: `+/-1`.
Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
### M π
`M` is <hotpink>INTEGER</hotpink>.
The order of the matrices `A` and `C`. `M >= 0`.
### N π
`N` is <hotpink>INTEGER</hotpink>.
The order of the matrices `B` and `D`. `N >= 0`.
### A π¦
`A` is <hotpink>SINGLE PRECISION</hotpink> array, dimension `(LDA,M)`.
The matrix `A` must be (quasi-) upper triangular.
### LDA π
`LDA` is <hotpink>INTEGER</hotpink>.
The leading dimension of the array `A`. `LDA >= max(1,M)`.
### B πΈ
`B` is <hotpink>SINGLE PRECISION</hotpink> array, dimension `(LDB,N)`.
The matrix `B` must be (quasi-) upper triangular.
### LDB π§
`LDB` is <hotpink>INTEGER</hotpink>.
The leading dimension of the array `B`. `LDB >= max(1,N)`.
### X π
`X` is <hotpink>SINGLE PRECISION</hotpink> array, dimension `(LDX,N)`.
On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
### LDX π«Ά
`LDX` is <hotpink>INTEGER</hotpink>.
The leading dimension of the array `X`. `LDB >= max(1,M)`.
### SCALE π₯
`SCALE` is <hotpink>SINGLE PRECISION</hotpink>.
`SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
### WORK π
`WORK` is <hotpink>SINGLE PRECISION</hotpink> array, dimension `LDWORK`.
Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
### INFO π
`INFO` is <hotpink>INTEGER</hotpink>.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the `i`-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the `i`-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 1903 of file trsylv.c.
---
## <purple>`void mepack_single_trsylv_level2_local_copy_128 (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 * SCALE, float * WORK, int * INFO)`</purple> π₯
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, `M,N <= 128`) β okay the `_128` suffix is *so* specific and honestly? obsessed. It's the same vibe but with a size limit, iykyk. π
**Purpose:**
`mepack_single_trsylv_level2_local_copy_128` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form LAPACK. π
**Remarks**
This function is a wrapper around `sla_trsylv_l2_local_copy_128`.
**See also**
`sla_trsylv_l2_local_copy_128`
**Parameters**
### TRANSA
- **`TRANSA`** β it's a <cyan>string</cyan> π« and it specifies the form of the system of equations with respect to A, bestie:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β also a <cyan>string</cyan> β¨ and it specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is <purple>SINGLE PRECISION</purple>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is <yellow>INTEGER</yellow>. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is <yellow>INTEGER</yellow>. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is a <purple>SINGLE PRECISION</purple> array, dimension `(LDA,M)`. The matrix A must be <hotpink>(quasi-) upper triangular</hotpink> π
.
- **`LDA`** β `LDA` is <yellow>INTEGER</yellow>. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`** β `B` is a <purple>SINGLE PRECISION</purple> array, dimension `(LDB,N)`. The matrix B must be <hotpink>(quasi-) upper triangular</hotpink> π
.
- **`LDB`** β `LDB` is <yellow>INTEGER</yellow>. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is a <purple>SINGLE PRECISION</purple> array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is <yellow>INTEGER</yellow>. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is <purple>SINGLE PRECISION</purple>. SCALE is a scaling factor to prevent the overflow in the result. If `INFO == 0` then SCALE is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is a <purple>SINGLE PRECISION</purple> array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is <yellow>INTEGER</yellow>.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author** β Martin Koehler, MPI Magdeburg
**Date** β October 2025
Definition at line 2535 of file `trsylv.c`.
---
### `mepack_single_trsylv_level2_local_copy_32`
void mepack_single_trsylv_level2_local_copy_32 (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 * SCALE, float * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, `M,N <= 32`) π¦
**Purpose:**
`mepack_single_trsylv_level2_local_copy_32` solves a Sylvester equation of the following forms, bestie:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via SGEES form LAPACK. <pink>periodt.</pink> π
**Remarks** β This function is a wrapper around `sla_trsylv_l2_local_copy_32`.
**See also** β `sla_trsylv_l2_local_copy_32`
**Parameters**
- **`TRANSA`** β it's a <cyan>string</cyan> π« and it specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β also a <cyan>string</cyan> β¨ and it specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is <purple>SINGLE PRECISION</purple>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is <yellow>INTEGER</yellow>. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is <yellow>INTEGER</yellow>. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is a <purple>SINGLE PRECISION</purple> array, dimension `(LDA,M)`. The matrix A must be <hotpink>(quasi-) upper triangular</hotpink> π
.
- **`LDA`** β `LDA` is <yellow>INTEGER</yellow>. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`** β `B` is a <purple>SINGLE PRECISION</purple> array, dimension `(LDB,N)`. The matrix B must be <hotpink>(quasi-) upper triangular</hotpink> π
.
- **`LDB`** β `LDB` is <yellow>INTEGER</yellow>. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is a <purple>SINGLE PRECISION</purple> array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is <yellow>INTEGER</yellow>. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is <purple>SINGLE PRECISION</purple>. SCALE is a scaling factor to prevent the overflow in the result. If `INFO == 0` then SCALE is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is a <purple>SINGLE PRECISION</purple> array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is <yellow>INTEGER</yellow>.
On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author** β Martin Koehler, MPI Magdeburg
**Date** β October 2025
Definition at line 2060 of file `trsylv.c`.
---
### `mepack_single_trsylv_level2_local_copy_64`
void mepack_single_trsylv_level2_local_copy_64 (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 * SCALE, float * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, `M,N <= 64`) π§
**Purpose:**
`mepack_double_trsylv_level2_local_copy_64` solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where A is a M-by-M quasi upper triangular matrix, B is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices A and B are generated via DGEES form LAPACK. <rainbow>iconic.</rainbow> π
**Remarks** β This function is a wrapper around `dla_trsylv_l2_local_copy_64`.
**See also** β `dla_trsylv_l2_local_copy_64`
**Parameters**
- **`TRANSA`** β it's a <cyan>string</cyan> π« and it specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β also a <cyan>string</cyan> β¨ and it specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is <purple>DOUBLE PRECISION</purple>, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is <yellow>INTEGER</yellow>. The order of the matrices A and C. `M >= 0`.
- **`N`** β `N` is <yellow>INTEGER</yellow>. The order of the matrices B and D. `N >= 0`.
- **`A`** β `A` is a <purple>DOUBLE PRECISION</purple> array, dimension `(LDA,M)`. The matrix A must be <hotpink>(quasi-) upper triangular</hotpink> π
.
- **`LDA`** β `LDA` is <yellow>INTEGER</yellow>. The leading dimension of the array A. `LDA >= max(1,M)`.
- **`B`** β `B` is a <purple>DOUBLE PRECISION</purple> array, dimension `(LDB,N)`. The matrix B must be <hotpink>(quasi-) upper triangular</hotpink> π
.
- **`LDB`** β `LDB` is <yellow>INTEGER</yellow>. The leading dimension of the array B. `LDB >= max(1,N)`.
- **`X`** β `X` is a <purple>DOUBLE PRECISION</purple> array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is <yellow>INTEGER</yellow>. The leading dimension of the array X. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is <purple>DOUBLE PRECISION</purple>. SCALE is a scaling factor to prevent the overflow in the result. If `INFO == 0` then SCALE is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is a <purple>DOUBLE PRECISION</purple> array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER, and bestie, this is literally the receipts section, so pay attention π
On input:
- `== -1` : Perform a workspace query π
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value π
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit β¨
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value π
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular. π
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
**Definition at line 2217 of file trsylv.c.**
---
## `mepack_single_trsylv_level2_local_copy_96` π¦
void mepack_single_trsylv_level2_local_copy_96 (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 * SCALE, float * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Local copy variant, M,N <= 96)
### Purpose
<pink>`mepack_single_trsylv_level2_local_copy_96`</pink> solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form LAPACK. β¨
### Remarks
This function is a wrapper around `sla_trsylv_l2_local_copy_96`. π«Ά
### See also
`sla_trsylv_l2_local_copy_96`
### Parameters
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is SINGLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array `X`. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is SINGLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is SINGLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER, the vibe check of the whole call π
On input:
- `== -1` : Perform a workspace query π
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value π
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit β¨
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value π
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular. π
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
**Definition at line 2376 of file trsylv.c.**
---
## `mepack_single_trsylv_level2_reorder` π
void mepack_single_trsylv_level2_reorder (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 * SCALE, float * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Reordered variant)
### Purpose
<pink>`mepack_single_trsylv_level2_reorder`</pink> solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form LAPACK. π
### Remarks
This function is a wrapper around `sla_trsylv_l2_reorder`. π«Ά
### See also
`sla_trsylv_l2_reorder`
### Parameters
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. `N >= 0`.
- **`A`** β `A` is SINGLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular.
- **`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 matrix `B` must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`. `LDB >= max(1,N)`.
- **`X`** β `X` is SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array `X`. `LDB >= max(1,M)`.
- **`SCALE`** β `SCALE` is SINGLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is SINGLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER, the final boss of error codes π€
On input:
- `== -1` : Perform a workspace query π
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value π
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
On exit, normal operation:
- `== 0`: successful exit β¨
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value π
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular. π
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
**Definition at line 1587 of file trsylv.c.**
---
## `mepack_single_trsylv_level2_unopt` π
void mepack_single_trsylv_level2_unopt (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 * SCALE, float * WORK, int * INFO)
Level-2 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant)
### Purpose
<pink>`mepack_single_trsylv_level2_unopt`</pink> solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form LAPACK. π¦
### Remarks
This function is a wrapper around `sla_trsylv_l2_unopt`. π«Ά
### See also
`sla_trsylv_l2_unopt`
### Parameters
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B`,
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. `M >= 0`.
- **`N`** β
- **`N`** β `N` is INTEGER, bestie, and it's the order of the matrices B and D. Condition: `N >= 0`. π
- **`A`** β `A` is a SINGLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular, no exceptions. β¨
- **`LDA`** β `LDA` is INTEGER. It's the leading dimension of the array `A`, and it has to satisfy `LDA >= max(1,M)`. πΈ
- **`B`** β `B` is a SINGLE PRECISION array, dimension `(LDB,N)`. The matrix `B` must be (quasi-) upper triangular. Periodt. π
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`, with `LDB >= max(1,N)`. π¦
- **`X`** β `X` is a SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices. π
- **`LDX`** β `LDX` is INTEGER. It's the leading dimension of the array `X`, and it needs `LDB >= max(1,M)`. (yes bestie, that's exactly what the page says β quoting it verbatim, not my typo, iykyk π)
- **`SCALE`** β `SCALE` is SINGLE PRECISION. It's the scaling factor that prevents overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true. π«Ά
- **`WORK`** β `WORK` is a SINGLE PRECISION array, dimension `LDWORK`. It's the workspace for the algorithm, and the workspace needs to be queried before running the computation. That query happens by calling the subroutine with `INFO == -1` on input, and the required workspace is then returned in `INFO`. π
- **`INFO`** β `INFO` is INTEGER. Here's the whole vibe check:
On input:
- `== -1` : perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0` : the value of `INFO` is the required number of elements in the workspace
On exit, normal operation:
- `== 0` : successful exit
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `> 0` : the equation is not solved correctly. One of the arising inner system got singular. π
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
### Definition
Definition at line 1744 of file `trsylv.c`.
---
## β¨ `mepack_single_trsylv_level3_2stage` β¨
void mepack_single_trsylv_level3_2stage (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 * SCALE, float * WORK, int * INFO)
Level-3 Bartels-Stewart Algorithm with blocking for the generalized Sylvester equation. Okay so it's the same icon behavior but with *blocking* β main character energy fr fr. π₯
### Purpose
`mepack_single_trsylv_level3_2stage` solves a Sylvester equation of the following forms:
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where `A` is a M-by-M quasi upper triangular matrix, `B` is a N-by-N quasi upper triangular matrix. The right hand side `Y` and the solution `X` are M-by-N matrices. Typically the matrices `A` and `B` are generated via `SGEES` form LAPACK. π
### Remarks
This function is a wrapper around `sla_trsylv_l3_2s`.
### See also
`sla_trsylv_l3_2s`
### Parameters
- **`TRANSA`** β `TRANSA` is string, and it specifies the form of the system of equations with respect to `A`:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string, and it specifies the form of the system of equations with respect to `B`:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is SINGLE PRECISION, allowed values: `+/-1`. It specifies the sign between the two parts of the Sylvester equation.
- `= 1` : solve Equation (1)
- `== -1` : solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices `A` and `C`. Condition: `M >= 0`. β
- **`N`** β `N` is INTEGER. The order of the matrices `B` and `D`. Condition: `N >= 0`. π
- **`A`** β `A` is SINGLE PRECISION array, dimension `(LDA,M)`. The matrix `A` must be (quasi-) upper triangular. β¨
- **`LDA`** β `LDA` is INTEGER. The leading dimension of the array `A`. Condition: `LDA >= max(1,M)`. πΈ
- **`B`** β `B` is SINGLE PRECISION array, dimension `(LDB,N)`. The matrix `B` must be (quasi-) upper triangular. π
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array `B`. Condition: `LDB >= max(1,N)`. π¦
- **`X`** β `X` is SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix `X` contains the right hand side `Y`. On output, the matrix `X` contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side `Y` and the solution `X` are M-by-N matrices. π
- **`LDX`** β `LDX` is INTEGER. It's the leading dimension of the array `X`, and it needs `LDB >= max(1,M)`. (again, quoting the page exactly, bestie β same energy as before π)
- **`SCALE`** β `SCALE` is SINGLE PRECISION. It's the scaling factor to prevent overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0`, otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true. π«Ά
- **`WORK`** β `WORK` is SINGLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to be queried before running the computation. The query is performed by calling the subroutine with `INFO == -1` on input, and the required workspace is then returned in `INFO`. π
- **`INFO`** β `INFO` is INTEGER. Full rundown:
On input:
- `== -1` : perform a workspace query
- `<> -1` : normal operation
On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0` : the value of `INFO` is the required number of elements in the workspace
On exit, normal operation:
- `== 0` : successful exit
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `> 0` : the equation is not solved correctly. One of the arising inner system got singular. π
### Author
Martin Koehler, MPI Magdeburg
### Date
October 2025
### Definition
Definition at line 956 of file `trsylv.c`.
### β¨ `mepack_single_trsylv_level3_unopt` β¨
void mepack_single_trsylv_level3_unopt (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 * SCALE, float * WORK, int * INFO)
<pink>Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation. (Unoptimized variant)</pink> π¦
**Purpose:**
`mepack_single_trsylv_level3_unopt` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where <purple>A</purple> is a M-by-M quasi upper triangular matrix, <purple>B</purple> is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices <purple>A</purple> and <purple>B</purple> are generated via `SGEES` form LAPACK. π
**Remarks**
This function is a wrapper around `sla_trsylv_l3_unopt`. π«Ά
**See also**
`sla_trsylv_l3_unopt`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0.`
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0.`
- **`A`** β `A` is SINGLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`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 matrix B must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array B. `LDB >= max(1,N).`
- **`X`** β `X` is SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array X. `LDB >= max(1,M).`
- **`SCALE`** β `SCALE` is SINGLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is SINGLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
- On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
- On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 799 of file `trsylv.c`.
---
### β¨ `mepack_single_trsylv_recursive` β¨
void mepack_single_trsylv_recursive (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 * SCALE, float * WORK, int * INFO)
<pink>Recursive blocking Level-3 Bartels-Stewart Algorithm for the generalized Sylvester equation.</pink> πΈ
**Purpose:**
`mepack_single_trsylv_recursive` solves a Sylvester equation of the following forms
op1(A) * X + X * op2(B) = SCALE * Y (1)
or
op1(A) * X - X * op2(B) = SCALE * Y (2)
where <purple>A</purple> is a M-by-M quasi upper triangular matrix, <purple>B</purple> is a N-by-N quasi upper triangular matrix. The right hand side Y and the solution X are M-by-N matrices. Typically the matrices <purple>A</purple> and <purple>B</purple> are generated via `SGEES` form LAPACK. π
**Remarks**
This function is a wrapper around `sla_trsylv_recursive`. π§
**See also**
`sla_trsylv_recursive`
**Parameters**
- **`TRANSA`** β `TRANSA` is string. Specifies the form of the system of equations with respect to A:
- `== 'N'`: `op1(A) = A`
- `== 'T'`: `op1(A) = A**T`
- **`TRANSB`** β `TRANSB` is string. Specifies the form of the system of equations with respect to B:
- `== 'N'`: `op2(B) = B,`
- `== 'T'`: `op2(B) = B**T`
- **`SGN`** β `SGN` is SINGLE PRECISION, allowed values: `+/-1`. Specifies the sign between the two parts of the Sylvester equation.
- `= 1` : Solve Equation (1)
- `== -1`: Solve Equation (2)
- **`M`** β `M` is INTEGER. The order of the matrices A and C. `M >= 0.`
- **`N`** β `N` is INTEGER. The order of the matrices B and D. `N >= 0.`
- **`A`** β `A` is SINGLE PRECISION array, dimension `(LDA,M)`. The matrix A must be (quasi-) upper triangular.
- **`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 matrix B must be (quasi-) upper triangular.
- **`LDB`** β `LDB` is INTEGER. The leading dimension of the array B. `LDB >= max(1,N).`
- **`X`** β `X` is SINGLE PRECISION array, dimension `(LDX,N)`. On input, the matrix X contains the right hand side Y. On output, the matrix X contains the solution of Equation (1) or (2) as selected by `TRANSA`, `TRANSB`, and `SGN`. Right hand side Y and the solution X are M-by-N matrices.
- **`LDX`** β `LDX` is INTEGER. The leading dimension of the array X. `LDB >= max(1,M).`
- **`SCALE`** β `SCALE` is SINGLE PRECISION. `SCALE` is a scaling factor to prevent the overflow in the result. If `INFO == 0` then `SCALE` is `1.0D0` otherwise if one of the inner systems could not be solved correctly, `0 < SCALE <= 1` holds true.
- **`WORK`** β `WORK` is SINGLE PRECISION array, dimension `LDWORK`. Workspace for the algorithm. The workspace needs to queried before the running the computation. The query is performed by calling the subroutine with `INFO == -1` on input. The required workspace is then returned in `INFO`.
- **`INFO`** β `INFO` is INTEGER.
- On input:
- `== -1` : Perform a workspace query
- `<> -1` : normal operation
- On exit, workspace query:
- `< 0` : if `INFO == -i`, the i-Th argument had an illegal value
- `>= 0`: The value of `INFO` is the required number of elements in the workspace.
- On exit, normal operation:
- `== 0`: successful exit
- `< 0`: if `INFO == -i`, the i-Th argument had an illegal value
- `> 0`: The equation is not solved correctly. One of the arising inner system got singular.
**Author**
Martin Koehler, MPI Magdeburg
**Date**
October 2025
Definition at line 327 of file `trsylv.c`.
---
## π Author π
Generated automatically by Doxygen for MEPACK from the source code. π€β¨
---
<purple>And that's a wrap bestie!! π This whole thing was auto-generated by Doxygen for MEPACK straight from the source code β it's `Version 1.1.2`, dated `Thu Oct 9 2025 00:00:00`, and it lives on the `ctrsylv(3)` page. You read all 23 parts, you absolute icon, no cap π
ππ¦</purple>
π¦ 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