![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
BMAP/M/1 by the matrix-analytic (M/G/1-type) method. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <string>#include <vector>#include "line/api/mc/ctmc_solve.h"#include "line/api/mc/dtmc_solve.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/linalg.h"#include "line/util/lu.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::qsys::BmapM1Result< T > |
| Everything qsys_bmapm1 returns, mirroring the MATLAB result struct. More... | |
Namespaces | |
| namespace | line |
| namespace | line::qsys |
Functions | |
| template<class T> | |
| BmapM1Result< T > | line::qsys::qsys_bmapm1 (const std::vector< Matrix< T > > &D, const T &mu, const T &qParam, std::size_t maxLevelParam, unsigned maxIter, const T &tol, double tailTol) |
| BMAP/M/1 by the matrix-analytic (M/G/1-type) method. | |
| template<class T> | |
| BmapM1Result< T > | line::qsys::qsys_bmapm1 (const std::vector< Matrix< T > > &D, const T &mu) |
| The reference's defaults: adaptive truncation, 10000 iterations, tol 1e-12. | |
BMAP/M/1 by the matrix-analytic (M/G/1-type) method.
Port of matlab/src/api/qsys/qsys_bmapm1.m. What makes this function unusual, and what getMAMResult exists to expose, is that it returns the INTERMEDIATE OBJECTS rather than only the mean measures: the randomized blocks, the matrix G, the drift, the measured decay rate and the level probabilities. Mean values alone hide the objects the method is built on, so a matrix-analytic result cannot otherwise be checked against a published derivation.
THE RANDOMIZATION. The continuous-time chain is uniformized by q, chosen as max_i(-D0(i,i)) + mu unless supplied, into a discrete-time M/G/1-type chain with blocks A0 = (mu/q)I (a service completion, level down), A1 = (1/q)(D0 - mu I) + I (level unchanged), Bk = (1/q)D_k (level up by k) and the boundary local block B0 = (1/q)D0 + I, which differs from A1 because no service can complete at level zero. A q that does not dominate the outflow would give the randomized chain negative entries, and is refused by name rather than silently clamped.
THE DECAY RATE IS MEASURED, NOT DERIVED, and that is deliberate in the reference: it is read as the ratio pi_(n+1)/pi_n at a level where the mass is still numerically meaningful (half way up the usable range), rather than taken from a spectral convention that would have to pick a branch. That is also why this function needs NO eigen-decomposition and is therefore instantiable at Real, not double-only. Every returned quantity is a linear solve, a functional iteration or a ratio.
ARITHMETIC. Gated on num_traits<T>::has_transcendental because the G iteration and the level truncation both terminate on a tolerance. The algebra itself is rational.
Definition in file qsys_bmapm1.h.