LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
cache_prob_fpi.m
1%{ @file cache_prob_fpi.m
2 % @brief Computes cache hit probabilities using fixed-point iteration
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Computes cache hit probabilities using FPI method
9 %
10 % @details
11 % This function computes cache hit probability distribution using the
12 % fixed-point iteration (FPI) method.
13 %
14 % @par Syntax:
15 % @code
16 % prob = cache_prob_fpi(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_fpi(gamma,m)
33% FPI method
34[n,h]=size(gamma);
35xi = cache_xi_fp(gamma,m);
36prob = zeros(n,h);
37for i=1:n
38 prob(i,1) = 1/(1+gamma(i,:)*xi(:));
39 prob(i,2:(1+h)) = gamma(i,:)*xi(:) ./ (1+gamma(i,:)*xi(:));
40end
41end