![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Joint queue-length probability of a closed product-form network. More...
#include <cstddef>#include <vector>#include "line/api/pfqn/pfqn_ca.h"#include "line/api/pfqn/pfqn_jointmarg.h"#include "line/api/pfqn/pfqn_perm.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> | |
| T | line::pfqn::pfqn_joint (const Matrix< int > &n, const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const T &G) |
| Joint probability of a PER-CLASS occupancy matrix. | |
| template<class T> | |
| T | line::pfqn::pfqn_joint_total (const std::vector< int > &m, const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const T &G) |
| Joint probability of the per-station TOTAL queue lengths. | |
| template<class T> | |
| T | line::pfqn::pfqn_joint (const Matrix< int > &n, const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z) |
| Overload computing G with pfqn_ca first, matching the reference's default. | |
| template<class T> | |
| T | line::pfqn::pfqn_joint_total (const std::vector< int > &m, const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z) |
Joint queue-length probability of a closed product-form network.
Templated port of matlab/src/api/pfqn/pfqn_joint.m, whose single entry point dispatches on the SHAPE of its first argument; the two behaviours are split into two named functions here, since C++ can tell an (M) vector from an (M x R) matrix at the call site and a shape-dispatching overload would only hide the distinction.
PER-CLASS form, pfqn_joint. For a per-station, per-class occupancy n(i,r), the unnormalized weight is the product of the per-station multinomial terms and the delay term,
F(n) = prod_r Z_r^{n0_r} / n0_r! * prod_i [ (sum_r n_ir)! / prod_r n_ir!
with n0 = N - sum_i n(i,:) the jobs left at the delay, and the probability is F(n)/G(N).
TOTAL form, pfqn_joint_total. When only the per-station TOTALS m(i) are given, the per-class split is unknown and the weight is a PERMANENT: it sums the product-form weight over every assignment of the N_r class-r jobs to the m(i) slots of station i. The reference builds that permanent by expanding every station row m(i) times and every class column N_r times and calling perm(); this port calls pfqn_perm directly on the (sum m) x R matrix with column multiplicities N, which is the same quantity without materializing the expansion. The delay contributes its own 1/n0! as in the reference.
Arithmetic: EXACT-CAPABLE, both forms. The reference works in log space throughout (log/gammaln/exp) purely to keep the factorials in range; every quantity involved is a ratio of products of the inputs and of factorials, so it is formed directly here and the probability comes out as an exact rational. Note the cost of the total form: pfqn_perm is prod_r (N_r + 1) evaluations of a length-(sum m) product, so it is a small-model routine.
Definition in file pfqn_joint.h.