![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Concentrated matrix exponentials, and the two-moment fit built on them. More...
#include <algorithm>#include <cmath>#include <cstddef>#include <vector>#include "line/api/mam/iltcme_table.h"#include "line/api/mam/map_moment.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::CmeRepresentation< T > |
| The unit-mean (alpha, A) form of a CME, with the SCV it attains. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| std::vector< std::size_t > | line::mam::cme_supported_orders () |
| Every phase count 2n+1 the vendored table realizes, ascending. | |
| const iltcme::CmeEntry & | line::mam::cme_table_entry (std::size_t order) |
| The most concentrated table entry realizing order phases. | |
| double | line::mam::cme_min_scv (std::size_t order) |
| The minimal SCV a CME of this order attains. | |
| template<class T> | |
| CmeRepresentation< T > | line::mam::cme_representation (std::size_t order) |
| template<class T> | |
| Map< T > | line::mam::me_to_map (const std::vector< T > &alpha, const Matrix< T > &A) |
| Assemble the renewal (D0, D1) of a matrix-exponential law (alpha, A). | |
| template<class T> | |
| Map< T > | line::mam::dist_fit_me (double mean, double scv, std::size_t maxPhases=0) |
| Two-moment matrix-exponential fit for 0 < scv < 1, a port of dist_fit_me.m. | |
Concentrated matrix exponentials, and the two-moment fit built on them.
Templated port of matlab/src/lang/processes/CME.m and dist_fit_me.m (mirrored by jline.lang.processes.CME / MEFit and the native Python fit_me_mean_scv).
A CME of order 2n+1 is the matrix-exponential law whose squared coefficient of variation is numerically minimal for that order, from the tables of Horvath, Horvath and Telek. Its SCV decays as O(1/n^2), so it reaches far below the Erlang bound 1/order that binds any phase-type of the same order: at 101 phases a CME reaches 3.9e-4 where Erlang-101 stops at 9.9e-3. The unit-mean density with n harmonics is f(x) = mu1 e^{-mu1 x} ( c + sum_k a_k cos(k w mu1 x) + b_k sin(k w mu1 x) ), which is alpha exp(A x) (-A e) for the block-diagonal A = blkdiag( -mu1, mu1 [-1, -k w; k w, -1], k = 1..n ).
The coefficients come from the SAME vendored iltcme table the CME inverse Laplace transform reads (api/mam/iltcme_table.h), so the two share one source of truth; a TU using this header must link src/api/mam/iltcme_table.cpp.
IT IS NOT A PHASE-TYPE. The off-diagonal entries of A are not rates – the rotation blocks carry a negative one – so a CTMC assembled from a CME does not describe the model. sn_is_phasetype is the test every consumer applies, and sn_nonmarkov_toph tags the result ME rather than PH on the strength of it.
ARITHMETIC: transcendental. The two-moment fit takes a square root and the table itself is a double table, so this does not instantiate under Rational.
Definition in file cme.h.