62 const std::vector<bool>& isDelay,
63 const std::vector<int>& cutoffs) {
64 const std::size_t M_sub = L.
rows();
65 const std::size_t K = L.
cols();
66 if (isDelay.size() != M_sub)
67 throw InputError(
"fes_compute_throughputs: isDelay has the wrong length");
68 if (!mi.empty() && mi.size() != M_sub)
69 throw InputError(
"fes_compute_throughputs: mi has the wrong length");
70 if (cutoffs.size() != K)
71 throw InputError(
"fes_compute_throughputs: cutoffs and demands disagree on the class count");
77 std::vector<std::size_t> queueIdx, delayIdx;
78 for (std::size_t i = 0; i < M_sub; ++i) (isDelay[i] ? delayIdx : queueIdx).push_back(i);
79 const std::size_t M_queue = queueIdx.size();
82 std::vector<int> mi_queue;
83 for (std::size_t a = 0; a < M_queue; ++a) {
84 for (std::size_t k = 0; k < K; ++k) L_queue(a, k) = L(queueIdx[a], k);
85 mi_queue.push_back(mi.empty() ? 1 : mi[queueIdx[a]]);
88 for (std::size_t d : delayIdx)
89 for (std::size_t k = 0; k < K; ++k) Z(0, k) += L(d, k);
91 std::size_t tableSize = 1;
92 for (
int c : cutoffs) {
93 if (c < 0)
throw InputError(
"fes_compute_throughputs: negative cutoff");
94 tableSize *=
static_cast<std::size_t
>(c + 1);
96 std::vector<std::vector<T>> scalingTable(K, std::vector<T>(tableSize, zero));
98 std::vector<int> nvec(K, 0);
103 for (
int v : nvec) totalPop += v;
105 std::vector<T> XN(K, zero);
116 std::vector<int>(), mi_queue);
120 for (std::size_t k = 0; k < K; ++k)
121 if (nvec[k] > 0 && Z(0, k) > zero)
127 for (std::size_t k = 0; k < K; ++k)
128 scalingTable[k][idx - 1] = nvec[k] > 0 ? XN[k] : zero;
std::vector< std::vector< T > > fes_compute_throughputs(const Matrix< T > &L, const std::vector< int > &mi, const std::vector< bool > &isDelay, const std::vector< int > &cutoffs)
Per-class throughput table of an isolated subnetwork, tabulated over the population lattice,...
std::size_t ljd_linearize(const std::vector< int > &nvec, const std::vector< int > &cutoffs)
Linearized index of a per-class population vector, for Limited Joint Dependence (LJD) tables.
MvaResult< T > pfqn_mvams(const std::vector< T > &lambda, const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< int > &mi, const std::vector< int > &S)
General-purpose exact MVA for mixed networks with multiserver stations.
bool next_pop(std::vector< int > &n, const std::vector< int > &N)
Advance n to the next population vector in the lattice 0 <= n <= N, odometer order with the last clas...