LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
sylvester.h File Reference

The Sylvester equation A X + X B = C, and MATLAB's lyap(A,B,C). More...

#include <cstddef>
#include <vector>
#include "line/num/number.h"
#include "line/util/eig.h"
#include "line/util/error.h"
#include "line/util/linalg.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for sylvester.h:

Go to the source code of this file.

Classes

class  line::SylvesterFactor< T >
 The Kronecker operator of a FIXED (A,B) pair, factorized once. More...

Namespaces

namespace  line

Functions

template<class T>
Matrix< T > line::sylvester_solve (const Matrix< T > &A, const Matrix< T > &B, const Matrix< T > &C)
 Solve A X + X B = C for X.
template<class T>
Matrix< T > line::lyap_solve (const Matrix< T > &A, const Matrix< T > &B, const Matrix< T > &C)
 MATLAB lyap(A,B,C) solves A X + X B + C = 0, i.e.
Matrix< double > line::sylvester_schur (const Matrix< double > &A, const Matrix< double > &B, const Matrix< double > &C)
 A X + X B = C by Bartels-Stewart, at double.
Matrix< double > line::lyap_schur (const Matrix< double > &A, const Matrix< double > &B, const Matrix< double > &C)
 MATLAB lyap(A,B,C) at double via Bartels-Stewart: A X + X B + C = 0.

Detailed Description

The Sylvester equation A X + X B = C, and MATLAB's lyap(A,B,C).

Solved in the Kronecker form (I_m kron A + B^T kron I_n) vec(X) = vec(C) with vec column-major, so the whole thing is one LU solve of order n*m in T. That is the ONLY formulation available at every arithmetic the port offers: Bartels-Stewart needs a real Schur factorization, util/eig.h is deliberately double-only (eigenvalues of a rational matrix are algebraic, not rational), so a Schur-based solver would silently pin every caller to double. The cost is O((n m)^3) against Bartels-Stewart's O(n^3 + m^3); the callers in this port pass phase-space matrices whose order is the product of an arrival MMAP order and a total service-PH order, both small, and the whole point of the header is that Rational and Real<D> get an answer at all.

mfq_multiregime.h carries the identical Kronecker construction for Matrix<double>; it predates this header and stays where it is because it is used only from double-only code and moving it would churn two large files that no test covers at another arithmetic.

Definition in file sylvester.h.