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
31Nscal = N(1); % codegen: ensure scalar loop bound
32g = zeros(M+1, Nscal+1, Nscal+2);
33for n=1:Nscal
34 g(0 +1,n +1, 1 +1)=0;
35end
36for m=1:M
37 for tm=1:(Nscal+1)
38 g(m +1,0 +1,tm +1)=1;
39 end
40 for n=1:Nscal
41 for tm=1:(Nscal-n+1)
42 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);
43 end
44 end
45end
46G = g(M +1,Nscal +1,1 +1);
47lG = log(G);
48end