61 const std::vector<bool>& isDelay,
62 const std::vector<int>& cutoffs) {
63 const std::size_t M_sub = L.
rows();
64 const std::size_t K = L.
cols();
65 if (isDelay.size() != M_sub)
66 throw InputError(
"fes_compute_metrics: isDelay has the wrong length");
67 if (cutoffs.size() != K)
68 throw InputError(
"fes_compute_metrics: cutoffs and demands disagree on the class count");
72 std::vector<std::size_t> queueIdx, delayIdx;
73 for (std::size_t i = 0; i < M_sub; ++i) (isDelay[i] ? delayIdx : queueIdx).push_back(i);
74 const std::size_t M_queue = queueIdx.size();
77 std::vector<int> mi_queue;
78 for (std::size_t a = 0; a < M_queue; ++a) {
79 for (std::size_t k = 0; k < K; ++k) L_queue(a, k) = L(queueIdx[a], k);
80 mi_queue.push_back(mi.empty() ? 1 : mi[queueIdx[a]]);
83 for (std::size_t d : delayIdx)
84 for (std::size_t k = 0; k < K; ++k) Z(0, k) += L(d, k);
86 std::size_t tableSize = 1;
87 for (
int c : cutoffs) {
88 if (c < 0)
throw InputError(
"fes_compute_metrics: negative cutoff");
89 tableSize *=
static_cast<std::size_t
>(c + 1);
93 out.
QN.assign(tableSize,
Matrix<T>(M_sub, K, zero));
94 out.
UN.assign(tableSize,
Matrix<T>(M_sub, K, zero));
96 for (std::size_t idx = 0; idx < tableSize; ++idx) {
99 for (
int v : nvec) totalPop += v;
100 if (totalPop == 0)
continue;
102 Matrix<T> Q(M_sub, K, zero), U(M_sub, K, zero);
103 std::vector<T> XN(K, zero);
114 std::vector<int>(), mi_queue);
116 for (std::size_t a = 0; a < M_queue; ++a) {
117 const int srv = mi_queue.empty() || mi_queue[a] < 1 ? 1 : mi_queue[a];
118 for (std::size_t k = 0; k < K; ++k) {
119 if (a < r.
QN.rows() && k < r.
QN.cols()) Q(queueIdx[a], k) = r.
QN(a, k);
124 for (std::size_t k = 0; k < K; ++k)
125 if (nvec[k] > 0 && Z(0, k) > zero)
130 for (std::size_t d : delayIdx)
131 for (std::size_t k = 0; k < K; ++k) {
132 Q(d, k) = T(XN[k] * L(d, k));
FesConditionalMetrics< T > fes_compute_metrics(const Matrix< T > &L, const std::vector< int > &mi, const std::vector< bool > &isDelay, const std::vector< int > &cutoffs)
Per-station metrics of the ISOLATED subnetwork at every population state, the companion of fes_comput...
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.