LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
map_transform.h File Reference

MAP constructors and structural transformations. More...

#include <cmath>
#include <cstddef>
#include <vector>
#include "line/api/mam/map_moment.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/linalg.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for map_transform.h:

Go to the source code of this file.

Classes

struct  line::mam::PhType< T >
 A phase-type representation (alpha, T) of a MAP's inter-arrival time. More...

Namespaces

namespace  line
namespace  line::mam

Functions

template<class T>
Map< T > line::mam::map_normalize (const Map< T > &in)
 Clamp negative off-diagonal entries of D0 and negative entries of D1 to zero, then rebuild the diagonal of D0 so that every row of D0 + D1 sums to zero (map_normalize.m).
template<class T>
Map< T > line::mam::map_scale (const Map< T > &in, const T &new_mean)
 Rescale time so that the mean inter-arrival time becomes new_mean.
template<class T>
Map< T > line::mam::map_scale_rate (const Map< T > &in, const T &new_mean)
 Rescale to a target mean WITHOUT the feasibility repair, for a matrix exponential.
template<class T>
Map< T > line::mam::map_exponential_mean (const T &mean)
 Poisson process with the given mean inter-arrival time (map_exponential.m).
template<class T>
Map< T > line::mam::map_erlang (const T &mean, unsigned k)
 Erlang-k renewal MAP with the given mean (map_erlang.m).
template<class T>
Map< T > line::mam::map_hyperexp (const T &mean, const T &scv, const T &p_in)
 Two-phase hyperexponential renewal MAP matching a mean and an SCV >= 1, with branching probability p (map_hyperexp.m, default p = 0.99).
template<class T>
Map< T > line::mam::map_hyperexp (const T &mean, const T &scv)
 map_hyperexp with the MATLAB default branching probability p = 0.99.
template<class T>
Map< T > line::mam::map_sum (const Map< T > &in, unsigned n)
 n-fold convolution of a MAP with itself: the inter-arrival time of the result is the sum of n consecutive inter-arrival times (map_sum.m).
template<class T>
Map< T > line::mam::map_sumind (const std::vector< Map< T > > &maps)
 Sum of independent, not necessarily identical MAPs: after each component completes, the next one restarts from its own stationary arrival phase distribution pie (map_sumind.m).
template<class T>
Map< T > line::mam::map_mixture (const std::vector< T > &alpha, const std::vector< Map< T > > &maps)
 Probabilistic mixture of MAPs with weights alpha: after an arrival from component i the process jumps to component j with probability alpha(j), entering at its stationary arrival phase (map_mixture.m).
template<class T>
Map< T > line::mam::map_renewal (const Map< T > &in)
 Renewal process with the same inter-arrival distribution: D1 is replaced by (D1 e) pie, which destroys the correlation but preserves every marginal moment (map_renewal.m).
template<class T>
PhType< T > line::mam::map2ph (const Map< T > &in)
 (alpha, T) of the inter-arrival distribution: alpha = pie, T = D0 (map2ph.m).
template<class T>
Map< T > line::mam::ph2map (const PhType< T > &ph)
 MAP whose inter-arrival time is the PH (alpha, T): the renewal MAP with D1 = (-T e) alpha.
template<class T>
Map< T > line::mam::map_stochcomp (const Map< T > &in, const std::vector< std::size_t > &retain)
 Stochastic complement of a MAP on the retained phases (map_stochcomp.m): the eliminated phases are censored out of the generator and of D1, giving a smaller MAP with the same behaviour observed on the retained phases.
template<class T>
line::mam::map_kurt (const Map< T > &m)
 Kurtosis of the inter-arrival time (map_kurt.m); rational in the entries.
template<class T>
line::mam::map_skew (const Map< T > &m)
 Skewness of the inter-arrival time (map_skew.m).
template<class T>
line::mam::map_joint (const Map< T > &m, const std::vector< unsigned > &a, const std::vector< unsigned > &i)
 Joint moment of K consecutive inter-arrival times observed at the cumulative lags a, with orders i (map_joint.m).
template<class T>
bool line::mam::map_isfeasible (const Map< T > &m, const T &tol)
 Structural feasibility of a MAP within a tolerance (map_isfeasible.m): off-diagonal D0 and all of D1 non-negative, diagonal of D0 non-positive, D0 + D1 a generator, and the embedded chain P = (-D0)^-1 D1 non-negative and stochastic.
template<class T>
bool line::mam::map_checkfeasible (const Map< T > &m, const T &tol)
 The reference's map_checkfeasible, i.e.
template<class T>
bool line::mam::map_isfeasible (const Map< T > &m)
 map_isfeasible(MAP) with no tolerance, which is NOT the zero-tolerance test.

Detailed Description

MAP constructors and structural transformations.

Templated port of the kpctoolbox MAP algebra that the QBD solvers consume (matlab/lib/kpctoolbox/map/map_normalize.m, map_scale.m, map_erlang.m, map_exponential.m, map_hyperexp.m, map_sum.m, map_sumind.m, map_mixture.m, map_renewal.m, map_stochcomp.m, map2ph.m, map_skew.m, map_kurt.m, map_joint.m, map_isfeasible.m).

Everything here except map_hyperexp and map_skew is a finite sequence of field operations on the entries of (D0, D1) – block assembly, a Kronecker product, one linear solve – so the exact instantiation carries the MAP identities (row sums of D0 + D1 vanish, the embedded chain is stochastic) with no residual at all. map_hyperexp needs a square root of the moment discriminant and map_skew a square root of the SCV, so both are gated on num_traits<T>::has_transcendental.

Naming note: map_exponential in map_moment.h is rate-parameterized, map_exponential(lambda), whereas the MATLAB map_exponential(MEAN) is mean-parameterized. map_exponential_mean below is the MATLAB spelling; the two differ by the reciprocal and are otherwise identical.

Definition in file map_transform.h.