![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Explicit inverse characterization of a second-order acyclic MAP (matlab/lib/kpctoolbox/map/map2_fit.m). More...
#include "line/api/mam/map_fit_detail.h"#include "line/api/mam/map_moment.h"#include "line/api/mam/map_transform.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::Map2FitResult< T > |
| Result of map2_fit: the MAP plus the reference's ERR code. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| template<class T> | |
| Map2FitResult< T > | line::mam::map2_fit (const T &e1, const T &e2, const T &e3_in, const T &g2) |
| Fit an AMAP(2) to (e1, e2, e3, g2); see the header comment for e3 sentinels. | |
| template<class T> | |
| Map2FitResult< T > | line::mam::map2_fit (const T &e1, const T &e2, const T &g2) |
| Three-argument form: map2_fit(e1, e2, g2), i.e. | |
Explicit inverse characterization of a second-order acyclic MAP (matlab/lib/kpctoolbox/map/map2_fit.m).
Implements A. Heindl, G. Horvath, K. Gross, "Explicit inverse characterization of acyclic MAPs of second order": given the first three moments e1, e2, e3 and the lag-1 autocorrelation parameter g2, the two canonical forms (hyperexponential for h2 > 0, hypoexponential for -1/4 <= h2 < 0) are written down directly from the normalized moments h2 = (r2 - r1^2)/r1^2, h3 = (r3 r1 - r2^2)/r1^4, r_k = e_k/k!.
e3 may be one of the reference's sentinel values, which pick a third moment from e1, e2 and g2 instead of matching one: e3 = -1 maximize the range of feasible correlations e3 = -2 minimum feasible e3 e3 = -3 maximum feasible e3 e3 in (-1, 0) interpolate between the two extremes with weight |e3| The reference's e3 = -4 draws that interpolation weight from MATLAB's global random stream; it is NOT ported, because it cannot be reproduced without that stream. Pass e3 = -r for the deterministic equivalent with weight r.
Gated on transcendental arithmetic: c = sqrt(b^2 + 4 h2^3) is taken in every branch, and the sentinel e3 selections take sqrt(-h2).
Divergence from the reference, deliberate: MATLAB's h2 == 0 branch builds the Poisson process for the case h3 == 0 and g2 == 0 but omits the return statement, so control falls through to the final else and the function returns an empty MAP with ERR = 30 – the fitted process is discarded. This port returns the Poisson process, which is what the branch clearly intends, and reports err = 0.
Definition in file map2_fit.h.