LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
pfqn_divdiff_ld.h File Reference

Exact load-dependent normalizing constant by divided differences of a single-class constant. More...

#include <cmath>
#include <cstddef>
#include <limits>
#include <vector>
#include "line/api/pfqn/pfqn_asympt_common.h"
#include "line/api/pfqn/pfqn_explicit.h"
#include "line/api/pfqn/pfqn_gldsingle.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
#include "line/util/population.h"
Include dependency graph for pfqn_divdiff_ld.h:

Go to the source code of this file.

Classes

struct  line::pfqn::DivdiffLdResult< T >
 Return value of pfqn_divdiff_ld, mirroring [lG, G, lossDigits]. More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::pfqn

Functions

template<class T>
DivdiffLdResult< T > line::pfqn::pfqn_divdiff_ld (const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const Matrix< T > &mu)
 Exact load-dependent normalizing constant by divided differences of a single-class constant.
template<class T>
DivdiffLdResult< T > line::pfqn::pfqn_divdiff_ld (const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z)
template<class T>
DivdiffLdResult< T > line::pfqn::pfqn_divdiff_ld (const Matrix< T > &L, const std::vector< int > &N)

Detailed Description

Exact load-dependent normalizing constant by divided differences of a single-class constant.

Templated port of matlab/src/api/pfqn/pfqn_divdiff_ld.m. Evaluates the multiclass load-dependent normalizing constant as the N-th order finite difference, in the class populations, of a SINGLE-CLASS load-dependent constant:

G(N) = sum_{0<=n<=N} (-1)^(|N|-|n|) / (N_1! ... N_R!)

  • prod_r nchoosek(N_r,n_r) * Gld_n(|N|)

where |N| = sum_r N_r, |n| = sum_r n_r and Gld_n(|N|) is the normalizing constant of the single-class model over the same M stations, with the same load-dependent rates alpha_i(.) = mu(i,.), total population |N| and aggregated demands rho_i(n) = sum_r n_r L(i,r). Since nchoosek(N_r,n_r)/N_r! = 1/(n_r! (N_r-n_r)!), the coefficient is evaluated in the equivalent factorial form, which needs no binomial.

The identity holds for arbitrary rate functions alpha_i(.), hence it covers load-independent, infinite-server, multiserver and limited load-dependent stations alike. Cost is prod_r (N_r+1) evaluations of pfqn_gldsingle.

NUMERICS. The sum alternates in sign and its terms are much larger than the result, so it is evaluated as a signed log-sum-exp, which removes the range problem but not the cancellation. The reference raises warnings past 15 decimal digits lost and when the sum comes out negative; warnings become outputs on this side: lossDigits is reported and a negative sum returns NaN exactly as MATLAB does, so the routine is gated on num_traits<T>::has_transcendental like pfqn_explicit_ld.

Definition in file pfqn_divdiff_ld.h.