LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
mtrace_cross_moment.h File Reference

Class-pair cross moments of a marked trace: the k-th moment of the interval that separates an event of class i from the next event, of class j,. 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"
Include dependency graph for mtrace_cross_moment.h:

Go to the source code of this file.

Classes

struct  line::trace::MtraceCrossMomentResult< T >
 Return value of mtrace_cross_moment. More...

Namespaces

namespace  line
namespace  line::trace

Functions

template<class T>
MtraceCrossMomentResult< T > line::trace::mtrace_cross_moment (const std::vector< T > &Tv, const std::vector< int > &L, unsigned k)
 Class-pair cross moments of a marked trace: the k-th moment of the interval that separates an event of class i from the next event, of class j, MC(i,j) = mean{ T_t^k : A_{t-1} = i, A_t = j }.

Detailed Description

Class-pair cross moments of a marked trace: the k-th moment of the interval that separates an event of class i from the next event, of class j,.

MC(i,j) = mean{ T_t^k : A_{t-1} = i, A_t = j }.

Templated port of matlab/lib/m3a/m3a/mtrace/mtrace_cross_moment.m, cross-checked against jar/src/main/java/jline/api/trace/Mtrace_cross_moment.java. The two agree on every observed pair; they differ only in what they report for a pair that never occurs, where MATLAB returns 0/0 = NaN and the JAR sets NaN explicitly. Rational arithmetic has no NaN, so this port reports the observed counts alongside the moments and leaves the unobserved entries at zero: count(i,j) == 0 marks them.

ARITHMETIC: sums of integer powers and a division, exact in Rational.

Definition in file mtrace_cross_moment.h.