![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Exact normalizing constant of a SINGLE-CLASS closed network whose stations are load dependent. More...
#include <cstddef>#include <vector>#include "line/api/pfqn/pfqn_ca.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Namespaces | |
| namespace | line |
| namespace | line::pfqn |
Functions | |
| template<class T> | |
| NcResult< T > | line::pfqn::pfqn_gldsingle (const Matrix< T > &L, int N, const Matrix< T > &mu) |
| Exact normalizing constant of a SINGLE-CLASS closed network whose stations are load dependent. | |
Exact normalizing constant of a SINGLE-CLASS closed network whose stations are load dependent.
Templated port of matlab/src/api/pfqn/pfqn_gldsingle.m.
The recursion carries a rate offset t alongside the station index m and the population n, so that the jobs already placed at station m shift its rate lattice without materializing a separate shifted matrix:
g(0, n, t) = 0 for n >= 1 g(m, 0, t) = 1 g(m, n, t) = g(m-1, n, 1) + L(m) g(m, n-1, t+1) / mu(m, t) G = g(M, N, 1)
This is the single-class specialization of pfqn_gld; the two agree to the last bit on every model both accept, and the specialization is kept because pfqn_ncld dispatches to it directly for R = 1 and because it costs O(M N^2) rather than going through the general convolution.
Arithmetic: EXACT-CAPABLE. MATLAB carries TWO implementations of the same recursion, a linear one and a log-space one selected by
useLog = isreal(L) && isreal(mu) && all(L>=0) && all(mu>0)
with a pairwise log-sum-exp replacing the addition. That branch is purely a range-management device for IEEE double – the comment in the reference says so explicitly, citing underflow of the delay term to realmin at N >= 190 – and the two branches compute the same mathematical quantity. This port keeps only the linear recursion, which is exact in any field: at T = Rational there is no underflow to manage, and at T = Real<D> the exponent range is wide enough that the models which drove the reference into log space stay in range. Callers that genuinely need the double path on such a model should raise the arithmetic rather than reintroduce the logs, since the log-sum-exp form cannot represent the negative intermediate rates that the reference's own useLog guard exists to fall back from.
An infinite rate is accepted the same way the reference accepts it: the term L/mu vanishes. In an exact field there is no infinity, so a caller expressing "this station cannot hold this many jobs" must pass a zero DEMAND instead.
Definition in file pfqn_gldsingle.h.