LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::retrieval Namespace Reference

Classes

struct  FpiOptions
 Options mirroring the trailing (max_iter, tol) arguments of the MATLAB function. More...
struct  RetrievalFpiLatencyResult
 Mirrors the [Z, d, phi, pi0] return list of the MATLAB function. More...
struct  RetrievalFpiResult
 Mirrors the [pmiss, phit, pdh] return list, plus the iteration diagnostics. More...
struct  RetrievalInputs
 The [m, lambda, gamma, eta, alpha/T (station), R] the retrieval algorithms read. More...
struct  RetrievalMetricsResult
 Mirrors the [pmiss, phit, pdh] return list of the MATLAB function. More...
struct  RetrievalMvaResult
 Mirrors the [pmiss, phit, pdh] return list of the MATLAB function. More...
struct  RetrievalRayintResult
 Outcome of the expansion. More...
struct  RetrievalStationPH
 Phase-type service of every item at one retrieval station. More...

Enumerations

enum class  RetrievalStationType {
  IS , PS , SIRO , FCFS ,
  LCFSPR
}
 Scheduling of a retrieval station, mirroring the MATLAB station_type strings. More...

Functions

template<class T>
RetrievalInputs< T > cache_retrieval_inputs (const qn::NetworkStruct< T > &sn, double lambda_override=-1.0)
 Extract the delayed-hit retrieval-algorithm inputs from a NetworkStruct, a port of matlab/src/api/retrieval/cache_retrieval_inputs.m.
template<class T>
RetrievalFpiResult< T > retrieval_fpi (const std::vector< int > &m, const std::vector< T > &lambda, const Matrix< T > &eta, const Matrix< T > &gamma, const FpiOptions &options=FpiOptions())
 Fixed-point heuristic for a delayed-hit (list-based) cache.
bool is_shared_station (RetrievalStationType t)
 True for the disciplines that carry the mean-field sharing slowdown.
template<class T>
RetrievalFpiLatencyResult< T > retrieval_fpi_latency (const std::vector< int > &m, const std::vector< T > &lambda, const Matrix< T > &gamma, const std::vector< RetrievalStationPH< T > > &station, const std::vector< Matrix< T > > &R, const FpiOptions &options=FpiOptions())
 FPI-based approximation of the delayed-hit count and the expected latency of a list-based cache with a phase-type retrieval system.
template<class T>
RetrievalMetricsResult< T > retrieval_metrics (const std::vector< int > &m, const std::vector< T > &lambda, const Matrix< T > &eta, const Matrix< T > &gamma)
 Exact miss, hit and delayed-hit metrics of a delayed-hit (list-based) cache.
template<class T>
RetrievalMvaResult< T > retrieval_mva (const std::vector< int > &m, const std::vector< T > &lambda, const Matrix< T > &eta, const Matrix< T > &gamma)
 Exact MVA-style recursion for delayed-hit (list-based) cache metrics.
template<class T>
retrieval_nc (const std::vector< int > &v, const std::vector< int > &m, const std::vector< T > &lambda, const Matrix< T > &eta, const Matrix< T > &gamma)
 Exact normalizing constant E(v,m) of a delayed-hit (list-based) cache.
template<class T>
RetrievalRayintResult< T > retrieval_rayint (const Matrix< T > &gamma, const std::vector< int > &m)
 Discrete (saddle) form.
template<class T>
RetrievalRayintResult< T > retrieval_rayint (const std::function< Matrix< T >(const std::vector< T > &)> &gfun, const std::vector< int > &m, int n, std::size_t nquad=4097)
 Continuum (ray-integral) form.

Enumeration Type Documentation

◆ RetrievalStationType

Scheduling of a retrieval station, mirroring the MATLAB station_type strings.

Enumerator
IS 
PS 
SIRO 
FCFS 
LCFSPR 

Definition at line 60 of file retrieval_fpi_latency.h.

Function Documentation

◆ cache_retrieval_inputs()

template<class T>
RetrievalInputs< T > line::retrieval::cache_retrieval_inputs ( const qn::NetworkStruct< T > & sn,
double lambda_override = -1.0 )

◆ is_shared_station()

bool line::retrieval::is_shared_station ( RetrievalStationType t)
inline

True for the disciplines that carry the mean-field sharing slowdown.

Definition at line 63 of file retrieval_fpi_latency.h.

References IS, and is_shared_station().

Referenced by is_shared_station(), and retrieval_fpi_latency().

◆ retrieval_fpi()

template<class T>
RetrievalFpiResult< T > line::retrieval::retrieval_fpi ( const std::vector< int > & m,
const std::vector< T > & lambda,
const Matrix< T > & eta,
const Matrix< T > & gamma,
const FpiOptions & options = FpiOptions() )

Fixed-point heuristic for a delayed-hit (list-based) cache.

Parameters
m(h) cache list capacities
lambda(n) per-item arrival rates
eta(n x (r+1)) fetching demands, column 0 = IS station, columns 1..r = PS
gamma(n x h) access factors
optionsfixed-point options (tolerance, iteration cap, damping)

Definition at line 97 of file retrieval_fpi.h.

References line::Matrix< T >::cols(), line::retrieval::RetrievalFpiResult< T >::converged, line::Matrix< T >::data(), line::retrieval::RetrievalFpiResult< T >::diverged, line::InputError::InputError(), line::retrieval::RetrievalFpiResult< T >::iterations, line::retrieval::RetrievalFpiResult< T >::pdh, line::retrieval::RetrievalFpiResult< T >::phit, line::retrieval::RetrievalFpiResult< T >::pmiss, retrieval_fpi(), line::Matrix< T >::rows(), and line::Matrix< T >::size().

Referenced by retrieval_fpi(), retrieval_fpi_latency(), and line::mva::solver_mva_retrieval_analyzer().

◆ retrieval_fpi_latency()

template<class T>
RetrievalFpiLatencyResult< T > line::retrieval::retrieval_fpi_latency ( const std::vector< int > & m,
const std::vector< T > & lambda,
const Matrix< T > & gamma,
const std::vector< RetrievalStationPH< T > > & station,
const std::vector< Matrix< T > > & R,
const FpiOptions & options = FpiOptions() )

FPI-based approximation of the delayed-hit count and the expected latency of a list-based cache with a phase-type retrieval system.

Parameters
m(h) cache list capacities
lambda(n) per-item arrival rates
gamma(n x h) access factors
station(S) phase-type service and discipline of each retrieval station
R(n) routing matrices, each (S+1) x (S+1), index 0 = outside
optionsfixed-point options (tolerance, iteration cap, damping)

Definition at line 121 of file retrieval_fpi_latency.h.

References line::Matrix< T >::cols(), line::retrieval::RetrievalFpiLatencyResult< T >::d, FCFS, line::InputError::InputError(), line::inverse(), IS, is_shared_station(), line::lu_factor(), line::lu_solve(), line::NumericError::NumericError(), line::retrieval::RetrievalFpiResult< T >::pdh, line::retrieval::RetrievalFpiLatencyResult< T >::phi, line::retrieval::RetrievalFpiLatencyResult< T >::pi0, line::retrieval::RetrievalFpiResult< T >::pmiss, retrieval_fpi(), retrieval_fpi_latency(), line::Matrix< T >::rows(), SIRO, line::Matrix< T >::size(), line::UnsupportedError::UnsupportedError(), and line::retrieval::RetrievalFpiLatencyResult< T >::Z.

Referenced by retrieval_fpi_latency(), and line::mva::solver_mva_retrieval_analyzer().

◆ retrieval_metrics()

template<class T>
RetrievalMetricsResult< T > line::retrieval::retrieval_metrics ( const std::vector< int > & m,
const std::vector< T > & lambda,
const Matrix< T > & eta,
const Matrix< T > & gamma )

Exact miss, hit and delayed-hit metrics of a delayed-hit (list-based) cache.

Parameters
m(h) cache list capacities
lambda(n) per-item arrival rates
eta(n x (r+1)) fetching demands, column 0 = IS station, columns 1..r = PS
gamma(n x h) access factors

Definition at line 79 of file retrieval_metrics.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), line::Matrix< T >::Matrix(), line::NumericError::NumericError(), line::retrieval::RetrievalMetricsResult< T >::pdh, line::retrieval::RetrievalMetricsResult< T >::phit, line::retrieval::RetrievalMetricsResult< T >::pmiss, retrieval_metrics(), retrieval_nc(), and line::Matrix< T >::rows().

Referenced by retrieval_metrics(), and line::nc::solver_nc_retrieval_analyzer().

◆ retrieval_mva()

template<class T>
RetrievalMvaResult< T > line::retrieval::retrieval_mva ( const std::vector< int > & m,
const std::vector< T > & lambda,
const Matrix< T > & eta,
const Matrix< T > & gamma )

Exact MVA-style recursion for delayed-hit (list-based) cache metrics.

Parameters
m(h) cache list capacities
lambda(n) per-item arrival rates
eta(n x (r+1)) fetching demands, column 0 = IS station, columns 1..r = PS
gamma(n x h) access factors

Definition at line 247 of file retrieval_mva.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), retrieval_mva(), line::Matrix< T >::rows(), and line::UnsupportedError::UnsupportedError().

Referenced by retrieval_mva().

◆ retrieval_nc()

template<class T>
T line::retrieval::retrieval_nc ( const std::vector< int > & v,
const std::vector< int > & m,
const std::vector< T > & lambda,
const Matrix< T > & eta,
const Matrix< T > & gamma )

Exact normalizing constant E(v,m) of a delayed-hit (list-based) cache.

Parameters
v(r) moment order at each PS station; all zeros for the plain constant
m(h) cache list capacities
lambda(n) per-item arrival rates
eta(n x (r+1)) fetching demands, column 0 = IS station, columns 1..r = PS
gamma(n x h) access factors
Returns
E(v,m)

Definition at line 108 of file retrieval_nc.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), retrieval_nc(), and line::Matrix< T >::rows().

Referenced by retrieval_metrics(), retrieval_nc(), and line::nc::solver_nc_retrieval_analyzer().

◆ retrieval_rayint() [1/2]

template<class T>
RetrievalRayintResult< T > line::retrieval::retrieval_rayint ( const Matrix< T > & gamma,
const std::vector< int > & m )

Discrete (saddle) form.

Parameters
gammaaccess factors gamma(k,j), n x h
mcache list capacities, length h

Definition at line 404 of file retrieval_rayint.h.

References line::InputError::InputError(), retrieval_rayint(), and line::Matrix< T >::rows().

Referenced by retrieval_rayint(), retrieval_rayint(), and line::nc::solver_nc_retrieval_analyzer().

◆ retrieval_rayint() [2/2]

template<class T>
RetrievalRayintResult< T > line::retrieval::retrieval_rayint ( const std::function< Matrix< T >(const std::vector< T > &)> & gfun,
const std::vector< int > & m,
int n,
std::size_t nquad = 4097 )

Continuum (ray-integral) form.

Parameters
gfunaccess-factor profile on v in [0,1], returning v.size() x h
mcache list capacities, length h
nnumber of items
nquadcomposite Simpson nodes (forced odd, at least 5)

Definition at line 423 of file retrieval_rayint.h.

References retrieval_rayint().