![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Cache hit and miss probabilities from the fixed-point multipliers. More...
#include <cstddef>#include <vector>#include "line/api/cache/cache_xi_fp.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Namespaces | |
| namespace | line |
| namespace | line::cache |
Functions | |
| template<class T> | |
| Matrix< T > | line::cache::cache_prob_fpi (const Matrix< T > &gamma, const std::vector< int > &m) |
| Cache hit and miss probabilities from the fixed-point multipliers. | |
Cache hit and miss probabilities from the fixed-point multipliers.
Templated port of matlab/src/api/cache/cache_prob_fpi.m, cross-checked against jar/src/main/java/jline/api/cache/Cache_prob_fpi.java.
With S(i) = sum_l gamma(i,l) xi(l) from cache_xi_fp,
prob(i,1) = 1 / (1 + S(i)) (miss) prob(i,1+l) = S(i) / (1 + S(i)) (hit, as written by the references)
ARITHMETIC: transcendental, inherited from cache_xi_fp's tolerance-stopped iteration.
REFERENCE DEFECT (both codebases): the hit entry is the AGGREGATE hit probability S/(1+S), written identically into all h list columns, instead of the per-list gamma(i,l) xi(l)/(1+S(i)). MATLAB's prob(i,2:(1+h)) = gamma(i,:)*xi(:) ./ (1+gamma(i,:)*xi(:)) is a scalar broadcast over the row, and the JAR reproduces it with an explicit loop that stores the same mul.get(0) in every column. The consequence is that the row sums to 1 + (h-1) S/(1+S), not to 1, whenever h > 1; only h == 1 is correct. This port is faithful to the references – correcting it here would silently diverge from MATLAB and the JAR – and the conservation test in the suite is asserted only for h == 1 for exactly this reason.
Definition in file cache_prob_fpi.h.