LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Toggle main menu visibility
Loading...
Searching...
No Matches
aoi_lst_erlang.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_AOI_LST_ERLANG_H
6
#define LINE_API_AOI_LST_ERLANG_H
7
8
/**
9
* @file
10
* @ingroup api_aoi
11
* Laplace-Stieltjes transform of an Erlang-k distribution.
12
*
13
* Templated port of matlab/src/api/aoi/aoi_lst_erlang.m, cross-checked against
14
* Aoi_lst.erlang in jar/src/main/java/jline/api/aoi/Aoi_lst.java (identical).
15
*
16
* H*(s) = (mu / (mu + s))^k, mean k/mu
17
*
18
* The exponent is an integer, so this stays a rational function of s and is
19
* exact in the field.
20
*/
21
22
#include "
line/api/aoi/aoi_types.h
"
23
#include "
line/num/number.h
"
24
#include "
line/util/error.h
"
25
26
namespace
line
{
27
namespace
aoi
{
28
29
/**
30
* @brief Laplace-Stieltjes transform of an Erlang-k distribution.
31
*
32
* @param k number of phases, >= 1
33
* @param mu per-phase rate, > 0
34
* @return s -> (mu/(mu+s))^k
35
*/
36
template
<
class
T>
37
Lst<T>
aoi_lst_erlang
(
unsigned
k,
const
T& mu) {
38
if
(k < 1)
throw
InputError
(
"aoi_lst_erlang: the shape k must be a positive integer"
);
39
detail::require_positive(mu,
"aoi_lst_erlang"
,
"the rate mu"
);
40
return
[k, mu](
const
T& s) {
return
num_pow_int
(T(mu / (mu + s)), k); };
41
}
42
43
}
// namespace aoi
44
}
// namespace line
45
46
#endif
// LINE_API_AOI_LST_ERLANG_H
aoi_types.h
Shared return types and arithmetic helpers for the templated Age of Information port.
line::InputError::InputError
InputError(const std::string &what)
Definition
error.h:39
error.h
The exception types the port throws.
line::aoi
Definition
aoi_dist2ph.h:53
line::aoi::Lst
std::function< T(const T &)> Lst
A Laplace-Stieltjes transform evaluated at real arguments.
Definition
aoi_types.h:41
line::aoi::aoi_lst_erlang
Lst< T > aoi_lst_erlang(unsigned k, const T &mu)
Laplace-Stieltjes transform of an Erlang-k distribution.
Definition
aoi_lst_erlang.h:37
line
Definition
aoi_dist2ph.h:52
line::num_pow_int
T num_pow_int(const T &base, unsigned e)
Integer power, valid in any field (no transcendental requirement).
Definition
number.h:192
number.h
Number-type abstraction for the templated API port.
include
line
api
aoi
aoi_lst_erlang.h
Generated by
1.18.0