![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Per-class counting processes of a marked trace: for each arrival, how many events of each class fall in the window of length scale that starts at that arrival. More...
#include <cstddef>#include <vector>#include "line/api/trace/trace_types.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::trace::MtraceCountsResult< T > |
| Return value of mtrace_iat2counts. More... | |
Namespaces | |
| namespace | line |
| namespace | line::trace |
Functions | |
| template<class T> | |
| MtraceCountsResult< T > | line::trace::mtrace_iat2counts (const std::vector< T > &Tv, const std::vector< int > &A, const T &scale) |
| Per-class counting processes of a marked trace: for each arrival, how many events of each class fall in the window of length scale that starts at that arrival. | |
Per-class counting processes of a marked trace: for each arrival, how many events of each class fall in the window of length scale that starts at that arrival.
Templated port of the pure-MATLAB branch of matlab/lib/m3a/m3a/mtrace/mtrace_iat2counts.m (the function prefers a MEX implementation, mtrace_iat2counts_native, when it is compiled; the MATLAB fallback is the specification and is what is ported), cross-checked against jar/src/main/java/jline/api/trace/Mtrace_iat2counts.java.
DIVERGENCE, MATLAB vs JAR: the JAR compares CT[cur+1] against CT[i+1] where MATLAB compares CT(cur+1) against CT(i), so its window ends one arrival early; it also seeds the search with max(i, previousCur) instead of MATLAB's (i-1)+C(i-1). The seeds are only a speed-up (the scan is monotone, so any lower start converges to the same window), but the endpoint is not, and the JAR counts are systematically one arrival short. MATLAB is the reference.
Note also that MATLAB's own speed-up seed cur = (i-1) + C(i-1) uses LINEAR indexing into the count matrix, so it reads the class-1 count rather than the total; it is an underestimate of the previous window end and therefore harmless, but it makes the loop slower, not faster, on multi-class traces.
The series is truncated at the first window that reaches the end of the trace, because from there on the counts are censored.
ARITHMETIC: additions and comparisons, exact in Rational.
Definition in file mtrace_iat2counts.h.