![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Three small MAP quantities the C++ tree had not carried: the factorial and joint moments, and the MMAP generator. 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/lu.h"#include "line/util/matrix.h"Go to the source code of this file.
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| template<class T> | |
| T | line::mam::map_factorial_moment (const Map< T > &m, std::size_t k) |
| k! | |
| template<class T> | |
| T | line::mam::map_joint_moment (const Map< T > &m, std::size_t k, std::size_t l) |
| k! | |
| template<class T> | |
| Matrix< T > | line::mam::mmap_infgen (const Matrix< T > &D0, const std::vector< Matrix< T > > &Dk) |
| The generator of an MMAP: D0 plus every marked arrival matrix. | |
| template<class T> | |
| void | line::mam::qbd_blocks_mapmap1 (const Matrix< T > &D0a, const Matrix< T > &D1a, const Matrix< T > &D0s, const Matrix< T > &D1s, Matrix< T > *B, Matrix< T > *L, Matrix< T > *F) |
| The QBD blocks of a MAP/MAP/1 queue: backward, local and forward. | |
Three small MAP quantities the C++ tree had not carried: the factorial and joint moments, and the MMAP generator.
Port of map_factorial_moment, map_joint_moment (from python/line_solver/api/mam/map_derivatives.py) and mmap_infgen (from mmap_ops.py). PYTHON-ONLY: no MATLAB or JAR twin.
ALL THREE REST ON ONE IDENTITY. The embedded chain of a MAP moves from one arrival to the next with kernel (-D0)^-1 D1, and the time spent doing so has, conditional on the phase, a phase-type law with generator D0. So
E[X^k] = k! pie (-D0)^-k e, E[X_n^k X_n+1^l] = k! l! pie (-D0)^-k P (-D0)^-l e, P = (-D0)^-1 D1,
with pie the EMBEDDED at-arrivals law and P the embedded TRANSITION KERNEL. The kernel is what separates the two intervals; dropping it entirely would give the product of two marginals, i.e. the independent case.
THE REFERENCE USES D1 WHERE THE KERNEL BELONGS, and that is a defect, not a convention. P = (-D0)^-1 D1 carries one more resolvent than D1 does, so the reference's joint moment is short by exactly one factor of the mean and is dimensionally wrong – a moment of two times must scale as time squared. A POISSON PROCESS SEES IT IMMEDIATELY: interarrivals are independent there, so E[X_n X_n+1] must be mean^2, and at rate 1.5 that is 0.4444 while the reference returns 0.6667, the mean itself. This port uses the kernel. Native Python needs the same correction; it is recorded rather than made here, because it changes a reference.
(-D0)^-1 IS APPLIED BY SOLVING, NOT BY INVERTING. The reference forms the inverse explicitly and falls back to a pseudo-inverse when D0 is singular; a singular D0 is a MAP whose phase process cannot leave some state, which is a malformed input rather than something to smooth over, so this port lets the factorization report it.
ARITHMETIC: field.
Definition in file map_moment_extra.h.