LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
pfqn_mvams_closed.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_PFQN_PFQN_MVAMS_CLOSED_H
6#define LINE_API_PFQN_PFQN_MVAMS_CLOSED_H
7
8/**
9 * @file
10 * @ingroup api_pfqn
11 * Memory-bounded exact MVA for closed networks with multiserver stations.
12 *
13 * Templated port of matlab/src/api/pfqn/pfqn_mvams_closed.m (native Python
14 * twin: python/line_solver/api/pfqn/mvams_closed.py). Reiser (1981),
15 * "Mean-value analysis and convolution method for queue-dependent servers in
16 * closed queueing networks", Performance Evaluation 1, 7-18: the
17 * queue-dependent MVA of Sec. 4 restricted to limited queue-dependent servers
18 * (Sec. 6.4). A station with c servers keeps only its marginals p_i(j|n),
19 * j = 0..c-1, and
20 *
21 * W_ir(n) = D_ir/c (1 + Q_i(n-1_r) + sum_{j=0}^{c-2} (c-1-j) p_i(j|n-1_r))
22 * p_i(j|n) = (1/j) sum_r D_ir X_r(n) p_i(j-1|n-1_r), j = 1..c-1.
23 *
24 * p_i(0|n) is never obtained by the subtraction 1 - sum_j p_i(j|n) (Reiser eq.
25 * 24, which loses all accuracy at a bottleneck); it follows from the
26 * complement-system relation (Reiser eq. 27) in its multichain form
27 * p_i(0|n) = p_i(0|n-1_r) X_r(n) / X_r^[i](n), any r with n_r > 0. Every
28 * sub-network obtained by removing copies of multiserver stations is solved in
29 * the same sweep (the nested complement solution of Sec. 6.5), the lattice is
30 * swept by total population level and only two levels are kept.
31 *
32 * p_i(0|N) of a delay station (needed for UN), and of a single server when P0
33 * is requested, comes from the normalizing constant of its own complement
34 * network, G^[i](N)/G(N).
35 *
36 * ARITHMETIC. Every step of the recursion is a field operation, so the routine
37 * is exact-capable. The only non-field step in MATLAB is the log used to
38 * accumulate lG and the exp(lG^[i] - lG) of the complement ratio: a
39 * transcendental arithmetic follows MATLAB (log-domain accumulation, which
40 * cannot overflow), while the exact field accumulates G itself as the product
41 * of the reciprocal throughputs along the lattice path, as pfqn_mva.h does,
42 * and takes the complement ratio G^[i]/G exactly.
43 *
44 * CONVENTIONS. A server count of -1 (pfqn::INF_SERVERS in pfqn_mvams.h) is an
45 * infinite server, MATLAB's Inf. A class absent from a complement sub-network
46 * (no demand there, no think time) has an infinite throughput in MATLAB; the
47 * port carries that as a flag next to the value, since the exact field has no
48 * infinity, and reproduces every use MATLAB makes of it.
49 */
50
51#include <cmath>
52#include <cstddef>
53#include <string>
54#include <vector>
55
56#include "line/num/number.h"
57#include "line/util/error.h"
58#include "line/util/matrix.h"
59
60namespace line {
61namespace pfqn {
62
63/** Return value of pfqn_mvams_closed, mirroring [XN,QN,UN,CN,lG,P0]. */
64template <class T>
66 std::vector<T> XN; ///< (R) class throughputs
67 Matrix<T> QN; ///< (M x R) mean queue lengths, aggregated over copies
68 std::vector<T> UN; ///< (M) busy probability 1-p_i(0|N) of one copy
69 Matrix<T> CN; ///< (M x R) residence times, aggregated over copies
70 T G; ///< normalizing constant
71 double lG; ///< log of the normalizing constant
72 std::vector<T> P0; ///< (M) p_i(0|N), computed without subtraction
73};
74
75namespace detail {
76
77/** 0-based rank of population vector n within its level (MATLAB mvams_closed_rank). */
78inline std::size_t mvams_closed_rank(const int* n, std::size_t R,
79 const std::vector<std::vector<long> >& Cc) {
80 // Cc[q][x] = number of vectors over the first q classes with sum <= x.
81 std::size_t rk = 0;
82 long S = n[0];
83 for (std::size_t r = 1; r < R; ++r) {
84 const long Sprev = S;
85 S += n[r];
86 rk += static_cast<std::size_t>(Cc[r][static_cast<std::size_t>(S)] -
87 Cc[r][static_cast<std::size_t>(Sprev)]);
88 }
89 return rk;
90}
91
92/** A class with jobs, no think time and no demand at any present station. */
93template <class T>
94bool mvams_closed_degenerate(const Matrix<T>& L, const std::vector<int>& N, const std::vector<T>& Z,
95 const std::vector<T>& mult) {
96 const T zero = num_traits<T>::from_int(0);
97 const std::size_t M = L.rows(), R = N.size();
98 for (std::size_t r = 0; r < R; ++r) {
99 if (N[r] <= 0 || Z[r] > zero) continue;
100 T cload = zero;
101 for (std::size_t i = 0; i < M; ++i) cload += L(i, r) * mult[i];
102 if (!(cload > zero)) return true;
103 }
104 return false;
105}
106
107template <class T>
108struct MvamsClosedKernelOut {
109 MvamsClosedResult<T> res;
110 T lGt; ///< log G in T (transcendental arithmetics)
111 T Gp; ///< G as a product (the exact field)
112};
113
114template <class T>
115MvamsClosedKernelOut<T> mvams_closed_kernel(const Matrix<T>& L, const std::vector<int>& N,
116 const std::vector<T>& Z, const std::vector<T>& mi,
117 const std::vector<int>& S, bool wantP0) {
118 using std::exp;
119 using std::log;
120 const std::size_t M = L.rows(), R = N.size();
121 const T zero = num_traits<T>::from_int(0), one = num_traits<T>::from_int(1);
122 long Nt = 0;
123 for (int v : N) Nt += v;
124
125 MvamsClosedKernelOut<T> out;
126 MvamsClosedResult<T>& res = out.res;
127 res.XN.assign(R, zero);
128 res.QN = Matrix<T>(M, R, zero);
129 res.CN = Matrix<T>(M, R, zero);
130 res.UN.assign(M, zero);
131 res.P0.assign(M, one);
132 res.G = one;
133 res.lG = 0.0;
134 out.lGt = zero;
135 out.Gp = one;
136 if (Nt == 0) {
137 for (std::size_t r = 0; r < R; ++r)
138 for (std::size_t i = 0; i < M; ++i) res.CN(i, r) = L(i, r) * mi[i];
139 return out;
140 }
141
142 // station roles at this population
143 std::vector<bool> isdelay(M, false);
144 std::vector<std::size_t> ss, dl, ms;
145 std::vector<int> cms;
146 for (std::size_t i = 0; i < M; ++i) {
147 isdelay[i] = S[i] == -1 || (S[i] > 1 && static_cast<long>(S[i]) >= Nt);
148 if (isdelay[i])
149 dl.push_back(i);
150 else if (S[i] == 1)
151 ss.push_back(i);
152 else if (S[i] > 1 && mi[i] > zero) {
153 ms.push_back(i);
154 cms.push_back(S[i]);
155 }
156 }
157 const std::size_t K = ms.size();
158
159 // sub-networks in mixed radix over the copies kept of each multiserver
160 std::vector<std::size_t> radix(K), stride(K, 1);
161 for (std::size_t k = 0; k < K; ++k)
162 radix[k] = static_cast<std::size_t>(std::llround(num_traits<T>::to_double(mi[ms[k]]))) + 1;
163 for (std::size_t k = 1; k < K; ++k) stride[k] = stride[k - 1] * radix[k - 1];
164 std::size_t NB = 1;
165 for (std::size_t k = 0; k < K; ++k) NB *= radix[k];
166 std::vector<std::vector<std::size_t> > copies(NB, std::vector<std::size_t>(K, 0));
167 for (std::size_t b = 0; b < NB; ++b) {
168 std::size_t rr = b;
169 for (std::size_t k = 0; k < K; ++k) {
170 copies[b][k] = rr % radix[k];
171 rr /= radix[k];
172 }
173 }
174 const std::size_t btop = NB - 1;
175
176 if (mvams_closed_degenerate(L, N, Z, mi))
177 throw InputError(ErrorKind{"Argument"},
178 "pfqn_mvams_closed: a class with jobs has neither think time nor demand at any station");
179
180 // cnt[q][s]: population vectors over the first q classes with sum s; Cc its prefix sum
181 const std::size_t NtS = static_cast<std::size_t>(Nt);
182 std::vector<std::vector<long> > cnt(R + 1, std::vector<long>(NtS + 1, 0));
183 cnt[0][0] = 1;
184 for (std::size_t r = 0; r < R; ++r)
185 for (std::size_t s = 0; s <= NtS; ++s) {
186 const long lo = static_cast<long>(s) - N[r] > 0 ? static_cast<long>(s) - N[r] : 0;
187 long acc = 0;
188 for (long u = lo; u <= static_cast<long>(s); ++u) acc += cnt[r][static_cast<std::size_t>(u)];
189 cnt[r + 1][s] = acc;
190 }
191 std::vector<std::vector<long> > Cc(R + 1, std::vector<long>(NtS + 1, 0));
192 for (std::size_t q = 0; q <= R; ++q) {
193 long acc = 0;
194 for (std::size_t s = 0; s <= NtS; ++s) {
195 acc += cnt[q][s];
196 Cc[q][s] = acc;
197 }
198 }
199
200 // level 0
201 std::vector<int> Pprev(R, 0); // nPrev x R, row-major
202 std::size_t nPrev = 1;
203 std::vector<std::vector<T> > Qprev(NB, std::vector<T>(M, zero)); // nPrev x M
204 std::vector<std::vector<std::vector<T> > > pprev(NB, std::vector<std::vector<T> >(K)); // nPrev x c
205 for (std::size_t b = 0; b < NB; ++b)
206 for (std::size_t k = 0; k < K; ++k)
207 if (copies[b][k] > 0) {
208 pprev[b][k].assign(static_cast<std::size_t>(cms[k]), zero);
209 pprev[b][k][0] = one;
210 }
211 std::vector<long> cumN(R, 0), offs(R, 0);
212 for (std::size_t r = 0; r < R; ++r) {
213 cumN[r] = (r == 0 ? 0 : cumN[r - 1]) + N[r];
214 offs[r] = (r == 0 ? 0 : cumN[r - 1]);
215 }
216 Matrix<T> Wtop(M, R, zero);
217 std::vector<std::vector<T> > Xlev(NB);
218 std::vector<std::vector<char> > Xinf(NB);
219
220 for (long lev = 1; lev <= Nt; ++lev) {
221 const std::size_t nL = static_cast<std::size_t>(cnt[R][static_cast<std::size_t>(lev)]);
222 std::vector<int> P(nL * R, 0);
223 std::vector<int> cand(R);
224 for (std::size_t row = 0; row < nPrev; ++row)
225 for (std::size_t r = 0; r < R; ++r) {
226 if (Pprev[row * R + r] >= N[r]) continue;
227 for (std::size_t c = 0; c < R; ++c) cand[c] = Pprev[row * R + c];
228 cand[r] += 1;
229 const std::size_t rk = mvams_closed_rank(cand.data(), R, Cc);
230 for (std::size_t c = 0; c < R; ++c) P[rk * R + c] = cand[c];
231 }
232 // row of n-1_r in the previous level; npos when n_r = 0
233 const std::size_t npos = static_cast<std::size_t>(-1);
234 std::vector<std::size_t> idxPrev(nL * R, npos);
235 for (std::size_t row = 0; row < nL; ++row)
236 for (std::size_t r = 0; r < R; ++r) {
237 if (P[row * R + r] <= 0) continue;
238 for (std::size_t c = 0; c < R; ++c) cand[c] = P[row * R + c];
239 cand[r] -= 1;
240 idxPrev[row * R + r] = mvams_closed_rank(cand.data(), R, Cc);
241 }
242
243 std::vector<std::vector<T> > Xcur(NB), Qcur(NB);
244 std::vector<std::vector<char> > XinfCur(NB);
245 std::vector<std::vector<std::vector<T> > > pcur(NB, std::vector<std::vector<T> >(K));
246 for (std::size_t b = 0; b < NB; ++b) {
247 std::vector<T> mult = mi;
248 for (std::size_t k = 0; k < K; ++k) mult[ms[k]] = num_traits<T>::from_int(static_cast<long>(copies[b][k]));
249 std::vector<bool> absent(M);
250 for (std::size_t i = 0; i < M; ++i) absent[i] = !(mult[i] > zero);
251 std::vector<T> X(nL * R, zero);
252 std::vector<char> Xi(nL * R, 0);
253 std::vector<T> Qn(nL * M, zero);
254 const std::vector<T>& Qp = Qprev[b];
255 const bool keepW = (b == btop) && (lev == Nt);
256 std::vector<T> W(M);
257 for (std::size_t r = 0; r < R; ++r) {
258 for (std::size_t row = 0; row < nL; ++row) {
259 if (P[row * R + r] <= 0) continue;
260 const std::size_t pr = idxPrev[row * R + r];
261 for (std::size_t i = 0; i < M; ++i) W[i] = zero;
262 for (std::size_t i : ss) W[i] = T(L(i, r) * T(one + Qp[pr * M + i]));
263 for (std::size_t i : dl) W[i] = L(i, r);
264 for (std::size_t k = 0; k < K; ++k) {
265 if (copies[b][k] == 0) continue;
266 const std::size_t m = ms[k];
267 const int c = cms[k];
268 const std::vector<T>& pp = pprev[b][k];
269 T acc = T(one + Qp[pr * M + m]);
270 for (int j = 0; j <= c - 2; ++j)
271 acc += pp[pr * static_cast<std::size_t>(c) + static_cast<std::size_t>(j)] *
272 num_traits<T>::from_int(c - 1 - j);
273 W[m] = T(T(L(m, r) / num_traits<T>::from_int(c)) * acc);
274 }
275 for (std::size_t i = 0; i < M; ++i)
276 if (absent[i]) W[i] = zero;
277 T den = Z[r];
278 for (std::size_t i = 0; i < M; ++i) den += W[i] * mult[i];
279 if (den == zero) {
280 // a class with no demand in a complement sub-network: X = Inf
281 // there, and it contributes nothing to any queue
282 Xi[row * R + r] = 1;
283 } else {
284 const T xr = T(num_traits<T>::from_int(P[row * R + r]) / den);
285 X[row * R + r] = xr;
286 for (std::size_t i = 0; i < M; ++i)
287 if (!(W[i] == zero)) Qn[row * M + i] += xr * W[i];
288 }
289 if (keepW)
290 for (std::size_t i = 0; i < M; ++i) Wtop(i, r) = W[i];
291 }
292 }
293 for (std::size_t k = 0; k < K; ++k) {
294 if (copies[b][k] == 0) continue;
295 const std::size_t m = ms[k];
296 const std::size_t c = static_cast<std::size_t>(cms[k]);
297 const std::vector<T>& pp = pprev[b][k];
298 std::vector<T> pm(nL * c, zero);
299 for (std::size_t r = 0; r < R; ++r) {
300 if (!(L(m, r) > zero)) continue;
301 for (std::size_t row = 0; row < nL; ++row) {
302 if (P[row * R + r] <= 0) continue;
303 const std::size_t pr = idxPrev[row * R + r];
304 // L(m,r) > 0 at a present copy, so X is finite here
305 const T f = T(L(m, r) * X[row * R + r]);
306 for (std::size_t j = 1; j < c; ++j) pm[row * c + j] += f * pp[pr * c + j - 1];
307 }
308 }
309 for (std::size_t row = 0; row < nL; ++row)
310 for (std::size_t j = 1; j < c; ++j)
311 pm[row * c + j] = T(pm[row * c + j] / num_traits<T>::from_int(static_cast<long>(j)));
312 // complement-system relation (Reiser eq. 27), multichain form, along
313 // the class with the largest complement throughput, so that a class
314 // absent from the complement (X = Inf) gives p(0) = 0
315 const std::vector<T>& Xc = Xcur[b - stride[k]];
316 const std::vector<char>& Xci = XinfCur[b - stride[k]];
317 for (std::size_t row = 0; row < nL; ++row) {
318 std::size_t rs = R;
319 for (std::size_t r = 0; r < R; ++r) {
320 if (P[row * R + r] == 0) continue;
321 if (rs == R) { rs = r; continue; }
322 const bool curInf = Xci[row * R + rs] != 0, newInf = Xci[row * R + r] != 0;
323 if (curInf) continue; // first maximum kept, as MATLAB max
324 if (newInf || Xc[row * R + r] > Xc[row * R + rs]) rs = r;
325 }
326 T p0 = zero;
327 if (Xci[row * R + rs] == 0)
328 p0 = T(pp[idxPrev[row * R + rs] * c] * T(X[row * R + rs] / Xc[row * R + rs]));
329 pm[row * c] = p0;
330 }
331 pcur[b][k] = pm;
332 }
333 Xcur[b] = X;
334 XinfCur[b] = Xi;
335 Qcur[b] = Qn;
336 }
337
338 // log G along the path that fills class 1, then class 2, ..., as PFQN_MVALD
339 std::size_t q = 0;
340 while (q < R && cumN[q] < lev) ++q;
341 std::vector<int> pathpop(R);
342 for (std::size_t r = 0; r < R; ++r) {
343 const long v = lev - offs[r];
344 pathpop[r] = static_cast<int>(v < 0 ? 0 : (v > N[r] ? N[r] : v));
345 }
346 const std::size_t prow = mvams_closed_rank(pathpop.data(), R, Cc);
347 const T xq = Xcur[btop][prow * R + q];
348 if constexpr (num_traits<T>::has_transcendental) {
349 out.lGt -= log(xq);
350 } else {
351 out.Gp = T(out.Gp / xq);
352 }
353
354 Pprev = P;
355 nPrev = nL;
356 Qprev = Qcur;
357 pprev = pcur;
358 Xlev = Xcur;
359 Xinf = XinfCur;
360 }
361
362 for (std::size_t r = 0; r < R; ++r) res.XN[r] = Xlev[btop][r];
363 for (std::size_t r = 0; r < R; ++r) {
364 if (N[r] > 0) {
365 for (std::size_t i = 0; i < M; ++i) {
366 res.CN(i, r) = T(mi[i] * Wtop(i, r));
367 res.QN(i, r) = T(res.XN[r] * res.CN(i, r));
368 }
369 } else {
370 for (std::size_t i = 0; i < M; ++i) res.CN(i, r) = T(L(i, r) * mi[i]); // an absent class
371 }
372 }
373 if constexpr (num_traits<T>::has_transcendental) {
374 res.G = exp(out.lGt);
375 res.lG = num_traits<T>::to_double(out.lGt);
376 } else {
377 res.G = out.Gp;
378 res.lG = num_traits<T>::log_as_double(out.Gp);
379 }
380 // a single server is busy with the utilization of one copy
381 for (std::size_t i : ss) {
382 T u = zero;
383 for (std::size_t r = 0; r < R; ++r) u += L(i, r) * res.XN[r];
384 res.UN[i] = u;
385 }
386 for (std::size_t k = 0; k < K; ++k) {
387 const std::size_t m = ms[k];
388 res.P0[m] = pprev[btop][k][0];
389 res.UN[m] = T(one - res.P0[m]);
390 }
391 // p_i(0|N) from the complement network: delays always (UN), single servers
392 // only when P0 is requested
393 std::vector<std::size_t> need = dl;
394 if (wantP0) need.insert(need.end(), ss.begin(), ss.end());
395 for (std::size_t i : need) {
396 if (!(mi[i] > zero)) {
397 res.P0[i] = one;
398 res.UN[i] = zero;
399 continue;
400 }
401 if (!isdelay[i] && mi[i] < one) {
402 // a fraction of one single-server copy has no complement: its empty
403 // probability is 1 - U, the only quantity defined there
404 res.P0[i] = T(one - res.UN[i]);
405 continue;
406 }
407 std::vector<T> mic = mi;
408 mic[i] = T(mic[i] - one);
409 T p0 = zero;
410 if (!mvams_closed_degenerate(L, N, Z, mic)) {
411 const MvamsClosedKernelOut<T> c = mvams_closed_kernel(L, N, Z, mic, S, false);
412 if constexpr (num_traits<T>::has_transcendental) {
413 p0 = exp(T(c.lGt - out.lGt));
414 } else {
415 p0 = T(c.Gp / out.Gp);
416 }
417 }
418 res.P0[i] = p0;
419 if (isdelay[i]) res.UN[i] = T(one - p0);
420 }
421 for (std::size_t i = 0; i < M; ++i)
422 if (!(mi[i] > zero)) res.UN[i] = zero;
423 return out;
424}
425
426} // namespace detail
427
428/**
429 * @brief Memory-bounded exact MVA for closed networks with multiserver stations
430 * (Reiser 1981).
431 *
432 * @param L (M x R) service demands per copy
433 * @param N (R) closed population, non-negative
434 * @param Z (K x R) think times, summed over rows; empty for none
435 * @param mi (M) replication factors with the pfqn_mva meaning (station i is
436 * mi[i] identical copies; QN, CN aggregate over them), integer at
437 * any station with more than one server; empty for all ones
438 * @param S (M) servers per station, positive, -1 for an infinite server;
439 * empty for all ones
440 * @param wantP0 compute p_i(0|N) of the single-server stations too (MATLAB
441 * computes it only when the sixth output is requested)
442 */
443template <class T>
444MvamsClosedResult<T> pfqn_mvams_closed(const Matrix<T>& L, const std::vector<int>& N, const Matrix<T>& Z,
445 const std::vector<T>& mi, const std::vector<int>& S,
446 bool wantP0 = true) {
447 const std::size_t M = L.rows(), R = N.size();
448 const T zero = num_traits<T>::from_int(0), one = num_traits<T>::from_int(1);
449 if (M > 0 && L.cols() != R)
450 throw InputError(ErrorKind{"Argument"},
451 "pfqn_mvams_closed: demand matrix and population vector disagree on the class count");
452 for (int v : N)
453 if (v < 0)
454 throw InputError(ErrorKind{"Argument"},
455 "pfqn_mvams_closed: N must be a vector of non-negative integers.");
456 std::vector<T> Zs(R, zero);
457 if (!Z.empty()) {
458 if (Z.cols() != R)
459 throw InputError(ErrorKind{"Argument"}, "pfqn_mvams_closed: Z and N disagree on the class count");
460 for (std::size_t k = 0; k < Z.rows(); ++k)
461 for (std::size_t r = 0; r < R; ++r) Zs[r] += Z(k, r);
462 }
463 std::vector<T> miv = mi.empty() ? std::vector<T>(M, one) : mi;
464 std::vector<int> Sv = S.empty() ? std::vector<int>(M, 1) : S;
465 if (miv.size() != M)
466 throw InputError(ErrorKind{"Argument"}, "pfqn_mvams_closed: replication vector has the wrong length");
467 if (Sv.size() != M)
468 throw InputError(ErrorKind{"Argument"}, "pfqn_mvams_closed: server-count vector has the wrong length");
469 for (int s : Sv)
470 if (s < 1 && s != -1)
471 throw InputError(ErrorKind{"Argument"}, "pfqn_mvams_closed: S must hold positive integers or Inf.");
472 for (std::size_t i = 0; i < M; ++i) {
473 const bool multi = Sv[i] == -1 || Sv[i] > 1;
474 const double md = num_traits<T>::to_double(miv[i]);
475 if (miv[i] < zero || (multi && md != std::round(md)))
476 throw InputError(ErrorKind{"Argument"},
477 "pfqn_mvams_closed: Replication factors must be non-negative, and integer at "
478 "stations with more than one server.");
479 }
480 return detail::mvams_closed_kernel(L, N, Zs, miv, Sv, wantP0).res;
481}
482
483/** Overload with unit replication factors. */
484template <class T>
485MvamsClosedResult<T> pfqn_mvams_closed(const Matrix<T>& L, const std::vector<int>& N, const Matrix<T>& Z,
486 const std::vector<int>& S) {
487 return pfqn_mvams_closed(L, N, Z, std::vector<T>(), S, true);
488}
489
490} // namespace pfqn
491} // namespace line
492
493#endif // LINE_API_PFQN_PFQN_MVAMS_CLOSED_H
InputError(const std::string &what)
Definition error.h:105
std::size_t cols() const
Definition matrix.h:90
std::size_t rows() const
Definition matrix.h:89
bool empty() const
Definition matrix.h:92
The exception types the port throws.
Dense matrix and non-owning view.
MvamsClosedResult< T > pfqn_mvams_closed(const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< T > &mi, const std::vector< int > &S, bool wantP0=true)
Memory-bounded exact MVA for closed networks with multiserver stations (Reiser 1981).
Mat mult(const Mat &A, const Mat &B)
Definition spn_ispn.h:173
Conservation laws of a layered queueing network, enumerated from its structure.
Definition aoi_dist2ph.h:51
Number-type abstraction for the templated API port.
The <kind> part of a LINE:<category>:<kind> identifier (see _kb/17-error-vocabulary....
Definition error.h:37
Return value of pfqn_mvams_closed, mirroring [XN,QN,UN,CN,lG,P0].
std::vector< T > P0
(M) p_i(0|N), computed without subtraction
std::vector< T > UN
(M) busy probability 1-p_i(0|N) of one copy
std::vector< T > XN
(R) class throughputs
Matrix< T > CN
(M x R) residence times, aggregated over copies
double lG
log of the normalizing constant
Matrix< T > QN
(M x R) mean queue lengths, aggregated over copies