![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Regression for Processor Sharing (RPS) demand estimator. More...
#include <cstddef>#include <vector>#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::infer |
Functions | |
| template<class T> | |
| std::vector< T > | line::infer::infer_rps (const std::vector< T > &rt, const std::vector< std::size_t > &cls, const Matrix< T > &ql, long V) |
| Regression for Processor Sharing (RPS) demand estimator. | |
Regression for Processor Sharing (RPS) demand estimator.
Templated port of matlab/src/api/infer/infer_rps.m. No JAR counterpart.
Mean value analysis of a PS station gives E[R_r] = E[D_r] E[Qbar_A]/V, with Qbar_A the total number of jobs seen on admission INCLUDING the arriving job and V the number of servers. The demand of each class is the non-negative least squares fit of its response times against Qbar_A/V.
MATLAB calls lsqnonneg, but the design matrix here has a SINGLE column, so the non-negative least squares problem has the closed form max(0, a.b / a.a): the unconstrained minimizer is the ordinary projection and the active-set method returns 0 exactly when it is negative. The port evaluates that closed form, so it needs no optimizer and reproduces lsqnonneg exactly rather than approximately.
MATLAB takes the class count from max(class); the port does the same, so a trailing class with no samples at all is simply not represented in the output, exactly as in MATLAB.
ARITHMETIC: two inner products, one division and one comparison against zero, so a finite field computation, exact in the exact instantiation. The response times are non-negative and Qbar_A >= 1, so the estimate can only hit the bound when every response time is zero.
Definition in file infer_rps.h.