LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Toggle main menu visibility
Loading...
Searching...
No Matches
fj_xmax_exp.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_FJ_XMAX_EXP_H
6
#define LINE_API_FJ_XMAX_EXP_H
7
8
/**
9
* @file
10
* @ingroup api_fj
11
* Expected maximum of K i.i.d. exponential service times.
12
*
13
* Templated port of matlab/src/api/fj/fj_xmax_exp.m, cross-checked against
14
* FJ_xmax.fj_xmax_exp in jar/src/main/java/jline/api/fj/FJ_xmax.java
15
* (identical).
16
*
17
* X_K^max = H_K / mu
18
*
19
* Exact in closed form and rational, so this is the oracle the rest of the
20
* xmax family is checked against: fj_xmax_2 at equal rates, fj_xmax_hyperexp
21
* at mu1 = mu2 and fj_xmax_erlang at k = 1 must all reproduce it exactly.
22
*/
23
24
#include "
line/api/fj/fj_harmonic.h
"
25
#include "
line/api/fj/fj_types.h
"
26
#include "
line/num/number.h
"
27
#include "
line/util/error.h
"
28
29
namespace
line
{
30
namespace
fj
{
31
32
/**
33
* @brief Expected maximum of K i.i.d. exponential service times.
34
*
35
* @param K number of branches, K >= 1
36
* @param mu branch service rate, mu > 0
37
* @return H_K / mu
38
*/
39
template
<
class
T>
40
T
fj_xmax_exp
(
unsigned
K,
const
T& mu) {
41
detail::require_positive_K(K,
"fj_xmax_exp"
);
42
if
(mu <=
num_traits<T>::from_int
(0))
throw
InputError
(
"fj_xmax_exp: the service rate mu must be positive"
);
43
return
fj_harmonic<T>
(K) / mu;
44
}
45
46
}
// namespace fj
47
}
// namespace line
48
49
#endif
// LINE_API_FJ_XMAX_EXP_H
line::InputError::InputError
InputError(const std::string &what)
Definition
error.h:39
error.h
The exception types the port throws.
fj_harmonic.h
Harmonic number H_K = sum_{k=1..K} 1/k.
fj_types.h
Shared return types and arithmetic helpers for the templated fork-join port.
line::fj
Definition
fj_amva.h:34
line::fj::fj_harmonic
T fj_harmonic(unsigned K)
Harmonic number H_K = sum_{k=1..K} 1/k.
Definition
fj_harmonic.h:37
line::fj::fj_xmax_exp
T fj_xmax_exp(unsigned K, const T &mu)
Expected maximum of K i.i.d.
Definition
fj_xmax_exp.h:40
line
Definition
aoi_dist2ph.h:52
number.h
Number-type abstraction for the templated API port.
line::num_traits
Definition
number.h:111
include
line
api
fj
fj_xmax_exp.h
Generated by
1.18.0