![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Classes | |
| struct | MmdpPair |
| The (Q, R) pair of an MMDP. More... | |
Functions | |
| template<class T> | |
| bool | mmdp_isfeasible (const Matrix< T > &Q, const Matrix< T > &R, double tol=1e-10) |
| True when (Q, R) is a valid MMDP. | |
| template<class T> | |
| std::vector< T > | mmdp_rates (const Matrix< T > &R) |
| The per-state rates, i.e. | |
| template<class T> | |
| T | mmdp_mean_rate (const Matrix< T > &Q, const Matrix< T > &R) |
| Stationary mean flow rate, pi diag(R). | |
| template<class T> | |
| T | mmdp_scv (const Matrix< T > &Q, const Matrix< T > &R) |
| SCV of the RATE under the stationary law: Var[r] / E[r]^2. | |
| template<class T> | |
| MmdpPair< T > | mmdp_from_map (const Matrix< T > &D0, const Matrix< T > &D1) |
| The MMDP of a MAP: Q = D0 + D1, R = diag(row sums of D1). | |
| template<class T> | |
| MmdpPair< T > | mmdp2 (const T &r0, const T &r1, const T &sigma0, const T &sigma1) |
| The two-state MMDP, in the reference's own parameterization. | |
| template<class T> | |
| T | mmdp2_mean_rate (const T &r0, const T &r1, const T &sigma0, const T &sigma1) |
| The closed-form mean rate of a two-state MMDP. | |
| template<class T> | |
| T | mmdp2_scv (const T &r0, const T &r1, const T &sigma0, const T &sigma1) |
| The closed-form SCV of a two-state MMDP. | |
| MmdpPair< T > line::mmdp::mmdp2 | ( | const T & | r0, |
| const T & | r1, | ||
| const T & | sigma0, | ||
| const T & | sigma1 ) |
The two-state MMDP, in the reference's own parameterization.
sigma0 is the rate out of state 0 and sigma1 the rate out of state 1, so the generator is [[-s0, s0], [s1, -s1]] and the stationary law is (s1, s0)/(s0+s1) – the chain spends LONGER in the state it leaves more slowly, which is why the weights look swapped.
Definition at line 170 of file mmdp.h.
References line::InputError::InputError(), line::Matrix< T >::Matrix(), mmdp2(), line::mmdp::MmdpPair< T >::Q, and line::mmdp::MmdpPair< T >::R.
Referenced by mmdp2().
| T line::mmdp::mmdp2_mean_rate | ( | const T & | r0, |
| const T & | r1, | ||
| const T & | sigma0, | ||
| const T & | sigma1 ) |
The closed-form mean rate of a two-state MMDP.
Definition at line 188 of file mmdp.h.
References mmdp2_mean_rate().
Referenced by mmdp2_mean_rate().
| T line::mmdp::mmdp2_scv | ( | const T & | r0, |
| const T & | r1, | ||
| const T & | sigma0, | ||
| const T & | sigma1 ) |
The closed-form SCV of a two-state MMDP.
Definition at line 194 of file mmdp.h.
References mmdp2_scv().
Referenced by mmdp2_scv().
| MmdpPair< T > line::mmdp::mmdp_from_map | ( | const Matrix< T > & | D0, |
| const Matrix< T > & | D1 ) |
The MMDP of a MAP: Q = D0 + D1, R = diag(row sums of D1).
The row sum of D1 is the total ARRIVAL rate out of a phase, so the fluid analogue flows at exactly the rate at which that phase would be generating arrivals. The MAP's phase process is unchanged, which is why Q is its full generator.
Definition at line 143 of file mmdp.h.
References line::Matrix< T >::cols(), line::InputError::InputError(), line::Matrix< T >::Matrix(), mmdp_from_map(), line::mmdp::MmdpPair< T >::Q, line::mmdp::MmdpPair< T >::R, and line::Matrix< T >::rows().
Referenced by mmdp_from_map().
| bool line::mmdp::mmdp_isfeasible | ( | const Matrix< T > & | Q, |
| const Matrix< T > & | R, | ||
| double | tol = 1e-10 ) |
True when (Q, R) is a valid MMDP.
Q must be a generator – square, non-positive diagonal, non-negative off-diagonal, rows summing to zero – and R must be DIAGONAL with non-negative entries. The diagonality is not a storage convention: a non-diagonal R would make the flow rate depend on a transition rather than on the state, which is a different process.
Definition at line 58 of file mmdp.h.
References line::Matrix< T >::cols(), mmdp_isfeasible(), and line::Matrix< T >::rows().
Referenced by mmdp_isfeasible().
Stationary mean flow rate, pi diag(R).
Definition at line 88 of file mmdp.h.
References line::Matrix< T >::cols(), line::mc::ctmc_solve(), line::InputError::InputError(), mmdp_mean_rate(), and line::Matrix< T >::rows().
Referenced by mmdp_mean_rate().
| std::vector< T > line::mmdp::mmdp_rates | ( | const Matrix< T > & | R | ) |
The per-state rates, i.e.
the diagonal of R.
Definition at line 80 of file mmdp.h.
References mmdp_rates(), and line::Matrix< T >::rows().
Referenced by mmdp_rates().
SCV of the RATE under the stationary law: Var[r] / E[r]^2.
A one-state process has no variability and returns zero. A mean rate of zero leaves the ratio undefined, and the reference returns infinity rather than dividing – that is a signal the caller can test, where a NaN is not.
Definition at line 109 of file mmdp.h.
References line::Matrix< T >::cols(), line::mc::ctmc_solve(), line::InputError::InputError(), mmdp_scv(), and line::Matrix< T >::rows().
Referenced by mmdp_scv().