LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
cache_prob_erec.m
1%{ @file cache_prob_erec.m
2 % @brief Computes cache hit probabilities using recursive method
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Computes cache hit probabilities recursively
9 %
10 % @details
11 % This function computes cache hit probability distribution using a
12 % recursive method based on normalizing constants.
13 %
14 % @par Syntax:
15 % @code
16 % prob = cache_prob_erec(gamma, m)
17 % @endcode
18 %
19 % @par Parameters:
20 % <table>
21 % <tr><th>Name<th>Description
22 % <tr><td>gamma<td>Item popularity probabilities
23 % <tr><td>m<td>Cache capacity vector
24 % </table>
25 %
26 % @par Returns:
27 % <table>
28 % <tr><th>Name<th>Description
29 % <tr><td>prob<td>Cache hit probability distribution
30 % </table>
31%}
32function prob = cache_prob_erec(gamma,m)
33[n,h]=size(gamma);
34E = cache_erec(gamma, m);
35for i=1:n
36 for j=1:h
37 Ei = cache_erec(gamma(setdiff(1:n,i),:),oner(m,j));
38 prob(i,1+j) = m(j) * gamma(i,j) * Ei / E;
39 end
40 prob(i,1) = abs(1 - sum(prob(i,2:end)));
41end
42end