LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
pfqn_gldsingle.m
1%{
2%{
3 % @file pfqn_gldsingle.m
4 % @brief Exact normalizing constant for single-class load-dependent models.
5%}
6%}
7
8%{
9%{
10 % @brief Exact normalizing constant for single-class load-dependent models.
11 % @fn pfqn_gldsingle(L, N, mu, options)
12 % @param L Service demand vector (Mx1).
13 % @param N Population (scalar).
14 % @param mu Load-dependent rate matrix (MxN).
15 % @param options Solver options.
16 % @return lG Logarithm of normalizing constant.
17 % @return G Normalizing constant.
18%}
19%}
20function [lG,G]=pfqn_gldsingle(L,N,mu,options)
21% G=PFQN_GLDSINGLE(L,N,MU)
22
23if nargin<4
24 options = [];
25end
26
27[M,R]=size(L);
28if R>1
29 line_error(mfilename,'multiclass model detected. pfqn_gldsingle is for single class models.');
30end
31g = L(1,1)*0;
32for n=1:N
33 g(0 +1,n +1, 1 +1)=0;
34end
35for m=1:M
36 for tm=1:(N+1)
37 g(m +1,0 +1,tm +1)=1;
38 end
39 for n=1:N
40 for tm=1:(N-n+1)
41 g(m +1, n +1, tm +1)= g(m-1 +1, n +1, 1 +1)+L(m)*g(m +1, n-1 +1, tm+1 +1)/mu(m,tm);
42 end
43 end
44end
45G = g(M +1,N +1,1 +1);
46lG = log(G);
47end