LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
snc_types.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2026, QORE Lab, Imperial College London
3 * All rights reserved.
4 */
5#ifndef LINE_API_SNC_TYPES_H
6#define LINE_API_SNC_TYPES_H
7
8/**
9 * @file
10 * @ingroup api_snc
11 * Shared types of the stochastic network calculus domain.
12 *
13 * An envelope is the pair `(sigma(theta), rho(theta))` in the exponential form
14 *
15 * E[exp(theta*A(s,t))] <= exp(theta*(rho*(t-s) + sigma)), theta > 0,
16 *
17 * and its service counterpart with the sign of theta reversed. The whole domain
18 * passes envelopes as FUNCTIONS of theta rather than as numbers, because every
19 * bound is an infimum over theta and a composition (superposition, leftover
20 * service, concatenation, departure) has to be re-evaluated at whatever theta
21 * the search asks for.
22 *
23 * ARITHMETIC. This domain is DOUBLE-ONLY, deliberately. Every entry point is an
24 * exp/log expression minimized numerically over theta, so there is no exact or
25 * multiprecision instantiation to offer: a Rational cannot carry `exp(theta)`
26 * and a Real would buy digits the Chernoff search does not have. The templated
27 * SolverBA arm converts at the boundary with `num_traits<T>::to_double` and
28 * `from_double`, exactly as `sylvester.h` does for the same reason.
29 *
30 * Port of matlab/src/api/snc, cross-checked against jline.api.snc.
31 *
32 * Reference: M. Fidler, A. Rizk, "A Guide to the Stochastic Network Calculus",
33 * IEEE Communications Surveys and Tutorials 17(1), 92-105, 2015.
34 */
35
36#include <functional>
37
38namespace line {
39namespace snc {
40
41/** The pair (sigma, rho) of an envelope evaluated at one theta. */
42struct Env {
43 double sigma = 0.0;
44 double rho = 0.0;
45};
46
47/** An envelope as a function of the Chernoff parameter. */
48using Envelope = std::function<Env(double)>;
49
50/** A bound together with the theta that attains it. */
51struct SncResult {
52 /** The bound: a violation probability, a quantile or a mean bound. */
53 double value = 0.0;
54 /** The minimizing theta, NaN when no feasible theta exists. */
55 double theta = 0.0;
56};
57
58} // namespace snc
59} // namespace line
60
61#endif // LINE_API_SNC_TYPES_H
std::function< Env(double)> Envelope
An envelope as a function of the Chernoff parameter.
Definition snc_types.h:48
The pair (sigma, rho) of an envelope evaluated at one theta.
Definition snc_types.h:42
A bound together with the theta that attains it.
Definition snc_types.h:51
double value
The bound: a violation probability, a quantile or a mean bound.
Definition snc_types.h:53
double theta
The minimizing theta, NaN when no feasible theta exists.
Definition snc_types.h:55