LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
fj_sm_tput.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_SM_TPUT_H
6#define LINE_API_FJ_SM_TPUT_H
7
8/**
9 * @file
10 * @ingroup api_fj
11 * Saturated (single-message) maximum throughput of a K-way fork-join system
12 * with exponential branch service.
13 *
14 * Templated port of matlab/src/api/fj/fj_sm_tput.m, cross-checked against
15 * jar/src/main/java/jline/api/fj/FJ_sm_tput.java (identical).
16 *
17 * lambda_max = mu / H_K = 1 / X_K^max
18 *
19 * Rational, hence exact in the field, and the exact reciprocal of fj_xmax_exp
20 * by construction.
21 */
22
25#include "line/num/number.h"
26#include "line/util/error.h"
27
28namespace line {
29namespace fj {
30
31/**
32 * @brief Saturated (single-message) maximum throughput of a K-way fork-join
33 * system with exponential branch service.
34 *
35 * @param K number of parallel branches, K >= 1
36 * @param mu per-branch service rate, mu > 0
37 * @return maximum sustainable arrival rate
38 */
39template <class T>
40T fj_sm_tput(unsigned K, const T& mu) {
41 detail::require_positive_K(K, "fj_sm_tput");
42 if (mu <= num_traits<T>::from_int(0)) throw InputError("fj_sm_tput: the service rate mu must be positive");
43 return mu / fj_harmonic<T>(K);
44}
45
46} // namespace fj
47} // namespace line
48
49#endif // LINE_API_FJ_SM_TPUT_H
InputError(const std::string &what)
Definition error.h:39
The exception types the port throws.
Harmonic number H_K = sum_{k=1..K} 1/k.
Shared return types and arithmetic helpers for the templated fork-join port.
T fj_sm_tput(unsigned K, const T &mu)
Saturated (single-message) maximum throughput of a K-way fork-join system with exponential branch ser...
Definition fj_sm_tput.h:40
T fj_harmonic(unsigned K)
Harmonic number H_K = sum_{k=1..K} 1/k.
Definition fj_harmonic.h:37
Number-type abstraction for the templated API port.