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

Bins a trace on a fixed time grid: the number of arrivals falling in each interval ((i-1)*scale, i*scale], and the bin index of each arrival. 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 trace_iat2bins.h:

Go to the source code of this file.

Classes

struct  line::trace::TraceBinsResult
 Return value of trace_iat2bins, mirroring [C, bC]. More...

Namespaces

namespace  line
namespace  line::trace

Functions

template<class T>
TraceBinsResult line::trace::trace_iat2bins (const std::vector< T > &S, const T &scale)
 Bins a trace on a fixed time grid: the number of arrivals falling in each interval ((i-1)*scale, i*scale], and the bin index of each arrival.

Detailed Description

Bins a trace on a fixed time grid: the number of arrivals falling in each interval ((i-1)*scale, i*scale], and the bin index of each arrival.

Templated port of matlab/lib/kpctoolbox/trace/trace_iat2bins.m, cross-checked against jar/src/main/java/jline/api/trace/Trace_var.java#trace_iat2bins (same algorithm; the JAR stops one bin earlier because its outer loop runs to bins while MATLAB runs to bins+1, so the JAR can drop the arrivals of the final, partially filled bin).

Unlike trace_iat2counts, the windows here are non-overlapping and anchored at the origin, so sum(C) is the number of non-censored arrivals.

ARITHMETIC: additions and comparisons plus one ceiling division for the bin count, exact in Rational.

Definition in file trace_iat2bins.h.