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

Per-type sample mean of a trace. More...

#include <cstddef>
#include <vector>
#include "line/api/trace/trace_types.h"
#include "line/num/number.h"
#include "line/util/error.h"
Include dependency graph for mtrace_mean.h:

Go to the source code of this file.

Classes

struct  line::trace::MtraceMeanResult< T >
 Return value of mtrace_mean. More...

Namespaces

namespace  line
namespace  line::trace

Functions

template<class T>
MtraceMeanResult< T > line::trace::mtrace_mean (const std::vector< T > &Tv, long ntypes, const std::vector< int > &type)
 Per-type sample mean of a trace.

Detailed Description

Per-type sample mean of a trace.

Templated port of matlab/lib/kpctoolbox/trace/mtrace_mean.m, cross-checked against jar/src/main/java/jline/api/trace/Mtrace_mean.java (identical, including the 0-indexed type vector: type c ranges over 0..ntypes-1, unlike the m3a mtrace_* family which uses the values of unique(A)).

Both references return NaN for a type that never occurs. Rational arithmetic has no NaN, so the per-type counts are returned alongside the means and count[c] == 0 marks an undefined entry.

ARITHMETIC: a sum and one division per type, exact in Rational.

Definition in file mtrace_mean.h.