![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
MAP to PH conversion for the age-of-information solvers. More...
#include <cstddef>#include <vector>#include "line/api/mam/map_moment.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::aoi::AoiPh< T > |
| The (alpha, T) PH pair produced by aoi_dist2ph. More... | |
Namespaces | |
| namespace | line |
| namespace | line::aoi |
Functions | |
| template<class T> | |
| AoiPh< T > | line::aoi::aoi_dist2ph (const Matrix< T > &D0, const Matrix< T > &D1) |
| Convert a MAP (D0, D1) into the PH pair (alpha, T). | |
| template<class T> | |
| AoiPh< T > | line::aoi::aoi_dist2ph (const mam::Map< T > &m) |
| Convenience overload taking the MAP as line::mam::Map. | |
MAP to PH conversion for the age-of-information solvers.
Templated port of matlab/src/api/aoi/aoi_dist2ph.m. The (D0, D1) pair of a MAP is turned into the (alpha, T) pair the aoi_* algorithms consume:
T = D0, the sub-generator, unchanged theta solves theta (D0 + D1) = 0, sum theta = 1 alpha = theta .* (D1 e) normalized, the phase distribution just after a completion, weighted by where completions actually occur
alpha is NOT map_pie. map_pie is theta D1 / (theta D1 e), the embedded arrival chain's stationary vector, which redistributes the mass through the columns of D1; the reference instead keeps the mass in the phase it left from, alpha_i proportional to theta_i (D1 e)_i. For a renewal MAP with D1 = d pi (rank one) the two coincide; for a general MAP they do not, and this port reproduces the reference rather than substituting map_pie.
ARITHMETIC. One linear solve, one normalization and sign checks, so this is exact at T = Rational and is instantiated there. MATLAB obtains theta from the overdetermined [Q'; e'] \ [0; 1], which its backslash resolves by QR; on a consistent system that is the exact solution, and the port reaches the same solution through the normal equations, which is a square solve the templated LU can carry exactly.
The generator repair of the reference is kept: when the rows of D0 + D1 do not sum to zero to within 1e-10, the diagonal is corrected so that they do. That test is a comparison against a constant and needs no transcendental function, so it carries over verbatim to the exact instantiation, where it is essentially never triggered.
Definition in file aoi_dist2ph.h.