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

Namespaces

namespace  iltcme

Classes

struct  Amap2AdjustGammaResult
 Result of amap2_adjust_gamma. More...
struct  Amap2FitGammaResult
 Result of amap2_fit_gamma. More...
struct  Aph2AdjustOptResult
 Result of an optimization-based APH(2) moment adjustment. More...
struct  Aph2AdjustResult
 Result of aph2_adjust. More...
struct  Aph2FitResult
 Result of aph2_fit. More...
struct  AphFitResult
 Result of aph_fit. More...
struct  AphPair
 A matrix-exponential law in (alpha, S) form: initial vector and subgenerator. More...
struct  BgchainCtmc
 The solved background modulating chain. More...
struct  BgchainEnv
 The environment one station sees: the background chain lumped onto its occupancy. More...
struct  BgchainStation
 What one modulated station QBD returns. More...
struct  BmapMap1Blocks
 The level blocks of solver_mam_bmap_map_1.m. More...
struct  BmapQueueResult
 What both reference files return once the ETAQA solve has run. More...
struct  CmeRepresentation
 The unit-mean (alpha, A) form of a CME, with the SCV it attains. More...
struct  CQbdFundMat
 G and R of a QBD whose local block is complex. More...
struct  Dmap
 A discrete-time MAP: substochastic D0 (no arrival) and D1 (one arrival). More...
struct  Dph
 A discrete phase-type law: initial row vector alpha and transient A. More...
struct  DtQueueResult
 Outcome of a slotted station solve. More...
struct  FjSyncMap
 sn_build_fj_sync_map: which incoming flows at a Join must be synchronized. More...
struct  FluidFundamental
 Psi, K and U of a fluid queue with drifts normalized to +-1. More...
struct  FluidPrioOptions
 Which measures to compute, and the numerical options. More...
struct  FluidPrioResult
 One entry per analyzed class, in the order given by FluidPrioOptions::classes. More...
struct  GeneralFluidSolution
 Stationary matrix-exponential solution of a general Markovian fluid model. More...
struct  GlobalConstants
 The MATLAB GlobalConstants, as reported by lineStart at its defaults. More...
struct  HyperexpLongtailResult
 Outcome of the long-tail hyperexponential fit. More...
struct  HyperParams
 Rates and branch probabilities of a hyperexponential given as a MAP. More...
struct  LdqbdAvg
 Per-(station,class) means read off an arbitrary distribution over the LD-QBD. More...
struct  LdqbdBlocks
 The LD-QBD blocks and parameters, the reference's optional eighth output. More...
struct  LdqbdFlat
 The flat generator of an LD-QBD, with the level each flat state belongs to. More...
struct  LdqbdMphcBlocks
 The three block lists of a level-dependent QBD, as ldqbd takes them. More...
struct  LdqbdPi
 Stationary distribution of a level-dependent QBD, per level and per phase. More...
struct  LdqbdResult
 R and the stationary distribution together (ldqbd.m). More...
struct  LdqbdSolution
 What the analyzer returns: the metrics plus the blocks it built them from. More...
struct  LevelDependentFluidBlocks
 The matrix-exponential building blocks of a multi-regime fluid queue, the output of mfq_ld_solve. More...
class  LibQbdProcess
 A QBD's level blocks, as libQBD's QBD class holds them. More...
struct  M3pp22FitcCovResult
 Result of the covariance-matching M3PP(2, 2) fits. More...
struct  M3pp22InterleaveResult
 Result of m3pp22_interleave_fitc. More...
struct  M3pp2mFitcApproxResult
 Result of the optimization-based M3PP(2, m) fits. More...
struct  M3pp2mFitcResult
 Result of m3pp2m_fitc. More...
struct  M3pp2mFitcTraceResult
 Result of m3pp2m_fitc_trace. More...
struct  M3ppSuperposResult
 Result of the superposition fits. More...
struct  Mamap22FitResult
 The fitted MAMAP(2,2), what it achieved, and whether the fit was exact. More...
struct  Mamap22FsFitResult
 The forward-plus-sigma result; warning carries the reference's diagnostic. More...
struct  Mamap2mCoefficients
 The three coefficient tables of one canonical form. More...
struct  Mamap2mFitResult
 The fitted MAMAP and the moments it achieved. More...
struct  MamFjInfo
 What fj_is_homogeneous.m returns: the fork-join pair, or why there is none. More...
struct  MamFjParams
 What fj_extract_params.m returns: one arrival and one service per class. More...
struct  MamOptions
 The options SolverMAM reads. More...
struct  MamRetrialConfig
 The knobs solver_mam_retrial.m reads from options.config and from model fields the C++ NetworkStruct does not carry. More...
struct  MamRetrialInfo
 What qsys_is_retrial.m returns: the station it found, or why it found none. More...
struct  MamSolution
 What the MAM dispatch returns: the metrics plus the algorithm that ran. More...
struct  Map
 A MAP as the pair of matrices (D0, D1). More...
struct  Map2FitIdcResult
 The fitted process and which of the reference's five outcomes produced it. More...
struct  Map2FitResult
 Result of map2_fit: the MAP plus the reference's ERR code. More...
struct  Map2mmppResult
 Result of map2mmpp. More...
struct  MapAnfitResult
 What map_anfit returns: the fitted MAP and the ladder it was built on. More...
struct  MapBmap1Blocks
 The level blocks of solver_mam_map_bmap_1.m. More...
struct  MapGammaResult
 Result of map_gamma, mirroring the MATLAB [GAMMA, RHO0] pair. More...
struct  Maph2mFitResult
 The fitted MAPH and the backward moments it actually achieved. More...
struct  MapM1psResult
 What the two MAP/M/1-PS sojourn entry points return. More...
struct  MapMap1Exact
 Result of the fast path; ok false means the model is not in its regime. More...
struct  MapOptimDist
 What an optimizing distance fit returns. More...
struct  MeRepresentation
 A matrix-exponential or phase-type representation (alpha, A). More...
class  MeSampler
 Stateful ME sampler holding the inversion table. More...
struct  Mmap
 An MMAP: the underlying MAP plus the per-class arrival matrices. More...
struct  MmapDecConfig
 The options.config fields the MMAP decomposition reads on top of MamOptions. More...
struct  MmapKFitResult
 A marked MAP and whether the marking system was solved exactly. More...
struct  MmckDetection
 What mam_detect_mmck returns; muRate is meaningful only when isMmck. More...
struct  Mmpp2FitcApproxResult
 Result of mmpp2_fitc_approx. More...
struct  Mmpp2FitcResult
 Result of mmpp2_fitc. More...
struct  Mmpp2FitResult
 Result of the (mean, scv, skew)-parameterized MMPP(2) fits. More...
struct  MnaConfig
 The options.config fields the two MNA analyzers read. More...
struct  MultiRegimeResult
 Return value of mfq_multiregime: one row of N per-state values per point. More...
struct  PhService
 One class's phase-type service law, He's (sigma_k, S_k). More...
struct  PhType
 A phase-type representation (alpha, T) of a MAP's inter-arrival time. More...
struct  ProbTable
 The joint (level, phase) table getProb returns: rows levels, cols phases. More...
struct  QbdBmapBmap1Blocks
 The level blocks assembled by qbd_bmapbmap1. More...
struct  QbdFundMat
 G and R together, as returned by qbd_fundmat. More...
struct  QbdMapMap1Blocks
 The four level blocks of the MAP/MAP/1 QBD. More...
struct  QbdMapMap1Result
 Result of qbd_mapmap1, mirroring the MATLAB return list. More...
struct  QbdRapRap1Result
 Everything qbd_raprap1 returns. More...
struct  QbdRapResult
 Everything qbd_rap returns. More...
struct  QbdRg
 R, G and the level blocks of a MAP/MAP/1 queue (qbd_rg.m). More...
struct  RespTCdf
 One class's response-time CDF, the reference's RD{station, class} = [F, X]. More...
struct  SampleTrace
 The state a sampled inter-arrival began and ended in. More...
struct  SetupDelayoffClosed
 Mean queue length and throughput of the CLOSED setup/delay-off queue. More...
struct  StDistrPh
 A phase-type law (alpha, A) as BUTools' 'stDistrPH' returns it. More...
struct  TaylorSeriesResult
 What the adaptive Taylor series returns: the reference grid and its laws. More...
struct  TrafficConfig
 The fields of options.config the traffic step reads. More...
struct  TranCurve
 One station-class transient curve, the reference's [metric, time] pair. More...
struct  TranResult
 What getTranAvg returns: queue length, utilization and throughput curves. More...
struct  TransientQbd
 The piecewise QBD blocks, 1-based exactly as the reference's cell arrays. More...

Typedefs

template<class T>
using DBatch = std::vector<Matrix<T>>
 A discrete batch arrival stream, entry k carrying the slots with k events.
using CMat = Matrix<Complex>
template<class T>
using DepTable = std::vector<std::vector<Map<T>>>
 DEP{i,r}, the departure process of class r from i in (D0,D1) form.

Enumerations

enum class  AphPattern { Sequence = 1 , Parallel = 2 , Branch = 3 , Loop = 4 }
 The pattern argument of aph_simplify.m, by name. More...
enum class  IltMethod { Cme , Euler , Gaver }
 Which Abate-Whitt weights to use. More...
enum class  FluidDistrKind { Pdf , Pdfd , Cdf , Cdfm }
 Which functional of the stationary level law to evaluate. More...
enum class  FluidBoundary { Reflective = 0 , Absorbing = 1 }
 Boundary behaviour of one background state at a reflecting level. More...
enum class  RiccatiMethod { ADDA , SDA }
 Which doubling iteration to run for Psi. More...
enum class  MmapCompressMethod {
  MixtureOrder1 , MixtureOrder2 , Mamap2 , Mamap2Fb ,
  M3ppApproxCov , M3ppApproxAg , M3ppExactDelta , M3ppApproxDelta
}
 The compression methods of mmap_compress.m. More...
enum class  ProcessType
 Distribution kinds, with the values of MATLAB ProcessType. More...
enum class  SchedStrategy
 Scheduling disciplines, with the values of MATLAB SchedStrategy. More...

Functions

template<class T>
bool amap2_gamma_feasible (const T &M1, const T &M2, const T &M3, const T &GAMMA, const T &slack)
 Is (M1, M2, M3, GAMMA) AMAP(2)-feasible?
template<class T>
Amap2AdjustGammaResult< T > amap2_adjust_gamma (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &weights, int method, int constraints, const T &tol)
 Nearest AMAP(2)-feasible characteristics.
template<class T>
Amap2AdjustGammaResult< T > amap2_adjust_gamma (const T &M1, const T &M2, const T &M3, const T &GAMMA)
 amap2_adjust_gamma with the reference defaults: weights (10,1,10), method 3, constraints 2.
template<class T>
Amap2AdjustGammaResult< T > amap2_adjust_gamma (const T &M1, const T &M2, const T &M3, const T &GAMMA, int method)
 amap2_adjust_gamma with a chosen method and the remaining reference defaults.
template<class T>
Map< T > amap2_assemble (const T &l1, const T &l2, const T &p1, const T &p2, int form)
 AMAP(2) in canonical form 1 (gamma >= 0) or 2 (gamma < 0).
template<class T>
Amap2FitGammaResult< T > amap2_fit_gamma (const T &M1, const T &M2, const T &M3, const T &GAMMA, const T &cvtol)
 Fit an AMAP(2) to (M1, M2, M3, GAMMA).
template<class T>
Amap2FitGammaResult< T > amap2_fit_gamma (const T &M1, const T &M2, const T &M3, const T &GAMMA)
 amap2_fit_gamma with the MATLAB default cvtol = 1e-6.
template<class T>
std::vector< Map< T > > amap2_fitall_gamma (const T &M1, const T &M2, const T &M3, const T &GAMMA, const T &degentol, const T &r12tol)
 Every AMAP(2) matching (M1, M2, M3, GAMMA).
template<class T>
std::vector< Map< T > > amap2_fitall_gamma (const T &M1, const T &M2, const T &M3, const T &GAMMA)
 amap2_fitall_gamma with the MATLAB defaults degentol = 1e-8, r12tol = 1e-6.
template<class T>
Aph2AdjustResult< T > aph2_adjust (const T &M1, const T &M2, const T &M3, const T &tol)
 Feasible (M2, M3) closest to the input, holding M1 fixed.
template<class T>
Aph2AdjustResult< T > aph2_adjust (const T &M1, const T &M2, const T &M3)
 aph2_adjust with the MATLAB default slack tol = 1e-4.
template<class T>
Aph2AdjustOptResult< T > aph2_adjust_opt_param (const T &M1, const T &M2, const T &M3, const T &feastol, const T &degentol)
 aph2_adjust, method 'opt_param': adjust (M2, M3) by searching the APH(2) parameter space with M1 matched exactly.
template<class T>
Aph2AdjustOptResult< T > aph2_adjust_opt_param (const T &M1, const T &M2, const T &M3)
 aph2_adjust_opt_param with the MATLAB defaults feastol = 1e-6, degentol = 1e-8.
template<class T>
Aph2AdjustOptResult< T > aph2_adjust_opt_char (const T &M1, const T &M2, const T &M3, const T &postol, const T &degen)
 aph2_adjust, method 'opt_char': adjust (M2, M3) by searching the moment space subject to APH(2) invertibility.
template<class T>
Aph2AdjustOptResult< T > aph2_adjust_opt_char (const T &M1, const T &M2, const T &M3)
 aph2_adjust_opt_char with the MATLAB default postol = 1e-6 and degen = 1e-10.
template<class T>
Map< T > aph2_assemble (const T &l1, const T &l2, const T &p1)
 APH(2) with phase means l1, l2 and continuation probability p1.
template<class T>
Aph2FitResult< T > aph2_fit (const T &M1, const T &M2, const T &M3)
 Fit an APH(2) to (M1, M2, M3), relaxing the moments if necessary.
template<class T>
std::vector< Map< T > > aph2_fitall (const T &M1, const T &M2, const T &M3, const T &degentol)
 All feasible APH(2) fits of (M1, M2, M3).
template<class T>
std::vector< Map< T > > aph2_fitall (const T &M1, const T &M2, const T &M3)
 aph2_fitall with the MATLAB default degentol = 1e-8.
template<class T>
AphPair< T > aph_convseq (const std::vector< AphPair< T > > &seq)
 Convolve the sequence, i.e.
template<class T>
AphFitResult< T > aph_fit (const T &e1, const T &e2, const T &e3, unsigned nmax, const T &tol)
 Fit an APH(n) with n <= nmax to the raw moments e1, e2, e3.
template<class T>
AphFitResult< T > aph_fit (const T &e1, const T &e2, const T &e3)
 aph_fit with the MATLAB defaults nmax = 10 and a 1e-12 degeneracy tolerance.
template<class T>
AphFitResult< T > aph_fit (const T &e1, const T &e2, const T &e3, unsigned nmax)
 aph_fit with an explicit order cap and the default degeneracy tolerance.
template<class T>
Map< T > aph_from_2moments (const T &e1, const T &e2)
 Port of BUTools' APHFrom2Moments.
template<class T>
Map< T > aph_fit_mean_scv (const T &mean, const T &scv)
 Port of APH.fitMeanAndSCV, the entry point the analyzers fit arrivals with.
template<class T>
AphPair< T > aph_simplify (const AphPair< T > &d1, const AphPair< T > &d2, const T &p1, const T &p2, AphPattern pattern)
 Compose two matrix-exponential laws, as aph_simplify.m does.
std::vector< std::size_t > cme_supported_orders ()
 Every phase count 2n+1 the vendored table realizes, ascending.
const iltcme::CmeEntrycme_table_entry (std::size_t order)
 The most concentrated table entry realizing order phases.
double cme_min_scv (std::size_t order)
 The minimal SCV a CME of this order attains.
template<class T>
CmeRepresentation< T > cme_representation (std::size_t order)
template<class T>
Map< T > me_to_map (const std::vector< T > &alpha, const Matrix< T > &A)
 Assemble the renewal (D0, D1) of a matrix-exponential law (alpha, A).
template<class T>
Map< T > dist_fit_me (double mean, double scv, std::size_t maxPhases=0)
 Two-moment matrix-exponential fit for 0 < scv < 1, a port of dist_fit_me.m.
template<class T>
std::vector< T > dmap_pie (const Dmap< T > &d)
 Stationary phase distribution at arrival epochs.
template<class T>
std::vector< T > dmap_moment (const Dmap< T > &d, const std::vector< unsigned > &orders)
 Raw moments of the interarrival time in slots, for orders 1, 2 and 3 only.
template<class T>
bool dmap_isfeasible (const Dmap< T > &d)
 True when D0 and D1 are nonnegative and D0 + D1 is stochastic.
template<class T>
dmap_exp_mul_int (const Dmap< T > &a, const Dmap< T > &b, unsigned L, const std::vector< T > &alA, const std::vector< T > &alB)
 Inner product of the two interarrival densities truncated at lag L.
template<class T>
dmap_exp_mul_int (const Dmap< T > &a, const Dmap< T > &b, unsigned L)
 Default stationary vectors, matching the three-argument MATLAB call.
template<class T>
dmap_dist (const Dmap< T > &a, const Dmap< T > &b, unsigned L, const std::vector< T > &alA, const std::vector< T > &alB)
 Squared L2 distance between the interarrival densities truncated at lag L.
template<class T>
dmap_dist (const Dmap< T > &a, const Dmap< T > &b, unsigned L)
 Default stationary vectors, matching the three-argument MATLAB call.
template<class T>
dmap_geo_mul_sum (const Dmap< T > &a, const Dmap< T > &b, const std::vector< T > &alA, const std::vector< T > &alB)
 Geometrically weighted sum of the lagged joint moments, the building block of the autocorrelation distance.
template<class T>
dmap_geo_mul_sum (const Dmap< T > &a, const Dmap< T > &b)
 Default stationary vectors, matching the two-argument MATLAB call.
template<class T>
dmap_dist_acf (const Dmap< T > &a, const Dmap< T > &b, const std::vector< T > &alA, const std::vector< T > &alB)
 Squared distance between the autocorrelation structures of two D-MAPs.
template<class T>
dmap_dist_acf (const Dmap< T > &a, const Dmap< T > &b)
 Default stationary vectors, matching the two-argument MATLAB call.
template<class T>
dmap_dist_lag1 (const Dmap< T > &a, const Dmap< T > &b, const std::vector< T > &alA, const std::vector< T > &alB)
 Squared distance between the lag-1 joint densities of two D-MAPs.
template<class T>
dmap_dist_lag1 (const Dmap< T > &a, const Dmap< T > &b)
 Default stationary vectors, matching the two-argument MATLAB call.
template<class T, class Gen>
std::vector< unsigned > dmap_sample (const Dmap< T > &d, std::size_t n, Gen &gen)
 n interarrival times in slots, drawn by walking the phase process.
template<class T>
MapOptimDist< T > dmap_optim_dist (const Dmap< T > &a, const std::vector< T > &alA, const Matrix< T > &B0, const std::vector< T > &alB, unsigned L)
 Fit B1 minimizing the lag-L joint-PMF distance to a, with B0 fixed.
template<class T>
MapOptimDist< T > dmap_optim_dist_acf (const Dmap< T > &a, const std::vector< T > &alA, const Matrix< T > &B0, const std::vector< T > &alB)
 Fit B1 minimizing the AUTOCORRELATION distance, with B0 fixed.
template<class T>
Dph< T > dph_from_dist (lang::ProcessType type, const T &mean_slots, const T &scv)
 Exact discrete phase-type representation of a lattice-valued law.
template<class T>
Dmap< T > dph_to_dmap (const Dph< T > &d)
 Renewal D-MAP (A, a alpha) of a discrete phase-type law.
template<class T>
bool dmap_is_renewal (const Dmap< T > &d)
 True when D1 has rank one, i.e.
template<class T>
Dph< T > dmap_to_dph (const Dmap< T > &d)
 Discrete phase-type law underlying a renewal D-MAP.
template<class T>
dmap_lambda_batch (const DBatch< T > &A)
 Mean number of EVENTS per slot, pi sum_k k A_k e.
template<class T>
DBatch< T > dmap_super (const DBatch< T > &A, const DBatch< T > &B)
 Superposition, E_k = sum_{i+j=k} kron(A_i, B_j).
template<class T>
DBatch< T > dmap_thin (const DBatch< T > &A, const T &p)
 Bernoulli thinning, B_k = sum_{n>=k} C(n,k) p^k (1-p)^(n-k) A_n.
template<class T>
Dmap< T > dmap_compress (const Dmap< T > &d, std::size_t max_order)
 Reduces the order of a D-MAP by matching interevent moments.
template<class T>
DBatch< T > dmap_compress_batch (const DBatch< T > &A, std::size_t max_order)
 Order reduction of a BATCH stream.
template<class T>
Matrix< T > qbd_dt_g (const Matrix< T > &A0, const Matrix< T > &A1, const Matrix< T > &A2, int max_iter=200)
 G matrix of a discrete-time QBD by logarithmic reduction (Latouche and Ramaswami).
template<class T>
Matrix< T > mg1_dt_g (const std::vector< Matrix< T > > &A, int max_iter=5000, double tol=1e-14)
 G matrix of an M/G/1-type chain by functional iteration on G = sum_k A_k G^k, the blocks being stochastic.
template<class T>
std::vector< T > mg1_dt_pi (const std::vector< Matrix< T > > &B, const std::vector< Matrix< T > > &A, std::size_t max_num_comp=1000)
 Stationary vector of an M/G/1-type chain by the stable Ramaswami formula.
template<class T>
std::vector< T > q_dt_map_map_1 (const Dmap< T > &arv, const Dmap< T > &svc, std::size_t max_num_comp=1000)
 Queue length distribution of a discrete-time D-MAP/D-MAP/1/FCFS queue, the queue-length half of Q_DT_MAP_MAP_1.
template<class T>
std::vector< T > q_dt_ph_ph_1 (const Dph< T > &arv, const Dph< T > &svc, std::size_t max_num_comp=1000)
 Queue length of a discrete-time DPH/DPH/1/FCFS queue, via the D-MAP route.
template<class T>
DtQueueResult< T > mg1_dt_queue (const DBatch< T > &arv, const Dmap< T > &svc, std::size_t max_num_comp=1000, bool want_departure=false)
 Discrete-time single-server queue with batch D-MAP arrivals, DBMAP/D-MAP/1.
template<class T, class Ccdf>
HyperexpLongtailResult< T > hyperexp_fit_longtail_k (Ccdf &&ccdf, std::size_t k, const T &c1, const T &b, const T &decade)
 The recursion at a fixed component count.
template<class T, class Ccdf>
HyperexpLongtailResult< T > hyperexp_fit_longtail (Ccdf &&ccdf, const T &b=num_traits< T >::from_rational(3, 2), const T &decade=num_traits< T >::from_int(4))
 The fit with the component count chosen automatically: one per decade between the 0.9 quantile and the 1e-6 quantile, retrying with fewer when the recursion runs out of probability near the body.
template<class T>
std::vector< Matrix< T > > ldqbd_R (const std::vector< Matrix< T > > &q0, const std::vector< Matrix< T > > &q1, const std::vector< Matrix< T > > &q2)
 Rate matrices R^(1), ..., R^(N) of a level-dependent QBD (ldqbd_R.m).
template<class T>
LdqbdPi< T > ldqbd_pi (const std::vector< Matrix< T > > &R, const std::vector< Matrix< T > > &q0, const std::vector< Matrix< T > > &q1, const std::vector< Matrix< T > > &q2)
 Stationary distribution of a level-dependent QBD given its rate matrices (ldqbd_pi.m).
template<class T>
LdqbdResult< T > ldqbd (const std::vector< Matrix< T > > &q0, const std::vector< Matrix< T > > &q1, const std::vector< Matrix< T > > &q2)
 Solve a level-dependent QBD: rate matrices and stationary law (ldqbd.m).
std::vector< std::vector< int > > ph_multisets (std::size_t p, std::size_t k)
 Configurations of k identical servers over p service phases.
template<class T>
LdqbdMphcBlocks< T > ldqbd_mphc (const Matrix< T > &D0, const Matrix< T > &D1, const std::vector< T > &alpha, double c, const std::vector< T > &arrRate, const std::vector< T > &sf)
 Block-tridiagonal generator of an M/PH/c queue with level-dependent arrivals.
double gammainc_lower (double a, double x)
 Regularized lower incomplete gamma P(a, x), MATLAB's gammainc(x, a, 'lower').
template<class T>
TaylorSeriesResult< T > taylor_series_adaptive (const LibQbdProcess< T > &proc, const std::vector< std::vector< T > > &pi0, double error, double max_time)
 libQBD's TaylorSeriesAdaptive, restricted to the reference grid that solver_mam_ldqbd_transient reads (get_reference_times and get_reference_dists); the interpolation to arbitrary points is not ported because no caller in this tree asks for it.
template<class T>
Aph2FitResult< T > aph2_fit_map (const Map< T > &m)
 Fit an APH(2) to the first three moments of a MAP.
template<class T>
Aph2FitResult< T > aph2_fit_trace (const std::vector< T > &S)
 Fit an APH(2) to the first three sample moments of a trace.
template<class T>
Amap2FitGammaResult< T > amap2_fit_gamma_map (const Map< T > &m)
 Fit an AMAP(2) to the three moments and the decay rate of a MAP.
template<class T>
Amap2FitGammaResult< T > amap2_fit_gamma_trace (const std::vector< T > &S)
 Fit an AMAP(2) to the three sample moments and the fitted decay rate of a trace.
template<class T>
M3pp22FitcCovResult< T > m3pp22_fitc_approx_cov_multiclass (const Map< T > &mmpp, const std::vector< T > &ai, const T &st3, const T &t3)
 Split a GIVEN MMPP(2) into two classes, matching the per-class rates exactly and the count covariance between them at t3 as closely as feasible.
template<class T>
M3pp22FitcCovResult< T > m3pp22_fitc_approx_cov (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const T &st3, const T &t3, const AugLagOptions< T > &opt)
 Fit the underlying MMPP(2) by optimization, then apply the covariance split.
template<class T>
M3pp22FitcCovResult< T > m3pp22_fitc_approx_cov (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const T &st3, const T &t3)
 m3pp22_fitc_approx_cov with the default tuning of the MMPP(2) solve.
template<class T>
M3pp2mFitcResult< T > m3pp2m_fitc (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const std::vector< T > &dvt3, const T &t3)
 Fit an M3PP(2, m).
template<class T>
Mmap< T > m3pp2m_assemble (const Map< T > &base, const std::vector< T > &q1, const std::vector< T > &q2)
 Assemble the M3PP from an underlying MAP and the per-phase marking probabilities.
template<class T>
M3pp2mFitcApproxResult< T > m3pp2m_fitc_approx (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const std::vector< T > &dvt3, const T &t3, const std::vector< Bound< T > > &bounds, const AugLagOptions< T > &opt)
 m3pp2m_fitc_approx: fit the underlying MMPP(2) by optimization, then split the classes on their variance DIFFERENCES at t3.
template<class T>
M3pp2mFitcApproxResult< T > m3pp2m_fitc_approx (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const std::vector< T > &dvt3, const T &t3)
 m3pp2m_fitc_approx with no box on the free variables and the default tuning.
template<class T>
M3pp2mFitcApproxResult< T > m3pp2m_fitc_approx_ag_multiclass (const Map< T > &mmpp, const std::vector< T > &ai, const std::vector< T > &gt3, const T &t3, const std::vector< Bound< T > > &bounds, const AugLagOptions< T > &opt)
 m3pp2m_fitc_approx_ag_multiclass: split a GIVEN MMPP(2) into m classes on their variance-plus-covariance at t3.
template<class T>
M3pp2mFitcApproxResult< T > m3pp2m_fitc_approx_ag_multiclass (const Map< T > &mmpp, const std::vector< T > &ai, const std::vector< T > &gt3, const T &t3)
 m3pp2m_fitc_approx_ag_multiclass with no box and the default tuning.
template<class T>
M3pp2mFitcApproxResult< T > m3pp2m_fitc_approx_ag (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const std::vector< T > &gt3, const T &t3, const std::vector< Bound< T > > &bounds, const AugLagOptions< T > &opt)
 m3pp2m_fitc_approx_ag: fit the underlying MMPP(2) by optimization, then apply the 'ag' per-class split.
template<class T>
M3pp2mFitcApproxResult< T > m3pp2m_fitc_approx_ag (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const std::vector< T > &ai, const std::vector< T > &gt3, const T &t3)
 m3pp2m_fitc_approx_ag with no box and the default tuning.
template<class T>
M3pp2mFitcTraceResult< T > m3pp2m_fitc_trace (const std::vector< T > &Tv, const std::vector< int > &A, const std::string &method, const T &t1, const T &tinf)
 Fit a multi-class trace with an M3PP(2, m) on its counting process.
template<class T>
M3pp2mFitcTraceResult< T > m3pp2m_fitc_trace (const std::vector< T > &Tv, const std::vector< int > &A, const std::string &method)
 m3pp2m_fitc_trace with the reference's default time scales.
template<class T>
Mmpp2FitcResult< T > mmpp2_fitc_theoretical (const Map< T > &mp, const T &t1, const T &t2, const T &tinf)
 MMPP(2) fitted to the counting characteristics of a GIVEN MAP (matlab/lib/kpctoolbox/mmpp/mmpp2_fitc_theoretical.m).
template<class T>
Mmpp2FitcResult< T > mmpp2_fitc_theoretical (const Map< T > &mp)
 mmpp2_fitc_theoretical with the reference's default time scales 1, 10, 1e8.
template<class T>
Mmap< T > m3pp2m_interleave (const std::vector< Mmap< T > > &parts)
 Interleave L M3PP(2, m_i) into one M3PP of order L + 1 whose class list is the concatenation of theirs.
template<class T>
Mmap< T > m3pp2m_fitc_theoretical (const Mmap< T > &mm, const std::string &method, const T &t, const T &tinf)
 Fit the counting characteristics of a GIVEN MMAP with an M3PP(2, m).
template<class T>
Mmap< T > m3pp2m_fitc_theoretical (const Mmap< T > &mm, const std::string &method)
 m3pp2m_fitc_theoretical with the reference's default scales t = 10, tinf = 1e4.
template<class T>
M3pp22InterleaveResult< T > m3pp22_interleave_fitc (const Matrix< T > &av, const std::vector< T > &btv, const std::vector< T > &binfv, const std::vector< T > &stv, const T &t)
 Fit L PAIRS of classes into one MMAP by lumped interleaving of L M3PP(2, 2).
template<class T>
M3ppSuperposResult< T > m3pp_superpos_fitc (const std::vector< T > &av, const std::vector< T > &btv, const std::vector< T > &binfv, const std::vector< T > &m3tv, const T &t, const T &tinf)
 Fit one second-order M3PP per class from its counting characteristics and superpose them.
template<class T>
M3ppSuperposResult< T > m3pp_superpos_fitc_theoretical (const Mmap< T > &mm, const T &t, const T &tinf)
 Superpose one M3PP per class to fit the counting characteristics of a given MMAP.
template<class T>
M3ppSuperposResult< T > m3pp_superpos_fitc_trace (const std::vector< T > &Tv, const std::vector< int > &A, const T &t, const T &tinf)
 Superpose one M3PP per class to fit a multi-class trace.
template<class T>
M3ppSuperposResult< T > m3pp_superpos_fitc_trace (const std::vector< T > &Tv, const std::vector< int > &A)
 m3pp_superpos_fitc_trace with the reference's default time scales.
CQbdFundMat qbd_fundmat_laplace (const CMat &B, const CMat &L, const CMat &F, double precision=1e-14, unsigned maxNumIt=50)
 Port of qbd_fundmat.m at complex argument: cyclic reduction (Bini-Meini logarithmic reduction) on the raw level blocks, with R recovered from G.
TransientQbd make_transient_qbd (const std::vector< CMat > &B, const std::vector< CMat > &L, const std::vector< CMat > &F, const std::vector< CMat > &Lv, const std::vector< long > &T)
 Build the 1-based padded form from plain 0-based vectors.
CMat mam_transient2_open (const TransientQbd &q, long n, long m, const Complex &s)
 V(s,n,m) for an OPEN piecewise QBD, the port of mam_transient2_open.m.
CMat mam_transient2 (const TransientQbd &q, long n, long m, const Complex &s)
 V(s,n,m) for a FINITE piecewise QBD, the port of mam_transient2.m.
template<class T>
Mamap22FitResult< T > mamap22_fit_bs_multiclass (const Map< T > &map, const std::vector< T > &p, const std::vector< T > &B, const Matrix< T > &S, const std::vector< T > &classWeights=std::vector< T >(), const std::vector< T > &bsWeights=std::vector< T >(), bool adjust=true)
template<class T>
Mmap< T > mamap22_fit_gamma_bs (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &p, const std::vector< T > &B, const Matrix< T > &S)
 mamap22_fit_gamma_bs: fit over every AMAP(2) form and keep the closest.
template<class T>
Mmap< T > mamap22_fit_gamma_bs_mmap (const Mmap< T > &mm)
 mamap22_fit_gamma_bs driven from an MMAP[2] of arbitrary order.
template<class T>
Mmap< T > mamap22_fit_gamma_bs_trace (const std::vector< T > &Tv, const std::vector< int > &A)
 mamap22_fit_gamma_bs driven from a marked trace.
template<class T>
Mamap22FsFitResult< T > mamap22_fit_fs_multiclass (const Map< T > &map, const std::vector< T > &p, const std::vector< T > &F, const Matrix< T > &S, const std::vector< T > &classWeights=std::vector< T >(), const std::vector< T > &fsWeights=std::vector< T >(), bool adjust=true)
template<class T>
Mmap< T > mamap22_fit_gamma_fs (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &p, const std::vector< T > &F, const Matrix< T > &S)
 mamap22_fit_gamma_fs: fit over every AMAP(2) form and keep the closest.
template<class T>
Mmap< T > mamap22_fit_gamma_fs_trace (const std::vector< T > &Tv, const std::vector< int > &A)
 mamap22_fit_gamma_fs driven from a marked trace.
template<class T>
Mamap2mCoefficients< T > mamap2m_can1_coefficients (const T &h1, const T &h2, const T &r1, const T &r2)
 First canonical form, a positive autocorrelation decay.
template<class T>
Mamap2mCoefficients< T > mamap2m_can2_coefficients (const T &h1, const T &h2, const T &r1, const T &r2)
 Second canonical form, a negative autocorrelation decay (E, V, Z).
template<class T>
Mamap2mFitResult< T > mamap2m_fit_fb_multiclass (const Map< T > &map, const std::vector< T > &p, const std::vector< T > &F, const std::vector< T > &B, const std::vector< T > &classWeights=std::vector< T >(), const std::vector< T > &fbWeights=std::vector< T >())
 Mark a canonical acyclic AMAP(2) with m classes, matching the forward and backward moments.
template<class T>
Mmap< T > mamap2m_fit_gamma_fb (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &p, const std::vector< T > &F, const std::vector< T > &B)
 Fit a MAMAP(2,m) to three moments, the decay rate, the class probabilities and the forward and backward moments, over every AMAP(2) form.
template<class T>
Mmap< T > mamap2m_fit (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &p, const std::vector< T > &F, const std::vector< T > &B, const Matrix< T > &S, const std::vector< T > &fbsWeights=std::vector< T >())
 The full mamap2m_fit dispatcher.
template<class T>
Mmap< T > mamap2m_fit_gamma_fb_trace (const std::vector< T > &Tv, const std::vector< int > &A)
 Fit a MAMAP(2,m) from a marked trace through the (F, B) pair alone.
template<class T>
Mmap< T > mamap2m_fit_trace (const std::vector< T > &Tv, const std::vector< int > &A, const std::vector< T > &fbsWeights=std::vector< T >())
 Fit a MAPH(2,m) or MAMAP(2,m) matching the characteristics of a marked trace.
template<class T>
Map2FitResult< T > map2_fit (const T &e1, const T &e2, const T &e3_in, const T &g2)
 Fit an AMAP(2) to (e1, e2, e3, g2); see the header comment for e3 sentinels.
template<class T>
Map2FitResult< T > map2_fit (const T &e1, const T &e2, const T &g2)
 Three-argument form: map2_fit(e1, e2, g2), i.e.
template<class T>
Map2FitIdcResult< T > map2_fit_idc (const T &e1, const T &e2, const T &e3, const T &I)
 Fit a MAP(2) to three moments and an asymptotic index of dispersion.
template<class T>
Map2mmppResult< T > map2mmpp (const Map< T > &m)
 Modulating generator and arrival-rate matrix of a MAP read as an MMPP.
template<class T>
std::vector< T > map_acfc (const Map< T > &m, const std::vector< unsigned > &kset, const T &u)
 Autocorrelation of the counting process of a MAP at a given timescale.
std::size_t map_largemap ()
 Order above which a MAP counts as large for the fitting heuristics.
template<class T>
Map< T > map_timereverse (const Map< T > &m)
 Time-reversed MAP, diag(pi)^-1 M' diag(pi) applied to D0 and D1.
template<class T>
Map< T > map_kpc (const Map< T > &a, const Map< T > &b)
 Kronecker product composition of two MAPs.
template<class T>
Map< T > map_kpc (const std::vector< Map< T > > &maps)
 Left-folded composition of a whole list of MAPs.
std::complex< double > map_gamma2 (const Map< double > &m)
 Subdominant eigenvalue of the embedded chain, the leading ACF decay rate.
template<class T>
MapAnfitResult< T > map_anfit (const T &ls, const T &rho, const T &H, double n, std::size_t ds)
 Fit a superposition of interrupted Poisson processes to a Hurst parameter.
template<class T>
MapAnfitResult< T > map_anfit_lsq (const T &ls, const T &rho, const T &H, double n, std::size_t ds, const std::vector< T > &SA, const std::vector< unsigned > &SAlags, unsigned iter_max=100)
 The least-squares variant: after the deterministic construction, the per-IPP ratios are tuned so the fitted autocorrelation matches a supplied one.
template<class T>
Map< T > map_bernstein (const std::function< double(double)> &f, unsigned order=20)
 Acyclic phase-type approximation of an arbitrary density by Bernstein exponentials.
template<class T>
Map< T > aph_bernstein (const std::function< double(double)> &f, unsigned order=20)
 The reference's (D0, D1) spelling of the same fit, kept because the JAR exposes it under this name (Aph_bernstein) and callers ported from it expect the pair rather than a Map.
template<class T>
Map< T > map_block (const T &E1, const T &E2, const T &E3, const T &G2)
 Fit a MAP(2) to three moments and an autocorrelation decay rate.
template<class T>
Map< T > map_block_scv (const T &E1, const T &SCV, const T &E3, const T &G2)
 map_block with the SCV spelling of the second argument.
template<class T>
Map< T > map_feasblock (const T &E1, const T &E2_in, const T &E3_in, const T &G2)
 map_feasblock: repair the moments into the feasible region, then fit.
template<class T>
std::vector< T > map_cdf (const Map< T > &m, const std::vector< T > &points)
 Cumulative distribution of the inter-arrival time at the given points.
template<class T>
std::vector< T > map_count_idc (const Map< T > &m, const std::vector< T > &t)
 Index of dispersion for counts (IDC) of a MAP at resolution t.
template<class T>
map_count_idc (const Map< T > &m, const T &t)
 Scalar convenience: the IDC at a single window length t.
template<class T>
std::vector< T > map_count_mean (const Map< T > &m, const std::vector< T > &t)
 Mean of the counting process of a MAP at resolution t.
template<class T>
std::vector< T > map_count_moment (const Map< T > &m, const T &t, const std::vector< unsigned > &orders)
 Power moments of the counts of a MAP in a window of length t.
template<class T>
Matrix< T > mmap_count_moment (const Mmap< T > &m, const T &t, const std::vector< unsigned > &orders)
 Per-class counting moments of a marked MAP, mmap_count_moment.
template<class T>
std::vector< T > map_count_var (const Map< T > &m, const std::vector< T > &t)
 Variance of the counting process of a MAP at resolution t.
template<class T>
map_exp_mul_int (const Map< T > &a, const Map< T > &b, unsigned L, const std::vector< T > &alA, const std::vector< T > &alB)
 Integral of the product of the two interarrival densities up to lag L.
template<class T>
map_exp_mul_int (const Map< T > &a, const Map< T > &b, unsigned L)
 map_exp_mul_int with both stationary embedded distributions taken from the MAPs.
template<class T>
map_geo_mul_sum (const Map< T > &a, const Map< T > &b, const std::vector< T > &alA, const std::vector< T > &alB)
 Geometrically weighted sum of the cross moments of the two embedded chains.
template<class T>
map_geo_mul_sum (const Map< T > &a, const Map< T > &b)
 map_geo_mul_sum with both embedded distributions taken from the MAPs.
template<class T>
map_dist (const Map< T > &a, const Map< T > &b, unsigned L, const std::vector< T > &alA, const std::vector< T > &alB)
 Squared L2 distance between the two joint densities up to lag L (map_dist.m).
template<class T>
map_dist (const Map< T > &a, const Map< T > &b, unsigned L)
 map_dist with both embedded distributions taken from the MAPs.
template<class T>
map_dist_acf (const Map< T > &a, const Map< T > &b, const std::vector< T > &alA, const std::vector< T > &alB)
 Squared L2 distance between the two autocorrelation functions (map_dist_acf.m).
template<class T>
map_dist_acf (const Map< T > &a, const Map< T > &b)
 map_dist_acf with both embedded distributions taken from the MAPs.
template<class T>
map_dist_lag1 (const Map< T > &a, const Map< T > &b, const std::vector< T > &alA, const std::vector< T > &alB)
 Squared L2 distance between the two lag-one joint densities (map_dist_lag1.m).
template<class T>
map_dist_lag1 (const Map< T > &a, const Map< T > &b)
 map_dist_lag1 with both embedded distributions taken from the MAPs.
template<class T>
MapGammaResult< T > map_gamma_full (const Map< T > &m, long limit=1000)
template<class T>
map_gamma (const Map< T > &m, long limit=1000)
 Autocorrelation decay rate of a MAP (map_gamma.m).
template<class T>
map_ccdf_derivative (const Map< T > &m, unsigned i)
 Derivative of order i at 0 of the MAP's complementary CDF, nu = pie D0^i e.
template<class T>
map_jointpdf_derivative (const Map< T > &m, const std::vector< unsigned > &iset)
 Mixed partial derivative at the origin of the joint density of consecutive inter-arrival times, gamma = pie prod_j (D0^{i_j} D1) e.
template<class T>
map_compute_R_residual (const Matrix< T > &C, const Matrix< T > &D, const T &mu, const Matrix< T > &R)
 Residual ||D + R (C - mu I) + mu R^2||_inf of the MAP/M/1 rate equation.
template<class T>
Matrix< T > map_compute_R (const Matrix< T > &C, const Matrix< T > &D, const T &mu, unsigned max_iter, const T &tol)
 Rate matrix R of a MAP/M/1 queue, the minimal nonnegative solution of D + R (C - mu I) + mu R^2 = 0, by the iteration R <- -D (C - mu I + mu R)^-1 (map_compute_R.m).
template<class T>
Matrix< T > map_compute_R (const Matrix< T > &C, const Matrix< T > &D, const T &mu)
 map_compute_R with the reference defaults, 1000 iterations and tolerance 1e-10.
template<class T>
Matrix< T > map_compute_R_quadratic (const Matrix< T > &C, const Matrix< T > &D, const T &mu, unsigned max_iter, const T &tol)
 The same R by the other splitting, R <- (D + mu R^2) (mu I - C)^-1, warm started at -D (C - mu I)^-1 and with the scalar case solved in closed form (the private compute_R_matrix of map_m1ps_cdfrespt.m).
template<class T>
Matrix< T > map_compute_R_quadratic (const Matrix< T > &C, const Matrix< T > &D, const T &mu)
 map_compute_R_quadratic with the reference defaults, 5000 iterations, 1e-10.
template<class T>
std::vector< std::vector< std::vector< T > > > map_m1ps_h_recursive (const Matrix< T > &C, const Matrix< T > &D, const T &mu, std::size_t N, std::size_t K)
 The vectors h_{n,k} of Theorem 1 (map_m1ps_h_recursive.m).
template<class T>
MapM1psResult< T > map_m1ps_sojourn (const Matrix< T > &C, const Matrix< T > &D, const T &mu, const std::vector< T > &x, const T &epsilon, const T &epsilon_prime)
 Complementary sojourn time distribution of a MAP/M/1-PS queue (map_m1ps_sojourn.m).
template<class T>
MapM1psResult< T > map_m1ps_sojourn (const Matrix< T > &C, const Matrix< T > &D, const T &mu, const std::vector< T > &x)
 map_m1ps_sojourn with the reference defaults, epsilon 1e-11 and 1e-10.
template<class T>
MapM1psResult< T > map_m1ps_cdfrespt (const Matrix< T > &C, const Matrix< T > &D, const T &mu, const std::vector< T > &x, const T &epsilon, const T &epsilon_prime)
 Complementary sojourn time distribution of a MAP/M/1-PS queue by the spectral-radius truncation (map_m1ps_cdfrespt.m).
template<class T>
MapM1psResult< T > map_m1ps_cdfrespt (const Matrix< T > &C, const Matrix< T > &D, const T &mu, const std::vector< T > &x)
 map_m1ps_cdfrespt with the reference defaults, epsilon 1e-11 and 1e-10.
template<class T>
Mmap< T > map_mark (const Map< T > &m, const std::vector< T > &prob)
 MMAP with the same inter-arrival process and arrivals marked by prob.
template<class T>
Map< T > map_max (const Map< T > &A, const Map< T > &B)
 MAP of the maximum of two independent MAPs.
template<class T>
Mmap< T > mmap_max (const Mmap< T > &a, const Mmap< T > &b, unsigned k)
 MMAP of the maximum over k synchronization rounds of two independent MMAPs.
template<class T>
Map< T > map_mmpp2 (const T &MEAN, const T &SCV_in, const T &SKEW, const T &ACF1)
 Fit an MMPP(2) to a mean, an SCV, a skewness and a lag-1 autocorrelation.
int map_feastol ()
 Tolerance exponent shared by the KPC feasibility checks (map_feastol.m).
template<class T>
Matrix< T > map_infgen (const Map< T > &m)
 Generator of the underlying phase process, D0 + D1.
template<class T>
std::vector< T > map_prob (const Map< T > &m)
 Stationary distribution of the phase process, pi (D0 + D1) = 0.
template<class T>
map_lambda (const Map< T > &m)
 Stationary arrival rate, lambda = pi D1 e.
template<class T>
std::vector< T > map_pie (const Map< T > &m)
 Phase distribution seen by an arriving job, pie = pi D1 / (pi D1 e).
template<class T>
map_mean (const Map< T > &m)
 Mean inter-arrival time, 1/lambda.
template<class T>
Matrix< T > map_embedded (const Map< T > &m)
 Embedded DTMC at arrival epochs, P = (-D0)^-1 D1.
template<class T>
map_moment (const Map< T > &m, unsigned k)
 Raw moment of order k of the inter-arrival time: k!
template<class T>
map_var (const Map< T > &m)
 Variance of the inter-arrival time.
template<class T>
map_scv (const Map< T > &m)
 Squared coefficient of variation.
template<class T>
std::vector< T > map_acf (const Map< T > &m, const std::vector< unsigned > &lags)
 Autocorrelation coefficients of the inter-arrival times at the given lags,.
template<class T>
map_idc (const Map< T > &m)
 Index of dispersion for counts, I = 1 + 2(lambda - pie (Q + e pi)^-1 D1 e).
template<class T>
Map< T > map_exponential (const T &lambda)
 Two-phase MAP constructor for a Poisson process of rate lambda.
template<class T>
map_factorial_moment (const Map< T > &m, std::size_t k)
 k!
template<class T>
map_joint_moment (const Map< T > &m, std::size_t k, std::size_t l)
 k!
template<class T>
Matrix< T > mmap_infgen (const Matrix< T > &D0, const std::vector< Matrix< T > > &Dk)
 The generator of an MMAP: D0 plus every marked arrival matrix.
template<class T>
void qbd_blocks_mapmap1 (const Matrix< T > &D0a, const Matrix< T > &D1a, const Matrix< T > &D0s, const Matrix< T > &D1s, Matrix< T > *B, Matrix< T > *L, Matrix< T > *F)
 The QBD blocks of a MAP/MAP/1 queue: backward, local and forward.
template<class T>
MapOptimDist< T > map_optim_dist (const Map< T > &a, const std::vector< T > &alA, const Matrix< T > &B0, const std::vector< T > &alB, unsigned L)
 Fit B1 minimizing the lag-L joint-density distance to a, with B0 fixed.
template<class T>
MapOptimDist< T > map_optim_dist_acf (const Map< T > &a, const std::vector< T > &alA, const Matrix< T > &B0, const std::vector< T > &alB)
 Fit B1 minimizing the AUTOCORRELATION distance to a, with B0 fixed.
template<class T>
std::vector< T > map_pdf (const Map< T > &m, const std::vector< T > &tset)
 Probability density of the inter-arrival time at the given points.
template<class T>
std::vector< Matrix< T > > map_pntbisect (const Map< T > &m, std::size_t na, const T &t)
 P_0(t) .
template<class T>
std::vector< Matrix< T > > map_pnt (const Map< T > &m, std::size_t na, const T &t, long M=-1)
 P_0(t) .
template<class T>
std::vector< Matrix< T > > map_pntquad (const Map< T > &m, std::size_t na, const T &t)
 The same counting probabilities by NUMERICAL INTEGRATION, map_pntquad.
template<class T>
Matrix< T > map_pntiter (const Map< T > &m, std::size_t na, const T &t, long M=-1)
 The reference's entry point: only the highest count is returned.
template<class T, class Gen>
Map< T > map_rand (std::size_t K, Gen &gen)
 Random MAP of order K with uniform [0,1) entries, normalized.
template<class T, class Gen>
Map< T > map_randn (std::size_t K, double mu, double sigma, Gen &gen)
 Random MAP of order K with folded normal entries, normalized.
template<class T, class Gen>
Map< T > mmpp_rand (std::size_t K, Gen &gen)
 Random MMPP of order K: the arrival matrix is diagonal, so arrivals do not switch phase.
template<class T, class Gen>
Mmap< T > m3pp_rand (std::size_t K, std::size_t classes, Gen &gen)
 Random M3PP of order K with classes marks (m3a/m3pp/m3pp_rand.m).
template<class T, class Gen>
Map< T > aph_rand (std::size_t K, Gen &gen)
 Random acyclic PH renewal process of order K, upper triangular in D0.
template<class T, class Gen>
Map< T > hyper_rand (std::size_t k, Gen &gen)
 Random hyperexponential of order k, given as a MAP.
template<class T, class Gen>
Mmap< T > mmap_rand (std::size_t order, std::size_t classes, Gen &gen)
 Random MMAP of the given order with a random split of D1 across the classes.
template<class T>
HyperParams< T > ph2hyper (const Map< T > &ph)
 Reads a hyperexponential MAP back into rates and branch probabilities.
template<class T>
std::size_t randp (const std::vector< T > &P, pfqn::McRng &rng)
 Draw an index from a discrete law, m3a's randp.
template<class T>
std::vector< T > map_sample (const Map< T > &m, std::size_t n, pfqn::McRng &rng, const std::vector< T > &pie0=std::vector< T >(), SampleTrace *trace=0)
 Sample the inter-arrival times of a MAP, a RAP or a matrix exponential.
template<class T>
std::vector< T > rap_sample (const Map< T > &m, std::size_t n, pfqn::McRng &rng, const std::vector< T > &a0=std::vector< T >(), std::vector< T > *a_out=0)
 Sample a RAP or a matrix exponential by inverse transform.
template<class T>
Map< T > 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 > 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 > 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 > map_exponential_mean (const T &mean)
 Poisson process with the given mean inter-arrival time (map_exponential.m).
template<class T>
Map< T > map_erlang (const T &mean, unsigned k)
 Erlang-k renewal MAP with the given mean (map_erlang.m).
template<class T>
Map< T > 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 > map_hyperexp (const T &mean, const T &scv)
 map_hyperexp with the MATLAB default branching probability p = 0.99.
template<class T>
Map< T > 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 > 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 > 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 > 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 > map2ph (const Map< T > &in)
 (alpha, T) of the inter-arrival distribution: alpha = pie, T = D0 (map2ph.m).
template<class T>
Map< T > 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 > 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>
map_kurt (const Map< T > &m)
 Kurtosis of the inter-arrival time (map_kurt.m); rational in the entries.
template<class T>
map_skew (const Map< T > &m)
 Skewness of the inter-arrival time (map_skew.m).
template<class T>
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 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 map_checkfeasible (const Map< T > &m, const T &tol)
 The reference's map_checkfeasible, i.e.
template<class T>
bool map_isfeasible (const Map< T > &m)
 map_isfeasible(MAP) with no tolerance, which is NOT the zero-tolerance test.
template<class T>
std::vector< T > map_varcount (const Map< T > &m, const std::vector< T > &tset)
 Variance of the counts of a MAP over windows of length t, in the spelling of matlab/lib/kpctoolbox/map/map_varcount.m.
template<class T>
Maph2mFitResult< T > maph2m_fit_multiclass (const Map< T > &aph, const std::vector< T > &p, const std::vector< T > &B, const std::vector< T > &classWeights=std::vector< T >())
 Mark a canonical acyclic APH(2) with m classes.
template<class T>
Mmap< T > maph2m_fit (const T &M1, const T &M2, const T &M3, const std::vector< T > &p, const std::vector< T > &B)
 Fit a MAPH(2,m) to three moments, the class probabilities and the per-class backward moments, trying every APH(2) form and keeping the closest.
template<class T>
Mmap< T > maph2m_fit_mmap (const Mmap< T > &m)
 Fit a MAPH(2,m) to the descriptors measured on a marked MAP.
template<class T>
Mmap< T > maph2m_fit_trace (const std::vector< T > &Tv, const std::vector< int > &A)
 Fit a MAPH(2,m) to the descriptors measured on a marked trace.
std::vector< double > matlab_ilt (const std::function< std::complex< double >(const std::complex< double > &)> &fun, const std::vector< double > &times, std::size_t maxFnEvals, IltMethod method=IltMethod::Cme)
 Invert a Laplace transform at the requested time points.
template<class T>
std::vector< T > me_sample (const Map< T > &m, std::size_t n, pfqn::McRng &rng, const std::vector< T > &a0=std::vector< T >())
 me_sample: n INDEPENDENT variates of the matrix exponential (D0, D1).
template<class T>
MeRepresentation< T > mfq_fluflu_sojourn (const Matrix< T > &Qin, const Matrix< T > &Rin, const Matrix< T > &Qout, const Matrix< T > &Rout, bool srv0stop, bool transToPH, const T &prec)
 Sojourn time of a drop in a fluid queue with fluid-modulated service.
template<class T>
MeRepresentation< T > mfq_fluflu_sojourn (const Matrix< T > &Qin, const Matrix< T > &Rin, const Matrix< T > &Qout, const Matrix< T > &Rout, bool srv0stop)
 mfq_fluflu_sojourn with an ME representation and prec = 1e-14.
template<class T>
std::vector< std::vector< T > > mfq_ld_distr (const LevelDependentFluidBlocks< T > &b, FluidDistrKind what, const std::vector< T > &points)
 Stationary density or distribution of a level-dependent fluid queue.
template<class T>
mfq_ld_mean (const LevelDependentFluidBlocks< T > &b)
 Stationary mean fluid level of a level-dependent fluid queue.
template<class T>
LevelDependentFluidBlocks< T > mfq_ld_solve (const std::vector< Matrix< T > > &Q, const std::vector< Matrix< T > > &R, const std::vector< Matrix< T > > &S, const std::vector< T > &Thr, const std::vector< FluidBoundary > &boundaryL, const std::vector< FluidBoundary > &boundaryU, const std::vector< Matrix< T > > &Qt, const T &prec)
 Solve a first- or second-order level-dependent fluid queue.
template<class T>
LevelDependentFluidBlocks< T > mfq_ld_solve (const std::vector< Matrix< T > > &Q, const std::vector< Matrix< T > > &R, const std::vector< Matrix< T > > &S, const std::vector< T > &Thr)
 mfq_ld_solve with reflective boundaries, Qt = Q and the default prec = 1e-14.
MultiRegimeResult mfq_multiregime (const std::vector< Matrix< double > > &Q, const std::vector< std::vector< double > > &R, const std::vector< Matrix< double > > &Qt, const std::vector< std::vector< double > > &Rt, const std::vector< double > &Thr, const std::vector< double > &pdfpoints, const std::vector< double > &cdfpoints)
 Multi-regime feedback fluid queue.
FluidPrioResult mfq_prio_queue (const Matrix< double > &Q, const Matrix< double > &R, double d, const FluidPrioOptions &opt)
 Fluid priority queue.
template<class T>
MeRepresentation< T > mfq_sojourn (const Matrix< T > &Q, const Matrix< T > &Rin, const Matrix< T > &Rout, const Matrix< T > &Q0, bool transToPH, const T &prec)
 Sojourn time of a drop in a Markov-modulated fluid queue.
template<class T>
MeRepresentation< T > mfq_sojourn (const Matrix< T > &Q, const Matrix< T > &Rin, const Matrix< T > &Rout)
 mfq_sojourn with the regular boundary, an ME representation and prec = 1e-14.
template<class T>
FluidFundamental< T > mfq_fundamental (const Matrix< T > &Fpp, const Matrix< T > &Fpm, const Matrix< T > &Fmp, const Matrix< T > &Fmm, const T &precision, unsigned maxNumIt, RiccatiMethod method)
 Psi, K and U of a fluid queue whose drifts have been normalized to +-1.
template<class T>
GeneralFluidSolution< T > mfq_general_solve (const Matrix< T > &Q, const Matrix< T > &R, const Matrix< T > &Q0, const T &prec)
 Stationary law of a general Markovian fluid model, pi(x) = ini exp(K x) clo above level zero plus the point mass mass0 at zero.
template<class T>
GeneralFluidSolution< T > mfq_general_solve (const Matrix< T > &Q, const Matrix< T > &R)
 mfq_general_solve with the regular boundary and the BUTools default prec = 1e-14.
template<class T>
Matrix< T > mfq_transform_to_ones (const std::vector< T > &v)
 The similarity transformation B with B v = e, for a non-negative column vector v.
template<class T>
Mmap< T > mmap_exponential_vec (const std::vector< T > &lambda, std::size_t n=1)
 Order-n MMAP with the given per-class arrival rates (mmap_exponential.m).
template<class T>
Mmap< T > mmap_mark_probs (const Mmap< T > &in, const Matrix< T > &prob)
 Re-mark an MMAP by a (K x R) probability matrix (mmap_mark.m): a type-k arrival is reported as class r with probability prob(k,r).
template<class T>
Mmap< T > mmap_scale_perclass (const Mmap< T > &in, const std::vector< T > &M)
 Retarget the per-class MEAN inter-arrival times (mmap_scale.m, vector form).
template<class T>
Mmap< T > mmap_super_safe (const std::vector< Mmap< T > > &in, std::size_t maxorder)
 Order-bounded superposition of several MMAPs (mmap_super_safe.m).
template<class T>
std::vector< std::vector< T > > mmap_backward_moment (const Mmap< T > &m, const std::vector< unsigned > &orders, bool normalized)
 Class-conditional backward moments of an MMAP (mmap_backward_moment.m).
template<class T>
std::vector< std::vector< T > > mmap_backward_moment (const Mmap< T > &m, const std::vector< unsigned > &orders)
 mmap_backward_moment with the MATLAB default, normalized.
template<class T>
Mmap< T > mmap_mixture (const std::vector< T > &alpha, const std::vector< Map< T > > &maps)
 Probabilistic mixture of MAPs (mmap_mixture.m).
template<class T>
Mmap< T > mmap_compress (const Mmap< T > &in, MmapCompressMethod method)
 Compress an MMAP (mmap_compress.m).
template<class T>
Mmap< T > mmap_compress (const Mmap< T > &in)
 mmap_compress with the default method, the order-1 mixture.
template<class T>
std::vector< T > mmap_count_var (const Mmap< T > &mm, const T &t)
 Per-class variance of the counting process of a marked MAP.
template<class T>
MmapKFitResult< T > mmap2k_fit (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &P, const std::vector< T > &F, const std::vector< T > &B)
 Exact marking of an AMAP(2) against per-class (p, F, B).
template<class T>
MmapKFitResult< T > mmap3k_fit (const Matrix< T > &D0, const Matrix< T > &D1, const std::vector< T > &P, const std::vector< T > &F, const std::vector< T > &B, const std::vector< T > &B2=std::vector< T >())
 Exact marking of an arbitrary MAP by solving the marking system directly.
template<class T>
Matrix< T > kron (const Matrix< T > &A, const Matrix< T > &B)
 Kronecker product.
template<class T>
Matrix< T > krons (const Matrix< T > &A, const Matrix< T > &B)
 Kronecker sum, MATLAB's krons: kron(A, I_nb) + kron(I_na, B).
template<class T>
Mmap< T > mmap_super (const Mmap< T > &a, const Mmap< T > &b)
 Superposition of two MMAPs: the phase process is the product chain, and the class list of the result is the concatenation of the two class lists (mmap_super.m, 'default' option).
template<class T>
std::vector< T > mmap_count_lambda (const Mmap< T > &m)
 Per-class arrival rates, lambda_c = theta D1^(c) e.
template<class T>
std::vector< T > mmap_lambda (const Mmap< T > &m)
 Alias kept for parity with the MATLAB name.
template<class T>
std::vector< T > mmap_pc (const Mmap< T > &m)
 Class probabilities seen by an arriving job, pc = pie (-D0)^-1 D1^(c) e.
template<class T>
bool mmap_isfeasible (const Mmap< T > &m)
 True when the per-class matrices partition D1 exactly and D0 is a generator.
template<class T>
bool mmap_isfeasible_tol (const Mmap< T > &m, const T &tol)
 Feasibility of a marked MAP WITHIN A TOLERANCE, the semantics of matlab/lib/m3a/m3a/mmap/mmap_isfeasible.m, whose second argument defaults to 10^-map_feastol = 1e-8: every per-class matrix non-negative up to -tol, the per-class matrices summing to D1 up to tol, and the underlying MAP feasible.
template<class T>
Mmap< T > mmap_normalize (const Mmap< T > &in)
 Clamp negative off-diagonal and per-class entries to zero and rebuild D1 and the diagonal of D0 from them (mmap_normalize.m).
template<class T>
Mmap< T > mmap_scale (const Mmap< T > &in, const T &M)
 Rescale time so that the mean inter-arrival time becomes M.
template<class T>
Mmap< T > mmap_hide (const Mmap< T > &in, const std::vector< std::size_t > &hide)
 Hide a subset of the marks (mmap_hide.m).
template<class T>
Mmap< T > mmap_hide_but (const Mmap< T > &in, std::size_t keep)
 mmap_hide(m, setdiff(1:K, keep)): keep ONE mark, hide every other.
template<class T>
Mmap< T > mmap_mark (const Map< T > &base, const Matrix< T > &weights)
 Turn a MAP into a single-class MMAP (mmap_mark with one class).
template<class T>
Mmap< T > mmap_modulate (const Matrix< T > &P, const std::vector< Map< T > > &HT, const std::vector< Mmap< T > > &comps)
 Modulate a family of marked MAPs by an environment chain.
template<class T>
Mmap< T > mmap_mixture_order2 (const std::vector< std::vector< Map< T > > > &PHs, const Matrix< T > &P2)
 Second-order mixture: the state records the previous and the current class.
template<class T>
Mmap< T > mmap_mixture_fit (const Matrix< T > &P2, const Matrix< T > &M1, const Matrix< T > &M2, const Matrix< T > &M3)
 Second-order mixture FITTED from cross moments and a triple sigma, the reference's mmap_mixture_fit.
template<class T>
Mmap< T > mmap_mixture_fit_trace (const std::vector< T > &Tv, const std::vector< int > &A)
 mmap_mixture_fit driven from a marked trace: the triple sigma and the cross moments are measured on the trace itself.
template<class T>
std::vector< Matrix< T > > mmap_embedded (const Mmap< T > &mm)
 Embedded per-class kernels E_c = (-D0)^-1 D1^(c).
template<class T>
std::vector< Map< T > > mmap_maps (const Mmap< T > &mm)
 The C MAPs seen by each class, MAP_c = (D0 + D1 - D1^(c), D1^(c)).
template<class T>
Matrix< T > mmap_pie (const Mmap< T > &mm)
 Stationary phase distribution seen just after a class-c arrival, one row per class.
template<class T>
Mmap< T > mmap_timereverse (const Mmap< T > &mm)
 Time-reversed MMAP, D^-1 M' D with D = diag(map_prob) applied to every matrix.
template<class T>
Matrix< T > mmap_sigma (const Mmap< T > &mm)
 sigma(i,j) = pie E_i E_j 1, the probability that two consecutive marks are (i,j).
template<class T>
std::vector< std::vector< std::vector< T > > > mmap_sigma2 (const Mmap< T > &mm)
 sigma2(i,j,h) = pie E_i E_j E_h 1, indexed as sigma2[i][j][h].
template<class T>
std::vector< T > mmap_count_mean (const Mmap< T > &mm, const T &t)
 Per-class mean of the counting process over a window of length t.
template<class T>
std::vector< T > mmap_count_idc (const Mmap< T > &mm, const T &t)
 Per-class index of dispersion of counts over a window of length t.
template<class T>
std::vector< T > mmap_idc (const Mmap< T > &mm)
 Asymptotic per-class index of dispersion, evaluated at t = 1e6 / sum_c lambda_c.
template<class T>
Matrix< T > mmap_count_mcov (const Mmap< T > &mm, const T &t)
 Covariance matrix of the per-class counts over a window of length t.
template<class T>
Matrix< T > mmap_cross_moment (const Mmap< T > &mm, unsigned k)
 Cross moments of order k: MC(i,j) is E[T^k] of the interval that FOLLOWS a class-i arrival, conditioned on that next arrival being of class j.
template<class T>
Matrix< T > mmap_forward_moment (const Mmap< T > &mm, const std::vector< unsigned > &orders, bool normalize)
 Forward moments: MOMENTS(a,h) is the order-orders[h] moment of the interval ENDING with a class-a arrival.
template<class T>
Matrix< T > mmap_forward_moment (const Mmap< T > &mm, const std::vector< unsigned > &orders)
 Default normalization, matching the two-argument MATLAB call.
template<class T>
Mmap< T > mmap_sum (const Mmap< T > &mm, unsigned n)
 MMAP of the sum of n independent copies, a block bidiagonal concatenation.
template<class T>
std::vector< StDistrPh< T > > mmapph1fcfs_stdistr_ph (const Mmap< T > &arrival, const std::vector< PhService< T > > &svc, double precision=1e-14)
 Per-class SOJOURN TIME as a continuous phase-type law, BUTools' 'stDistrPH'.
template<class T>
std::vector< T > mmapph1fcfs_ncmean (const Mmap< T > &arrival, const std::vector< PhService< T > > &svc)
 Per-class mean number of customers in the system, BUTools' 'ncMoms', 1.
template<class T>
std::vector< std::vector< T > > mmapph1fcfs_ncdistr (const Mmap< T > &arrival, const std::vector< PhService< T > > &svc, std::size_t levels)
 Per-class queue-length distribution, BUTools' 'ncDistr', n: P(N_k = 0..n-1).
template<class T>
bool mmdp_isfeasible (const Matrix< T > &Q, const Matrix< T > &R, const T &tol)
 True when (Q, R) is a valid MMDP pair up to the given tolerance.
template<class T>
bool mmdp_isfeasible (const Matrix< T > &Q, const Matrix< T > &R)
 mmdp_isfeasible with the MATLAB tolerance, 1e-10.
template<class T>
Map< T > mmpp2_fit (const T &E1, const T &E2, const T &E3, const T &ACFLAG1)
 MMPP(2) with moments (E1, E2, E3) and lag-1 autocorrelation ACFLAG1.
template<class T>
Map2FitResult< T > mmpp2_fit1 (const T &mean, const T &scv, const T &skew, const T &idc)
 MAP(2) with the given mean, SCV, skewness and IDC.
template<class T>
Mmpp2FitResult< T > mmpp2_fit2 (const T &mean, const T &scv, const T &skew, const T &g2)
 MMPP(2) with the given mean, SCV, skewness and decay rate g2.
template<class T>
Map< T > mmpp2_fit3 (const T &E1, const T &E2, const T &E3, const T &G2, const T &g2tol)
 MMPP(2) with moments (E1, E2, E3) and autocorrelation decay rate G2.
template<class T>
Map< T > mmpp2_fit3 (const T &E1, const T &E2, const T &E3, const T &G2)
 mmpp2_fit3 with the MATLAB default g2tol = 1e-6.
template<class T>
Mmpp2FitResult< T > mmpp2_fit4 (const T &mean, const T &scv, const T &skew, const T &acf1)
 MMPP(2) with the given mean, SCV, skewness and lag-1 autocorrelation.
template<class T>
Mmpp2FitcResult< T > mmpp2_fitc (const T &mu, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2)
 MMPP(2) from the arrival rate, the IDC at t1, t2 and infinity, and the third central moment of the counts at t2.
template<class T>
Mmpp2FitcApproxResult< T > mmpp2_fitc_approx (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2, const AugLagOptions< T > &opt)
 Fit an MMPP(2) to counting characteristics.
template<class T>
Mmpp2FitcApproxResult< T > mmpp2_fitc_approx (const T &a, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2)
 mmpp2_fitc_approx with the default tuning.
template<class T>
QbdBmapBmap1Blocks< T > qbd_bmapbmap1 (const Map< T > &arrival, const std::vector< T > &pbatch, const Map< T > &service)
 Level blocks of a BMAP/MAP/1 queue.
template<class T>
Map< T > qbd_depproc_etaqa (const Map< T > &arrival, const Map< T > &service, std::size_t n)
 MAP descriptor of the departure process of a MAP/MAP/1-FCFS queue, ETAQA-truncated at level n (qbd_depproc_etaqa.m).
template<class T>
Map< T > qbd_depproc_etaqa_ps (const Map< T > &arrival, const Map< T > &service, std::size_t n)
 MAP descriptor of the departure process of a MAP/MAP/1-PS queue, ETAQA-truncated at level n (qbd_depproc_etaqa_ps.m).
template<class T>
qbd_depproc_residual (const Map< T > &m)
 ||(D0 + D1) e||_inf, zero for a genuine MAP.
template<class T>
std::vector< T > qbd_depproc_jointmom (const Map< T > &arrival, const Map< T > &service, const std::vector< std::pair< unsigned, unsigned > > &iset)
 Joint moments E[X_0^i X_1^j] of consecutive inter-departure times of a MAP/MAP/1-FCFS queue (qbd_depproc_jointmom.m).
template<class T>
QbdMapMap1Blocks< T > qbd_mapmap1_blocks (const Map< T > &arrival, const Map< T > &service)
 Level blocks of the MAP/MAP/1 QBD from the arrival and service MAPs.
template<class T>
QbdRg< T > qbd_rg (const Map< T > &arrival, const Map< T > &service_in, const T &util)
 R and G of the MAP/MAP/1 QBD (qbd_rg.m).
template<class T>
QbdRg< T > qbd_rg (const Map< T > &arrival, const Map< T > &service)
 qbd_rg without rescaling the service process.
template<class T>
qbd_qlen_factmoment (const std::vector< T > &pi0, const Matrix< T > &R, unsigned m)
 Factorial moment of order m of the number in system, computed in closed form from the boundary vector and R:
template<class T>
qbd_qlen_moment (const std::vector< T > &pi0, const Matrix< T > &R, unsigned m)
 Raw moment of order m of the number in system, E[N^m], assembled from the factorial moments with the Stirling numbers of the second kind, N^m = sum_j S(m,j) N(N-1)...(N-j+1).
template<class T>
QbdMapMap1Result< T > qbd_mapmap1 (const Map< T > &arrival, const Map< T > &service_in, const T &util, std::size_t max_levels)
 MAP/MAP/1 queue (qbd_mapmap1.m).
template<class T>
QbdMapMap1Result< T > qbd_mapmap1 (const Map< T > &arrival, const Map< T > &service)
 qbd_mapmap1 without rescaling and with 20000 materialized levels.
template<class T>
qbd_mapmap1_qlen_truncated (const QbdMapMap1Result< T > &res)
 The mean number in system computed the way MATLAB's qbd_mapmap1 does it, by summing k over the materialized levels.
template<class T>
qbd_R_residual (const Matrix< T > &B, const Matrix< T > &L, const Matrix< T > &F, const Matrix< T > &R)
 Residual of the defining equation of R, ||F + R L + R^2 B||_inf.
template<class T>
qbd_G_residual (const Matrix< T > &B, const Matrix< T > &L, const Matrix< T > &F, const Matrix< T > &G)
 Residual of the defining equation of G, ||B + L G + F G^2||_inf.
template<class T>
Matrix< T > qbd_R (const Matrix< T > &B, const Matrix< T > &L, const Matrix< T > &F, unsigned iter_max, const T &tol)
 R by successive substitutions (qbd_R.m): iterate R <- -(F + R^2 B) L^-1.
template<class T>
Matrix< T > qbd_R (const Matrix< T > &B, const Matrix< T > &L, const Matrix< T > &F)
 qbd_R with the MATLAB defaults, 100000 iterations and tolerance 1e-12.
template<class T>
Matrix< T > qbd_R_logred (const Matrix< T > &B, const Matrix< T > &L, const Matrix< T > &F, unsigned iter_max, const T &tol)
 R by logarithmic reduction (qbd_R_logred.m).
template<class T>
Matrix< T > qbd_R_logred (const Matrix< T > &B, const Matrix< T > &L, const Matrix< T > &F)
 qbd_R_logred with the MATLAB defaults, 100000 iterations and tolerance 1e-12.
template<class T>
QbdFundMat< T > qbd_fundmat (const Matrix< T > &B, const Matrix< T > &L, const Matrix< T > &F, unsigned iter_max, const T &tol)
 G and R by cyclic reduction (qbd_fundmat.m, the Bini-Meini logarithmic reduction on the raw level blocks).
template<class T>
QbdFundMat< T > qbd_fundmat (const Matrix< T > &B, const Matrix< T > &L, const Matrix< T > &F)
 qbd_fundmat with the MATLAB defaults, 50 iterations and tolerance 1e-14.
template<class T>
qbd_caudal (const Matrix< T > &R, unsigned iter_max, const T &tol)
 Caudal characteristic eta = sp(R), the decay rate of the queue-length tail.
template<class T>
qbd_caudal (const Matrix< T > &R)
 qbd_caudal with 10000 iterations and tolerance 1e-14.
template<class T>
Matrix< T > qbd_pi (const Matrix< T > &B, const Matrix< T > &Lbar, const Matrix< T > &R, std::size_t max_levels, const T &mass_tol)
 Stationary distribution of a QBD given R (QBD_pi.m, continuous-time branch, default boundary).
template<class T>
Matrix< T > qbd_pi (const Matrix< T > &B, const Matrix< T > &Lbar, const Matrix< T > &R)
 qbd_pi with the MATLAB-side defaults, 20000 levels and mass tolerance 1e-10.
template<class T>
QbdRapResult< T > qbd_rap (const Matrix< T > &A0, const Matrix< T > &A1, const Matrix< T > &A2, const Matrix< T > &B0, const Matrix< T > &B1, std::size_t numLevels)
 Equilibrium analysis of a QBD with RAP components (qbd_rap.m).
template<class T>
QbdRapResult< T > qbd_rap (const Matrix< T > &A0, const Matrix< T > &A1, const Matrix< T > &A2)
 qbd_rap with the reference defaults, B0 = A0, B1 = A1 and 20 levels.
template<class T>
QbdRapRap1Result< T > qbd_raprap1 (const Map< T > &arrival, const Map< T > &service_in, const T &util)
 RAP/RAP/1 queue (qbd_raprap1.m).
template<class T>
QbdRapRap1Result< T > qbd_raprap1 (const Map< T > &arrival, const Map< T > &service)
 qbd_raprap1 without rescaling the service process.
template<class T>
Matrix< T > coxian_phase_subgen (const T &rate, const T &scv)
 Sub-generator of the canonical Coxian form with the given RATE and SCV, entered at phase 1 (the coxian_phase local of qbd_setupdelayoff.m, which routes through Coxian.fitMeanAndSCV for SCV != 1).
template<class T>
qbd_setupdelayoff (const T &lambda, const T &mu, const T &alpharate, const T &alphascv, const T &betarate, const T &betascv)
 Mean queue length of the M/M/1 queue with setup delay and delay-off (qbd_setupdelayoff.m).
template<class T>
SetupDelayoffClosed< T > qbd_setupdelayoff_closed (const T &N, const T &Z, const T &mu, const T &alpharate, const T &alphascv, const T &betarate, const T &betascv)
 Mean queue length and throughput of a FINITE-POPULATION queue with setup delay and delay-off, a port of matlab/src/api/mam/qbd_setupdelayoff_closed.m.
template<class T>
MamSolution< T > & finish_dispatch (const qn::NetworkStruct< T > &L, MamSolution< T > &out)
 What solver_mam_analyzer.m does AFTER whichever analyzer ran: pin the throughput of every EXT (Source) station to its declared rate, and zero every non-finite entry.
template<class T>
MamSolution< T > mam_dispatch (const qn::NetworkStruct< T > &L, const MamOptions &opt_in)
 The ladder.
template<class T>
mva::MvaSolution< T > solver_mam_basic (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of solver_mam_basic.m.
template<class T>
mva::MvaSolution< T > solver_mam_basic_mmap_inner (const qn::NetworkStruct< T > &L, const MamOptions &opt, const MmapDecConfig &cfg, const std::vector< T > &lambda, std::size_t *totiter)
 Port of solver_mam_basic_mmap_inner.m.
template<class T>
mva::MvaSolution< T > solver_mam_basic_mmap_closed (const qn::NetworkStruct< T > &L, const MamOptions &opt, const MmapDecConfig &cfg, std::size_t *totiter)
 Port of solver_mam_basic_mmap_closed.m: the per-class bisection on the surrogate arrival rate that makes the inner analyzer's queue lengths match the closed population.
template<class T>
mva::MvaSolution< T > solver_mam_basic_mmap (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of solver_mam_basic_mmap.m, the top-level dispatcher of the MMAP fork-join decomposition: an open model goes straight to the inner algorithm with the arrival rates its sources declare, a closed one through the bisection wrapper.
template<class T>
BgchainCtmc< T > mam_bgchain_ctmc (const std::vector< int > &Nb, const std::vector< std::vector< T > > &STb, const std::vector< Matrix< T > > &Pb, const std::vector< bool > &isinf_i, const std::vector< double > &nsrv, const std::vector< std::vector< double > > &cshare, const std::vector< std::vector< bool > > &supp, std::size_t states_max)
 Build and solve the background chain (mam_bgchain_ctmc.m).
template<class T>
BgchainEnv< T > mam_bgchain_env (const BgchainCtmc< T > &bg, std::size_t i)
 Lump the background chain onto the closed occupancy of station i (mam_bgchain_env.m).
template<class T>
BgchainStation< T > mam_bgchain_station (const Matrix< T > &Da0, const Matrix< T > &Da1, const std::vector< T > &alpha_s, const Matrix< T > &Tsvc, const Matrix< T > &Ain, const std::vector< int > &esup_in, double nservers, const std::vector< double > &gref_in, std::size_t Kmax)
 Solve the open classes of one station as a modulated level-dependent QBD (mam_bgchain_station.m).
template<class T>
double bgchain_states (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of solver_mam_bgchain.m.
template<class T>
mva::MvaSolution< T > solver_mam_bgchain (const qn::NetworkStruct< T > &L, const MamOptions &opt)
template<class T>
MmckDetection< T > mam_detect_mmck (const qn::NetworkStruct< T > &L, std::size_t ist, const Mmap< T > &arv)
 Port of mam_detect_mmck.m: is the exact M/M/c/K closed form legitimate at this station?
template<class T>
basic_detail::TruncRenorm< T > mam_truncate_renorm (const Mmap< T > &arv, const std::vector< PhService< T > > &svc, std::size_t capK)
 Port of mam_truncate_renorm.m: the finite-buffer marginal of an MMAP[K]/PH[K]/1 FCFS queue, by truncation and renormalization.
template<class T>
BmapMap1Blocks< T > solver_mam_bmap_map_1_blocks (const std::vector< Matrix< T > > &D, const Map< T > &service)
 Port of the block assembly and the stability test of solver_mam_bmap_map_1.m.
template<class T>
MapBmap1Blocks< T > solver_mam_map_bmap_1_blocks (const Map< T > &arrival, const std::vector< Matrix< T > > &D)
 Port of the block assembly, the generator validation and the stability test of solver_mam_map_bmap_1.m.
template<class T>
BmapQueueResult< T > solver_mam_bmap_map_1 (const std::vector< Matrix< T > > &D, const Map< T > &service, std::size_t nMoments=3)
 Port of solver_mam_bmap_map_1.m, mean measures included.
template<class T>
BmapQueueResult< T > solver_mam_map_bmap_1 (const Map< T > &arrival, const std::vector< Matrix< T > > &D)
 Port of solver_mam_map_bmap_1.m, mean measures included.
template<class T>
mva::MvaSolution< T > solver_mam_decmmap (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of solver_mam.m.
template<class T>
MamSolution< T > solver_mam_dt (const qn::NetworkStruct< T > &sn, const MamOptions &opt, double slot_length)
 Discrete-time analysis of sn, returning the same metric tuple as every other MAM analyzer.
template<class T>
MamFjInfo mam_fj_is_homogeneous (const qn::NetworkStruct< T > &L)
 Port of fj_is_homogeneous.m.
template<class T>
MamFjParams< T > mam_fj_extract_params (const qn::NetworkStruct< T > &L, const MamFjInfo &info)
 Port of fj_extract_params.m: the arrival descriptor from the Source and the service descriptor from the first branch, per class.
const std::vector< double > & mam_fj_stored_percentiles ()
 The four percentiles solver_mam_fj.m stores for getPerctRespT.
const std::vector< double > & mam_fj_dense_percentiles ()
 The 21-point grid solver_mam_fj.m inverts for the MEAN, [0.01:0.05:0.95, 0.99, 0.999].
template<class T>
mva::MvaSolution< T > solver_mam_fj (const qn::NetworkStruct< T > &L, const MamOptions &opt, std::vector< std::vector< T > > *percentiles_out)
 Port of solver_mam_fj.m.
template<class T>
mva::MvaSolution< T > solver_mam_fj (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 solver_mam_fj.m without the percentile side channel.
template<class T>
std::vector< std::vector< T > > solver_mam_fj_percentiles (const qn::NetworkStruct< T > &L, const MamOptions &opt, const std::vector< double > &percentiles)
 @@SolverMAM/getPerctRespT.m's fork-join path: the percentiles solver_mam_fj.m stores in percResults.RT, one row per class, at the four levels mam_fj_stored_percentiles() names.
template<class T>
LdqbdSolution< T > solver_mam_ldqbd (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of solver_mam_ldqbd.m.
template<class T>
LdqbdFlat< T > solver_mam_ldqbd_flatten (const LdqbdBlocks< T > &ld)
 Port of solver_mam_ldqbd_flatten.m.
template<class T>
LdqbdAvg< T > solver_mam_ldqbd_avg (const LdqbdBlocks< T > &ld, const std::vector< T > &piflat_in, const std::vector< std::size_t > &levelOf)
 Port of solver_mam_ldqbd_avg.m: map a distribution over the flat state space to means.
template<class T>
bool mam_transient_qbd_applicable (const qn::NetworkStruct< T > &L)
 Port of mam_transient_qbd_applicable.m: true when the Laplace-domain transient QBD should run instead of this fast path.
template<class T>
TranResult< T > solver_mam_ldqbd_transient (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of solver_mam_ldqbd_transient.m.
template<class T>
MapMap1Exact< T > solver_mam_mapmap1_exact (const qn::NetworkStruct< T > &L)
template<class T>
std::vector< RespTCdf< T > > solver_mam_passage_time (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of solver_mam_passage_time.m.
template<class T>
std::vector< T > mam_percentiles_from_cdf (const RespTCdf< T > &cdf, const std::vector< double > &pcts)
 Port of the CDF path of @@SolverMAM/getPerctRespT.m: linear interpolation of the response-time CDF at the requested percentile levels.
template<class T>
ProbTable< T > solver_mam_getprob (const qn::NetworkStruct< T > &L, const MamOptions &opt, std::size_t node, const mva::AvgResult< T > &avg)
 Port of @@SolverMAM/getProb.m.
template<class T>
std::vector< T > solver_mam_getprobmarg (const qn::NetworkStruct< T > &L, const MamOptions &opt, std::size_t ist, std::size_t jobclass, const mva::AvgResult< T > &avg)
 Port of @@SolverMAM/getProbMarg.m: P(n jobs of class jobclass) at station ist, for n = 0..N(jobclass) closed, or over the whole cutoff range open.
template<class T>
qsys::BmapM1Result< T > solver_mam_getmamresult (const qn::NetworkStruct< T > &L)
 Port of @@SolverMAM/getMAMResult.m: the matrix-analytic internals of a single-queue model, for a BMAP (or MAP) arrival stream into an exponential single server.
template<class T>
MamRetrialInfo mam_retrial_detect (const qn::NetworkStruct< T > &L)
 Port of qsys_is_retrial.m, plus the reneging gate of solver_mam_retrial.m.
template<class T>
std::string mam_retrial_refusal (const qn::NetworkStruct< T > &L)
 The 'retrial' method's applicability as one sentence; empty when applicable.
template<class T>
mva::MvaSolution< T > solver_mam_retrial (const qn::NetworkStruct< T > &L, const MamOptions &opt, const MamRetrialConfig &cfg=MamRetrialConfig())
 Port of solver_mam_retrial.m.
std::vector< std::string > list_valid_methods ()
 Port of SolverMAM.listValidMethods.
bool rcat_moved_to_ag (const std::string &method, std::string &why)
 True for the four RCAT names that moved to SolverAG, with the redirect message.
void check_method (const std::string &method)
 An unlisted method is refused; one that MOVED is redirected by name.
template<class T>
std::string mam_model_method_refusal (const qn::NetworkStruct< T > &L, const std::string &method)
 check_model_method asked WITHOUT raising: the same verdict as a sentence.
template<class T>
MamSolution< T > solver_mam_solve (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 The gates and the dispatch of @@SolverMAM/runAnalyzer.m, without the metric filter.
template<class T>
mva::AvgResult< T > solver_mam_run_analyzer (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of @@SolverMAM/runAnalyzer.m for the lang='matlab' path: solve, then apply the metric filter @@NetworkSolver/getAvg puts between the analyzer and the caller.
template<class T>
ProbTable< T > solver_mam_get_prob (const qn::NetworkStruct< T > &L, const MamOptions &opt, std::size_t node, const mva::AvgResult< T > &avg)
 @@SolverMAM/getProb.m: the joint (level, phase) table at a node.
template<class T>
std::vector< T > solver_mam_get_prob_marg (const qn::NetworkStruct< T > &L, const MamOptions &opt, std::size_t ist, std::size_t jobclass, const mva::AvgResult< T > &avg)
 @@SolverMAM/getProbMarg.m: P(n jobs of one class) at a station.
template<class T>
qsys::BmapM1Result< T > solver_mam_get_mam_result (const qn::NetworkStruct< T > &L)
 @@SolverMAM/getMAMResult.m: the M/G/1-type internals of a single queue.
template<class T>
std::vector< RespTCdf< T > > solver_mam_get_cdf_respt (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 @@SolverMAM/getCdfRespT.m: the response-time CDF per class.
template<class T>
std::vector< RespTCdf< T > > solver_mam_get_sjrn_t (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 @@SolverMAM/getSjrnT.m and sjrnT.m, both aliases of getCdfRespT.
template<class T>
bool mam_has_fj_percentiles (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Whether getPerctRespT reads the FJ_codes table rather than inverting a CDF.
template<class T>
std::vector< std::vector< T > > solver_mam_get_perct_respt (const qn::NetworkStruct< T > &L, const MamOptions &opt, const std::vector< double > &percentiles)
 @@SolverMAM/getPerctRespT.m: response-time percentiles per class.
template<class T>
TranResult< T > solver_mam_get_tran_avg (const qn::NetworkStruct< T > &L, const MamOptions &opt_in)
 Port of @@SolverMAM/getTranAvg.m: transient queue length, utilization and throughput.
TrafficConfig traffic_config (const MamOptions &opt)
 The traffic step's view of SolverOptions('MAM').
template<class T>
Mmap< T > mmap_max (const Mmap< T > &a, const Mmap< T > &b, std::size_t k)
 mmap_max(MMAPa, MMAPb, k): the synchronization of two flows through a join with a queue of length k on each side.
template<class T>
FjSyncMap sn_build_fj_sync_map (const qn::NetworkStruct< T > &sn)
 sn_build_fj_sync_map.
template<class T>
std::vector< Mmap< T > > solver_mam_traffic (const qn::NetworkStruct< T > &sn, const DepTable< T > &DEP, const TrafficConfig &config)
 Port of solver_mam_traffic.m.
template<class T>
std::vector< Mmap< T > > solver_mam_traffic_mmap (const qn::NetworkStruct< T > &sn, const DepTable< T > &DEP, const TrafficConfig &config, const FjSyncMap &fjSyncMap)
 Port of solver_mam_traffic_mmap.m, the fork-join aware traffic step.
template<class T>
TranResult< T > solver_mam_transient_qbd (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of solver_mam_transient_qbd.m.
template<class T>
mva::MvaSolution< T > solver_mna_open (const qn::NetworkStruct< T > &L, const MamOptions &opt, const MnaConfig &cfg=MnaConfig())
 Port of solver_mna_open.m.
template<class T>
mva::MvaSolution< T > solver_mna_closed (const qn::NetworkStruct< T > &L, const MamOptions &opt)
 Port of solver_mna_closed.m.

Variables

constexpr std::size_t LDQBD_MPHC_MAX_CONFIGS = 2000
 The widest level is the repeating one, and the LD-QBD recursion inverts one matrix of that order per level, so that is the size worth guarding.

Typedef Documentation

◆ CMat

Definition at line 51 of file mam_transient2.h.

◆ DBatch

template<class T>
using line::mam::DBatch = std::vector<Matrix<T>>

A discrete batch arrival stream, entry k carrying the slots with k events.

Definition at line 64 of file dtime.h.

◆ DepTable

template<class T>
using line::mam::DepTable = std::vector<std::vector<Map<T>>>

DEP{i,r}, the departure process of class r from i in (D0,D1) form.

Definition at line 106 of file solver_mam_traffic.h.

Enumeration Type Documentation

◆ AphPattern

enum class line::mam::AphPattern
strong

The pattern argument of aph_simplify.m, by name.

Enumerator
Sequence 
Parallel 
Branch 
Loop 

Definition at line 54 of file aph_simplify.h.

◆ FluidBoundary

enum class line::mam::FluidBoundary
strong

Boundary behaviour of one background state at a reflecting level.

Enumerator
Reflective 
Absorbing 

Definition at line 107 of file mfq_ld_solve.h.

◆ FluidDistrKind

enum class line::mam::FluidDistrKind
strong

Which functional of the stationary level law to evaluate.

Enumerator
Pdf 

per-state density

Pdfd 

derivative of the density

Cdf 

P(X < p), excluding an atom sitting exactly at p.

Cdfm 

P(X <= p), including it.

Definition at line 90 of file mfq_ld_distr.h.

◆ IltMethod

enum class line::mam::IltMethod
strong

Which Abate-Whitt weights to use.

Enumerator
Cme 
Euler 
Gaver 

Definition at line 54 of file matlab_ilt.h.

◆ MmapCompressMethod

enum class line::mam::MmapCompressMethod
strong

The compression methods of mmap_compress.m.

Enumerator
MixtureOrder1 

'default', 'mixture', 'mixture.order1'

MixtureOrder2 

'mixture.order2', not ported

Mamap2 

'mamap2', not ported

Mamap2Fb 

'mamap2.fb', not ported

M3ppApproxCov 

'm3pp.approx_cov', not ported

M3ppApproxAg 

'm3pp.approx_ag', not ported

M3ppExactDelta 

'm3pp.exact_delta', not ported

M3ppApproxDelta 

'm3pp.approx_delta', not ported

Definition at line 190 of file mmap_compress.h.

◆ ProcessType

enum class line::lang::ProcessType
strong

Distribution kinds, with the values of MATLAB ProcessType.

Definition at line 483 of file lang_types.h.

◆ RiccatiMethod

enum class line::mam::RiccatiMethod
strong

Which doubling iteration to run for Psi.

Enumerator
ADDA 
SDA 

Definition at line 82 of file mfq_solve.h.

◆ SchedStrategy

enum class line::lang::SchedStrategy
strong

Scheduling disciplines, with the values of MATLAB SchedStrategy.

Definition at line 181 of file lang_types.h.

Function Documentation

◆ amap2_adjust_gamma() [1/3]

template<class T>
Amap2AdjustGammaResult< T > line::mam::amap2_adjust_gamma ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA )

amap2_adjust_gamma with the reference defaults: weights (10,1,10), method 3, constraints 2.

Definition at line 494 of file amap2_adjust_gamma.h.

References amap2_adjust_gamma().

◆ amap2_adjust_gamma() [2/3]

template<class T>
Amap2AdjustGammaResult< T > line::mam::amap2_adjust_gamma ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
const std::vector< T > & weights,
int method,
int constraints,
const T & tol )

Nearest AMAP(2)-feasible characteristics.

Parameters
M1,M2,M3,GAMMAthe requested characteristics
weightsthe three weights on (M2, M3, GAMMA); the reference default is (10, 1, 10). Ignored by methods 3 and 4's first component, exactly as in the reference
method1..4, see the header comment; the reference default 3
constraints2 for the theoretical region (the only one ported); 1 raises UnsupportedError
tolthe strict-inequality slack, the reference's 1e-2

Definition at line 252 of file amap2_adjust_gamma.h.

References amap2_adjust_gamma(), amap2_assemble(), amap2_gamma_feasible(), aph2_adjust(), line::auglag(), line::auglag_defaults(), line::bound_box(), line::bound_lower(), line::mam::Amap2AdjustGammaResult< T >::feasible, line::NelderMeadOptions< T >::ftol, line::AugLagResult< T >::fval, line::NelderMeadResult< T >::fval, line::mam::Amap2AdjustGammaResult< T >::GAMMAa, line::InputError::InputError(), line::mam::Amap2AdjustGammaResult< T >::M2a, line::mam::Aph2AdjustResult< T >::M2a, line::mam::Amap2AdjustGammaResult< T >::M3a, line::mam::Aph2AdjustResult< T >::M3a, map_acf(), map_moment(), map_scale(), line::nelder_mead_box(), line::nelder_mead_defaults(), line::num_abs(), line::mam::Amap2AdjustGammaResult< T >::objective, line::UnsupportedError::UnsupportedError(), line::AugLagResult< T >::violation, line::AugLagResult< T >::x, line::NelderMeadResult< T >::x, and line::NelderMeadOptions< T >::xtol.

Referenced by amap2_adjust_gamma(), amap2_adjust_gamma(), and amap2_adjust_gamma().

◆ amap2_adjust_gamma() [3/3]

template<class T>
Amap2AdjustGammaResult< T > line::mam::amap2_adjust_gamma ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
int method )

amap2_adjust_gamma with a chosen method and the remaining reference defaults.

Definition at line 505 of file amap2_adjust_gamma.h.

References amap2_adjust_gamma().

◆ amap2_assemble()

template<class T>
Map< T > line::mam::amap2_assemble ( const T & l1,
const T & l2,
const T & p1,
const T & p2,
int form )

AMAP(2) in canonical form 1 (gamma >= 0) or 2 (gamma < 0).

Definition at line 36 of file amap2_assemble.h.

References amap2_assemble(), line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), and line::Matrix< T >::Matrix().

Referenced by amap2_adjust_gamma(), amap2_assemble(), and amap2_fitall_gamma().

◆ amap2_fit_gamma() [1/2]

template<class T>
Amap2FitGammaResult< T > line::mam::amap2_fit_gamma ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA )

amap2_fit_gamma with the MATLAB default cvtol = 1e-6.

Definition at line 82 of file amap2_fit_gamma.h.

References amap2_fit_gamma().

◆ amap2_fit_gamma() [2/2]

template<class T>
Amap2FitGammaResult< T > line::mam::amap2_fit_gamma ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
const T & cvtol )

◆ amap2_fit_gamma_map()

template<class T>
Amap2FitGammaResult< T > line::mam::amap2_fit_gamma_map ( const Map< T > & m)

Fit an AMAP(2) to the three moments and the decay rate of a MAP.

Definition at line 92 of file m3a_fit_from.h.

References amap2_fit_gamma(), amap2_fit_gamma_map(), map_gamma(), map_mean(), and map_moment().

Referenced by amap2_fit_gamma_map().

◆ amap2_fit_gamma_trace()

template<class T>
Amap2FitGammaResult< T > line::mam::amap2_fit_gamma_trace ( const std::vector< T > & S)

Fit an AMAP(2) to the three sample moments and the fitted decay rate of a trace.

The residual of the gamma fit is discarded, as in the reference.

Definition at line 101 of file m3a_fit_from.h.

References amap2_fit_gamma(), amap2_fit_gamma_trace(), and line::trace::trace_gamma().

Referenced by amap2_fit_gamma_trace().

◆ amap2_fitall_gamma() [1/2]

template<class T>
std::vector< Map< T > > line::mam::amap2_fitall_gamma ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA )

amap2_fitall_gamma with the MATLAB defaults degentol = 1e-8, r12tol = 1e-6.

Definition at line 149 of file amap2_fitall_gamma.h.

References amap2_fitall_gamma().

◆ amap2_fitall_gamma() [2/2]

template<class T>
std::vector< Map< T > > line::mam::amap2_fitall_gamma ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
const T & degentol,
const T & r12tol )

Every AMAP(2) matching (M1, M2, M3, GAMMA).

degentol screens the degenerate discriminants (MATLAB 1e-8); r12tol is the slack allowed on the branching probabilities before a solution is rejected (MATLAB 1e-6).

Definition at line 48 of file amap2_fitall_gamma.h.

References amap2_assemble(), amap2_fitall_gamma(), line::InputError::InputError(), line::num_abs(), and line::NumericError::NumericError().

Referenced by amap2_fit_gamma(), amap2_fitall_gamma(), amap2_fitall_gamma(), mamap22_fit_gamma_bs(), and mamap22_fit_gamma_fs().

◆ amap2_gamma_feasible()

template<class T>
bool line::mam::amap2_gamma_feasible ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
const T & slack )

Is (M1, M2, M3, GAMMA) AMAP(2)-feasible?

The predicate behind the acceptance criterion of every method here; it is the reference's own nonlcon_theoretical, evaluated rather than optimized.

Definition at line 232 of file amap2_adjust_gamma.h.

References amap2_gamma_feasible().

Referenced by amap2_adjust_gamma(), and amap2_gamma_feasible().

◆ aph2_adjust() [1/2]

template<class T>
Aph2AdjustResult< T > line::mam::aph2_adjust ( const T & M1,
const T & M2,
const T & M3 )

aph2_adjust with the MATLAB default slack tol = 1e-4.

Definition at line 92 of file aph2_adjust.h.

References aph2_adjust().

◆ aph2_adjust() [2/2]

template<class T>
Aph2AdjustResult< T > line::mam::aph2_adjust ( const T & M1,
const T & M2,
const T & M3,
const T & tol )

Feasible (M2, M3) closest to the input, holding M1 fixed.

tol is the relative slack applied above the SCV > 1 lower bound (MATLAB uses 1e-4).

Definition at line 46 of file aph2_adjust.h.

References aph2_adjust(), line::InputError::InputError(), line::mam::Aph2AdjustResult< T >::M2a, and line::mam::Aph2AdjustResult< T >::M3a.

Referenced by amap2_adjust_gamma(), aph2_adjust(), aph2_adjust(), and aph2_fit().

◆ aph2_adjust_opt_char() [1/2]

template<class T>
Aph2AdjustOptResult< T > line::mam::aph2_adjust_opt_char ( const T & M1,
const T & M2,
const T & M3 )

aph2_adjust_opt_char with the MATLAB default postol = 1e-6 and degen = 1e-10.

Definition at line 384 of file aph2_adjust_opt.h.

References aph2_adjust_opt_char().

◆ aph2_adjust_opt_char() [2/2]

template<class T>
Aph2AdjustOptResult< T > line::mam::aph2_adjust_opt_char ( const T & M1,
const T & M2,
const T & M3,
const T & postol,
const T & degen )

aph2_adjust, method 'opt_char': adjust (M2, M3) by searching the moment space subject to APH(2) invertibility.

Two constrained problems are solved, one per branch of the inversion, and the one with the smaller adjustment is returned, exactly as the reference intends.

Parameters
M1,M2,M3the requested moments
postolthe strict-positivity slack applied to the phase means (MATLAB 1e-6)
degenmagnitude below which the inversion denominator 6 M2 - 12 M1^2 is clamped; see the note on aph2_invert

Definition at line 319 of file aph2_adjust_opt.h.

References aph2_adjust_opt_char(), line::auglag_defaults(), line::auglag_ls(), line::mam::Aph2AdjustOptResult< T >::converged, line::InputError::InputError(), line::mam::Aph2AdjustOptResult< T >::M2a, line::mam::Aph2AdjustOptResult< T >::M3a, line::mam::Aph2AdjustOptResult< T >::objective, line::AugLagResult< T >::violation, line::mam::Aph2AdjustOptResult< T >::violation, and line::AugLagResult< T >::x.

Referenced by aph2_adjust_opt_char(), and aph2_adjust_opt_char().

◆ aph2_adjust_opt_param() [1/2]

template<class T>
Aph2AdjustOptResult< T > line::mam::aph2_adjust_opt_param ( const T & M1,
const T & M2,
const T & M3 )

aph2_adjust_opt_param with the MATLAB defaults feastol = 1e-6, degentol = 1e-8.

Definition at line 299 of file aph2_adjust_opt.h.

References aph2_adjust_opt_param().

◆ aph2_adjust_opt_param() [2/2]

template<class T>
Aph2AdjustOptResult< T > line::mam::aph2_adjust_opt_param ( const T & M1,
const T & M2,
const T & M3,
const T & feastol,
const T & degentol )

aph2_adjust, method 'opt_param': adjust (M2, M3) by searching the APH(2) parameter space with M1 matched exactly.

Parameters
M1,M2,M3the requested moments
feastolthe strict-inequality slack of the reference (MATLAB 1e-6), used as the lower bound on l2 and in the constraint l2 r1 <= M1 - feastol that keeps l1 positive
degentolthe slack that keeps r1 away from 0 and 1 (MATLAB 1e-8); set it to zero to allow the degenerate exponential

Definition at line 236 of file aph2_adjust_opt.h.

References aph2_adjust_opt_param(), line::auglag_defaults(), line::auglag_ls(), line::mam::Aph2AdjustOptResult< T >::converged, line::InputError::InputError(), line::mam::Aph2AdjustOptResult< T >::M2a, line::mam::Aph2AdjustOptResult< T >::M3a, line::mam::Aph2AdjustOptResult< T >::objective, line::AugLagResult< T >::violation, line::mam::Aph2AdjustOptResult< T >::violation, and line::AugLagResult< T >::x.

Referenced by aph2_adjust_opt_param(), and aph2_adjust_opt_param().

◆ aph2_assemble()

template<class T>
Map< T > line::mam::aph2_assemble ( const T & l1,
const T & l2,
const T & p1 )

APH(2) with phase means l1, l2 and continuation probability p1.

Definition at line 36 of file aph2_assemble.h.

References aph2_assemble(), line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), and line::Matrix< T >::Matrix().

Referenced by aph2_assemble(), and aph2_fitall().

◆ aph2_fit()

template<class T>
Aph2FitResult< T > line::mam::aph2_fit ( const T & M1,
const T & M2,
const T & M3 )

◆ aph2_fit_map()

template<class T>
Aph2FitResult< T > line::mam::aph2_fit_map ( const Map< T > & m)

Fit an APH(2) to the first three moments of a MAP.

Definition at line 78 of file m3a_fit_from.h.

References aph2_fit(), aph2_fit_map(), map_mean(), and map_moment().

Referenced by aph2_fit_map(), mamap22_fit_bs_multiclass(), and mamap22_fit_fs_multiclass().

◆ aph2_fit_trace()

template<class T>
Aph2FitResult< T > line::mam::aph2_fit_trace ( const std::vector< T > & S)

Fit an APH(2) to the first three sample moments of a trace.

Definition at line 84 of file m3a_fit_from.h.

References aph2_fit(), and aph2_fit_trace().

Referenced by aph2_fit_trace().

◆ aph2_fitall() [1/2]

template<class T>
std::vector< Map< T > > line::mam::aph2_fitall ( const T & M1,
const T & M2,
const T & M3 )

aph2_fitall with the MATLAB default degentol = 1e-8.

Definition at line 128 of file aph2_fitall.h.

References aph2_fitall().

◆ aph2_fitall() [2/2]

template<class T>
std::vector< Map< T > > line::mam::aph2_fitall ( const T & M1,
const T & M2,
const T & M3,
const T & degentol )

All feasible APH(2) fits of (M1, M2, M3).

degentol is the tolerance used both for the "M3 sits on its lower bound" degeneracy and for accepting a branching probability marginally outside [0, 1] (MATLAB uses 1e-8).

Definition at line 46 of file aph2_fitall.h.

References aph2_assemble(), aph2_fitall(), aph_fit(), line::InputError::InputError(), and line::num_abs().

Referenced by aph2_fit(), aph2_fitall(), and aph2_fitall().

◆ aph_bernstein()

template<class T>
Map< T > line::mam::aph_bernstein ( const std::function< double(double)> & f,
unsigned order = 20 )

The reference's (D0, D1) spelling of the same fit, kept because the JAR exposes it under this name (Aph_bernstein) and callers ported from it expect the pair rather than a Map.

Definition at line 121 of file map_bernstein.h.

References aph_bernstein(), and map_bernstein().

Referenced by aph_bernstein().

◆ aph_convseq()

template<class T>
AphPair< T > line::mam::aph_convseq ( const std::vector< AphPair< T > > & seq)

Convolve the sequence, i.e.

the law of the sum of independent terms.

Definition at line 37 of file aph_convseq.h.

References aph_convseq(), aph_simplify(), line::InputError::InputError(), and Sequence.

Referenced by aph_convseq().

◆ aph_fit() [1/3]

template<class T>
AphFitResult< T > line::mam::aph_fit ( const T & e1,
const T & e2,
const T & e3 )

aph_fit with the MATLAB defaults nmax = 10 and a 1e-12 degeneracy tolerance.

Definition at line 396 of file aph_fit.h.

References aph_fit().

◆ aph_fit() [2/3]

template<class T>
AphFitResult< T > line::mam::aph_fit ( const T & e1,
const T & e2,
const T & e3,
unsigned nmax )

aph_fit with an explicit order cap and the default degeneracy tolerance.

Definition at line 402 of file aph_fit.h.

References aph_fit().

◆ aph_fit() [3/3]

template<class T>
AphFitResult< T > line::mam::aph_fit ( const T & e1,
const T & e2,
const T & e3,
unsigned nmax,
const T & tol )

Fit an APH(n) with n <= nmax to the raw moments e1, e2, e3.

tol is the tolerance used only for the exponential degeneracy screen (scv == 1 with the matching third moment), where the general APH(2) formulas divide by zero.

The order search's own boundary tests carry a separate, precision-derived slack (fitdetail::aph_boundary_slack) so that a moment set lying ON an APH(n) bound is accepted at every arithmetic rather than at whichever ones happen to round the residual the right way. See that function for the measurement that motivates it.

Definition at line 176 of file aph_fit.h.

References line::mam::AphFitResult< T >::aph, aph_fit(), line::InputError::InputError(), line::mam::AphFitResult< T >::isexact, map_exponential_mean(), line::num_abs(), line::NumericError::NumericError(), and line::mam::AphFitResult< T >::order.

Referenced by aph2_fitall(), aph_fit(), aph_fit(), aph_fit(), line::lang::aph_fit_central(), line::lang::dist_to_map(), and line::qsys::qsys_mapg1_service_fit().

◆ aph_fit_mean_scv()

template<class T>
Map< T > line::mam::aph_fit_mean_scv ( const T & mean,
const T & scv )

Port of APH.fitMeanAndSCV, the entry point the analyzers fit arrivals with.

Definition at line 87 of file aph_fit_moments.h.

References aph_fit_mean_scv(), aph_from_2moments(), line::lang::GlobalConstants::FineTol, map_exponential(), and line::lang::GlobalConstants::Zero.

Referenced by line::lang::aph_fit_mean_scv(), and aph_fit_mean_scv().

◆ aph_from_2moments()

template<class T>
Map< T > line::mam::aph_from_2moments ( const T & e1,
const T & e2 )

Port of BUTools' APHFrom2Moments.

Absorption is possible ONLY from the last phase: the first N-1 rows of the generator have a zero row sum by construction, so D1 is zero everywhere except its last row. That is the shape, not an artifact of the fit.

Definition at line 49 of file aph_fit_moments.h.

References aph_from_2moments(), line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::Matrix< T >::Matrix(), and line::NumericError::NumericError().

Referenced by aph_fit_mean_scv(), and aph_from_2moments().

◆ aph_rand()

template<class T, class Gen>
Map< T > line::mam::aph_rand ( std::size_t K,
Gen & gen )

Random acyclic PH renewal process of order K, upper triangular in D0.

Definition at line 122 of file map_rand.h.

References aph_rand(), map_normalize(), and map_renewal().

Referenced by aph_rand().

◆ aph_simplify()

template<class T>
AphPair< T > line::mam::aph_simplify ( const AphPair< T > & d1,
const AphPair< T > & d2,
const T & p1,
const T & p2,
AphPattern pattern )

Compose two matrix-exponential laws, as aph_simplify.m does.

p1 and p2 are read only by Branch, where they are the branch probabilities; the other patterns take them as the reference does, i.e. they are present in the signature and unused.

Definition at line 89 of file aph_simplify.h.

References line::mam::AphPair< T >::alpha, aph_simplify(), Branch, line::InputError::InputError(), line::Matrix< T >::Matrix(), line::mam::AphPair< T >::order(), Parallel, line::mam::AphPair< T >::S, Sequence, and line::UnsupportedError::UnsupportedError().

Referenced by aph_convseq(), and aph_simplify().

◆ bgchain_states()

template<class T>
double line::mam::bgchain_states ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

Port of solver_mam_bgchain.m.

Parameters
Lthe refreshed struct; must be mixed (at least one open and one closed chain)
optthe MAM options; cutoff bounds the open level truncation, bgstates_max the background chain, qbdphases_max each station Number of states of the background-chain CTMC solver_mam_bgchain would build on this model, WITHOUT building it. Mirrors mam_bgchain_states.m.

The size is what decides whether bgchain is affordable and mam_bgchain_ctmc only discovers it after the partition is fixed, so the default-method chooser needs it up front. The count follows the partition below: a pass carries the tagged closed chain as background class 0 and the demand-similar groups of the other closed chains as classes 1..G, each enumerating the compositions of its population over the stations its members visit. Merging two chains onto the UNION of their supports can raise the count as easily as lower it, so the passes are enumerated rather than bounded and the largest returned: that is the one mam_bgchain_ctmc would refuse. Returns 0 when bgchain does not apply to the model at all.

Definition at line 791 of file solver_mam_bgchain.h.

References bgchain_states(), line::qn::NetworkStruct< T >::classes, line::qn::NetworkStruct< T >::inchain, line::mva::ChainDemands< T >::Lchain, line::mva::ChainDemands< T >::Nchain, line::qn::NetworkStruct< T >::nchains, line::qn::NetworkStruct< T >::nstations, line::mva::sn_get_demands_chain(), and line::mva::ChainDemands< T >::Vchain.

Referenced by bgchain_states().

◆ check_method()

void line::mam::check_method ( const std::string & method)
inline

An unlisted method is refused; one that MOVED is redirected by name.

Definition at line 121 of file solver_mam_runner.h.

References check_method(), list_valid_methods(), rcat_moved_to_ag(), and line::UnsupportedError::UnsupportedError().

Referenced by check_method(), solver_mam_get_cdf_respt(), and solver_mam_solve().

◆ cme_min_scv()

double line::mam::cme_min_scv ( std::size_t order)
inline

The minimal SCV a CME of this order attains.

Definition at line 93 of file cme.h.

References cme_min_scv(), cme_table_entry(), and line::mam::iltcme::CmeEntry::cv2.

Referenced by cme_min_scv(), and dist_fit_me().

◆ cme_representation()

◆ cme_supported_orders()

std::vector< std::size_t > line::mam::cme_supported_orders ( )
inline

Every phase count 2n+1 the vendored table realizes, ascending.

Definition at line 63 of file cme.h.

References cme_supported_orders(), line::mam::iltcme::kTable, and line::mam::iltcme::kTableSize.

Referenced by cme_supported_orders(), and dist_fit_me().

◆ cme_table_entry()

const iltcme::CmeEntry & line::mam::cme_table_entry ( std::size_t order)
inline

The most concentrated table entry realizing order phases.

Several entries share an n (the table's 'full' and 'approx' optimizations); the smallest cv2 wins, which is the selection rule matlab_ilt also applies.

Definition at line 78 of file cme.h.

References cme_table_entry(), line::InputError::InputError(), line::mam::iltcme::kTable, and line::mam::iltcme::kTableSize.

Referenced by cme_min_scv(), cme_representation(), and cme_table_entry().

◆ coxian_phase_subgen()

template<class T>
Matrix< T > line::mam::coxian_phase_subgen ( const T & rate,
const T & scv )

Sub-generator of the canonical Coxian form with the given RATE and SCV, entered at phase 1 (the coxian_phase local of qbd_setupdelayoff.m, which routes through Coxian.fitMeanAndSCV for SCV != 1).

The four branches of Coxian.fitMeanAndSCV, with MEAN = 1/rate and CoarseTol = 1e-3: |SCV - 1| <= tol one exponential phase of rate 1/MEAN; 0.5 + tol < SCV < 1 - tol two phases, mu_i = 2/MEAN/(1 -+ sqrt(2 SCV - 1)), phi = [0, 1], i.e. a pure series (hypoexponential); SCV <= 0.5 + tol an Erlang of n = ceil(1/SCV) phases of rate n/MEAN; SCV > 1 + tol two phases with mu_1 = 2/MEAN, mu_2 = mu_1/(2 SCV) and phi_1 = 1 - mu_2/mu_1, the Coxian form of a hyperexponential. The sub-generator is diag(-mu) + diag(mu_i (1 - phi_i), 1), as in Coxian.m's process assembly.

Definition at line 82 of file qbd_setupdelayoff.h.

References coxian_phase_subgen(), and line::InputError::InputError().

Referenced by coxian_phase_subgen(), qbd_setupdelayoff(), and qbd_setupdelayoff_closed().

◆ dist_fit_me()

template<class T>
Map< T > line::mam::dist_fit_me ( double mean,
double scv,
std::size_t maxPhases = 0 )

Two-moment matrix-exponential fit for 0 < scv < 1, a port of dist_fit_me.m.

The fit is the convolution X = c Y + Z of a scaled unit-mean CME Y with an independent exponential Z. Matching c + d = mean and c^2 sY + d^2 = scv mean^2 gives c = mean (1 - sqrt(1 - (1+sY)(1-scv))) / (1 + sY), d = mean - c, so every target in [sY/(1+sY), 1] is hit EXACTLY in 2n+2 phases. The exponential tail is what lets the convolution reach up to SCV 1; the concentrated part is what lets it reach far below the Erlang bound.

BUDGET-LIMITED IS NOT AN ERROR. When maxPhases cannot buy an order whose reach covers the target, the most concentrated affordable member is returned and the caller gets the closest achievable SCV, rather than a silent Erlang.

Parameters
meantarget mean, positive and finite
scvtarget SCV, strictly inside (0,1)
maxPhasescap on the phase count, 0 for no cap

Definition at line 168 of file cme.h.

References line::mam::CmeRepresentation< T >::A, line::mam::CmeRepresentation< T >::alpha, cme_min_scv(), cme_representation(), cme_supported_orders(), dist_fit_me(), line::InputError::InputError(), me_to_map(), and line::mam::CmeRepresentation< T >::scv.

Referenced by dist_fit_me().

◆ dmap_compress()

template<class T>
Dmap< T > line::mam::dmap_compress ( const Dmap< T > & d,
std::size_t max_order )

Reduces the order of a D-MAP by matching interevent moments.

Leaves the process untouched while its order stays within max_order, and otherwise replaces it by the two-phase discrete phase-type law with the same first three interevent moments, read back as a renewal D-MAP. Correlation is NOT preserved, which is the reason the multi-station discrete-time path is an approximation. When the moment triple is outside the DPH(2) region the fallback keeps the exact mean with a Geometric, so the event rate of the decomposition is conserved in every branch.

The MATLAB twin reaches the same three moments through BuTools (MGFromMoments then CanonicalFromDPH2), which admits the wider matrix-geometric class; this port solves the acyclic DPH(2) directly, so a triple that is MG(2)-feasible but not DPH(2)-feasible takes the Geometric fallback here and the two-phase fit there.

Definition at line 438 of file dtime.h.

References line::mam::Dph< T >::A, line::mam::Dph< T >::alpha, line::mam::Dmap< T >::D0, dmap_compress(), dmap_isfeasible(), dmap_moment(), dph_to_dmap(), and line::Matrix< T >::Matrix().

Referenced by dmap_compress(), and dmap_compress_batch().

◆ dmap_compress_batch()

template<class T>
DBatch< T > line::mam::dmap_compress_batch ( const DBatch< T > & A,
std::size_t max_order )

Order reduction of a BATCH stream.

The process of NONEMPTY SLOTS is compressed as a plain D-MAP and the stationary batch-size distribution, conditional on the slot being nonempty, is reattached to it. Compressing the phase alone would keep the slot process and lose the batch sizes, which would silently rescale the event rate.

MATLAB twin: dmap_compress_batch.m

Definition at line 480 of file dtime.h.

References line::Matrix< T >::cols(), line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_compress(), dmap_compress_batch(), line::mc::dtmc_solve(), line::InputError::InputError(), and line::Matrix< T >::rows().

Referenced by dmap_compress_batch(), and solver_mam_dt().

◆ dmap_dist() [1/2]

template<class T>
T line::mam::dmap_dist ( const Dmap< T > & a,
const Dmap< T > & b,
unsigned L )

Default stationary vectors, matching the three-argument MATLAB call.

Definition at line 214 of file dmap.h.

References dmap_dist(), and dmap_pie().

◆ dmap_dist() [2/2]

template<class T>
T line::mam::dmap_dist ( const Dmap< T > & a,
const Dmap< T > & b,
unsigned L,
const std::vector< T > & alA,
const std::vector< T > & alB )

Squared L2 distance between the interarrival densities truncated at lag L.

Definition at line 205 of file dmap.h.

References dmap_dist(), and dmap_exp_mul_int().

Referenced by dmap_dist(), dmap_dist(), and dmap_optim_dist().

◆ dmap_dist_acf() [1/2]

template<class T>
T line::mam::dmap_dist_acf ( const Dmap< T > & a,
const Dmap< T > & b )

Default stationary vectors, matching the two-argument MATLAB call.

Definition at line 279 of file dmap.h.

References dmap_dist_acf(), and dmap_pie().

◆ dmap_dist_acf() [2/2]

template<class T>
T line::mam::dmap_dist_acf ( const Dmap< T > & a,
const Dmap< T > & b,
const std::vector< T > & alA,
const std::vector< T > & alB )

Squared distance between the autocorrelation structures of two D-MAPs.

Definition at line 261 of file dmap.h.

References dmap_dist_acf(), dmap_geo_mul_sum(), and dmap_moment().

Referenced by dmap_dist_acf(), dmap_dist_acf(), and dmap_optim_dist_acf().

◆ dmap_dist_lag1() [1/2]

template<class T>
T line::mam::dmap_dist_lag1 ( const Dmap< T > & a,
const Dmap< T > & b )

Default stationary vectors, matching the two-argument MATLAB call.

Definition at line 344 of file dmap.h.

References dmap_dist_lag1(), and dmap_pie().

◆ dmap_dist_lag1() [2/2]

template<class T>
T line::mam::dmap_dist_lag1 ( const Dmap< T > & a,
const Dmap< T > & b,
const std::vector< T > & alA,
const std::vector< T > & alB )

Squared distance between the lag-1 joint densities of two D-MAPs.

Definition at line 285 of file dmap.h.

References line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_dist_lag1(), and line::mam::Dmap< T >::order().

Referenced by dmap_dist_lag1(), and dmap_dist_lag1().

◆ dmap_exp_mul_int() [1/2]

template<class T>
T line::mam::dmap_exp_mul_int ( const Dmap< T > & a,
const Dmap< T > & b,
unsigned L )

Default stationary vectors, matching the three-argument MATLAB call.

Definition at line 199 of file dmap.h.

References dmap_exp_mul_int(), and dmap_pie().

◆ dmap_exp_mul_int() [2/2]

template<class T>
T line::mam::dmap_exp_mul_int ( const Dmap< T > & a,
const Dmap< T > & b,
unsigned L,
const std::vector< T > & alA,
const std::vector< T > & alB )

Inner product of the two interarrival densities truncated at lag L.

Definition at line 170 of file dmap.h.

References line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_exp_mul_int(), line::InputError::InputError(), line::matmul(), line::mam::Dmap< T >::order(), and line::vecmul().

Referenced by dmap_dist(), dmap_exp_mul_int(), and dmap_exp_mul_int().

◆ dmap_geo_mul_sum() [1/2]

template<class T>
T line::mam::dmap_geo_mul_sum ( const Dmap< T > & a,
const Dmap< T > & b )

Default stationary vectors, matching the two-argument MATLAB call.

Definition at line 255 of file dmap.h.

References dmap_geo_mul_sum(), and dmap_pie().

◆ dmap_geo_mul_sum() [2/2]

template<class T>
T line::mam::dmap_geo_mul_sum ( const Dmap< T > & a,
const Dmap< T > & b,
const std::vector< T > & alA,
const std::vector< T > & alB )

Geometrically weighted sum of the lagged joint moments, the building block of the autocorrelation distance.

MATLAB returns 1/rcond as a large sentinel when the Stein operator is near singular; here the linear solve is exact in the rational backend and raises otherwise, so no sentinel is produced.

Definition at line 225 of file dmap.h.

References line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_geo_mul_sum(), line::eye(), line::inverse(), line::matmul(), line::mam::Dmap< T >::order(), and line::vecmul().

Referenced by dmap_dist_acf(), dmap_geo_mul_sum(), and dmap_geo_mul_sum().

◆ dmap_is_renewal()

template<class T>
bool line::mam::dmap_is_renewal ( const Dmap< T > & d)

True when D1 has rank one, i.e.

the process renews at every event.

Definition at line 233 of file dtime.h.

References line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, and dmap_is_renewal().

Referenced by dmap_is_renewal(), and dmap_to_dph().

◆ dmap_isfeasible()

template<class T>
bool line::mam::dmap_isfeasible ( const Dmap< T > & d)

True when D0 and D1 are nonnegative and D0 + D1 is stochastic.

Definition at line 150 of file dmap.h.

References line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_isfeasible(), and line::num_abs().

Referenced by dmap_compress(), and dmap_isfeasible().

◆ dmap_lambda_batch()

template<class T>
T line::mam::dmap_lambda_batch ( const DBatch< T > & A)

Mean number of EVENTS per slot, pi sum_k k A_k e.

A slot carrying a batch of two counts twice, which is what Little's law consumes downstream.

Definition at line 277 of file dtime.h.

References dmap_lambda_batch(), and line::mc::dtmc_solve().

Referenced by dmap_lambda_batch(), mg1_dt_queue(), and solver_mam_dt().

◆ dmap_moment()

template<class T>
std::vector< T > line::mam::dmap_moment ( const Dmap< T > & d,
const std::vector< unsigned > & orders )

Raw moments of the interarrival time in slots, for orders 1, 2 and 3 only.

Definition at line 110 of file dmap.h.

References line::mam::Dmap< T >::D0, dmap_moment(), dmap_pie(), line::eye(), line::InputError::InputError(), line::inverse(), line::mulvec(), line::ones(), line::mam::Dmap< T >::order(), and line::vecmul().

Referenced by dmap_compress(), dmap_dist_acf(), and dmap_moment().

◆ dmap_optim_dist()

template<class T>
MapOptimDist< T > line::mam::dmap_optim_dist ( const Dmap< T > & a,
const std::vector< T > & alA,
const Matrix< T > & B0,
const std::vector< T > & alB,
unsigned L )

Fit B1 minimizing the lag-L joint-PMF distance to a, with B0 fixed.

Always a LOCAL optimum: the discrete reference has no convex branch.

Definition at line 107 of file dmap_optim_dist.h.

References line::mam::MapOptimDist< T >::B1, line::Matrix< T >::cols(), line::mam::MapOptimDist< T >::d, line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_dist(), dmap_optim_dist(), line::mam::MapOptimDist< T >::global, line::InputError::InputError(), and line::Matrix< T >::rows().

Referenced by dmap_optim_dist().

◆ dmap_optim_dist_acf()

template<class T>
MapOptimDist< T > line::mam::dmap_optim_dist_acf ( const Dmap< T > & a,
const std::vector< T > & alA,
const Matrix< T > & B0,
const std::vector< T > & alB )

Fit B1 minimizing the AUTOCORRELATION distance, with B0 fixed.

As in the continuous twin, the distance is RE-EVALUATED at the returned B1 rather than taken from the optimizer, so the number reported is the distance of the D-MAP the caller was handed.

Definition at line 154 of file dmap_optim_dist.h.

References line::mam::MapOptimDist< T >::B1, line::Matrix< T >::cols(), line::mam::MapOptimDist< T >::d, line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_dist_acf(), dmap_optim_dist_acf(), line::mam::MapOptimDist< T >::global, line::InputError::InputError(), and line::Matrix< T >::rows().

Referenced by dmap_optim_dist_acf().

◆ dmap_pie()

template<class T>
std::vector< T > line::mam::dmap_pie ( const Dmap< T > & d)

Stationary phase distribution at arrival epochs.

Definition at line 104 of file dmap.h.

References line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_pie(), and line::mc::dtmc_solve().

Referenced by dmap_dist(), dmap_dist_acf(), dmap_dist_lag1(), dmap_exp_mul_int(), dmap_geo_mul_sum(), dmap_moment(), dmap_pie(), and dmap_sample().

◆ dmap_sample()

template<class T, class Gen>
std::vector< unsigned > line::mam::dmap_sample ( const Dmap< T > & d,
std::size_t n,
Gen & gen )

n interarrival times in slots, drawn by walking the phase process.

Definition at line 350 of file dmap.h.

References line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_pie(), dmap_sample(), and line::mam::Dmap< T >::order().

Referenced by dmap_sample().

◆ dmap_super()

template<class T>
DBatch< T > line::mam::dmap_super ( const DBatch< T > & A,
const DBatch< T > & B )

Superposition, E_k = sum_{i+j=k} kron(A_i, B_j).

NOT closed on D-MAPs: two slotted streams fire in the same slot with positive probability, so the merged stream carries batches. Folding E_2 into E_1 would conserve neither the arrival rate nor the slot in which the work appears, so the batch dimension is kept and the station is solved as an M/G/1-type chain instead of a QBD.

Definition at line 300 of file dtime.h.

References dmap_super().

Referenced by dmap_super().

◆ dmap_thin()

template<class T>
DBatch< T > line::mam::dmap_thin ( const DBatch< T > & A,
const T & p )

Bernoulli thinning, B_k = sum_{n>=k} C(n,k) p^k (1-p)^(n-k) A_n.

The phase process is untouched, so this is exact for PROB/RAND routing.

Definition at line 320 of file dtime.h.

References dmap_thin(), and line::InputError::InputError().

Referenced by dmap_thin().

◆ dmap_to_dph()

template<class T>
Dph< T > line::mam::dmap_to_dph ( const Dmap< T > & d)

Discrete phase-type law underlying a renewal D-MAP.

Definition at line 254 of file dtime.h.

References line::mam::Dph< T >::A, line::mam::Dph< T >::alpha, line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dmap_is_renewal(), dmap_to_dph(), and line::InputError::InputError().

Referenced by dmap_to_dph().

◆ dph_from_dist()

template<class T>
Dph< T > line::mam::dph_from_dist ( lang::ProcessType type,
const T & mean_slots,
const T & scv )

Exact discrete phase-type representation of a lattice-valued law.

Geometric, Det and DiscreteUniform are represented EXACTLY, not moment-matched: a fitted surrogate would leave the lattice the caller relies on, so any other family is an error here.

Definition at line 157 of file dtime.h.

References line::mam::Dph< T >::A, line::mam::Dph< T >::alpha, line::lang::DET, dph_from_dist(), line::lang::DUNIFORM, line::lang::GEOMETRIC, line::InputError::InputError(), and line::Matrix< T >::Matrix().

Referenced by dph_from_dist().

◆ dph_to_dmap()

template<class T>
Dmap< T > line::mam::dph_to_dmap ( const Dph< T > & d)

Renewal D-MAP (A, a alpha) of a discrete phase-type law.

Definition at line 216 of file dtime.h.

References line::mam::Dph< T >::A, line::mam::Dph< T >::alpha, line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, dph_to_dmap(), and line::Matrix< T >::Matrix().

Referenced by dmap_compress(), dph_to_dmap(), and q_dt_ph_ph_1().

◆ finish_dispatch()

template<class T>
MamSolution< T > & line::mam::finish_dispatch ( const qn::NetworkStruct< T > & L,
MamSolution< T > & out )

What solver_mam_analyzer.m does AFTER whichever analyzer ran: pin the throughput of every EXT (Source) station to its declared rate, and zero every non-finite entry.

Factored out because THREE branches return early and must still take this tail: 2a (qiu), 2c (retrial) and the 2e ldqbd preference on default. The reference has no early return at any of them – its case bodies fall through to the tail – so routing them here is what keeps the C++ ladder equivalent rather than an optimization.

THE ONE EARLY RETURN THAT DOES NOT COME HERE is the exact MAP/MAP/1 fast path, and it matches the reference: solver_mam_analyzer.m lines 10-17 return before the tail as well. It is not an omission – that analyzer sets the Source throughput itself (solver_mam_mapmap1_exact.h, Tp(src,0) = lambda), so there is nothing for the tail to pin.

Definition at line 368 of file mam_dispatch.h.

References line::qn::NetworkStruct< T >::disabled, finish_dispatch(), line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nstations, line::qn::NetworkStruct< T >::rates, line::mam::MamSolution< T >::sol, and line::qn::NetworkStruct< T >::stations.

Referenced by finish_dispatch(), and mam_dispatch().

◆ gammainc_lower()

double line::mam::gammainc_lower ( double a,
double x )
inline

Regularized lower incomplete gamma P(a, x), MATLAB's gammainc(x, a, 'lower').

Series below the transition point, continued fraction above it (Numerical Recipes 6.2); evaluated in double because it is a TRUNCATION TEST, not a returned quantity – the distribution itself is accumulated in T.

Definition at line 68 of file libqbd_taylor.h.

References gammainc_lower(), and line::InputError::InputError().

Referenced by line::lang::dist_cdf(), gammainc_lower(), and taylor_series_adaptive().

◆ hyper_rand()

template<class T, class Gen>
Map< T > line::mam::hyper_rand ( std::size_t k,
Gen & gen )

Random hyperexponential of order k, given as a MAP.

Definition at line 137 of file map_rand.h.

References hyper_rand().

Referenced by hyper_rand().

◆ hyperexp_fit_longtail()

template<class T, class Ccdf>
HyperexpLongtailResult< T > line::mam::hyperexp_fit_longtail ( Ccdf && ccdf,
const T & b = num_traits<T>::from_rational(3, 2),
const T & decade = num_traits<T>::from_int(4) )

The fit with the component count chosen automatically: one per decade between the 0.9 quantile and the 1e-6 quantile, retrying with fewer when the recursion runs out of probability near the body.

Parameters
ccdfF^c(t) = P(X > t)
bthe within-scale spacing
decadethe ratio between successive fitting arguments

Definition at line 216 of file hyperexp_fit_longtail.h.

References hyperexp_fit_longtail(), hyperexp_fit_longtail_k(), and line::InputError::InputError().

Referenced by hyperexp_fit_longtail().

◆ hyperexp_fit_longtail_k()

template<class T, class Ccdf>
HyperexpLongtailResult< T > line::mam::hyperexp_fit_longtail_k ( Ccdf && ccdf,
std::size_t k,
const T & c1,
const T & b,
const T & decade )

◆ kron()

◆ krons()

template<class T>
Matrix< T > line::mam::krons ( const Matrix< T > & A,
const Matrix< T > & B )

◆ ldqbd()

template<class T>
LdqbdResult< T > line::mam::ldqbd ( const std::vector< Matrix< T > > & q0,
const std::vector< Matrix< T > > & q1,
const std::vector< Matrix< T > > & q2 )

Solve a level-dependent QBD: rate matrices and stationary law (ldqbd.m).

Definition at line 246 of file ldqbd.h.

References ldqbd(), ldqbd_pi(), ldqbd_R(), line::mam::LdqbdResult< T >::pi, and line::mam::LdqbdResult< T >::R.

Referenced by ldqbd(), mam_bgchain_station(), and solver_mam_ldqbd().

◆ ldqbd_mphc()

template<class T>
LdqbdMphcBlocks< T > line::mam::ldqbd_mphc ( const Matrix< T > & D0,
const Matrix< T > & D1,
const std::vector< T > & alpha,
double c,
const std::vector< T > & arrRate,
const std::vector< T > & sf )

Block-tridiagonal generator of an M/PH/c queue with level-dependent arrivals.

Parameters
D0service sub-generator (p x p), phase changes without completion
D1service completion block (p x p); D1 = (-D0*1)*alpha for a PH
alphalength-p vector a server starts each new job in
cnumber of identical servers (>= 1; capped at the top level)
arrRatelength Nlev+1; arrRate[n] is the arrival rate out of level n
sfempty, or length >= Nlev: a multiplier on the station's TOTAL service rate at level n (load dependence), so each busy server runs at sf[n-1]/min(n,c) of nominal and sf[n-1] = min(n,c) reproduces the unscaled queue exactly

Q2 carries an unused entry at index 0 so the three lists line up by level, matching what the C++ ldqbd expects.

Definition at line 111 of file ldqbd_mphc.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), ldqbd_mphc(), LDQBD_MPHC_MAX_CONFIGS, line::Matrix< T >::Matrix(), ph_multisets(), line::mam::LdqbdMphcBlocks< T >::Q0, line::mam::LdqbdMphcBlocks< T >::Q1, line::mam::LdqbdMphcBlocks< T >::Q2, line::Matrix< T >::rows(), and line::UnsupportedError::UnsupportedError().

Referenced by ldqbd_mphc(), and solver_mam_ldqbd().

◆ ldqbd_pi()

template<class T>
LdqbdPi< T > line::mam::ldqbd_pi ( const std::vector< Matrix< T > > & R,
const std::vector< Matrix< T > > & q0,
const std::vector< Matrix< T > > & q1,
const std::vector< Matrix< T > > & q2 )

Stationary distribution of a level-dependent QBD given its rate matrices (ldqbd_pi.m).

The level-0 vector solves pi_0 (Q1[0] + R^(1) Q2[1]) = 0, the higher levels follow from pi_n = pi_{n-1} R^(n), and the whole family is normalized to unit total mass.

DIVERGENCE FROM THE REFERENCE, deliberate and tested. MATLAB extracts the level-0 vector from an eigendecomposition: it takes the eigenvector of A' whose eigenvalue has smallest modulus, then applies real(), abs() and a normalization. Three problems with that, all avoided here:

  • abs() silently turns a genuinely signed null vector into a nonnegative one, hiding a mis-specified generator instead of reporting it;
  • the eigenvector is only accurate to the square root of the eigenvalue separation, whereas the null vector of an exactly known matrix is a linear solve;
  • it forces the whole routine through a double-precision eigensolver, so no exact instantiation would be possible. The port solves x A = 0 with sum(x) = 1 directly (qbd_detail::statvec), one linear system, exact at Rational. On a well-posed instance the two agree to roundoff; the tests check that against MATLAB and separately check the balance residual ||pi_0 A||_inf, which the eigen route cannot drive to zero.

The scalar-level-0 special case of the reference (a level 0 of order one is seeded with pi_0 = 1 instead of solving anything) is reproduced, because for an order-one level the balance equation is 1 x 1 and any nonzero scalar is its solution up to the final normalization.

Definition at line 202 of file ldqbd.h.

References line::InputError::InputError(), ldqbd_pi(), line::matmul(), line::NumericError::NumericError(), line::mam::LdqbdPi< T >::pi, line::mam::LdqbdPi< T >::pi_level, and line::vecmul().

Referenced by ldqbd(), and ldqbd_pi().

◆ ldqbd_R()

template<class T>
std::vector< Matrix< T > > line::mam::ldqbd_R ( const std::vector< Matrix< T > > & q0,
const std::vector< Matrix< T > > & q1,
const std::vector< Matrix< T > > & q2 )

Rate matrices R^(1), ..., R^(N) of a level-dependent QBD (ldqbd_R.m).

Parameters
q0up-blocks, q0[n] from level n to n+1, n = 0..N-1
q1local blocks, q1[n] at level n, n = 0..N
q2down-blocks, q2[n] from level n to n-1, n = 1..N; q2[0] is required to be present so that the vectors line up by level, and is never read
Returns
R indexed by level, R[n] for n = 1..N; R[0] is empty

Definition at line 144 of file ldqbd.h.

References line::InputError::InputError(), ldqbd_R(), and line::matmul().

Referenced by ldqbd(), and ldqbd_R().

◆ list_valid_methods()

std::vector< std::string > line::mam::list_valid_methods ( )
inline

Port of SolverMAM.listValidMethods.

The reference's list verbatim, in its order (the comment there records that test files index into it, so nothing may be inserted in the middle). A listed name that has no ported analyzer passes this gate and is then refused BY NAME by the dispatch, which is the honest outcome and different from silently solving a different model.

exact at the end is the RCAT ALIAS – mam_dispatch.h groups it with inap/inapplus/inapinf, exactly as solver_mam_analyzer.m does – and NOT the retired autocat of solver_mam_autocat.h, whose own refusal message predates the reference re-advertising the name. retrial names the BMAP/PH/N/N analyzer that default also resolves to on a retrial topology.

Definition at line 92 of file solver_mam_runner.h.

References list_valid_methods().

Referenced by line::autosolver::auto_family_methods(), check_method(), list_valid_methods(), and line::NetworkSolver::list_valid_methods().

◆ m3pp22_fitc_approx_cov() [1/2]

template<class T>
M3pp22FitcCovResult< T > line::mam::m3pp22_fitc_approx_cov ( const T & a,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2,
const std::vector< T > & ai,
const T & st3,
const T & t3 )

m3pp22_fitc_approx_cov with the default tuning of the MMPP(2) solve.

Definition at line 299 of file m3pp22_fitc_cov.h.

References line::auglag_defaults(), and m3pp22_fitc_approx_cov().

◆ m3pp22_fitc_approx_cov() [2/2]

template<class T>
M3pp22FitcCovResult< T > line::mam::m3pp22_fitc_approx_cov ( const T & a,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2,
const std::vector< T > & ai,
const T & st3,
const T & t3,
const AugLagOptions< T > & opt )

Fit the underlying MMPP(2) by optimization, then apply the covariance split.

Parameters
a,bt1,bt2,binf,m3t2,t1,t2the aggregate counting characteristics
aithe rates of the two classes, which must sum to a
st3the requested count covariance between them at t3
t3the third time scale
opttuning of the underlying MMPP(2) solve

Definition at line 282 of file m3pp22_fitc_cov.h.

References line::InputError::InputError(), m3pp22_fitc_approx_cov(), m3pp22_fitc_approx_cov_multiclass(), line::mam::Mmpp2FitcApproxResult< T >::map, mmpp2_fitc_approx(), and line::num_abs().

Referenced by m3pp22_fitc_approx_cov(), m3pp22_fitc_approx_cov(), m3pp2m_fitc_theoretical(), and m3pp2m_fitc_trace().

◆ m3pp22_fitc_approx_cov_multiclass()

template<class T>
M3pp22FitcCovResult< T > line::mam::m3pp22_fitc_approx_cov_multiclass ( const Map< T > & mmpp,
const std::vector< T > & ai,
const T & st3,
const T & t3 )

Split a GIVEN MMPP(2) into two classes, matching the per-class rates exactly and the count covariance between them at t3 as closely as feasible.

Parameters
mmppthe underlying MAP, of order 1 (Poisson) or 2
aithe per-class rates; at most two
st3the requested count covariance between the two classes at t3
t3the third time scale

Definition at line 78 of file m3pp22_fitc_cov.h.

References line::mam::M3pp22FitcCovResult< T >::clamped, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::M3pp22FitcCovResult< T >::degenerate, line::InputError::InputError(), m3pp22_fitc_approx_cov_multiclass(), line::mam::M3pp22FitcCovResult< T >::mmap, line::num_abs(), line::NumericError::NumericError(), line::mam::M3pp22FitcCovResult< T >::root, and line::mam::M3pp22FitcCovResult< T >::sigma.

Referenced by m3pp22_fitc_approx_cov(), m3pp22_fitc_approx_cov_multiclass(), and m3pp22_interleave_fitc().

◆ m3pp22_interleave_fitc()

◆ m3pp2m_assemble()

template<class T>
Mmap< T > line::mam::m3pp2m_assemble ( const Map< T > & base,
const std::vector< T > & q1,
const std::vector< T > & q2 )

Assemble the M3PP from an underlying MAP and the per-phase marking probabilities.

The last class is NOT special-cased: every class gets the probability the QP assigned it, and the equality rows are what make the columns sum to D1.

Definition at line 303 of file m3pp2m_fitc_approx.h.

References line::mam::Map< T >::D0, line::mam::Mmap< T >::D0, line::mam::Map< T >::D1, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), and m3pp2m_assemble().

Referenced by m3pp2m_assemble().

◆ m3pp2m_fitc()

template<class T>
M3pp2mFitcResult< T > line::mam::m3pp2m_fitc ( const T & a,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2,
const std::vector< T > & ai,
const std::vector< T > & dvt3,
const T & t3 )

Fit an M3PP(2, m).

ai holds the per-class arrival rates (summing to a), dvt3 the per-class variance differences at resolution t3.

Definition at line 60 of file m3pp2m_fitc.h.

References line::mam::M3pp2mFitcResult< T >::degenerate, line::mam::Mmpp2FitcResult< T >::degenerate, line::InputError::InputError(), m3pp2m_fitc(), line::mam::Mmpp2FitcResult< T >::map, line::mam::M3pp2mFitcResult< T >::mmap, mmpp2_fitc(), and line::num_abs().

Referenced by m3pp2m_fitc(), m3pp2m_fitc_theoretical(), and m3pp2m_fitc_trace().

◆ m3pp2m_fitc_approx() [1/2]

template<class T>
M3pp2mFitcApproxResult< T > line::mam::m3pp2m_fitc_approx ( const T & a,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2,
const std::vector< T > & ai,
const std::vector< T > & dvt3,
const T & t3 )

m3pp2m_fitc_approx with no box on the free variables and the default tuning.

Definition at line 427 of file m3pp2m_fitc_approx.h.

References line::auglag_defaults(), and m3pp2m_fitc_approx().

◆ m3pp2m_fitc_approx() [2/2]

template<class T>
M3pp2mFitcApproxResult< T > line::mam::m3pp2m_fitc_approx ( const T & a,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2,
const std::vector< T > & ai,
const std::vector< T > & dvt3,
const T & t3,
const std::vector< Bound< T > > & bounds,
const AugLagOptions< T > & opt )

m3pp2m_fitc_approx: fit the underlying MMPP(2) by optimization, then split the classes on their variance DIFFERENCES at t3.

Parameters
a,bt1,bt2,binf,m3t2,t1,t2the aggregate counting characteristics
aiper-class rates, which must sum to a
dvt3per-class variance differences at t3
t3the third time scale
boundsoptional box on the free variables; empty for none, which is the default (see the reference-defect note in the header)
opttuning of the constrained solve

Definition at line 395 of file m3pp2m_fitc_approx.h.

References line::mam::M3pp2mFitcApproxResult< T >::degenerate, line::InputError::InputError(), m3pp2m_fitc_approx(), line::mam::Mmpp2FitcApproxResult< T >::map, mmpp2_fitc_approx(), line::mam::M3pp2mFitcApproxResult< T >::mmpp_objective, line::num_abs(), and line::mam::Mmpp2FitcApproxResult< T >::objective.

Referenced by m3pp2m_fitc_approx(), m3pp2m_fitc_approx(), m3pp2m_fitc_theoretical(), and m3pp2m_fitc_trace().

◆ m3pp2m_fitc_approx_ag() [1/2]

template<class T>
M3pp2mFitcApproxResult< T > line::mam::m3pp2m_fitc_approx_ag ( const T & a,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2,
const std::vector< T > & ai,
const std::vector< T > & gt3,
const T & t3 )

m3pp2m_fitc_approx_ag with no box and the default tuning.

Definition at line 523 of file m3pp2m_fitc_approx.h.

References line::auglag_defaults(), and m3pp2m_fitc_approx_ag().

◆ m3pp2m_fitc_approx_ag() [2/2]

template<class T>
M3pp2mFitcApproxResult< T > line::mam::m3pp2m_fitc_approx_ag ( const T & a,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2,
const std::vector< T > & ai,
const std::vector< T > & gt3,
const T & t3,
const std::vector< Bound< T > > & bounds,
const AugLagOptions< T > & opt )

m3pp2m_fitc_approx_ag: fit the underlying MMPP(2) by optimization, then apply the 'ag' per-class split.

Parameters
a,bt1,bt2,binf,m3t2,t1,t2the aggregate counting characteristics
aiper-class rates, which must sum to a
gt3per-class variance-plus-covariance targets at t3
t3the third time scale
boundsoptional box on the free variables; empty for none
opttuning of the constrained solve

Definition at line 500 of file m3pp2m_fitc_approx.h.

References line::InputError::InputError(), m3pp2m_fitc_approx_ag(), m3pp2m_fitc_approx_ag_multiclass(), line::mam::Mmpp2FitcApproxResult< T >::map, mmpp2_fitc_approx(), line::mam::M3pp2mFitcApproxResult< T >::mmpp_objective, line::num_abs(), and line::mam::Mmpp2FitcApproxResult< T >::objective.

Referenced by m3pp2m_fitc_approx_ag(), m3pp2m_fitc_approx_ag(), m3pp2m_fitc_theoretical(), and m3pp2m_fitc_trace().

◆ m3pp2m_fitc_approx_ag_multiclass() [1/2]

template<class T>
M3pp2mFitcApproxResult< T > line::mam::m3pp2m_fitc_approx_ag_multiclass ( const Map< T > & mmpp,
const std::vector< T > & ai,
const std::vector< T > & gt3,
const T & t3 )

m3pp2m_fitc_approx_ag_multiclass with no box and the default tuning.

Definition at line 479 of file m3pp2m_fitc_approx.h.

References line::auglag_defaults(), and m3pp2m_fitc_approx_ag_multiclass().

◆ m3pp2m_fitc_approx_ag_multiclass() [2/2]

template<class T>
M3pp2mFitcApproxResult< T > line::mam::m3pp2m_fitc_approx_ag_multiclass ( const Map< T > & mmpp,
const std::vector< T > & ai,
const std::vector< T > & gt3,
const T & t3,
const std::vector< Bound< T > > & bounds,
const AugLagOptions< T > & opt )

m3pp2m_fitc_approx_ag_multiclass: split a GIVEN MMPP(2) into m classes on their variance-plus-covariance at t3.

Parameters
mmppthe underlying MAP, of order 1 (Poisson) or 2
aiper-class rates, which must sum to the rate of mmpp
gt3per-class variance-plus-covariance targets at t3
t3the third time scale
boundsoptional box on the free variables; empty for none
opttuning of the constrained solve

Definition at line 449 of file m3pp2m_fitc_approx.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::M3pp2mFitcApproxResult< T >::degenerate, line::InputError::InputError(), m3pp2m_fitc_approx_ag_multiclass(), map_lambda(), line::mam::M3pp2mFitcApproxResult< T >::mmpp_objective, and line::num_abs().

Referenced by m3pp2m_fitc_approx_ag(), m3pp2m_fitc_approx_ag_multiclass(), and m3pp2m_fitc_approx_ag_multiclass().

◆ m3pp2m_fitc_theoretical() [1/2]

template<class T>
Mmap< T > line::mam::m3pp2m_fitc_theoretical ( const Mmap< T > & mm,
const std::string & method )

m3pp2m_fitc_theoretical with the reference's default scales t = 10, tinf = 1e4.

Definition at line 222 of file m3pp2m_interleave.h.

References m3pp2m_fitc_theoretical().

◆ m3pp2m_fitc_theoretical() [2/2]

template<class T>
Mmap< T > line::mam::m3pp2m_fitc_theoretical ( const Mmap< T > & mm,
const std::string & method,
const T & t,
const T & tinf )

Fit the counting characteristics of a GIVEN MMAP with an M3PP(2, m).

Parameters
mmthe MMAP(n, m) to fit
method'exact_delta', 'approx_delta', 'approx_cov' or 'approx_ag'
tthe single finite time scale (the reference sets t1 = t2 = t3 = t)
tinfthe near-infinite time scale

Definition at line 140 of file m3pp2m_interleave.h.

References line::mam::Mmap< T >::classes(), line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), m3pp22_fitc_approx_cov(), m3pp2m_fitc(), m3pp2m_fitc_approx(), m3pp2m_fitc_approx_ag(), m3pp2m_fitc_theoretical(), line::mam::Mmap< T >::map(), map_count_mean(), map_count_moment(), map_count_var(), mmap_count_mcov(), mmap_count_mean(), mmap_count_var(), and line::Matrix< T >::rows().

Referenced by m3pp2m_fitc_theoretical(), m3pp2m_fitc_theoretical(), and line::npfqn::npfqn_traffic_merge().

◆ m3pp2m_fitc_trace() [1/2]

template<class T>
M3pp2mFitcTraceResult< T > line::mam::m3pp2m_fitc_trace ( const std::vector< T > & Tv,
const std::vector< int > & A,
const std::string & method )

m3pp2m_fitc_trace with the reference's default time scales.

Definition at line 256 of file m3pp2m_fitc_trace.h.

References line::InputError::InputError(), and m3pp2m_fitc_trace().

◆ m3pp2m_fitc_trace() [2/2]

template<class T>
M3pp2mFitcTraceResult< T > line::mam::m3pp2m_fitc_trace ( const std::vector< T > & Tv,
const std::vector< int > & A,
const std::string & method,
const T & t1,
const T & tinf )

◆ m3pp2m_interleave()

template<class T>
Mmap< T > line::mam::m3pp2m_interleave ( const std::vector< Mmap< T > > & parts)

Interleave L M3PP(2, m_i) into one M3PP of order L + 1 whose class list is the concatenation of theirs.

Definition at line 71 of file m3pp2m_interleave.h.

References line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), m3pp2m_interleave(), and line::Matrix< T >::Matrix().

Referenced by m3pp22_interleave_fitc(), m3pp2m_interleave(), and line::npfqn::npfqn_traffic_merge().

◆ m3pp_rand()

template<class T, class Gen>
Mmap< T > line::mam::m3pp_rand ( std::size_t K,
std::size_t classes,
Gen & gen )

Random M3PP of order K with classes marks (m3a/m3pp/m3pp_rand.m).

The underlying process is mmpp_rand; the marks are a class-independent Bernoulli split of D1 with probabilities drawn from a uniform simplex, so sum_c Dc = D1 by construction. The reference wraps the draw in two further loops over the phases whose bodies overwrite the same matrices, so only the last draw survives; that is what a single draw here reproduces.

Definition at line 98 of file map_rand.h.

References line::mam::Map< T >::D0, line::mam::Mmap< T >::D0, line::mam::Map< T >::D1, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), m3pp_rand(), and mmpp_rand().

Referenced by m3pp_rand().

◆ m3pp_superpos_fitc()

template<class T>
M3ppSuperposResult< T > line::mam::m3pp_superpos_fitc ( const std::vector< T > & av,
const std::vector< T > & btv,
const std::vector< T > & binfv,
const std::vector< T > & m3tv,
const T & t,
const T & tinf )

Fit one second-order M3PP per class from its counting characteristics and superpose them.

Parameters
avper-class rates
btvper-class IDC(t)
binfvper-class IDC(inf)
m3tvper-class third central moment of counts at t
tfinite time scale
tinfnear-infinite time scale

Definition at line 111 of file m3pp_superpos_fitc.h.

References line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), m3pp_superpos_fitc(), line::mam::Mmpp2FitcResult< T >::map, line::mam::M3ppSuperposResult< T >::mmap, mmap_super(), mmpp2_fitc(), and line::mam::M3ppSuperposResult< T >::parts.

Referenced by m3pp_superpos_fitc(), m3pp_superpos_fitc_theoretical(), and m3pp_superpos_fitc_trace().

◆ m3pp_superpos_fitc_theoretical()

template<class T>
M3ppSuperposResult< T > line::mam::m3pp_superpos_fitc_theoretical ( const Mmap< T > & mm,
const T & t,
const T & tinf )

Superpose one M3PP per class to fit the counting characteristics of a given MMAP.

Parameters
mmthe process to fit
tfinite time scale
tinfnear-infinite time scale

Definition at line 145 of file m3pp_superpos_fitc.h.

References line::mam::Mmap< T >::classes(), line::InputError::InputError(), m3pp_superpos_fitc(), m3pp_superpos_fitc_theoretical(), mmap_count_idc(), mmap_count_mean(), and mmap_count_moment().

Referenced by m3pp_superpos_fitc_theoretical().

◆ m3pp_superpos_fitc_trace() [1/2]

template<class T>
M3ppSuperposResult< T > line::mam::m3pp_superpos_fitc_trace ( const std::vector< T > & Tv,
const std::vector< int > & A )

m3pp_superpos_fitc_trace with the reference's default time scales.

Definition at line 207 of file m3pp_superpos_fitc.h.

References line::InputError::InputError(), and m3pp_superpos_fitc_trace().

◆ m3pp_superpos_fitc_trace() [2/2]

template<class T>
M3ppSuperposResult< T > line::mam::m3pp_superpos_fitc_trace ( const std::vector< T > & Tv,
const std::vector< int > & A,
const T & t,
const T & tinf )

Superpose one M3PP per class to fit a multi-class trace.

Parameters
Tvinter-arrival times
Aclass labels
tfinite time scale
tinfnear-infinite time scale

Definition at line 175 of file m3pp_superpos_fitc.h.

References line::trace::MtraceCountsResult< T >::counts, line::InputError::InputError(), line::trace::MtraceCountsResult< T >::labels, m3pp_superpos_fitc(), m3pp_superpos_fitc_trace(), and line::trace::mtrace_iat2counts().

Referenced by m3pp_superpos_fitc_trace(), and m3pp_superpos_fitc_trace().

◆ make_transient_qbd()

TransientQbd line::mam::make_transient_qbd ( const std::vector< CMat > & B,
const std::vector< CMat > & L,
const std::vector< CMat > & F,
const std::vector< CMat > & Lv,
const std::vector< long > & T )
inline

◆ mam_bgchain_ctmc()

template<class T>
BgchainCtmc< T > line::mam::mam_bgchain_ctmc ( const std::vector< int > & Nb,
const std::vector< std::vector< T > > & STb,
const std::vector< Matrix< T > > & Pb,
const std::vector< bool > & isinf_i,
const std::vector< double > & nsrv,
const std::vector< std::vector< double > > & cshare,
const std::vector< std::vector< bool > > & supp,
std::size_t states_max )

Build and solve the background chain (mam_bgchain_ctmc.m).

A station holding e closed jobs serves background class b at rate n[i][b] / STb[i][b] when it is an infinite server, and cshare[i][e] * (n[i][b]/e) / STb[i][b] otherwise, splitting the capacity the closed jobs hold over the background classes in proportion to their counts. That is exact under PS and is the random-order surrogate under FCFS.

Parameters
Nbpopulation of each background class, size B in {1,2}
STb(Mc x B) mean service time per station per background class
PbB row-stochastic (Mc x Mc) routing matrices
isinf_iwhether each station of the support is an infinite server
nsrvservers of each station of the support
cshare(Mc x (Nmax+1)) mean servers the e closed jobs hold
suppsupp[i][b]: station i is on the route of background class b. NOT an optimization – a chain that never visits a station cannot hold jobs there, and enumerating the union of every chain's stations puts probability on unreachable configurations that also ABSORB, because the chain's routing matrix has a zero row at an unvisited station which row-normalizes to a self-loop. The generator turns reducible and population conservation silently fails
states_maxcap on the number of chain states

Definition at line 304 of file solver_mam_bgchain.h.

References line::mc::ctmc_makeinfgen(), line::mc::ctmc_solve(), mam_bgchain_ctmc(), line::mam::BgchainCtmc< T >::nstates, line::mam::BgchainCtmc< T >::pi, line::mam::BgchainCtmc< T >::Q, line::mam::BgchainCtmc< T >::QLen, line::mam::BgchainCtmc< T >::space, line::mam::BgchainCtmc< T >::totocc, line::mam::BgchainCtmc< T >::Tput, line::mam::BgchainCtmc< T >::Ubusy, and line::UnsupportedError::UnsupportedError().

Referenced by mam_bgchain_ctmc(), and solver_mam_bgchain().

◆ mam_bgchain_env()

template<class T>
BgchainEnv< T > line::mam::mam_bgchain_env ( const BgchainCtmc< T > & bg,
std::size_t i )

Lump the background chain onto the closed occupancy of station i (mam_bgchain_env.m).

Station i does not observe the whole closed population vector, only how many closed jobs compete with the open ones for its server. The lumped generator is the stationary-weighted aggregation of Q over the level sets {s : totocc(s,i) = e}, exact when the partition is lumpable in the Kemeny-Snell sense and the standard exact-aggregation approximation otherwise. The diagonal is rebuilt from the off-diagonal row sums, so the result is a proper generator whatever the lumping error is. Environment states of zero stationary probability are unreachable and are dropped.

Definition at line 515 of file solver_mam_bgchain.h.

References mam_bgchain_env(), line::Matrix< T >::Matrix(), line::mam::BgchainCtmc< T >::nstates, line::mam::BgchainCtmc< T >::pi, line::mam::BgchainCtmc< T >::Q, and line::mam::BgchainCtmc< T >::totocc.

Referenced by mam_bgchain_env(), and solver_mam_bgchain().

◆ mam_bgchain_station()

template<class T>
BgchainStation< T > line::mam::mam_bgchain_station ( const Matrix< T > & Da0,
const Matrix< T > & Da1,
const std::vector< T > & alpha_s,
const Matrix< T > & Tsvc,
const Matrix< T > & Ain,
const std::vector< int > & esup_in,
double nservers,
const std::vector< double > & gref_in,
std::size_t Kmax )

Solve the open classes of one station as a modulated level-dependent QBD (mam_bgchain_station.m).

Level = number of open jobs held by the station, phase = (arrival MAP phase, environment state, service phase). With k open and e closed jobs present the open aggregate completes at rate min(k+e,c) k/(k+e) times the phase-type completion rate of one busy server: the dependence on k makes the QBD level-dependent, the dependence on e makes it modulated.

The environment is level-dependent too. A lumped transition that LOWERS the closed occupancy is a closed completion here, so it carries the closed share and level k rescales it by the ratio to the averaged share gref the chain was built at; a transition that RAISES the occupancy is an arrival from elsewhere and is left alone. Without this the closed jobs would drain at their mean-field rate however long the open queue is, and the positive correlation between the two occupancies would be lost.

The level space is truncated at Kmax. An arrival at the top level is lost but still advances the arrival phase, so the arrival process keeps its exact marginal and autocorrelation and only the queue tail is cut.

Definition at line 616 of file solver_mam_bgchain.h.

References line::mam::BgchainStation< T >::cshare, line::mam::BgchainStation< T >::esup, kron(), ldqbd(), mam_bgchain_station(), line::matmul(), line::Matrix< T >::Matrix(), line::mam::BgchainStation< T >::penv, line::mam::LdqbdResult< T >::pi, line::mam::BgchainStation< T >::ploss, line::mam::BgchainStation< T >::QLen, line::Matrix< T >::rows(), line::mam::BgchainStation< T >::Tput, and line::mam::BgchainStation< T >::Util.

Referenced by mam_bgchain_station(), and solver_mam_bgchain().

◆ mam_detect_mmck()

template<class T>
MmckDetection< T > line::mam::mam_detect_mmck ( const qn::NetworkStruct< T > & L,
std::size_t ist,
const Mmap< T > & arv )

Port of mam_detect_mmck.m: is the exact M/M/c/K closed form legitimate at this station?

All three conditions are about losing nothing, not about convenience. A multi-phase arrival MMAP is not Poisson, so the M/M/c/K birth-death chain would answer a different arrival process; a non-exponential service breaks the same chain's death rates; and per-class rates that differ leave the aggregate service non-exponential even when each class is. A class the station never serves is skipped rather than failing the test, because the reference reads its NaN rate as "no inflow" – the C++ disabled flag is that same sentinel.

Parameters
ist1-based station index
arvthe assembled arrival stream at that station
Lthe refreshed struct whose station ist is being tested

Definition at line 203 of file solver_mam_bmap.h.

References line::qn::NetworkStruct< T >::disabled, line::lang::EXP, line::InputError::InputError(), line::mam::MmckDetection< T >::isMmck, mam_detect_mmck(), line::mam::MmckDetection< T >::muRate, line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nstations, line::mam::Mmap< T >::order(), line::qn::NetworkStruct< T >::rates, and line::qn::NetworkStruct< T >::service.

Referenced by mam_detect_mmck(), solver_mam_basic_mmap_inner(), solver_mam_decmmap(), and solver_mna_open().

◆ mam_dispatch()

◆ mam_fj_dense_percentiles()

const std::vector< double > & line::mam::mam_fj_dense_percentiles ( )
inline

The 21-point grid solver_mam_fj.m inverts for the MEAN, [0.01:0.05:0.95, 0.99, 0.999].

It is a percentile grid and not a quadrature rule; see defect 4 in the header for what closing it at p = 1 costs.

Definition at line 368 of file solver_mam_fj.h.

References mam_fj_dense_percentiles().

Referenced by mam_fj_dense_percentiles(), and solver_mam_fj().

◆ mam_fj_extract_params()

template<class T>
MamFjParams< T > line::mam::mam_fj_extract_params ( const qn::NetworkStruct< T > & L,
const MamFjInfo & info )

Port of fj_extract_params.m: the arrival descriptor from the Source and the service descriptor from the first branch, per class.

The reference WARNS on an unstable class and calls mainFJ anyway, which then errors with "System not stable"; the two disagree about the severity of the same condition. This refuses at the earlier point, which is where the model can still be named.

Definition at line 306 of file solver_mam_fj.h.

References line::fj::Arrival, line::mam::MamFjParams< T >::arrival, line::qn::NetworkStruct< T >::classes, line::lang::dist_to_map(), line::fj::fj_dist2fj(), line::InputError::InputError(), line::mam::MamFjInfo::K, line::mam::MamFjParams< T >::K, line::fj::FjDist< T >::lambda, mam_fj_extract_params(), line::fj::FjDist< T >::mu, line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nodes, line::qn::NetworkStruct< T >::nstations, line::mam::MamFjInfo::ok, line::lang::process_to_text(), line::mam::MamFjInfo::queueNodes, line::fj::Service, line::mam::MamFjParams< T >::service, line::qn::NetworkStruct< T >::service, line::qn::NetworkStruct< T >::stations, and line::UnsupportedError::UnsupportedError().

Referenced by mam_fj_extract_params(), and solver_mam_fj().

◆ mam_fj_is_homogeneous()

template<class T>
MamFjInfo line::mam::mam_fj_is_homogeneous ( const qn::NetworkStruct< T > & L)

Port of fj_is_homogeneous.m.

This is NOT a test for the presence of a Fork: most fork-join models fail it. It tests membership in the homogeneous class the FJ_codes approximation is defined on – one fork-join pair, K parallel queues between them carrying identical service, open classes, FCFS or PS – and it is the 2a/2b branch predicate of the analyzer dispatch. It returns rather than throws for that reason, with the rejection reason in why.

Definition at line 188 of file solver_mam_fj.h.

References line::qn::NetworkStruct< T >::classes, line::qn::NetworkStruct< T >::disabled, line::lang::dist_to_map(), line::qn::NetworkStruct< T >::fj, line::mam::MamFjInfo::forkNode, line::qn::NetworkStruct< T >::is_open_model(), line::qn::NetworkStruct< T >::join_siblings(), line::mam::MamFjInfo::joinNode, line::mam::MamFjInfo::K, mam_fj_is_homogeneous(), line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nodes, line::mam::MamFjInfo::ok, line::mam::MamFjInfo::queueNodes, line::qn::NetworkStruct< T >::service, line::sn::sn_join_quorum(), line::qn::NetworkStruct< T >::stations, and line::mam::MamFjInfo::why.

Referenced by mam_dispatch(), mam_fj_is_homogeneous(), mam_has_fj_percentiles(), and solver_mam_fj().

◆ mam_fj_stored_percentiles()

const std::vector< double > & line::mam::mam_fj_stored_percentiles ( )
inline

The four percentiles solver_mam_fj.m stores for getPerctRespT.

Definition at line 358 of file solver_mam_fj.h.

References mam_fj_stored_percentiles().

Referenced by mam_fj_stored_percentiles(), solver_mam_fj(), and solver_mam_fj_percentiles().

◆ mam_has_fj_percentiles()

template<class T>
bool line::mam::mam_has_fj_percentiles ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

Whether getPerctRespT reads the FJ_codes table rather than inverting a CDF.

The reference decides by whether the last solve left a result.Percentile behind, which happens exactly when the analyzer took branch 2a. That is a state test on a stateless interface here, so the condition is recomputed from the model. Exposed rather than inlined because the CLI needs the SAME answer: a fork-join model has no response-time CDF at all, so a caller that asked for one must be told which of the two it is getting.

Compiled out below double: mam_fj_is_homogeneous fits a phase-type per branch and is not instantiable in an exact field.

Definition at line 501 of file solver_mam_runner.h.

References line::qn::NetworkStruct< T >::fj, mam_fj_is_homogeneous(), mam_has_fj_percentiles(), and line::mam::MamFjInfo::ok.

Referenced by mam_has_fj_percentiles(), and solver_mam_get_perct_respt().

◆ mam_model_method_refusal()

template<class T>
std::string line::mam::mam_model_method_refusal ( const qn::NetworkStruct< T > & L,
const std::string & method )

check_model_method asked WITHOUT raising: the same verdict as a sentence.

autosolver::auto_family_refusal needs a reason rather than an exception – the report answers yes or no per (family, method) pair and prints why – and asking the gate itself is what keeps the offered pairs and the runnable ones the same set. Duplicating the rules there is how a method comes to be offered on a model its own runner refuses, which is exactly what happened to 'dec.mmap' and 'retrial'.

Definition at line 307 of file solver_mam_runner.h.

References mam_model_method_refusal().

Referenced by line::autosolver::auto_family_refusal(), and mam_model_method_refusal().

◆ mam_percentiles_from_cdf()

template<class T>
std::vector< T > line::mam::mam_percentiles_from_cdf ( const RespTCdf< T > & cdf,
const std::vector< double > & pcts )

Port of the CDF path of @@SolverMAM/getPerctRespT.m: linear interpolation of the response-time CDF at the requested percentile levels.

Duplicate CDF values are collapsed keeping the LAST, as MATLAB's unique(probs,'last') does, so a flat tail interpolates from the largest time carrying that probability rather than the smallest.

The FJ_codes branch of the reference is not reachable here: it reads percentiles stored by solver_mam_fj, which is not ported and whose models the dispatch refuses.

Definition at line 262 of file solver_mam_passage_time.h.

References line::mam::RespTCdf< T >::F, line::InputError::InputError(), mam_percentiles_from_cdf(), and line::mam::RespTCdf< T >::X.

Referenced by mam_percentiles_from_cdf(), and solver_mam_get_perct_respt().

◆ mam_retrial_detect()

template<class T>
MamRetrialInfo line::mam::mam_retrial_detect ( const qn::NetworkStruct< T > & L)

Port of qsys_is_retrial.m, plus the reneging gate of solver_mam_retrial.m.

Returns rather than throws, because solver_mam_analyzer.m uses it as the 2c/2d branch predicate and only errors once every branch has declined. The rejection reason travels in why so the dispatch can quote it.

Definition at line 249 of file solver_mam_retrial.h.

References line::qn::NetworkStruct< T >::cap, line::mam::MamRetrialInfo::cls, line::qn::NetworkStruct< T >::droprule, line::qn::NetworkStruct< T >::is_open_model(), mam_retrial_detect(), line::qn::NetworkStruct< T >::nclasses, line::mam::MamRetrialInfo::nservers, line::qn::NetworkStruct< T >::nstations, line::mam::MamRetrialInfo::ok, line::mam::MamRetrialInfo::R, line::mam::MamRetrialInfo::source, line::mam::MamRetrialInfo::station, line::qn::NetworkStruct< T >::stations, and line::mam::MamRetrialInfo::why.

Referenced by mam_dispatch(), mam_retrial_detect(), mam_retrial_refusal(), and solver_mam_retrial().

◆ mam_retrial_refusal()

template<class T>
std::string line::mam::mam_retrial_refusal ( const qn::NetworkStruct< T > & L)

The 'retrial' method's applicability as one sentence; empty when applicable.

A "MUST BE PRESENT" RULE, which is why it cannot live in a feature set: a FeatureSet says "I accept this construct", so it can refuse a model for HAVING something and never for LACKING it. This analyzer needs the BMAP/PH/N/N bufferless retrial topology to work on, and a model without one is not a smaller retrial model, it is a different one.

ONE PREDICATE, THREE CALLERS: mam_dispatch's 'retrial' arm raises it, runner_detail::check_model_method raises it ahead of the dispatch, and autosolver::auto_family_refusal returns it through mam_model_method_refusal, so the method the report offers and the method that runs are the same set.

Definition at line 335 of file solver_mam_retrial.h.

References mam_retrial_detect(), mam_retrial_refusal(), line::mam::MamRetrialInfo::ok, and line::mam::MamRetrialInfo::why.

Referenced by mam_dispatch(), and mam_retrial_refusal().

◆ mam_transient2()

CMat line::mam::mam_transient2 ( const TransientQbd & q,
long n,
long m,
const Complex & s )
inline

V(s,n,m) for a FINITE piecewise QBD, the port of mam_transient2.m.

K = |T| - 1 regimes and Lv[K+1] is the top boundary level, so the chain is closed above and there is no R tail.

Definition at line 502 of file mam_transient2.h.

References line::mam::TransientQbd::B1(), line::eye(), line::mam::TransientQbd::F1(), line::mam::CQbdFundMat::G, line::InputError::InputError(), line::mam::TransientQbd::L1(), line::mam::TransientQbd::Lv1(), mam_transient2(), line::matmul(), line::mam::TransientQbd::nT(), qbd_fundmat_laplace(), line::mam::CQbdFundMat::R, line::Matrix< T >::rows(), and line::mam::TransientQbd::T1().

Referenced by mam_transient2(), and solver_mam_transient_qbd().

◆ mam_transient2_open()

CMat line::mam::mam_transient2_open ( const TransientQbd & q,
long n,
long m,
const Complex & s )
inline

V(s,n,m) for an OPEN piecewise QBD, the port of mam_transient2_open.m.

K = |T| regimes; regime K repeats to infinity, so a target level above the last threshold is reached by post-multiplying with a power of R{K}.

Definition at line 318 of file mam_transient2.h.

References line::mam::TransientQbd::B1(), line::eye(), line::mam::TransientQbd::F1(), line::mam::CQbdFundMat::G, line::InputError::InputError(), line::mam::TransientQbd::L1(), line::mam::TransientQbd::Lv1(), mam_transient2_open(), line::matmul(), line::mam::TransientQbd::nT(), qbd_fundmat_laplace(), line::mam::CQbdFundMat::R, line::Matrix< T >::rows(), and line::mam::TransientQbd::T1().

Referenced by mam_transient2_open(), and solver_mam_transient_qbd().

◆ mam_transient_qbd_applicable()

template<class T>
bool line::mam::mam_transient_qbd_applicable ( const qn::NetworkStruct< T > & L)

Port of mam_transient_qbd_applicable.m: true when the Laplace-domain transient QBD should run instead of this fast path.

The Laplace solver is for single-server open queues whose ARRIVAL is non-Poisson or whose SERVICE is a correlated (non-renewal) MAP – exactly what the level structure here cannot represent. Poisson arrival with PH or exponential service, and M/M/c, stay on the fast path.

Definition at line 79 of file solver_mam_ldqbd_transient.h.

References line::qn::NetworkStruct< T >::classes, line::mam::Map< T >::D0, line::lang::dist_to_map(), mam_transient_qbd_applicable(), line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nstations, line::qn::NetworkStruct< T >::service, and line::qn::NetworkStruct< T >::stations.

Referenced by mam_transient_qbd_applicable(), and solver_mam_get_tran_avg().

◆ mam_truncate_renorm()

template<class T>
basic_detail::TruncRenorm< T > line::mam::mam_truncate_renorm ( const Mmap< T > & arv,
const std::vector< PhService< T > > & svc,
std::size_t capK )

Port of mam_truncate_renorm.m: the finite-buffer marginal of an MMAP[K]/PH[K]/1 FCFS queue, by truncation and renormalization.

The body is solver_mam_basic.h's basic_detail::truncate_renorm, which is the same function under the name the analyzer that first needed it gave it. It is re-exposed here under the REFERENCE's name so that a caller reading mam_truncate_renorm.m finds it, and so that the tail convention documented at the top of this file has one place to be documented.

Multi-class input is aggregated first: ncDistr returns the per-class marginal P(N_k = n) and the truncation needs the joint P(N_total = n).

Definition at line 252 of file solver_mam_bmap.h.

References line::InputError::InputError(), mam_truncate_renorm(), and line::UnsupportedError::UnsupportedError().

Referenced by mam_truncate_renorm().

◆ mamap22_fit_bs_multiclass()

template<class T>
Mamap22FitResult< T > line::mam::mamap22_fit_bs_multiclass ( const Map< T > & map,
const std::vector< T > & p,
const std::vector< T > & B,
const Matrix< T > & S,
const std::vector< T > & classWeights = std::vector<T>(),
const std::vector< T > & bsWeights = std::vector<T>(),
bool adjust = true )
Parameters
mapthe AMAP(2), in one of the two canonical acyclic forms
pthe two class probabilities
Bthe two target backward moments
Sthe target class transition matrix; only S(0,0) is used
classWeightsper-class weights; empty means uniform
bsWeightsthe (backward, sigma) weights; empty means (1, 1)
adjustrepair an infeasible closed form; the repair is unported

Definition at line 131 of file mamap22_fit_bs.h.

References aph2_fit_map(), line::Matrix< T >::cols(), line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::Mamap22FitResult< T >::exact, line::mam::Mamap22FitResult< T >::fB, line::mam::Mamap22FitResult< T >::fS, line::InputError::InputError(), mamap22_fit_bs_multiclass(), mamap2m_can1_coefficients(), mamap2m_can2_coefficients(), map_normalize(), line::mam::Maph2mFitResult< T >::maph, maph2m_fit_multiclass(), line::Matrix< T >::Matrix(), line::mam::Mamap22FitResult< T >::mmap, mmap_backward_moment(), mmap_sigma(), line::num_abs(), line::NumericError::NumericError(), line::Matrix< T >::rows(), and line::UnsupportedError::UnsupportedError().

Referenced by mamap22_fit_bs_multiclass(), mamap22_fit_gamma_bs(), and mamap2m_fit().

◆ mamap22_fit_fs_multiclass()

template<class T>
Mamap22FsFitResult< T > line::mam::mamap22_fit_fs_multiclass ( const Map< T > & map,
const std::vector< T > & p,
const std::vector< T > & F,
const Matrix< T > & S,
const std::vector< T > & classWeights = std::vector<T>(),
const std::vector< T > & fsWeights = std::vector<T>(),
bool adjust = true )

◆ mamap22_fit_gamma_bs()

template<class T>
Mmap< T > line::mam::mamap22_fit_gamma_bs ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
const std::vector< T > & p,
const std::vector< T > & B,
const Matrix< T > & S )

mamap22_fit_gamma_bs: fit over every AMAP(2) form and keep the closest.

Port of matlab/lib/m3a/m3a/mamap22/mamap22_fit_gamma_bs.m: the class probabilities are fitted exactly, the BACKWARD moments and the one-step class transition probabilities approximately. When the moment set admits only a one-state process, the reference perturbs the second and third moments slightly above the exponential to recover a two-state form, and falls back to a marked Poisson only if that also fails; both steps are here, as in the mamap22_fit_gamma_fs twin.

Definition at line 384 of file mamap22_fit_bs.h.

References amap2_fit_gamma(), amap2_fitall_gamma(), line::mam::Amap2FitGammaResult< T >::amaps, line::mam::Mamap22FitResult< T >::fB, line::mam::Mamap22FitResult< T >::fS, mamap22_fit_bs_multiclass(), mamap22_fit_gamma_bs(), map_normalize(), line::mam::Mamap22FitResult< T >::mmap, and line::NumericError::NumericError().

Referenced by mamap22_fit_gamma_bs(), mamap22_fit_gamma_bs_mmap(), and mamap22_fit_gamma_bs_trace().

◆ mamap22_fit_gamma_bs_mmap()

template<class T>
Mmap< T > line::mam::mamap22_fit_gamma_bs_mmap ( const Mmap< T > & mm)

◆ mamap22_fit_gamma_bs_trace()

template<class T>
Mmap< T > line::mam::mamap22_fit_gamma_bs_trace ( const std::vector< T > & Tv,
const std::vector< int > & A )

◆ mamap22_fit_gamma_fs()

template<class T>
Mmap< T > line::mam::mamap22_fit_gamma_fs ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
const std::vector< T > & p,
const std::vector< T > & F,
const Matrix< T > & S )

mamap22_fit_gamma_fs: fit over every AMAP(2) form and keep the closest.

Port of matlab/lib/m3a/m3a/mamap22/mamap22_fit_gamma_fs.m. When the moment set admits only a one-state process, the reference perturbs the second and third moments slightly above the exponential to recover a two-state form, and falls back to a marked Poisson only if that also fails; both steps are here.

Definition at line 420 of file mamap22_fit_fs.h.

References amap2_fit_gamma(), amap2_fitall_gamma(), line::mam::Amap2FitGammaResult< T >::amaps, line::mam::Mamap22FsFitResult< T >::fF, line::mam::Mamap22FsFitResult< T >::fS, mamap22_fit_fs_multiclass(), mamap22_fit_gamma_fs(), map_normalize(), line::mam::Mamap22FsFitResult< T >::mmap, and line::NumericError::NumericError().

Referenced by mamap22_fit_gamma_fs(), and mamap22_fit_gamma_fs_trace().

◆ mamap22_fit_gamma_fs_trace()

template<class T>
Mmap< T > line::mam::mamap22_fit_gamma_fs_trace ( const std::vector< T > & Tv,
const std::vector< int > & A )

◆ mamap2m_can1_coefficients()

template<class T>
Mamap2mCoefficients< T > line::mam::mamap2m_can1_coefficients ( const T & h1,
const T & h2,
const T & r1,
const T & r2 )

First canonical form, a positive autocorrelation decay.

Indices are 1-based in the reference; the vectors here are 0-based, so G[0] is the reference's G(1).

Definition at line 64 of file mamap2m_coefficients.h.

References line::mam::Mamap2mCoefficients< T >::G, mamap2m_can1_coefficients(), line::NumericError::NumericError(), line::mam::Mamap2mCoefficients< T >::U, and line::mam::Mamap2mCoefficients< T >::Y.

Referenced by mamap22_fit_bs_multiclass(), mamap22_fit_fs_multiclass(), and mamap2m_can1_coefficients().

◆ mamap2m_can2_coefficients()

template<class T>
Mamap2mCoefficients< T > line::mam::mamap2m_can2_coefficients ( const T & h1,
const T & h2,
const T & r1,
const T & r2 )

◆ mamap2m_fit()

template<class T>
Mmap< T > line::mam::mamap2m_fit ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
const std::vector< T > & p,
const std::vector< T > & F,
const std::vector< T > & B,
const Matrix< T > & S,
const std::vector< T > & fbsWeights = std::vector<T>() )

The full mamap2m_fit dispatcher.

Port of matlab/lib/m3a/m3a/mamap2m/mamap2m_fit.m. It chooses WHICH pair of descriptors to match from the AMAP's degeneracies and from the caller's weights over (forward, backward, sigma):

  • more than two classes: F+B, since the sigma fitters are two-class only;
  • a negligible gamma: the process is renewal, so a MAPH is fitted instead;
  • otherwise one AMAP(2) form at a time, taking F+B, F+S or B+S as the degeneracy allows and the weights prefer, and keeping the form whose achieved descriptors land closest.

The sigma branches call mamap22_fit_fs_multiclass and mamap22_fit_bs_multiclass (mamap22_fit_fs.h, mamap22_fit_bs.h); they fire when the weights prefer sigma over forward or backward, and on the degenerate AMAP shapes. With the reference's DEFAULT weights (1,1,1) F+B is preferred.

Parameters
fbsWeightsthe (forward, backward, sigma) weights; empty means (1,1,1)

Definition at line 477 of file mamap2m_fit.h.

References amap2_fit_gamma(), line::mam::Amap2FitGammaResult< T >::amaps, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), mamap22_fit_bs_multiclass(), mamap22_fit_fs_multiclass(), mamap2m_fit(), mamap2m_fit_fb_multiclass(), mamap2m_fit_gamma_fb(), maph2m_fit(), line::mam::Mamap22FitResult< T >::mmap, line::mam::Mamap22FsFitResult< T >::mmap, line::mam::Mamap2mFitResult< T >::mmap, mmap_backward_moment(), mmap_forward_moment(), mmap_sigma(), line::NumericError::NumericError(), line::mam::Map< T >::order(), and line::Matrix< T >::rows().

Referenced by mamap2m_fit(), and mamap2m_fit_trace().

◆ mamap2m_fit_fb_multiclass()

template<class T>
Mamap2mFitResult< T > line::mam::mamap2m_fit_fb_multiclass ( const Map< T > & map,
const std::vector< T > & p,
const std::vector< T > & F,
const std::vector< T > & B,
const std::vector< T > & classWeights = std::vector<T>(),
const std::vector< T > & fbWeights = std::vector<T>() )

Mark a canonical acyclic AMAP(2) with m classes, matching the forward and backward moments.

Parameters
mapthe AMAP(2), in one of the two canonical acyclic forms
pper-class probabilities
Fper-class target forward moments
Bper-class target backward moments
classWeightsper-class weights; empty means uniform
fbWeightsthe forward and backward weights; empty means (1, 1)

Definition at line 176 of file mamap2m_fit.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::Mamap2mFitResult< T >::fB, line::mam::Mamap2mFitResult< T >::fF, line::InputError::InputError(), mamap2m_fit_fb_multiclass(), map_mean(), map_normalize(), line::mam::Maph2mFitResult< T >::maph, maph2m_fit_multiclass(), line::mam::Mamap2mFitResult< T >::mmap, mmap_backward_moment(), mmap_forward_moment(), and line::num_abs().

Referenced by mamap2m_fit(), mamap2m_fit_fb_multiclass(), and mamap2m_fit_gamma_fb().

◆ mamap2m_fit_gamma_fb()

template<class T>
Mmap< T > line::mam::mamap2m_fit_gamma_fb ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
const std::vector< T > & p,
const std::vector< T > & F,
const std::vector< T > & B )

◆ mamap2m_fit_gamma_fb_trace()

template<class T>
Mmap< T > line::mam::mamap2m_fit_gamma_fb_trace ( const std::vector< T > & Tv,
const std::vector< int > & A )

Fit a MAMAP(2,m) from a marked trace through the (F, B) pair alone.

Port of matlab/lib/m3a/m3a/mamap2m/mamap2m_fit_gamma_fb_trace.m: the descriptors are the class probabilities and the per-class FORWARD and BACKWARD first moments, with no sigma and no descriptor-pair selection. mamap2m_fit_trace is the full dispatcher of the reference.

Parameters
Tvthe inter-arrival times
Athe class of each arrival, 1-based

Definition at line 583 of file mamap2m_fit.h.

References line::InputError::InputError(), mamap2m_fit_gamma_fb(), mamap2m_fit_gamma_fb_trace(), line::trace::mtrace_backward_moment(), line::trace::mtrace_forward_moment(), line::trace::mtrace_pc(), and line::trace::trace_gamma().

Referenced by mamap2m_fit_gamma_fb_trace().

◆ mamap2m_fit_trace()

template<class T>
Mmap< T > line::mam::mamap2m_fit_trace ( const std::vector< T > & Tv,
const std::vector< int > & A,
const std::vector< T > & fbsWeights = std::vector<T>() )

Fit a MAPH(2,m) or MAMAP(2,m) matching the characteristics of a marked trace.

Port of matlab/lib/m3a/m3a/mamap2m/mamap2m_fit_trace.m: the class probabilities are always matched exactly; the remaining two characteristics default to the forward and backward moments unless the underlying AMAP(2) is degenerate, and fbsWeights moves the preference among (forward, backward, sigma). Unlike mamap2m_fit_gamma_fb_trace this computes the class transition probabilities (mtrace_sigma) and dispatches through the full mamap2m_fit descriptor selection.

Parameters
Tvthe inter-arrival times
Athe class of each arrival, 1-based
fbsWeightsthe (forward, backward, sigma) weights; empty means (1,1,1)

Definition at line 626 of file mamap2m_fit.h.

References line::InputError::InputError(), mamap2m_fit(), mamap2m_fit_trace(), line::trace::mtrace_backward_moment(), line::trace::mtrace_forward_moment(), line::trace::mtrace_pc(), line::trace::mtrace_sigma(), and line::trace::trace_gamma().

Referenced by mamap2m_fit_trace().

◆ map2_fit() [1/2]

template<class T>
Map2FitResult< T > line::mam::map2_fit ( const T & e1,
const T & e2,
const T & e3_in,
const T & g2 )

◆ map2_fit() [2/2]

template<class T>
Map2FitResult< T > line::mam::map2_fit ( const T & e1,
const T & e2,
const T & g2 )

Three-argument form: map2_fit(e1, e2, g2), i.e.

e3 selected automatically.

Definition at line 266 of file map2_fit.h.

References map2_fit().

◆ map2_fit_idc()

template<class T>
Map2FitIdcResult< T > line::mam::map2_fit_idc ( const T & e1,
const T & e2,
const T & e3,
const T & I )

Fit a MAP(2) to three moments and an asymptotic index of dispersion.

Parameters
e1mean inter-arrival time
e2second moment of the inter-arrival times
e3third moment of the inter-arrival times
Iasymptotic index of dispersion

Definition at line 72 of file map2_fit_idc.h.

References line::mam::Map2FitResult< T >::err, line::lang::GlobalConstants::FineTol, line::mam::Map2FitResult< T >::has_map, line::mam::Map2FitIdcResult< T >::map, line::mam::Map2FitResult< T >::map, map2_fit(), map2_fit_idc(), map_exponential_mean(), and line::mam::Map2FitIdcResult< T >::status.

Referenced by line::fes::fes_map_aggregate(), and map2_fit_idc().

◆ map2mmpp()

template<class T>
Map2mmppResult< T > line::mam::map2mmpp ( const Map< T > & m)

◆ map2ph()

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).

Definition at line 337 of file map_transform.h.

References line::mam::PhType< T >::alpha, line::mam::Map< T >::D0, map2ph(), map_pie(), and line::mam::PhType< T >::subgen.

Referenced by map2ph().

◆ map_acf()

template<class T>
std::vector< T > line::mam::map_acf ( const Map< T > & m,
const std::vector< unsigned > & lags )

Autocorrelation coefficients of the inter-arrival times at the given lags,.

rho_k = (x P^k y - 1) / scv,   x = lambda pi,  y = (-D0)^-1 e,

which is matlab/lib/kpctoolbox/map/map_acf.m in full, closing line included.

The closing normalization USED TO BE MISSING here, and the raw kpctoolbox quantity x P^k y was returned instead. That is not an autocorrelation coefficient: it is 1, not 0, for a renewal process, and it is unbounded above rather than confined to [-1, 1]. On the two-class MMAP of tests/test_qbd_family.cpp the unnormalized form gave 1.13166 where MATLAB gives 0.0739911109309197, and every renewal MAP read 1 where MATLAB reads 0 (checked directly: map_acf({[-1]},{[1]}, [1 2]) is [0 0] in MATLAB, and the raw quantity is 1). The ratio rho_{k+1}/rho_k that amap2_adjust_gamma uses as its decay characteristic was correspondingly wrong, since scv cancels in the ratio but the -1 does not: MATLAB's FGAMMA is (raw_4 - 1)/(raw_3 - 1) and the port was computing raw_4/raw_3.

Exact in rational arithmetic: the normalization is one subtraction and one division, so a renewal MAP returns identically zero rather than 1e-16.

Definition at line 168 of file map_moment.h.

References line::Matrix< T >::cols(), line::mam::Map< T >::D0, line::inverse(), map_acf(), map_embedded(), map_lambda(), map_prob(), map_scv(), line::matpow(), line::mulvec(), line::NumericError::NumericError(), line::ones(), line::mam::Map< T >::order(), line::Matrix< T >::rows(), and line::vecmul().

Referenced by amap2_adjust_gamma(), map_acf(), map_anfit_lsq(), map_gamma_full(), and solver_mam_basic_mmap_inner().

◆ map_acfc()

template<class T>
std::vector< T > line::mam::map_acfc ( const Map< T > & m,
const std::vector< unsigned > & kset,
const T & u )

Autocorrelation of the counting process of a MAP at a given timescale.

Parameters
mthe MAP (D0, D1)
ksetlags, each >= 1
ulength of the counting window (the timescale)
Returns
rho(k) for each lag, in the order of kset

Definition at line 57 of file map_acfc.h.

References line::mam::Map< T >::D1, line::expm(), line::InputError::InputError(), map_acfc(), map_infgen(), map_prob(), map_varcount(), line::matmul(), line::mulvec(), line::NumericError::NumericError(), line::ones(), line::mam::Map< T >::order(), and line::vecmul().

Referenced by map_acfc().

◆ map_anfit()

template<class T>
MapAnfitResult< T > line::mam::map_anfit ( const T & ls,
const T & rho,
const T & H,
double n,
std::size_t ds )

Fit a superposition of interrupted Poisson processes to a Hurst parameter.

Parameters
lstarget arrival rate
rhotarget burstiness parameter, below 1/2 for the construction to hold
HHurst parameter; beta = 2 - 2H
nnumber of decades the variance-time curve should follow t^beta
dsstarting number of IPPs; grown when a ladder level cannot be filled

Definition at line 147 of file map_anfit.h.

References line::mam::MapAnfitResult< T >::d, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), line::mam::MapAnfitResult< T >::map, map_anfit(), map_normalize(), line::Matrix< T >::Matrix(), line::NumericError::NumericError(), line::mam::MapAnfitResult< T >::poisson_rate, line::mam::MapAnfitResult< T >::rates, and line::mam::MapAnfitResult< T >::switching.

Referenced by map_anfit(), and map_anfit_lsq().

◆ map_anfit_lsq()

template<class T>
MapAnfitResult< T > line::mam::map_anfit_lsq ( const T & ls,
const T & rho,
const T & H,
double n,
std::size_t ds,
const std::vector< T > & SA,
const std::vector< unsigned > & SAlags,
unsigned iter_max = 100 )

The least-squares variant: after the deterministic construction, the per-IPP ratios are tuned so the fitted autocorrelation matches a supplied one.

Parameters
SAtarget autocorrelation values
SAlagsthe lags they were measured at

Definition at line 222 of file map_anfit.h.

References line::auglag(), line::auglag_defaults(), line::mam::MapAnfitResult< T >::d, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), line::mam::MapAnfitResult< T >::map, map_acf(), map_anfit(), map_anfit_lsq(), map_normalize(), line::Matrix< T >::Matrix(), line::NumericError::NumericError(), line::mam::MapAnfitResult< T >::poisson_rate, line::mam::MapAnfitResult< T >::rates, line::mam::MapAnfitResult< T >::switching, and line::AugLagResult< T >::x.

Referenced by map_anfit_lsq().

◆ map_bernstein()

template<class T>
Map< T > line::mam::map_bernstein ( const std::function< double(double)> & f,
unsigned order = 20 )

Acyclic phase-type approximation of an arbitrary density by Bernstein exponentials.

Parameters
fthe density to approximate, evaluated at positive abscissae
ordernumber of phases, the reference default being 20
Returns
the fitted renewal MAP, of unit time scale; rescale with map_scale

Definition at line 62 of file map_bernstein.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_bernstein(), map_erlang(), and line::Matrix< T >::Matrix().

Referenced by aph_bernstein(), map_bernstein(), and line::api::sn_nonmarkov_toph().

◆ map_block()

template<class T>
Map< T > line::mam::map_block ( const T & E1,
const T & E2,
const T & E3,
const T & G2 )

Fit a MAP(2) to three moments and an autocorrelation decay rate.

Parameters
E1first moment
E2second moment
E3third moment
G2autocorrelation decay rate rho(i)/rho(i-1)

Definition at line 230 of file map_block.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, map_block(), map_isfeasible(), and line::Matrix< T >::Matrix().

Referenced by map_block(), map_block_scv(), and map_feasblock().

◆ map_block_scv()

template<class T>
Map< T > line::mam::map_block_scv ( const T & E1,
const T & SCV,
const T & E3,
const T & G2 )

map_block with the SCV spelling of the second argument.

Definition at line 268 of file map_block.h.

References map_block(), and map_block_scv().

Referenced by map_block_scv().

◆ map_ccdf_derivative()

template<class T>
T line::mam::map_ccdf_derivative ( const Map< T > & m,
unsigned i )

Derivative of order i at 0 of the MAP's complementary CDF, nu = pie D0^i e.

Order 0 returns pie e = 1.

Definition at line 58 of file map_joint_derivative.h.

References line::mam::Map< T >::D0, line::InputError::InputError(), map_ccdf_derivative(), map_pie(), line::matpow(), line::mam::Map< T >::order(), and line::vecmul().

Referenced by map_ccdf_derivative().

◆ map_cdf()

template<class T>
std::vector< T > line::mam::map_cdf ( const Map< T > & m,
const std::vector< T > & points )

Cumulative distribution of the inter-arrival time at the given points.

Parameters
mthe MAP (D0, D1)
pointsevaluation times, each >= 0
Returns
F(t) = Pr[T <= t] in the order of points

Definition at line 63 of file map_cdf.h.

References line::mam::Map< T >::D0, line::expm(), line::InputError::InputError(), map_cdf(), map_pie(), and line::vecmul().

Referenced by map_cdf(), line::pfqn::pfqn_stdf_heur(), line::api::sn_patience_handles(), line::fluid::solver_fluid_qsys(), solver_mam_passage_time(), and line::nc::solver_nc_cdf_respt().

◆ map_checkfeasible()

template<class T>
bool line::mam::map_checkfeasible ( const Map< T > & m,
const T & tol )

The reference's map_checkfeasible, i.e.

map_isfeasible at a given tolerance. It is a nested function of map_isfeasible.m and a top-level class in the JAR; both spellings name the same test.

Definition at line 553 of file map_transform.h.

References map_checkfeasible(), and map_isfeasible().

Referenced by map_checkfeasible().

◆ map_compute_R() [1/2]

template<class T>
Matrix< T > line::mam::map_compute_R ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu )

map_compute_R with the reference defaults, 1000 iterations and tolerance 1e-10.

Definition at line 169 of file map_m1ps.h.

References map_compute_R().

◆ map_compute_R() [2/2]

template<class T>
Matrix< T > line::mam::map_compute_R ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu,
unsigned max_iter,
const T & tol )

Rate matrix R of a MAP/M/1 queue, the minimal nonnegative solution of D + R (C - mu I) + mu R^2 = 0, by the iteration R <- -D (C - mu I + mu R)^-1 (map_compute_R.m).

Negative entries produced by rounding are clamped to zero, as in the reference; the clamp is a no-op whenever the iteration has converged.

Definition at line 135 of file map_m1ps.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), line::inverse(), map_compute_R(), line::matmul(), line::num_abs(), and line::Matrix< T >::rows().

Referenced by map_compute_R(), map_compute_R(), and map_m1ps_sojourn().

◆ map_compute_R_quadratic() [1/2]

template<class T>
Matrix< T > line::mam::map_compute_R_quadratic ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu )

map_compute_R_quadratic with the reference defaults, 5000 iterations, 1e-10.

Definition at line 247 of file map_m1ps.h.

References map_compute_R_quadratic().

◆ map_compute_R_quadratic() [2/2]

template<class T>
Matrix< T > line::mam::map_compute_R_quadratic ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu,
unsigned max_iter,
const T & tol )

The same R by the other splitting, R <- (D + mu R^2) (mu I - C)^-1, warm started at -D (C - mu I)^-1 and with the scalar case solved in closed form (the private compute_R_matrix of map_m1ps_cdfrespt.m).

For M = 1 the equation is mu R^2 + (C - mu) R + D = 0 and the root in [0, 1) is selected, which for Poisson arrivals (C = -lambda, D = lambda) is exactly the utilization rho = lambda/mu. That closed form is the sharpest available oracle for the matrix iteration.

Definition at line 184 of file map_m1ps.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), line::inverse(), map_compute_R_quadratic(), line::matmul(), line::num_abs(), line::NumericError::NumericError(), and line::Matrix< T >::rows().

Referenced by map_compute_R_quadratic(), map_compute_R_quadratic(), and map_m1ps_cdfrespt().

◆ map_compute_R_residual()

template<class T>
T line::mam::map_compute_R_residual ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu,
const Matrix< T > & R )

Residual ||D + R (C - mu I) + mu R^2||_inf of the MAP/M/1 rate equation.

Definition at line 105 of file map_m1ps.h.

References map_compute_R_residual(), line::matmul(), line::num_abs(), and line::Matrix< T >::rows().

Referenced by map_compute_R_residual().

◆ map_count_idc() [1/2]

template<class T>
std::vector< T > line::mam::map_count_idc ( const Map< T > & m,
const std::vector< T > & t )

Index of dispersion for counts (IDC) of a MAP at resolution t.

Parameters
mthe MAP (D0, D1)
twindow lengths (t > 0)
Returns
the IDC at each window length, in the order of t; 1 where the mean is zero (an orderly point process is locally Poisson as t -> 0)

Definition at line 45 of file map_count_idc.h.

References map_count_idc(), map_count_mean(), and map_count_var().

Referenced by map_count_idc(), map_count_idc(), line::mva::solver_mva_qsys_analyzer(), and line::mva::solver_rqna().

◆ map_count_idc() [2/2]

template<class T>
T line::mam::map_count_idc ( const Map< T > & m,
const T & t )

Scalar convenience: the IDC at a single window length t.

Definition at line 59 of file map_count_idc.h.

References map_count_idc().

◆ map_count_mean()

template<class T>
std::vector< T > line::mam::map_count_mean ( const Map< T > & m,
const std::vector< T > & t )

Mean of the counting process of a MAP at resolution t.

Parameters
mthe MAP (D0, D1)
twindow lengths
Returns
lambda t for each window length, in the order of t

Definition at line 44 of file map_count_mean.h.

References line::InputError::InputError(), map_count_mean(), and map_lambda().

Referenced by m3pp2m_fitc_theoretical(), map_count_idc(), map_count_mean(), and mmpp2_fitc_theoretical().

◆ map_count_moment()

template<class T>
std::vector< T > line::mam::map_count_moment ( const Map< T > & m,
const T & t,
const std::vector< unsigned > & orders )

Power moments of the counts of a MAP in a window of length t.

Parameters
mthe MAP (D0, D1)
twindow length
ordersorders of the moments to compute (0 returns 1)
Returns
E[N(t)^k] for each requested order, in the order of orders

Definition at line 69 of file map_count_moment.h.

References line::mam::Map< T >::D1, line::expm(), line::InputError::InputError(), map_count_moment(), map_infgen(), map_prob(), line::num_factorial(), and line::mam::Map< T >::order().

Referenced by m3pp2m_fitc_theoretical(), map_count_moment(), mmap_count_moment(), and mmpp2_fitc_theoretical().

◆ map_count_var()

template<class T>
std::vector< T > line::mam::map_count_var ( const Map< T > & m,
const std::vector< T > & t )

Variance of the counting process of a MAP at resolution t.

Parameters
mthe MAP (D0, D1)
twindow lengths
Returns
Var[N(t)] for each window length, in the order of t

Definition at line 74 of file map_count_var.h.

References line::mam::Map< T >::D1, line::expm(), line::InputError::InputError(), map_count_var(), map_infgen(), map_prob(), line::mulvec(), line::ones(), line::mam::Map< T >::order(), and line::vecmul().

Referenced by m3pp2m_fitc_theoretical(), map_count_idc(), map_count_var(), and mmpp2_fitc_theoretical().

◆ map_dist() [1/2]

template<class T>
T line::mam::map_dist ( const Map< T > & a,
const Map< T > & b,
unsigned L )

map_dist with both embedded distributions taken from the MAPs.

Definition at line 235 of file map_dist.h.

References map_dist(), and map_pie().

◆ map_dist() [2/2]

template<class T>
T line::mam::map_dist ( const Map< T > & a,
const Map< T > & b,
unsigned L,
const std::vector< T > & alA,
const std::vector< T > & alB )

Squared L2 distance between the two joint densities up to lag L (map_dist.m).

Definition at line 226 of file map_dist.h.

References map_dist(), and map_exp_mul_int().

Referenced by map_dist(), map_dist(), and map_optim_dist().

◆ map_dist_acf() [1/2]

template<class T>
T line::mam::map_dist_acf ( const Map< T > & a,
const Map< T > & b )

map_dist_acf with both embedded distributions taken from the MAPs.

Definition at line 256 of file map_dist.h.

References map_dist_acf(), and map_pie().

◆ map_dist_acf() [2/2]

template<class T>
T line::mam::map_dist_acf ( const Map< T > & a,
const Map< T > & b,
const std::vector< T > & alA,
const std::vector< T > & alB )

Squared L2 distance between the two autocorrelation functions (map_dist_acf.m).

Definition at line 241 of file map_dist.h.

References line::InputError::InputError(), map_dist_acf(), map_geo_mul_sum(), and map_moment().

Referenced by map_dist_acf(), map_dist_acf(), and map_optim_dist_acf().

◆ map_dist_lag1() [1/2]

template<class T>
T line::mam::map_dist_lag1 ( const Map< T > & a,
const Map< T > & b )

map_dist_lag1 with both embedded distributions taken from the MAPs.

Definition at line 289 of file map_dist.h.

References map_dist_lag1(), and map_pie().

◆ map_dist_lag1() [2/2]

template<class T>
T line::mam::map_dist_lag1 ( const Map< T > & a,
const Map< T > & b,
const std::vector< T > & alA,
const std::vector< T > & alB )

Squared L2 distance between the two lag-one joint densities (map_dist_lag1.m).

The quadratic form is vec(D1)' kron(X, Z) vec(D1) with X and Z the two Sylvester solutions; it is accumulated directly here rather than through the Kronecker product, which would be an order-four matrix in the MAP order.

Definition at line 268 of file map_dist.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, map_dist_lag1(), and line::mam::Map< T >::order().

Referenced by map_dist_lag1(), and map_dist_lag1().

◆ map_embedded()

template<class T>
Matrix< T > line::mam::map_embedded ( const Map< T > & m)

Embedded DTMC at arrival epochs, P = (-D0)^-1 D1.

Definition at line 109 of file map_moment.h.

References line::Matrix< T >::cols(), line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::inverse(), map_embedded(), line::matmul(), and line::Matrix< T >::rows().

Referenced by map_acf(), map_embedded(), and map_gamma2().

◆ map_erlang()

template<class T>
Map< T > line::mam::map_erlang ( const T & mean,
unsigned k )

◆ map_exp_mul_int() [1/2]

template<class T>
T line::mam::map_exp_mul_int ( const Map< T > & a,
const Map< T > & b,
unsigned L )

map_exp_mul_int with both stationary embedded distributions taken from the MAPs.

Definition at line 165 of file map_dist.h.

References map_exp_mul_int(), and map_pie().

◆ map_exp_mul_int() [2/2]

template<class T>
T line::mam::map_exp_mul_int ( const Map< T > & a,
const Map< T > & b,
unsigned L,
const std::vector< T > & alA,
const std::vector< T > & alB )

Integral of the product of the two interarrival densities up to lag L.

The reference recursion is Z_1 = lyap(B0', A0, alB' alA) followed by Z_i = lyap(B0', A0, B1' Z_{i-1} A1), read out as (-B0 1)' Z (-A0 1).

Definition at line 149 of file map_dist.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_exp_mul_int(), line::matmul(), and line::Matrix< T >::rows().

Referenced by map_dist(), map_exp_mul_int(), and map_exp_mul_int().

◆ map_exponential()

template<class T>
Map< T > line::mam::map_exponential ( const T & lambda)

◆ map_exponential_mean()

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).

Definition at line 118 of file map_transform.h.

References line::InputError::InputError(), map_exponential(), and map_exponential_mean().

Referenced by amap2_fit_gamma(), aph_fit(), map2_fit(), map2_fit_idc(), map_exponential_mean(), mmpp2_fit2(), line::pfqn::pfqn_stdf_heur(), solver_mam_basic(), and solver_mam_basic_mmap_inner().

◆ map_factorial_moment()

template<class T>
T line::mam::map_factorial_moment ( const Map< T > & m,
std::size_t k )

k!

pie (-D0)^-k e: the k-th factorial moment of the interarrival time.

Definition at line 77 of file map_moment_extra.h.

References line::mam::Map< T >::D0, line::InputError::InputError(), map_factorial_moment(), and map_pie().

Referenced by map_factorial_moment().

◆ map_feasblock()

template<class T>
Map< T > line::mam::map_feasblock ( const T & E1,
const T & E2_in,
const T & E3_in,
const T & G2 )

map_feasblock: repair the moments into the feasible region, then fit.

An E2 at or below the exponential value makes the SCV non-positive, and an E3 below (3/2) E2^2 / E1 is outside what any MAP(2) admits; both are raised to their limits plus a tolerance, exactly as the reference does.

Definition at line 280 of file map_block.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, map_block(), map_feasblock(), map_scale(), and line::Matrix< T >::Matrix().

Referenced by map_feasblock().

◆ map_feastol()

int line::mam::map_feastol ( )
inline

Tolerance exponent shared by the KPC feasibility checks (map_feastol.m).

It lives HERE, in the header every MAP user already includes, because it is odr-used from map_transform.h (map_isfeasible) and from map_dist.h. A declaration in one header and a definition in another that does not include it links only while some third translation unit happens to emit the weak symbol; a program built from the declaring header alone would not link.

Definition at line 49 of file map_moment.h.

References map_feastol().

Referenced by map_feastol(), map_isfeasible(), and map_mmpp2().

◆ map_gamma()

template<class T>
T line::mam::map_gamma ( const Map< T > & m,
long limit = 1000 )

Autocorrelation decay rate of a MAP (map_gamma.m).

Definition at line 192 of file map_gamma.h.

References map_gamma(), and map_gamma_full().

Referenced by amap2_fit_gamma_map(), mamap22_fit_gamma_bs_mmap(), and map_gamma().

◆ map_gamma2()

std::complex< double > line::mam::map_gamma2 ( const Map< double > & m)
inline

Subdominant eigenvalue of the embedded chain, the leading ACF decay rate.

Definition at line 85 of file map_algebra.h.

References line::eig_values(), line::InputError::InputError(), map_embedded(), and map_gamma2().

Referenced by map_gamma2().

◆ map_gamma_full()

template<class T>
MapGammaResult< T > line::mam::map_gamma_full ( const Map< T > & m,
long limit = 1000 )

◆ map_geo_mul_sum() [1/2]

template<class T>
T line::mam::map_geo_mul_sum ( const Map< T > & a,
const Map< T > & b )

map_geo_mul_sum with both embedded distributions taken from the MAPs.

Definition at line 220 of file map_dist.h.

References map_geo_mul_sum(), and map_pie().

◆ map_geo_mul_sum() [2/2]

template<class T>
T line::mam::map_geo_mul_sum ( const Map< T > & a,
const Map< T > & b,
const std::vector< T > & alA,
const std::vector< T > & alB )

Geometrically weighted sum of the cross moments of the two embedded chains.

When the Stein operator is numerically singular the reference returns 1/rcond(M) as a large penalty rather than a distance, which is what steers the fitter away from that corner of the parameter space; the same guard is kept here, driven by the pivot growth of the Kronecker matrix.

Definition at line 178 of file map_dist.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), line::inverse(), map_geo_mul_sum(), line::matmul(), line::mam::Map< T >::order(), and line::vecmul().

Referenced by map_dist_acf(), map_geo_mul_sum(), and map_geo_mul_sum().

◆ map_hyperexp() [1/2]

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.

Definition at line 194 of file map_transform.h.

References map_hyperexp().

◆ map_hyperexp() [2/2]

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).

Gated on transcendental arithmetic: the phase rates come from the root of a quadratic moment-matching condition and need a square root, which has no exact rational counterpart. MATLAB falls back to the second root and then to a smaller p when the first root is infeasible; the same two fallbacks are reproduced here, and an infeasible result throws rather than returning the empty MAP that MATLAB returns.

Definition at line 150 of file map_transform.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, map_hyperexp(), line::Matrix< T >::Matrix(), and line::NumericError::NumericError().

Referenced by line::lang::hyperexp_fit_mean_scv(), map_hyperexp(), map_hyperexp(), and line::api::sn_refresh_process_fields().

◆ map_idc()

template<class T>
T line::mam::map_idc ( const Map< T > & m)

Index of dispersion for counts, I = 1 + 2(lambda - pie (Q + e pi)^-1 D1 e).

Definition at line 196 of file map_moment.h.

References line::mam::Map< T >::D1, line::inverse(), map_idc(), map_infgen(), map_lambda(), map_pie(), map_prob(), line::mam::Map< T >::order(), and line::vecmul().

Referenced by line::fes::fes_map_aggregate(), map_idc(), and line::mva::solver_rqna().

◆ map_infgen()

◆ map_isfeasible() [1/2]

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.

The reference scans k from 15 downwards, i.e. from the tightest tolerance 1e-15 to the loosest 1e-1, stops at the first k whose map_checkfeasible passes, and reports feasible iff that tightest passing tolerance is tighter than map_feastol (1e-8). A MAP whose row sums are exact only to rounding is therefore feasible to the reference and INFEASIBLE to a zero-tolerance test.

This overload used to call the zero-tolerance form, which no assembled MAP can pass in floating point: map_block was sent to its fallback on moment sets MATLAB fits exactly, purely on the row sums' last bits.

Definition at line 571 of file map_transform.h.

References map_feastol(), and map_isfeasible().

◆ map_isfeasible() [2/2]

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.

The eigenvalue-multiplicity screen of the MATLAB routine is not reproduced – it needs a full eigendecomposition, which is not in this port; a MAP that passes here can in principle still have a defective generator.

Definition at line 498 of file map_transform.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::inverse(), map_infgen(), map_isfeasible(), line::matmul(), line::num_abs(), and line::mam::Map< T >::order().

Referenced by map2_fit(), map_block(), map_checkfeasible(), map_isfeasible(), map_isfeasible(), mmap_isfeasible_tol(), mmpp2_fit2(), and mmpp2_fit4().

◆ map_joint()

template<class T>
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).

a and i have the same length K; a[0] is ignored as a base point exactly as MATLAB's cumsum makes it.

Definition at line 455 of file map_transform.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::eye(), line::InputError::InputError(), line::inverse(), map_joint(), map_pie(), line::matmul(), line::matpow(), line::num_factorial(), line::mam::Map< T >::order(), and line::vecmul().

Referenced by map_joint().

◆ map_joint_moment()

template<class T>
T line::mam::map_joint_moment ( const Map< T > & m,
std::size_t k,
std::size_t l )

k!

l! pie (-D0)^-k P (-D0)^-l e with P = (-D0)^-1 D1: the joint moment of CONSECUTIVE interarrival times.

The EMBEDDED KERNEL P sits between the two resolvents, not D1; see the header for the measurement that separates the two.

Definition at line 97 of file map_moment_extra.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_joint_moment(), and map_pie().

Referenced by map_joint_moment().

◆ map_jointpdf_derivative()

template<class T>
T line::mam::map_jointpdf_derivative ( const Map< T > & m,
const std::vector< unsigned > & iset )

Mixed partial derivative at the origin of the joint density of consecutive inter-arrival times, gamma = pie prod_j (D0^{i_j} D1) e.

An empty index set returns pie e = 1, matching the MATLAB loop over an empty vector.

Definition at line 76 of file map_joint_derivative.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_jointpdf_derivative(), map_pie(), line::matpow(), line::mam::Map< T >::order(), and line::vecmul().

Referenced by map_jointpdf_derivative().

◆ map_kpc() [1/2]

template<class T>
Map< T > line::mam::map_kpc ( const Map< T > & a,
const Map< T > & b )

Kronecker product composition of two MAPs.

Definition at line 68 of file map_algebra.h.

References line::Matrix< T >::cols(), line::mam::Map< T >::D0, line::mam::Map< T >::D1, kron(), map_kpc(), and line::Matrix< T >::rows().

Referenced by map_kpc(), and map_kpc().

◆ map_kpc() [2/2]

template<class T>
Map< T > line::mam::map_kpc ( const std::vector< Map< T > > & maps)

Left-folded composition of a whole list of MAPs.

Definition at line 77 of file map_algebra.h.

References line::InputError::InputError(), and map_kpc().

◆ map_kurt()

template<class T>
T line::mam::map_kurt ( const Map< T > & m)

Kurtosis of the inter-arrival time (map_kurt.m); rational in the entries.

Definition at line 418 of file map_transform.h.

References map_kurt(), map_moment(), and map_var().

Referenced by map_kurt().

◆ map_lambda()

◆ map_largemap()

std::size_t line::mam::map_largemap ( )
inline

Order above which a MAP counts as large for the fitting heuristics.

Definition at line 48 of file map_algebra.h.

References map_largemap().

Referenced by map_largemap().

◆ map_m1ps_cdfrespt() [1/2]

template<class T>
MapM1psResult< T > line::mam::map_m1ps_cdfrespt ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu,
const std::vector< T > & x )

map_m1ps_cdfrespt with the reference defaults, epsilon 1e-11 and 1e-10.

Definition at line 607 of file map_m1ps.h.

References map_m1ps_cdfrespt().

◆ map_m1ps_cdfrespt() [2/2]

template<class T>
MapM1psResult< T > line::mam::map_m1ps_cdfrespt ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu,
const std::vector< T > & x,
const T & epsilon,
const T & epsilon_prime )

Complementary sojourn time distribution of a MAP/M/1-PS queue by the spectral-radius truncation (map_m1ps_cdfrespt.m).

Differences from map_m1ps_sojourn are listed in the header note: R comes from the other splitting, the level truncation is estimated from Sp(R) and then cut again at ||pi_0 R^n D||_inf < epsilon/100, and the h recursion is built ONCE at the largest uniformization index over all evaluation points instead of once per point.

Sp(R) is obtained from the caudal-characteristic bracket on the nonnegative R (qbd_caudal) rather than from a double-precision eigensolve, so the truncation estimate is computed at the working precision.

Definition at line 494 of file map_m1ps.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), line::mam::MapM1psResult< T >::k_max, map_compute_R_quadratic(), map_m1ps_cdfrespt(), map_m1ps_h_recursive(), line::mam::MapM1psResult< T >::n_levels, line::num_abs(), line::NumericError::NumericError(), qbd_caudal(), line::Matrix< T >::rows(), line::vecmul(), line::mam::MapM1psResult< T >::w_bar, and line::mam::MapM1psResult< T >::w_bar_n_unweighted.

Referenced by map_m1ps_cdfrespt(), map_m1ps_cdfrespt(), and solver_mam_passage_time().

◆ map_m1ps_h_recursive()

template<class T>
std::vector< std::vector< std::vector< T > > > line::mam::map_m1ps_h_recursive ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu,
std::size_t N,
std::size_t K )

The vectors h_{n,k} of Theorem 1 (map_m1ps_h_recursive.m).

Returns
h[n][k], each of length M, for n = 0..N and k = 0..K

Definition at line 257 of file map_m1ps.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), map_m1ps_h_recursive(), line::mulvec(), line::num_abs(), line::NumericError::NumericError(), and line::Matrix< T >::rows().

Referenced by map_m1ps_cdfrespt(), map_m1ps_h_recursive(), and map_m1ps_sojourn().

◆ map_m1ps_sojourn() [1/2]

template<class T>
MapM1psResult< T > line::mam::map_m1ps_sojourn ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu,
const std::vector< T > & x )

map_m1ps_sojourn with the reference defaults, epsilon 1e-11 and 1e-10.

Definition at line 473 of file map_m1ps.h.

References map_m1ps_sojourn().

◆ map_m1ps_sojourn() [2/2]

template<class T>
MapM1psResult< T > line::mam::map_m1ps_sojourn ( const Matrix< T > & C,
const Matrix< T > & D,
const T & mu,
const std::vector< T > & x,
const T & epsilon,
const T & epsilon_prime )

Complementary sojourn time distribution of a MAP/M/1-PS queue (map_m1ps_sojourn.m).

The queue-length truncation is the reference's: the smallest N with (1/lambda) sum_{n<=N} pi_0 R^n D e > 1 - epsilon over n = 0..1000, falling back to N = 100. The uniformization window is recomputed per evaluation point, as in the reference, so the h recursion is rebuilt for each point.

Definition at line 367 of file map_m1ps.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), line::mam::MapM1psResult< T >::k_max, map_compute_R(), map_m1ps_h_recursive(), map_m1ps_sojourn(), line::mam::MapM1psResult< T >::n_levels, line::num_abs(), line::NumericError::NumericError(), line::ones(), line::Matrix< T >::rows(), line::vecmul(), line::mam::MapM1psResult< T >::w_bar, and line::mam::MapM1psResult< T >::w_bar_n_unweighted.

Referenced by map_m1ps_sojourn(), and map_m1ps_sojourn().

◆ map_mark()

template<class T>
Mmap< T > line::mam::map_mark ( const Map< T > & m,
const std::vector< T > & prob )

◆ map_max()

template<class T>
Map< T > line::mam::map_max ( const Map< T > & A,
const Map< T > & B )

MAP of the maximum of two independent MAPs.

Definition at line 54 of file map_max.h.

References line::mam::Map< T >::D0, krons(), map_max(), and map_pie().

Referenced by map_max().

◆ map_mean()

◆ map_mixture()

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).

Definition at line 276 of file map_transform.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_mixture(), map_normalize(), map_pie(), and line::Matrix< T >::Matrix().

Referenced by map_mixture().

◆ map_mmpp2()

template<class T>
Map< T > line::mam::map_mmpp2 ( const T & MEAN,
const T & SCV_in,
const T & SKEW,
const T & ACF1 )

Fit an MMPP(2) to a mean, an SCV, a skewness and a lag-1 autocorrelation.

Parameters
MEANmean inter-arrival time
SCV_insquared coefficient of variation, which must exceed one
SKEWskewness, or -1 for the minimum-skewness fit
ACF1lag-1 autocorrelation, or -1 for the maximum feasible value

Definition at line 63 of file map_mmpp2.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_feastol(), map_mmpp2(), line::Matrix< T >::Matrix(), and line::num_abs().

Referenced by map_mmpp2().

◆ map_moment()

◆ map_normalize()

◆ map_optim_dist()

template<class T>
MapOptimDist< T > line::mam::map_optim_dist ( const Map< T > & a,
const std::vector< T > & alA,
const Matrix< T > & B0,
const std::vector< T > & alB,
unsigned L )

Fit B1 minimizing the lag-L joint-density distance to a, with B0 fixed.

Parameters
athe reference MAP
alAits embedded (at-arrivals) distribution
B0the approximation's D0, held fixed
alBthe approximation's declared embedded distribution
Lnumber of lags; L = 1 takes the convex quadratic path

Definition at line 215 of file map_optim_dist.h.

References line::mam::MapOptimDist< T >::B1, line::Matrix< T >::cols(), line::mam::MapOptimDist< T >::d, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::MapOptimDist< T >::global, line::InputError::InputError(), line::lyap_solve(), map_dist(), map_optim_dist(), and line::Matrix< T >::rows().

Referenced by map_optim_dist().

◆ map_optim_dist_acf()

template<class T>
MapOptimDist< T > line::mam::map_optim_dist_acf ( const Map< T > & a,
const std::vector< T > & alA,
const Matrix< T > & B0,
const std::vector< T > & alB )

Fit B1 minimizing the AUTOCORRELATION distance to a, with B0 fixed.

The reference re-evaluates the distance at the returned B1 rather than trusting the optimizer's own objective value, and so does this: the two can differ when the solve stops on its own tolerance, and the number a caller reports should be the distance of the MAP it was handed.

Definition at line 333 of file map_optim_dist.h.

References line::mam::MapOptimDist< T >::B1, line::Matrix< T >::cols(), line::mam::MapOptimDist< T >::d, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::MapOptimDist< T >::global, line::InputError::InputError(), map_dist_acf(), map_optim_dist_acf(), and line::Matrix< T >::rows().

Referenced by map_optim_dist_acf().

◆ map_pdf()

template<class T>
std::vector< T > line::mam::map_pdf ( const Map< T > & m,
const std::vector< T > & tset )

Probability density of the inter-arrival time at the given points.

Parameters
mthe MAP (D0, D1)
tsetevaluation times, each >= 0
Returns
f(t) in the order of tset

Definition at line 43 of file map_pdf.h.

References line::Matrix< T >::cols(), line::mam::Map< T >::D0, line::expm(), line::InputError::InputError(), map_pdf(), map_pie(), line::mulvec(), line::ones(), line::mam::Map< T >::order(), line::Matrix< T >::rows(), and line::vecmul().

Referenced by line::api::infer_mlps(), map_pdf(), and line::api::sn_patience_handles().

◆ map_pie()

◆ map_pnt()

template<class T>
std::vector< Matrix< T > > line::mam::map_pnt ( const Map< T > & m,
std::size_t na,
const T & t,
long M = -1 )

P_0(t) .

. P_na(t), evaluated on a short interval and squared up.

Parameters
mthe MAP
nahighest arrival count to return
tinterval length
Mnumber of squarings; negative selects the reference's default ceil(log2(100 t / mean)), and a value below zero after that means the direct evaluation

Definition at line 165 of file map_pnt.h.

References map_mean(), map_pnt(), map_pntbisect(), and line::mam::Map< T >::order().

Referenced by map_pnt(), and map_pntiter().

◆ map_pntbisect()

template<class T>
std::vector< Matrix< T > > line::mam::map_pntbisect ( const Map< T > & m,
std::size_t na,
const T & t )

P_0(t) .

. P_na(t) by uniformization on one interval, without the squaring.

Parameters
mthe MAP
nahighest arrival count to return
tinterval length

Definition at line 98 of file map_pnt.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_pntbisect(), and line::mam::Map< T >::order().

Referenced by map_pnt(), and map_pntbisect().

◆ map_pntiter()

template<class T>
Matrix< T > line::mam::map_pntiter ( const Map< T > & m,
std::size_t na,
const T & t,
long M = -1 )

The reference's entry point: only the highest count is returned.

Definition at line 257 of file map_pnt.h.

References map_pnt(), and map_pntiter().

Referenced by map_pntiter().

◆ map_pntquad()

template<class T>
std::vector< Matrix< T > > line::mam::map_pntquad ( const Map< T > & m,
std::size_t na,
const T & t )

The same counting probabilities by NUMERICAL INTEGRATION, map_pntquad.

Port of matlab/lib/kpctoolbox/map/map_pntquad.m, which integrates the forward equations dP_0/dt = P_0 D0, dP_n/dt = P_n D0 + P_{n-1} D1 from P_0(0) = I with ode45. The reference stacks all na+1 matrices into one state vector and integrates them together, which is what is done here with ode_rosenbrock4.

IT IS A SECOND ROUTE TO THE SAME OBJECT, not a different quantity, and that is its value: map_pnt reaches P_n(t) by uniformization and this one by quadrature, so the two agreeing is evidence neither is wrong. The uniformization route is the cheaper one and is what callers should use; this exists because the reference exposes it and because it is the independent check the tests apply.

Parameters
mthe MAP
nahighest arrival count to return
tinterval length

Definition at line 221 of file map_pnt.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_pntquad(), line::ode_rosenbrock4_endpoint(), and line::mam::Map< T >::order().

Referenced by map_pntquad().

◆ map_prob()

template<class T>
std::vector< T > line::mam::map_prob ( const Map< T > & m)

◆ map_rand()

template<class T, class Gen>
Map< T > line::mam::map_rand ( std::size_t K,
Gen & gen )

Random MAP of order K with uniform [0,1) entries, normalized.

Definition at line 48 of file map_rand.h.

References map_normalize(), and map_rand().

Referenced by map_rand(), and mmap_rand().

◆ map_randn()

template<class T, class Gen>
Map< T > line::mam::map_randn ( std::size_t K,
double mu,
double sigma,
Gen & gen )

Random MAP of order K with folded normal entries, normalized.

Definition at line 61 of file map_rand.h.

References map_normalize(), and map_randn().

Referenced by map_randn().

◆ map_renewal()

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).

Definition at line 313 of file map_transform.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, map_pie(), map_renewal(), line::Matrix< T >::Matrix(), and line::mam::Map< T >::order().

Referenced by aph_rand(), and map_renewal().

◆ map_sample()

template<class T>
std::vector< T > line::mam::map_sample ( const Map< T > & m,
std::size_t n,
pfqn::McRng & rng,
const std::vector< T > & pie0 = std::vector<T>(),
SampleTrace * trace = 0 )

Sample the inter-arrival times of a MAP, a RAP or a matrix exponential.

Parameters
mthe MAP
nnumber of inter-arrival times to draw
rnggenerator, advanced by the call
pie0initial phase law; empty selects map_pie, the reference's interval-stationary initialization
traceoptional per-sample start and end phases

Definition at line 98 of file map_sample.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_mean(), map_pie(), map_sample(), line::pfqn::mc_uniform01(), line::mam::Map< T >::order(), and randp().

Referenced by map_sample().

◆ map_scale()

◆ map_scale_rate()

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.

map_scale finishes with map_normalize, which zeroes every negative entry; that is a repair for a MAP whose blocks drifted, and it is DESTRUCTION for an ME or a RAP, whose negative off-diagonals are the representation. Scaling both blocks by one positive factor already preserves every normalized moment and the zero row sums of D0 + D1, so nothing needs repairing.

The distinction is the reference's: solver_mam_basic.m:82-88 branches on procid == ME || procid == RAP and rescales by the rate alone. Without the branch the clamp turns a two-moment CME fit into a different process altogether – measured on M/Pareto/1 at rho 0.5, which reported the queue length of an infinite server (0.5) against the exact 0.95.

Definition at line 104 of file map_transform.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_mean(), map_scale_rate(), and line::mam::Map< T >::order().

Referenced by map_scale_rate(), and solver_mam_basic().

◆ map_scv()

template<class T>
T line::mam::map_scv ( const Map< T > & m)

Squared coefficient of variation.

Definition at line 140 of file map_moment.h.

References map_mean(), map_scv(), and map_var().

Referenced by line::lang::dist_refresh_moments(), mamap22_fit_fs_multiclass(), map_acf(), map_scv(), map_skew(), mmap_super_safe(), and line::mva::solver_rqt().

◆ map_skew()

template<class T>
T line::mam::map_skew ( const Map< T > & m)

Skewness of the inter-arrival time (map_skew.m).

Gated on transcendental arithmetic: the denominator is (sqrt(SCV) * mean)^3, and the square root of a rational SCV is irrational in general.

Definition at line 436 of file map_transform.h.

References map_moment(), map_scv(), and map_skew().

Referenced by map_skew().

◆ map_stochcomp()

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.

Definition at line 367 of file map_transform.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), line::inverse(), map_infgen(), map_normalize(), map_stochcomp(), line::matmul(), line::Matrix< T >::Matrix(), and line::mam::Map< T >::order().

Referenced by map_stochcomp().

◆ map_sum()

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).

Definition at line 203 of file map_transform.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_sum(), line::Matrix< T >::Matrix(), and line::mam::Map< T >::order().

Referenced by map_sum().

◆ map_sumind()

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).

Definition at line 234 of file map_transform.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_pie(), map_sumind(), and line::Matrix< T >::Matrix().

Referenced by map_sumind(), and line::pfqn::pfqn_stdf_heur().

◆ map_timereverse()

template<class T>
Map< T > line::mam::map_timereverse ( const Map< T > & m)

Time-reversed MAP, diag(pi)^-1 M' diag(pi) applied to D0 and D1.

Definition at line 52 of file map_algebra.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, map_prob(), map_timereverse(), and line::Matrix< T >::Matrix().

Referenced by map_timereverse().

◆ map_var()

template<class T>
T line::mam::map_var ( const Map< T > & m)

Variance of the inter-arrival time.

Definition at line 133 of file map_moment.h.

References map_mean(), map_moment(), and map_var().

Referenced by map_kurt(), map_scv(), map_var(), line::mam::MeSampler< T >::MeSampler(), and solver_mam_passage_time().

◆ map_varcount()

template<class T>
std::vector< T > line::mam::map_varcount ( const Map< T > & m,
const std::vector< T > & tset )

Variance of the counts of a MAP over windows of length t, in the spelling of matlab/lib/kpctoolbox/map/map_varcount.m.

Parameters
mthe MAP (D0, D1)
tsetwindow lengths
Returns
Var[N(t)] for each window length, in the order of tset

Definition at line 53 of file map_varcount.h.

References line::mam::Map< T >::D1, line::expm(), line::InputError::InputError(), map_infgen(), map_prob(), map_varcount(), line::matmul(), line::mulvec(), line::ones(), line::mam::Map< T >::order(), and line::vecmul().

Referenced by map_acfc(), and map_varcount().

◆ maph2m_fit()

template<class T>
Mmap< T > line::mam::maph2m_fit ( const T & M1,
const T & M2,
const T & M3,
const std::vector< T > & p,
const std::vector< T > & B )

Fit a MAPH(2,m) to three moments, the class probabilities and the per-class backward moments, trying every APH(2) form and keeping the closest.

Definition at line 228 of file maph2m_fit.h.

References aph2_fit(), line::mam::Aph2FitResult< T >::aphs, line::mam::Maph2mFitResult< T >::fB, line::mam::Maph2mFitResult< T >::maph, maph2m_fit(), maph2m_fit_multiclass(), and line::NumericError::NumericError().

Referenced by mamap2m_fit(), maph2m_fit(), maph2m_fit_mmap(), and maph2m_fit_trace().

◆ maph2m_fit_mmap()

template<class T>
Mmap< T > line::mam::maph2m_fit_mmap ( const Mmap< T > & m)

Fit a MAPH(2,m) to the descriptors measured on a marked MAP.

Definition at line 262 of file maph2m_fit.h.

References line::mam::Mmap< T >::map(), map_moment(), maph2m_fit(), maph2m_fit_mmap(), mmap_backward_moment(), and mmap_pc().

Referenced by maph2m_fit_mmap().

◆ maph2m_fit_multiclass()

template<class T>
Maph2mFitResult< T > line::mam::maph2m_fit_multiclass ( const Map< T > & aph,
const std::vector< T > & p,
const std::vector< T > & B,
const std::vector< T > & classWeights = std::vector<T>() )

Mark a canonical acyclic APH(2) with m classes.

Parameters
aphthe APH(2), in canonical acyclic form
pper-class probabilities, summing to one
Bper-class target backward moments
classWeightsper-class weights in the objective; empty means uniform

Definition at line 89 of file maph2m_fit.h.

References line::auglag(), line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::Maph2mFitResult< T >::fB, line::InputError::InputError(), line::mam::Maph2mFitResult< T >::maph, maph2m_fit_multiclass(), mmap_backward_moment(), line::num_abs(), line::NumericError::NumericError(), and line::AugLagResult< T >::x.

Referenced by mamap22_fit_bs_multiclass(), mamap22_fit_fs_multiclass(), mamap2m_fit_fb_multiclass(), maph2m_fit(), and maph2m_fit_multiclass().

◆ maph2m_fit_trace()

template<class T>
Mmap< T > line::mam::maph2m_fit_trace ( const std::vector< T > & Tv,
const std::vector< int > & A )

Fit a MAPH(2,m) to the descriptors measured on a marked trace.

Parameters
Tvthe inter-arrival times
Athe class of each arrival, 1-based as the reference indexes them

Definition at line 278 of file maph2m_fit.h.

References line::InputError::InputError(), maph2m_fit(), maph2m_fit_trace(), line::trace::mtrace_backward_moment(), and line::trace::mtrace_pc().

Referenced by maph2m_fit_trace().

◆ matlab_ilt()

std::vector< double > line::mam::matlab_ilt ( const std::function< std::complex< double >(const std::complex< double > &)> & fun,
const std::vector< double > & times,
std::size_t maxFnEvals,
IltMethod method = IltMethod::Cme )
inline

Invert a Laplace transform at the requested time points.

Parameters
funthe transform F(s), evaluated at complex s
timesthe points to invert at; each must be positive
maxFnEvalsevaluation budget per point, which selects the CME entry
methodthe weight family; the reference's default is Cme

Definition at line 64 of file matlab_ilt.h.

References line::mam::iltcme::CmeEntry::a, line::mam::iltcme::CmeEntry::b, line::mam::iltcme::CmeEntry::c, Cme, line::mam::iltcme::CmeEntry::cv2, line::InputError::InputError(), line::mam::iltcme::kTable, line::mam::iltcme::kTableSize, matlab_ilt(), line::mam::iltcme::CmeEntry::mu1, line::mam::iltcme::CmeEntry::n, line::mam::iltcme::CmeEntry::omega, and line::UnsupportedError::UnsupportedError().

Referenced by line::lti::laplace_invert(), matlab_ilt(), and solver_mam_transient_qbd().

◆ me_sample()

template<class T>
std::vector< T > line::mam::me_sample ( const Map< T > & m,
std::size_t n,
pfqn::McRng & rng,
const std::vector< T > & a0 = std::vector<T>() )

me_sample: n INDEPENDENT variates of the matrix exponential (D0, D1).

Passing a MAP or a RAP here samples its stationary marginal independently, which is a deliberate renewal approximation: the autocorrelation is dropped. Use rap_sample to retain it.

Parameters
mthe process, read through its entry law map_pie and its D0
nnumber of inter-arrival times to draw
rnggenerator, advanced by one uniform per variate
a0entry law; empty selects map_pie

Definition at line 330 of file me_sample.h.

References me_sample(), and line::mam::MeSampler< T >::next().

Referenced by me_sample().

◆ me_to_map()

template<class T>
Map< T > line::mam::me_to_map ( const std::vector< T > & alpha,
const Matrix< T > & A )

Assemble the renewal (D0, D1) of a matrix-exponential law (alpha, A).

Definition at line 134 of file cme.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::Matrix< T >::Matrix(), me_to_map(), and line::Matrix< T >::rows().

Referenced by dist_fit_me(), and me_to_map().

◆ mfq_fluflu_sojourn() [1/2]

template<class T>
MeRepresentation< T > line::mam::mfq_fluflu_sojourn ( const Matrix< T > & Qin,
const Matrix< T > & Rin,
const Matrix< T > & Qout,
const Matrix< T > & Rout,
bool srv0stop )

mfq_fluflu_sojourn with an ME representation and prec = 1e-14.

Definition at line 141 of file mfq_fluflu_sojourn.h.

References mfq_fluflu_sojourn().

◆ mfq_fluflu_sojourn() [2/2]

template<class T>
MeRepresentation< T > line::mam::mfq_fluflu_sojourn ( const Matrix< T > & Qin,
const Matrix< T > & Rin,
const Matrix< T > & Qout,
const Matrix< T > & Rout,
bool srv0stop,
bool transToPH,
const T & prec )

Sojourn time of a drop in a fluid queue with fluid-modulated service.

Parameters
Qingenerator of the arrival-modulating chain, Na x Na
Rindiagonal arrival fluid rate matrix, Na x Na
Qoutgenerator of the service-modulating chain, Ns x Ns
Routdiagonal service fluid rate matrix, Ns x Ns
srv0stoptrue if service stops when the server fluid level hits zero
transToPHtrue for a phase-type representation, false for ME
prectolerance handed to mfq_general_solve

Definition at line 65 of file mfq_fluflu_sojourn.h.

References line::mam::MeRepresentation< T >::A, line::mam::MeRepresentation< T >::alpha, line::mam::GeneralFluidSolution< T >::clo, line::Matrix< T >::cols(), line::mc::ctmc_solve(), line::eye(), line::mam::GeneralFluidSolution< T >::ini, line::InputError::InputError(), line::inverse(), line::mam::GeneralFluidSolution< T >::K, kron(), line::matmul(), line::Matrix< T >::Matrix(), mfq_fluflu_sojourn(), mfq_general_solve(), mfq_transform_to_ones(), line::NumericError::NumericError(), line::Matrix< T >::rows(), and line::vecmul().

Referenced by line::fluid::fluid_mfq(), mfq_fluflu_sojourn(), and mfq_fluflu_sojourn().

◆ mfq_fundamental()

template<class T>
FluidFundamental< T > line::mam::mfq_fundamental ( const Matrix< T > & Fpp,
const Matrix< T > & Fpm,
const Matrix< T > & Fmp,
const Matrix< T > & Fmm,
const T & precision,
unsigned maxNumIt,
RiccatiMethod method )

Psi, K and U of a fluid queue whose drifts have been normalized to +-1.

Parameters
Fppup-to-up block, Fpm up-to-down, Fmp down-to-up, Fmm down-to-down
precisionstopping tolerance on the doubling residual
maxNumItiteration cap
methodADDA (the BUTools default) or SDA
Fpmgenerator block from the up-phases to the down-phases
Fmpgenerator block from the down-phases to the up-phases
Fmmgenerator block within the down-phases

Definition at line 196 of file mfq_solve.h.

References ADDA, line::Matrix< T >::cols(), line::mam::FluidFundamental< T >::converged, line::eye(), line::InputError::InputError(), line::inverse(), line::mam::FluidFundamental< T >::iterations, line::mam::FluidFundamental< T >::K, line::matmul(), line::Matrix< T >::Matrix(), mfq_fundamental(), line::mam::FluidFundamental< T >::Psi, line::Matrix< T >::rows(), SDA, and line::mam::FluidFundamental< T >::U.

Referenced by mfq_fundamental(), and mfq_general_solve().

◆ mfq_general_solve() [1/2]

template<class T>
GeneralFluidSolution< T > line::mam::mfq_general_solve ( const Matrix< T > & Q,
const Matrix< T > & R )

mfq_general_solve with the regular boundary and the BUTools default prec = 1e-14.

Definition at line 494 of file mfq_solve.h.

References mfq_general_solve().

◆ mfq_general_solve() [2/2]

template<class T>
GeneralFluidSolution< T > line::mam::mfq_general_solve ( const Matrix< T > & Q,
const Matrix< T > & R,
const Matrix< T > & Q0,
const T & prec )

Stationary law of a general Markovian fluid model, pi(x) = ini exp(K x) clo above level zero plus the point mass mass0 at zero.

Parameters
Qgenerator of the background chain, N x N
Rdiagonal drift matrix, N x N, entries of any sign
Q0boundary generator at level zero; pass an empty matrix for the regular boundary behaviour Q0 = Q
prectolerance, used both to classify a drift as zero and to stop the Riccati iteration, exactly as in the reference

Definition at line 299 of file mfq_solve.h.

References ADDA, line::mam::GeneralFluidSolution< T >::clo, line::Matrix< T >::cols(), line::mam::GeneralFluidSolution< T >::ini, line::InputError::InputError(), line::inverse(), line::mam::FluidFundamental< T >::K, line::mam::GeneralFluidSolution< T >::K, line::mam::GeneralFluidSolution< T >::mass0, line::matmul(), mfq_fundamental(), mfq_general_solve(), line::mulvec(), line::num_abs(), line::NumericError::NumericError(), line::ones(), line::mam::FluidFundamental< T >::Psi, line::Matrix< T >::rows(), line::mam::FluidFundamental< T >::U, and line::vecmul().

Referenced by mfq_fluflu_sojourn(), mfq_general_solve(), mfq_general_solve(), mfq_prio_queue(), and mfq_sojourn().

◆ mfq_ld_distr()

template<class T>
std::vector< std::vector< T > > line::mam::mfq_ld_distr ( const LevelDependentFluidBlocks< T > & b,
FluidDistrKind what,
const std::vector< T > & points )

Stationary density or distribution of a level-dependent fluid queue.

Parameters
bthe building blocks returned by mfq_ld_solve
whatwhich functional to evaluate
pointsthe fluid levels at which to evaluate it
Returns
one row of N per-state values per requested point

Definition at line 223 of file mfq_ld_distr.h.

References Cdf, Cdfm, line::mam::LevelDependentFluidBlocks< T >::cloB, line::mam::LevelDependentFluidBlocks< T >::cloF, line::expm(), line::mam::LevelDependentFluidBlocks< T >::iniB, line::mam::LevelDependentFluidBlocks< T >::iniF, line::InputError::InputError(), line::mam::LevelDependentFluidBlocks< T >::KB, line::mam::LevelDependentFluidBlocks< T >::KF, line::mam::LevelDependentFluidBlocks< T >::masses, mfq_ld_distr(), Pdf, Pdfd, line::mam::LevelDependentFluidBlocks< T >::Thr, and line::vecmul().

Referenced by mfq_ld_distr().

◆ mfq_ld_mean()

◆ mfq_ld_solve() [1/2]

template<class T>
LevelDependentFluidBlocks< T > line::mam::mfq_ld_solve ( const std::vector< Matrix< T > > & Q,
const std::vector< Matrix< T > > & R,
const std::vector< Matrix< T > > & S,
const std::vector< T > & Thr )

mfq_ld_solve with reflective boundaries, Qt = Q and the default prec = 1e-14.

Definition at line 568 of file mfq_ld_solve.h.

References mfq_ld_solve().

◆ mfq_ld_solve() [2/2]

template<class T>
LevelDependentFluidBlocks< T > line::mam::mfq_ld_solve ( const std::vector< Matrix< T > > & Q,
const std::vector< Matrix< T > > & R,
const std::vector< Matrix< T > > & S,
const std::vector< T > & Thr,
const std::vector< FluidBoundary > & boundaryL,
const std::vector< FluidBoundary > & boundaryU,
const std::vector< Matrix< T > > & Qt,
const T & prec )

Solve a first- or second-order level-dependent fluid queue.

Parameters
Qper-regime generators, K of them
Rper-regime DIAGONAL drift matrices, K of them
Sper-regime DIAGONAL variance matrices; all zero = first order
Thrthe K thresholds
boundaryLper background state, the behaviour at the lower boundary; empty means every state reflective
boundaryUlikewise at the upper boundary; empty means the same as boundaryL, as in the reference
Qtboundary generators, K+1 of them; empty means {Q[0], ..., Q[K-1], Q[K-1]}, a single entry is replicated
prectolerance for the state classification and the QBD solves

Definition at line 157 of file mfq_ld_solve.h.

References Absorbing, line::mam::LevelDependentFluidBlocks< T >::cloB, line::mam::LevelDependentFluidBlocks< T >::cloF, line::expm(), line::mam::LevelDependentFluidBlocks< T >::iniB, line::mam::LevelDependentFluidBlocks< T >::iniF, line::InputError::InputError(), line::inverse(), line::mam::LevelDependentFluidBlocks< T >::KB, line::mam::LevelDependentFluidBlocks< T >::KF, line::mam::LevelDependentFluidBlocks< T >::masses, line::matmul(), line::Matrix< T >::Matrix(), mfq_ld_solve(), line::num_abs(), line::NumericError::NumericError(), Reflective, line::solve(), and line::mam::LevelDependentFluidBlocks< T >::Thr.

Referenced by mfq_ld_solve(), and mfq_ld_solve().

◆ mfq_multiregime()

MultiRegimeResult line::mam::mfq_multiregime ( const std::vector< Matrix< double > > & Q,
const std::vector< std::vector< double > > & R,
const std::vector< Matrix< double > > & Qt,
const std::vector< std::vector< double > > & Rt,
const std::vector< double > & Thr,
const std::vector< double > & pdfpoints,
const std::vector< double > & cdfpoints )
inline

Multi-regime feedback fluid queue.

Parameters
Qper-regime generators, K of them; a single entry is replicated across all regimes, as in the reference
Rper-regime drift RATE VECTORS of length N (not matrices)
Qtboundary generators, K+1 of them; empty means {Q[0], Q[0], ..., Q[K-1]}, a single entry is replicated
Rtboundary rate vectors, K+1 of them; empty means {R[0], R[0], ..., R[K-1]}
Thrthe K thresholds
pdfpointslevels at which the density and its derivative are wanted
cdfpointslevels at which the distribution is wanted

Definition at line 185 of file mfq_multiregime.h.

References line::mam::MultiRegimeResult::cdf, line::mam::MultiRegimeResult::cdfm, line::Matrix< T >::cols(), line::eye(), line::InputError::InputError(), line::inverse(), line::matmul(), mfq_multiregime(), line::NumericError::NumericError(), line::mam::MultiRegimeResult::pdf, line::mam::MultiRegimeResult::pdfd, line::Matrix< T >::rows(), line::schur_decomposition(), line::schur_reorder(), line::solve(), line::RealSchur::T, line::vecmul(), and line::RealSchur::Z.

Referenced by mfq_multiregime().

◆ mfq_prio_queue()

◆ mfq_sojourn() [1/2]

template<class T>
MeRepresentation< T > line::mam::mfq_sojourn ( const Matrix< T > & Q,
const Matrix< T > & Rin,
const Matrix< T > & Rout )

mfq_sojourn with the regular boundary, an ME representation and prec = 1e-14.

Definition at line 174 of file mfq_sojourn.h.

References mfq_sojourn().

◆ mfq_sojourn() [2/2]

template<class T>
MeRepresentation< T > line::mam::mfq_sojourn ( const Matrix< T > & Q,
const Matrix< T > & Rin,
const Matrix< T > & Rout,
const Matrix< T > & Q0,
bool transToPH,
const T & prec )

Sojourn time of a drop in a Markov-modulated fluid queue.

Parameters
Qgenerator of the background chain, N x N
Rindiagonal input fluid rate matrix, N x N
Routdiagonal output (service) fluid rate matrix, N x N
Q0level-zero generator; an empty matrix means Q0 = Q
transToPHtrue for a phase-type representation, false for ME
prectolerance handed to mfq_general_solve

Definition at line 86 of file mfq_sojourn.h.

References line::mam::MeRepresentation< T >::A, line::mam::MeRepresentation< T >::alpha, line::mam::GeneralFluidSolution< T >::clo, line::Matrix< T >::cols(), line::mam::GeneralFluidSolution< T >::ini, line::InputError::InputError(), line::inverse(), line::mam::GeneralFluidSolution< T >::K, line::mam::GeneralFluidSolution< T >::mass0, line::matmul(), line::Matrix< T >::Matrix(), mfq_general_solve(), mfq_sojourn(), mfq_transform_to_ones(), line::NumericError::NumericError(), line::Matrix< T >::rows(), and line::vecmul().

Referenced by mfq_sojourn(), and mfq_sojourn().

◆ mfq_transform_to_ones()

template<class T>
Matrix< T > line::mam::mfq_transform_to_ones ( const std::vector< T > & v)

The similarity transformation B with B v = e, for a non-negative column vector v.

Port of BUTools TransformToOnes: sort v decreasing so that a non-zero entry leads, then take the lower-triangular matrix of reciprocal partial sums. It works even when v has zero entries, which is why the naive diag(1/v) is not used.

Definition at line 506 of file mfq_solve.h.

References line::InputError::InputError(), mfq_transform_to_ones(), and line::NumericError::NumericError().

Referenced by mfq_fluflu_sojourn(), mfq_sojourn(), and mfq_transform_to_ones().

◆ mg1_dt_g()

template<class T>
Matrix< T > line::mam::mg1_dt_g ( const std::vector< Matrix< T > > & A,
int max_iter = 5000,
double tol = 1e-14 )

G matrix of an M/G/1-type chain by functional iteration on G = sum_k A_k G^k, the blocks being stochastic.

A[0] is the down-one block and A[k] the block raising the level by k-1. SMCSolver reaches the same minimal solution by cyclic reduction; the JAR port of that routine costs 19.8 s at order 17 where functional iteration costs 25 ms and agrees to 1.6e-15, which is why neither this port nor the JAR one takes it.

Definition at line 565 of file dtime.h.

References mg1_dt_g().

Referenced by mg1_dt_g(), and mg1_dt_pi().

◆ mg1_dt_pi()

template<class T>
std::vector< T > line::mam::mg1_dt_pi ( const std::vector< Matrix< T > > & B,
const std::vector< Matrix< T > > & A,
std::size_t max_num_comp = 1000 )

Stationary vector of an M/G/1-type chain by the stable Ramaswami formula.

A repeats from level one and B is the boundary row, both as block lists with A[0] the down-one block. The recursion is level-by-level, so it costs O(levels * m^3) and not O((levels*m)^3): a dense solve of the truncated chain is cubic in the WHOLE state space and stops being affordable at the second station of a decomposition, where the arrival process already carries the level space of the first.

MATLAB twin: MG1_pi.m (SMCSolver, Van Houdt), default-boundary branch.

Definition at line 599 of file dtime.h.

References line::mc::dtmc_solve(), line::InputError::InputError(), mg1_dt_g(), and mg1_dt_pi().

Referenced by mg1_dt_pi(), and mg1_dt_queue().

◆ mg1_dt_queue()

template<class T>
DtQueueResult< T > line::mam::mg1_dt_queue ( const DBatch< T > & arv,
const Dmap< T > & svc,
std::size_t max_num_comp = 1000,
bool want_departure = false )

Discrete-time single-server queue with batch D-MAP arrivals, DBMAP/D-MAP/1.

The chain is M/G/1-type because a slot may deliver a batch: with arrival matrices A_k and service pair (S0,S1), A^(-1) = kron(A_0,S1), A^(k) = kron(A_k,S0) + kron(A_{k+1},S1), B^(k) = kron(A_k,I), the boundary row holding the empty system where no service runs.

Solved by the Ramaswami level recursion of mg1_dt_pi. The DEPARTURE process is a different object: it is read off the chain truncated at the level where the tail carries less than 1e-10, with arrivals that would cross the top held there, which is a level cut and not a rate change.

Definition at line 835 of file dtime.h.

References line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, line::mam::DtQueueResult< T >::dep, dmap_lambda_batch(), line::InputError::InputError(), mg1_dt_pi(), mg1_dt_queue(), line::mam::DtQueueResult< T >::ql, line::mam::DtQueueResult< T >::QN, line::mam::DtQueueResult< T >::TN, and line::mam::DtQueueResult< T >::UN.

Referenced by mg1_dt_queue(), and solver_mam_dt().

◆ mmap2k_fit()

template<class T>
MmapKFitResult< T > line::mam::mmap2k_fit ( const T & M1,
const T & M2,
const T & M3,
const T & GAMMA,
const std::vector< T > & P,
const std::vector< T > & F,
const std::vector< T > & B )

Exact marking of an AMAP(2) against per-class (p, F, B).

Parameters
M1,M2,M3the first three moments of the inter-arrival time
GAMMAthe autocorrelation decay rate
P,F,Bper-class probabilities, forward and backward moments

Definition at line 137 of file mmap_k_fit.h.

References amap2_fit_gamma(), line::mam::Amap2FitGammaResult< T >::amaps, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::MmapKFitResult< T >::exact, line::InputError::InputError(), mamap2m_fit_gamma_fb(), line::mam::MmapKFitResult< T >::mmap, mmap2k_fit(), line::num_abs(), and line::mam::Map< T >::order().

Referenced by mmap2k_fit().

◆ mmap3k_fit()

template<class T>
MmapKFitResult< T > line::mam::mmap3k_fit ( const Matrix< T > & D0,
const Matrix< T > & D1,
const std::vector< T > & P,
const std::vector< T > & F,
const std::vector< T > & B,
const std::vector< T > & B2 = std::vector<T>() )

Exact marking of an arbitrary MAP by solving the marking system directly.

Parameters
D0,D1the underlying MAP
P,F,Bper-class probabilities, forward and backward moments
B2per-class second-order backward moments; required once the MAP has more than three arrival entries to mark

Definition at line 232 of file mmap_k_fit.h.

References line::mam::MmapKFitResult< T >::exact, line::eye(), line::InputError::InputError(), line::inverse(), line::matmul(), line::mam::MmapKFitResult< T >::mmap, mmap3k_fit(), line::NumericError::NumericError(), line::Matrix< T >::rows(), and line::solve().

Referenced by mmap3k_fit().

◆ mmap_backward_moment() [1/2]

template<class T>
std::vector< std::vector< T > > line::mam::mmap_backward_moment ( const Mmap< T > & m,
const std::vector< unsigned > & orders )

mmap_backward_moment with the MATLAB default, normalized.

Definition at line 128 of file mmap_compress.h.

References mmap_backward_moment().

◆ mmap_backward_moment() [2/2]

template<class T>
std::vector< std::vector< T > > line::mam::mmap_backward_moment ( const Mmap< T > & m,
const std::vector< unsigned > & orders,
bool normalized )

Class-conditional backward moments of an MMAP (mmap_backward_moment.m).

Parameters
ordersthe moment orders to compute
normalizedtrue for B(c,k) with M_k = sum_c B(c,k) p_c, i.e. divided by the class probability p_c (the MATLAB default); false for the unnormalized form with M_k = sum_c B(c,k)
mthe marked MAP whose backward moments are taken
Returns
B[c][h], the moment of order orders[h] for class c

Definition at line 91 of file mmap_compress.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::Dc, line::inverse(), line::mam::Mmap< T >::map(), map_pie(), line::matpow(), mmap_backward_moment(), line::num_factorial(), line::NumericError::NumericError(), line::mam::Mmap< T >::order(), and line::vecmul().

Referenced by mamap22_fit_bs_multiclass(), mamap22_fit_gamma_bs_mmap(), mamap2m_fit(), mamap2m_fit_fb_multiclass(), maph2m_fit_mmap(), maph2m_fit_multiclass(), mmap_backward_moment(), mmap_backward_moment(), and mmap_compress().

◆ mmap_compress() [1/2]

template<class T>
Mmap< T > line::mam::mmap_compress ( const Mmap< T > & in)

mmap_compress with the default method, the order-1 mixture.

Definition at line 248 of file mmap_compress.h.

References MixtureOrder1, and mmap_compress().

◆ mmap_compress() [2/2]

template<class T>
Mmap< T > line::mam::mmap_compress ( const Mmap< T > & in,
MmapCompressMethod method )

Compress an MMAP (mmap_compress.m).

A class that never arrives (p_c <= 1e-14, the reference's GlobalConstants.Zero) gets Exp(1) as its component, exactly as in the reference: it carries zero mixture weight, so any proper MAP leaves the result unchanged and the 0/0 normalization of its backward moments is avoided.

Definition at line 211 of file mmap_compress.h.

References aph2_fit(), line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::Dc, line::InputError::InputError(), map_exponential(), MixtureOrder1, mmap_backward_moment(), mmap_compress(), mmap_mixture(), mmap_normalize(), mmap_pc(), and line::UnsupportedError::UnsupportedError().

Referenced by mmap_compress(), and mmap_compress().

◆ mmap_count_idc()

template<class T>
std::vector< T > line::mam::mmap_count_idc ( const Mmap< T > & mm,
const T & t )

Per-class index of dispersion of counts over a window of length t.

Definition at line 198 of file mmap_stats.h.

References mmap_count_idc(), mmap_count_mean(), and mmap_count_var().

Referenced by m3pp_superpos_fitc_theoretical(), mmap_count_idc(), and mmap_idc().

◆ mmap_count_lambda()

template<class T>
std::vector< T > line::mam::mmap_count_lambda ( const Mmap< T > & m)

◆ mmap_count_mcov()

template<class T>
Matrix< T > line::mam::mmap_count_mcov ( const Mmap< T > & mm,
const T & t )

Covariance matrix of the per-class counts over a window of length t.

The off-diagonal entries come from the polarization identity on the pooled classes, since only the variance of a single mark is available in closed form.

Definition at line 222 of file mmap_stats.h.

References line::mam::Mmap< T >::classes(), line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, mmap_count_mcov(), mmap_count_var(), and line::Matrix< T >::rows().

Referenced by m3pp2m_fitc_theoretical(), and mmap_count_mcov().

◆ mmap_count_mean()

template<class T>
std::vector< T > line::mam::mmap_count_mean ( const Mmap< T > & mm,
const T & t )

◆ mmap_count_moment()

template<class T>
Matrix< T > line::mam::mmap_count_moment ( const Mmap< T > & m,
const T & t,
const std::vector< unsigned > & orders )

Per-class counting moments of a marked MAP, mmap_count_moment.

Port of jar/src/main/java/jline/api/mam/Mmap_count_moment.java. Class c's own counting process is the MAP whose arrivals are c's alone and whose hidden transitions absorb every other class,

D0' = D0 + sum_{j != c} D1_j, D1' = D1_c,

so the per-class moments are map_count_moment on that marginal. That marginalization is exact – an arrival of another class IS a hidden phase transition as far as class c's counter is concerned – and it is why the per-class counts are NOT independent: they share the phase process.

Parameters
mthe marked MAP
twindow length
ordersmoment orders
Returns
(orders x classes) matrix of counting moments

Definition at line 131 of file map_count_moment.h.

References line::mam::Mmap< T >::classes(), line::mam::Map< T >::D0, line::mam::Mmap< T >::D0, line::mam::Map< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), map_count_moment(), and mmap_count_moment().

Referenced by m3pp_superpos_fitc_theoretical(), and mmap_count_moment().

◆ mmap_count_var()

template<class T>
std::vector< T > line::mam::mmap_count_var ( const Mmap< T > & mm,
const T & t )

Per-class variance of the counting process of a marked MAP.

Parameters
mmthe marked MAP
twindow length
Returns
Var[N_k(t)] for each class k

Definition at line 54 of file mmap_count_var.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::Dc, line::expm(), line::InputError::InputError(), line::mam::Mmap< T >::map(), map_infgen(), map_prob(), mmap_count_var(), line::mulvec(), line::ones(), line::mam::Mmap< T >::order(), and line::vecmul().

Referenced by m3pp2m_fitc_theoretical(), mmap_count_idc(), mmap_count_mcov(), and mmap_count_var().

◆ mmap_cross_moment()

template<class T>
Matrix< T > line::mam::mmap_cross_moment ( const Mmap< T > & mm,
unsigned k )

Cross moments of order k: MC(i,j) is E[T^k] of the interval that FOLLOWS a class-i arrival, conditioned on that next arrival being of class j.

Definition at line 253 of file mmap_stats.h.

References line::mam::Mmap< T >::classes(), line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::Dc, line::inverse(), line::mam::Mmap< T >::map(), map_pie(), line::matpow(), mmap_cross_moment(), mmap_embedded(), line::num_factorial(), line::Matrix< T >::rows(), and line::vecmul().

Referenced by mmap_cross_moment().

◆ mmap_embedded()

template<class T>
std::vector< Matrix< T > > line::mam::mmap_embedded ( const Mmap< T > & mm)

Embedded per-class kernels E_c = (-D0)^-1 D1^(c).

Definition at line 63 of file mmap_stats.h.

References line::mam::Mmap< T >::classes(), and mmap_embedded().

Referenced by mmap_cross_moment(), mmap_embedded(), mmap_forward_moment(), mmap_sigma(), and mmap_sigma2().

◆ mmap_exponential_vec()

template<class T>
Mmap< T > line::mam::mmap_exponential_vec ( const std::vector< T > & lambda,
std::size_t n = 1 )

Order-n MMAP with the given per-class arrival rates (mmap_exponential.m).

The per-class matrix is flip(eye(n)) * lambda_c, so at n = 1 this is the ordinary marked Poisson stream and at n > 1 it is the n-phase cycle the reference uses as a neutral element of the superposition.

Definition at line 51 of file mmap_assemble.h.

References line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), line::Matrix< T >::Matrix(), mmap_exponential_vec(), and mmap_normalize().

Referenced by mmap_exponential_vec(), mmap_super_safe(), and solver_mam_basic().

◆ mmap_forward_moment() [1/2]

template<class T>
Matrix< T > line::mam::mmap_forward_moment ( const Mmap< T > & mm,
const std::vector< unsigned > & orders )

Default normalization, matching the two-argument MATLAB call.

Definition at line 319 of file mmap_stats.h.

References mmap_forward_moment().

◆ mmap_forward_moment() [2/2]

template<class T>
Matrix< T > line::mam::mmap_forward_moment ( const Mmap< T > & mm,
const std::vector< unsigned > & orders,
bool normalize )

Forward moments: MOMENTS(a,h) is the order-orders[h] moment of the interval ENDING with a class-a arrival.

With normalize false the per-class probability is left in, which returns the unnormalized contribution instead.

Definition at line 290 of file mmap_stats.h.

References line::mam::Mmap< T >::classes(), line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::inverse(), line::mam::Mmap< T >::map(), map_pie(), line::matpow(), mmap_embedded(), mmap_forward_moment(), line::num_factorial(), line::Matrix< T >::rows(), and line::vecmul().

Referenced by mamap22_fit_fs_multiclass(), mamap2m_fit(), mamap2m_fit_fb_multiclass(), mmap_forward_moment(), and mmap_forward_moment().

◆ mmap_hide()

template<class T>
Mmap< T > line::mam::mmap_hide ( const Mmap< T > & in,
const std::vector< std::size_t > & hide )

Hide a subset of the marks (mmap_hide.m).

The process is UNCHANGED – D0 and the total D1 still describe the same point process – and only the observation of the hidden classes is removed, which is why the reference renormalizes afterwards: with Dc zeroed for the hidden classes, mmap_normalize rebuilds D1 as the sum of the SURVIVING marks and moves the hidden arrivals into D0 as phase changes. The result is the MAP of the visible class alone, embedded in the joint phase process.

Parameters
hide0-based class indices to hide

Definition at line 244 of file mmap_lambda.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::Dc, line::InputError::InputError(), line::Matrix< T >::Matrix(), mmap_hide(), mmap_normalize(), and line::mam::Mmap< T >::order().

Referenced by mmap_hide(), and mmap_hide_but().

◆ mmap_hide_but()

template<class T>
Mmap< T > line::mam::mmap_hide_but ( const Mmap< T > & in,
std::size_t keep )

mmap_hide(m, setdiff(1:K, keep)): keep ONE mark, hide every other.

Definition at line 256 of file mmap_lambda.h.

References line::mam::Mmap< T >::classes(), mmap_hide(), and mmap_hide_but().

Referenced by mmap_hide_but(), solver_mam_basic_mmap_inner(), and solver_mam_decmmap().

◆ mmap_idc()

template<class T>
std::vector< T > line::mam::mmap_idc ( const Mmap< T > & mm)

Asymptotic per-class index of dispersion, evaluated at t = 1e6 / sum_c lambda_c.

Definition at line 208 of file mmap_stats.h.

References mmap_count_idc(), mmap_idc(), and mmap_lambda().

Referenced by mmap_idc().

◆ mmap_infgen()

template<class T>
Matrix< T > line::mam::mmap_infgen ( const Matrix< T > & D0,
const std::vector< Matrix< T > > & Dk )

The generator of an MMAP: D0 plus every marked arrival matrix.

Definition at line 126 of file map_moment_extra.h.

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

Referenced by mmap_infgen().

◆ mmap_isfeasible()

template<class T>
bool line::mam::mmap_isfeasible ( const Mmap< T > & m)

True when the per-class matrices partition D1 exactly and D0 is a generator.

Definition at line 136 of file mmap_lambda.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, mmap_isfeasible(), and line::mam::Mmap< T >::order().

Referenced by mmap_isfeasible().

◆ mmap_isfeasible_tol()

template<class T>
bool line::mam::mmap_isfeasible_tol ( const Mmap< T > & m,
const T & tol )

Feasibility of a marked MAP WITHIN A TOLERANCE, the semantics of matlab/lib/m3a/m3a/mmap/mmap_isfeasible.m, whose second argument defaults to 10^-map_feastol = 1e-8: every per-class matrix non-negative up to -tol, the per-class matrices summing to D1 up to tol, and the underlying MAP feasible.

The mmap_isfeasible above is the EXACT predicate: it compares sums with == and rejects any negative entry however small. That is the right check for an algebraically assembled MMAP, but no optimizer can pass it – the marking probabilities sum to one only to the tolerance of the solve – so the optimization-based fits report feasibility through this tolerant form, which is what the reference actually applies to their output.

Definition at line 169 of file mmap_lambda.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::mam::Mmap< T >::map(), map_isfeasible(), mmap_isfeasible_tol(), line::num_abs(), and line::mam::Mmap< T >::order().

Referenced by mmap_isfeasible_tol().

◆ mmap_lambda()

template<class T>
std::vector< T > line::mam::mmap_lambda ( const Mmap< T > & m)

Alias kept for parity with the MATLAB name.

Definition at line 114 of file mmap_lambda.h.

References mmap_count_lambda(), and mmap_lambda().

Referenced by mmap_idc(), mmap_lambda(), solver_mam_basic_mmap_inner(), and solver_mam_decmmap().

◆ mmap_maps()

template<class T>
std::vector< Map< T > > line::mam::mmap_maps ( const Mmap< T > & mm)

The C MAPs seen by each class, MAP_c = (D0 + D1 - D1^(c), D1^(c)).

Definition at line 72 of file mmap_stats.h.

References line::mam::Mmap< T >::classes(), line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, mmap_maps(), and line::Matrix< T >::rows().

Referenced by mmap_maps().

◆ mmap_mark()

template<class T>
Mmap< T > line::mam::mmap_mark ( const Map< T > & base,
const Matrix< T > & weights )

◆ mmap_mark_probs()

template<class T>
Mmap< T > line::mam::mmap_mark_probs ( const Mmap< T > & in,
const Matrix< T > & prob )

Re-mark an MMAP by a (K x R) probability matrix (mmap_mark.m): a type-k arrival is reported as class r with probability prob(k,r).

Definition at line 72 of file mmap_assemble.h.

References line::mam::Mmap< T >::classes(), line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), mmap_mark_probs(), line::mam::Mmap< T >::order(), and line::Matrix< T >::rows().

Referenced by mmap_mark_probs().

◆ mmap_max() [1/2]

template<class T>
Mmap< T > line::mam::mmap_max ( const Mmap< T > & a,
const Mmap< T > & b,
std::size_t k )

mmap_max(MMAPa, MMAPb, k): the synchronization of two flows through a join with a queue of length k on each side.

The phase space is (phase of a) x (phase of b) x (lead), with lead running over 2k+1 blocks: block 0 is "both streams matched", the ODD blocks 1..2k-1 are "a is ahead by 1..k" and the EVEN blocks 2..2k are "b is ahead by 1..k". A stream that is k ahead is BLOCKED, which is why the two extreme diagonal blocks carry only the other stream's hidden generator. An arrival is emitted exactly when the lagging stream catches up, i.e. on every transition that moves the lead towards 0, so the join's throughput is bounded by the slower of the two inputs and falls short of it by the blocking probability.

Transcription of matlab/lib/m3a/m3a/mmap/mmap_max.m. It belongs in line/api/mam/; see the header note on why it is here.

Definition at line 287 of file solver_mam_traffic.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::eye(), line::InputError::InputError(), kron(), krons(), mmap_max(), and line::mam::Mmap< T >::order().

◆ mmap_max() [2/2]

template<class T>
Mmap< T > line::mam::mmap_max ( const Mmap< T > & a,
const Mmap< T > & b,
unsigned k )

◆ mmap_mixture()

template<class T>
Mmap< T > line::mam::mmap_mixture ( const std::vector< T > & alpha,
const std::vector< Map< T > > & maps )

Probabilistic mixture of MAPs (mmap_mixture.m).

The phase space is the disjoint union of the component phase spaces, the hidden generator is block diagonal, and on completion of an interval in component i the process jumps into component j with probability alpha_j, entering it at its own map_pie. The arrival that LEAVES component i is marked with class i, so the resulting MMAP has one class per component:

D0 = blkdiag(D0^1, ..., D0^I)
D1 block (i,j) = alpha_j (D1^i e) pie^j
D1^(c) block (i,j) = D1 block (i,j) if i == c, else 0.

The result is a renewal process by construction; see the header note.

Definition at line 149 of file mmap_compress.h.

References line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), map_pie(), line::Matrix< T >::Matrix(), mmap_mixture(), and mmap_normalize().

Referenced by mmap_compress(), and mmap_mixture().

◆ mmap_mixture_fit()

template<class T>
Mmap< T > line::mam::mmap_mixture_fit ( const Matrix< T > & P2,
const Matrix< T > & M1,
const Matrix< T > & M2,
const Matrix< T > & M3 )

Second-order mixture FITTED from cross moments and a triple sigma, the reference's mmap_mixture_fit.

Port of matlab/lib/m3a/m3a/mmap/mmap_mixture_fit.m and mmap_mixture_fit_trace.m. Each ordered class pair (i,j) gets its own APH(2) fitted to the cross moments M1(i,j), M2(i,j), M3(i,j) – the sojourn in class j when it followed class i – and those are assembled exactly as mmap_mixture_order2 assembles them, except that the transition weight is the CONDITIONAL second-order probability

p = P2(i1, i2, j2) / sum_h P2(i1, i2, h),

so the chain over (previous, current) pairs is stochastic by construction. That normalization is the whole difference from mmap_mixture_order2, which takes an already-conditioned two-index weight.

Parameters
P2the triple sigma, (C x C*C) with entry (i, j*C + h) = P2(i,j,h)
M1,M2,M3the (C x C) cross moments

Definition at line 230 of file mmap_modulate.h.

References aph2_fit(), line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), map_pie(), line::Matrix< T >::Matrix(), mmap_mixture_fit(), mmap_normalize(), and line::Matrix< T >::rows().

Referenced by mmap_mixture_fit(), and mmap_mixture_fit_trace().

◆ mmap_mixture_fit_trace()

template<class T>
Mmap< T > line::mam::mmap_mixture_fit_trace ( const std::vector< T > & Tv,
const std::vector< int > & A )

mmap_mixture_fit driven from a marked trace: the triple sigma and the cross moments are measured on the trace itself.

Parameters
Tvthe inter-arrival times
Athe class of each arrival

Definition at line 303 of file mmap_modulate.h.

References line::InputError::InputError(), mmap_mixture_fit(), mmap_mixture_fit_trace(), line::trace::mtrace_cross_moment(), and line::trace::mtrace_sigma2().

Referenced by mmap_mixture_fit_trace().

◆ mmap_mixture_order2()

template<class T>
Mmap< T > line::mam::mmap_mixture_order2 ( const std::vector< std::vector< Map< T > > > & PHs,
const Matrix< T > & P2 )

Second-order mixture: the state records the previous and the current class.

Parameters
PHs(m x m) two-phase components, PHs[i][j] being the sojourn in class j reached from class i
P2(m x m) second-order class transition probabilities

Definition at line 156 of file mmap_modulate.h.

References line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), map_pie(), line::Matrix< T >::Matrix(), mmap_mixture_order2(), mmap_normalize(), and line::Matrix< T >::rows().

Referenced by mmap_mixture_order2().

◆ mmap_modulate()

template<class T>
Mmap< T > line::mam::mmap_modulate ( const Matrix< T > & P,
const std::vector< Map< T > > & HT,
const std::vector< Mmap< T > > & comps )

Modulate a family of marked MAPs by an environment chain.

Parameters
P(J x J) environment transition probabilities
HTthe J phase-type holding times, as (D0, D1) pairs
compsthe J marked arrival processes, one per environment

Definition at line 70 of file mmap_modulate.h.

References line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::eye(), line::InputError::InputError(), kron(), krons(), map_pie(), line::Matrix< T >::Matrix(), mmap_modulate(), mmap_normalize(), and line::Matrix< T >::rows().

Referenced by mmap_modulate().

◆ mmap_normalize()

◆ mmap_pc()

template<class T>
std::vector< T > line::mam::mmap_pc ( const Mmap< T > & m)

◆ mmap_pie()

template<class T>
Matrix< T > line::mam::mmap_pie ( const Mmap< T > & mm)

Stationary phase distribution seen just after a class-c arrival, one row per class.

The row is the left invariant vector of the STOCHASTIC matrix P_c = (-D0 - D1 + D1^(c))^-1 D1^(c), which is the chain watched only at class-c epochs, and is not E_c.

Definition at line 91 of file mmap_stats.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::inverse(), line::matmul(), mmap_pie(), line::mam::Mmap< T >::order(), and line::solve().

Referenced by mmap_pie().

◆ mmap_rand()

template<class T, class Gen>
Mmap< T > line::mam::mmap_rand ( std::size_t order,
std::size_t classes,
Gen & gen )

◆ mmap_scale()

template<class T>
Mmap< T > line::mam::mmap_scale ( const Mmap< T > & in,
const T & M )

◆ mmap_scale_perclass()

template<class T>
Mmap< T > line::mam::mmap_scale_perclass ( const Mmap< T > & in,
const std::vector< T > & M )

Retarget the per-class MEAN inter-arrival times (mmap_scale.m, vector form).

Each class matrix is rescaled by (1/M_c)/lambda_c, then the MMAP is renormalized. The reference calls this "heuristic because it also affects the other classes"; the refinement loop that follows it in MATLAB is dead code behind an unconditional return, so the heuristic IS the function and is what is reproduced here. A class with zero rate is zeroed rather than divided.

Definition at line 102 of file mmap_assemble.h.

References line::mam::Mmap< T >::classes(), line::Matrix< T >::cols(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), line::Matrix< T >::Matrix(), mmap_count_lambda(), mmap_normalize(), mmap_scale_perclass(), line::mam::Mmap< T >::order(), and line::Matrix< T >::rows().

Referenced by mmap_scale_perclass().

◆ mmap_sigma()

template<class T>
Matrix< T > line::mam::mmap_sigma ( const Mmap< T > & mm)

sigma(i,j) = pie E_i E_j 1, the probability that two consecutive marks are (i,j).

Definition at line 140 of file mmap_stats.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::map(), map_pie(), mmap_embedded(), mmap_sigma(), and line::vecmul().

Referenced by mamap22_fit_bs_multiclass(), mamap22_fit_fs_multiclass(), mamap22_fit_gamma_bs_mmap(), mamap2m_fit(), and mmap_sigma().

◆ mmap_sigma2()

template<class T>
std::vector< std::vector< std::vector< T > > > line::mam::mmap_sigma2 ( const Mmap< T > & mm)

sigma2(i,j,h) = pie E_i E_j E_h 1, indexed as sigma2[i][j][h].

Definition at line 159 of file mmap_stats.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::map(), map_pie(), mmap_embedded(), mmap_sigma2(), and line::vecmul().

Referenced by mmap_sigma2().

◆ mmap_sum()

template<class T>
Mmap< T > line::mam::mmap_sum ( const Mmap< T > & mm,
unsigned n )

MMAP of the sum of n independent copies, a block bidiagonal concatenation.

Definition at line 325 of file mmap_stats.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::InputError::InputError(), line::Matrix< T >::Matrix(), mmap_sum(), and line::mam::Mmap< T >::order().

Referenced by mmap_sum().

◆ mmap_super()

template<class T>
Mmap< T > line::mam::mmap_super ( const Mmap< T > & a,
const Mmap< T > & b )

Superposition of two MMAPs: the phase process is the product chain, and the class list of the result is the concatenation of the two class lists (mmap_super.m, 'default' option).

Definition at line 88 of file mmap_lambda.h.

References line::mam::Mmap< T >::classes(), line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, krons(), mmap_super(), and line::mam::Mmap< T >::order().

Referenced by m3pp_superpos_fitc(), mmap_super(), mmap_super_safe(), and solver_mam_passage_time().

◆ mmap_super_safe()

template<class T>
Mmap< T > line::mam::mmap_super_safe ( const std::vector< Mmap< T > > & in,
std::size_t maxorder )

Order-bounded superposition of several MMAPs (mmap_super_safe.m).

Components are superposed low-SCV first, and the product order is held at or below maxorder by replacing a component with its marked Poisson equivalent. The marks are permuted back into INPUT order afterwards, because mmap_super concatenates them in fold order while every caller reads mark k as its own k-th class; without that the SCV sort renames the classes.

ONE REFERENCE BRANCH IS REFUSED BY NAME rather than substituted. When the order budget still allows an order-2 component, MATLAB compresses with mamap2m_fit_gamma_fb_mmap, an acyclic MAP(2) fit that mmap_compress.h records as not ported. Substituting the Poisson fallback there would silently discard the component's variability, so this refuses instead. With the solver's default space_max = 128 the branch needs an arrival stream of order above 128 (or a product above it with room for a 2-phase factor) to be reachable at all.

Definition at line 165 of file mmap_assemble.h.

References line::mam::Mmap< T >::Dc, line::InputError::InputError(), map_scv(), mmap_exponential_vec(), mmap_super(), mmap_super_safe(), line::mam::Mmap< T >::order(), and line::UnsupportedError::UnsupportedError().

Referenced by mmap_super_safe(), solver_mam_basic(), and solver_mam_bgchain().

◆ mmap_timereverse()

template<class T>
Mmap< T > line::mam::mmap_timereverse ( const Mmap< T > & mm)

◆ mmapph1fcfs_ncdistr()

template<class T>
std::vector< std::vector< T > > line::mam::mmapph1fcfs_ncdistr ( const Mmap< T > & arrival,
const std::vector< PhService< T > > & svc,
std::size_t levels )

Per-class queue-length distribution, BUTools' 'ncDistr', n: P(N_k = 0..n-1).

Parameters
levelsthe number of probabilities per class, n
arrivalthe marked arrival process
svcper-class phase-type service processes

Definition at line 389 of file mmapph1fcfs.h.

References line::eye(), line::InputError::InputError(), kron(), line::matmul(), mmapph1fcfs_ncdistr(), and line::SylvesterFactor< T >::solve_lyap().

Referenced by mmapph1fcfs_ncdistr(), and solver_mna_closed().

◆ mmapph1fcfs_ncmean()

template<class T>
std::vector< T > line::mam::mmapph1fcfs_ncmean ( const Mmap< T > & arrival,
const std::vector< PhService< T > > & svc )

Per-class mean number of customers in the system, BUTools' 'ncMoms', 1.

Parameters
arrivalthe MMAP (D0, D1, D1^(1)..D1^(K)) of the arrival stream
svcthe per-class phase-type service laws, K of them

Definition at line 355 of file mmapph1fcfs.h.

References line::eye(), kron(), line::matmul(), mmapph1fcfs_ncmean(), line::SylvesterFactor< T >::solve_lyap(), and line::vecmul().

Referenced by mmapph1fcfs_ncmean(), solver_mam_basic_mmap_inner(), solver_mam_decmmap(), and solver_mna_open().

◆ mmapph1fcfs_stdistr_ph()

template<class T>
std::vector< StDistrPh< T > > line::mam::mmapph1fcfs_stdistr_ph ( const Mmap< T > & arrival,
const std::vector< PhService< T > > & svc,
double precision = 1e-14 )

Per-class SOJOURN TIME as a continuous phase-type law, BUTools' 'stDistrPH'.

The age process is already the sojourn-time engine: T generates it and pi0 starts it, so the sojourn time of a class-k job is the absorption time of T with the class-k exit column as its closing vector. What this routine does beyond that is the SIMILARITY TRANSFORM BUTools applies, which turns the matrix-exponential pair into a genuine PH pair: it drops the states carrying no probability (vv > precision), rescales by delta = diag(vv(nz)), and TRANSPOSES the generator. Without the transpose the pair still has the right transform but is not a subgenerator, and map_cdf on it returns values outside [0,1].

The result feeds solver_mam_passage_time, which reads it as the MAP {A, (-A e) alpha} and evaluates the response-time CDF on a grid.

Definition at line 302 of file mmapph1fcfs.h.

References line::inverse(), line::Matrix< T >::Matrix(), mmapph1fcfs_stdistr_ph(), line::mulvec(), line::NumericError::NumericError(), and line::vecmul().

Referenced by line::fj::fj_return_rt1(), mmapph1fcfs_stdistr_ph(), and solver_mam_passage_time().

◆ mmdp_isfeasible() [1/2]

template<class T>
bool line::mam::mmdp_isfeasible ( const Matrix< T > & Q,
const Matrix< T > & R )

mmdp_isfeasible with the MATLAB tolerance, 1e-10.

Definition at line 67 of file mmdp_isfeasible.h.

References mmdp_isfeasible().

◆ mmdp_isfeasible() [2/2]

template<class T>
bool line::mam::mmdp_isfeasible ( const Matrix< T > & Q,
const Matrix< T > & R,
const T & tol )

True when (Q, R) is a valid MMDP pair up to the given tolerance.

Definition at line 41 of file mmdp_isfeasible.h.

References line::Matrix< T >::cols(), mmdp_isfeasible(), line::num_abs(), and line::Matrix< T >::rows().

Referenced by mmdp_isfeasible(), and mmdp_isfeasible().

◆ mmpp2_fit()

template<class T>
Map< T > line::mam::mmpp2_fit ( const T & E1,
const T & E2,
const T & E3,
const T & ACFLAG1 )

MMPP(2) with moments (E1, E2, E3) and lag-1 autocorrelation ACFLAG1.

Definition at line 34 of file mmpp2_fit.h.

References line::InputError::InputError(), mmpp2_fit(), and mmpp2_fit3().

Referenced by mmpp2_fit().

◆ mmpp2_fit1()

template<class T>
Map2FitResult< T > line::mam::mmpp2_fit1 ( const T & mean,
const T & scv,
const T & skew,
const T & idc )

MAP(2) with the given mean, SCV, skewness and IDC.

Definition at line 36 of file mmpp2_fit1.h.

References line::InputError::InputError(), map2_fit(), and mmpp2_fit1().

Referenced by mmpp2_fit1().

◆ mmpp2_fit2()

template<class T>
Mmpp2FitResult< T > line::mam::mmpp2_fit2 ( const T & mean,
const T & scv,
const T & skew,
const T & g2 )

MMPP(2) with the given mean, SCV, skewness and decay rate g2.

Definition at line 43 of file mmpp2_fit2.h.

References line::mam::Mmpp2FitResult< T >::feasible, line::InputError::InputError(), line::mam::Mmpp2FitResult< T >::map, map_exponential_mean(), map_isfeasible(), mmpp2_fit2(), and mmpp2_fit3().

Referenced by mmpp2_fit2().

◆ mmpp2_fit3() [1/2]

template<class T>
Map< T > line::mam::mmpp2_fit3 ( const T & E1,
const T & E2,
const T & E3,
const T & G2 )

mmpp2_fit3 with the MATLAB default g2tol = 1e-6.

Definition at line 188 of file mmpp2_fit3.h.

References mmpp2_fit3().

◆ mmpp2_fit3() [2/2]

template<class T>
Map< T > line::mam::mmpp2_fit3 ( const T & E1,
const T & E2,
const T & E3,
const T & G2,
const T & g2tol )

MMPP(2) with moments (E1, E2, E3) and autocorrelation decay rate G2.

g2tol is the threshold below which the uncorrelated branch is taken (MATLAB uses 1e-6).

Definition at line 51 of file mmpp2_fit3.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), line::Matrix< T >::Matrix(), mmpp2_fit3(), and line::NumericError::NumericError().

Referenced by mmpp2_fit(), mmpp2_fit2(), mmpp2_fit3(), mmpp2_fit3(), and mmpp2_fit4().

◆ mmpp2_fit4()

template<class T>
Mmpp2FitResult< T > line::mam::mmpp2_fit4 ( const T & mean,
const T & scv,
const T & skew,
const T & acf1 )

MMPP(2) with the given mean, SCV, skewness and lag-1 autocorrelation.

Definition at line 37 of file mmpp2_fit4.h.

References line::mam::Mmpp2FitResult< T >::feasible, line::InputError::InputError(), line::mam::Mmpp2FitResult< T >::map, map_isfeasible(), mmpp2_fit3(), and mmpp2_fit4().

Referenced by mmpp2_fit4().

◆ mmpp2_fitc()

template<class T>
Mmpp2FitcResult< T > line::mam::mmpp2_fitc ( const T & mu,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2 )

◆ mmpp2_fitc_approx() [1/2]

template<class T>
Mmpp2FitcApproxResult< T > line::mam::mmpp2_fitc_approx ( const T & a,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2 )

mmpp2_fitc_approx with the default tuning.

Definition at line 241 of file mmpp2_fitc_approx.h.

References line::auglag_defaults(), and mmpp2_fitc_approx().

◆ mmpp2_fitc_approx() [2/2]

template<class T>
Mmpp2FitcApproxResult< T > line::mam::mmpp2_fitc_approx ( const T & a,
const T & bt1,
const T & bt2,
const T & binf,
const T & m3t2,
const T & t1,
const T & t2,
const AugLagOptions< T > & opt )

◆ mmpp2_fitc_theoretical() [1/2]

template<class T>
Mmpp2FitcResult< T > line::mam::mmpp2_fitc_theoretical ( const Map< T > & mp)

mmpp2_fitc_theoretical with the reference's default time scales 1, 10, 1e8.

Definition at line 303 of file m3pp2m_fitc_trace.h.

References mmpp2_fitc_theoretical().

◆ mmpp2_fitc_theoretical() [2/2]

template<class T>
Mmpp2FitcResult< T > line::mam::mmpp2_fitc_theoretical ( const Map< T > & mp,
const T & t1,
const T & t2,
const T & tinf )

MMPP(2) fitted to the counting characteristics of a GIVEN MAP (matlab/lib/kpctoolbox/mmpp/mmpp2_fitc_theoretical.m).

The characteristics are the rate at t1, the IDC at t1, t2 and tinf, and the third central moment of counts at t2, all evaluated exactly on the input MAP.

Definition at line 275 of file m3pp2m_fitc_trace.h.

References map_count_mean(), map_count_moment(), map_count_var(), mmpp2_fitc(), and mmpp2_fitc_theoretical().

Referenced by mmpp2_fitc_theoretical(), and mmpp2_fitc_theoretical().

◆ mmpp_rand()

template<class T, class Gen>
Map< T > line::mam::mmpp_rand ( std::size_t K,
Gen & gen )

Random MMPP of order K: the arrival matrix is diagonal, so arrivals do not switch phase.

Definition at line 74 of file map_rand.h.

References map_normalize(), and mmpp_rand().

Referenced by m3pp_rand(), and mmpp_rand().

◆ ph2hyper()

template<class T>
HyperParams< T > line::mam::ph2hyper ( const Map< T > & ph)

◆ ph2map()

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.

Definition at line 346 of file map_transform.h.

References line::mam::PhType< T >::alpha, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), line::Matrix< T >::Matrix(), ph2map(), and line::mam::PhType< T >::subgen.

Referenced by ph2map().

◆ ph_multisets()

std::vector< std::vector< int > > line::mam::ph_multisets ( std::size_t p,
std::size_t k )
inline

Configurations of k identical servers over p service phases.

Rows are the compositions of k into p nonnegative parts: entry (r,i) is the number of the k busy servers sitting in phase i. The order is fixed and shared by every caller, so a configuration index means the same thing in each of them: the first part descends, hence k = 1 yields the identity rows e_1 ... e_p in phase order, which is what makes the c = 1 case coincide with plain phase indexing.

Definition at line 63 of file ldqbd_mphc.h.

References ph_multisets().

Referenced by ldqbd_mphc(), and ph_multisets().

◆ q_dt_map_map_1()

template<class T>
std::vector< T > line::mam::q_dt_map_map_1 ( const Dmap< T > & arv,
const Dmap< T > & svc,
std::size_t max_num_comp = 1000 )

Queue length distribution of a discrete-time D-MAP/D-MAP/1/FCFS queue, the queue-length half of Q_DT_MAP_MAP_1.

Entry i is Prob[i customers in system] under LAS-DA. The waiting and sojourn pmfs of the Q-MAM routine are deliberately not ported: no LINE caller consumes them, and the discrete-time solver path reads the queue length alone.

Definition at line 724 of file dtime.h.

References line::mam::Dmap< T >::D0, line::mam::Dmap< T >::D1, line::mc::dtmc_solve(), line::InputError::InputError(), q_dt_map_map_1(), and qbd_dt_g().

Referenced by q_dt_map_map_1(), and q_dt_ph_ph_1().

◆ q_dt_ph_ph_1()

template<class T>
std::vector< T > line::mam::q_dt_ph_ph_1 ( const Dph< T > & arv,
const Dph< T > & svc,
std::size_t max_num_comp = 1000 )

Queue length of a discrete-time DPH/DPH/1/FCFS queue, via the D-MAP route.

Definition at line 805 of file dtime.h.

References dph_to_dmap(), q_dt_map_map_1(), and q_dt_ph_ph_1().

Referenced by q_dt_ph_ph_1().

◆ qbd_blocks_mapmap1()

template<class T>
void line::mam::qbd_blocks_mapmap1 ( const Matrix< T > & D0a,
const Matrix< T > & D1a,
const Matrix< T > & D0s,
const Matrix< T > & D1s,
Matrix< T > * B,
Matrix< T > * L,
Matrix< T > * F )

The QBD blocks of a MAP/MAP/1 queue: backward, local and forward.

The level is the queue length and the phase is the PAIR (arrival phase, service phase), so every block is a Kronecker product with the identity of the other process:

F = D1_arr (x) I an arrival raises the level B = I (x) D1_srv a completion lowers it L = D0_arr (x) I + I (x) D0_srv both processes move, the level does not

The ORDER of the factors is the state ordering and cannot be swapped independently in the three: doing so in one alone transposes the phase index and the chain silently describes a different queue.

Definition at line 155 of file map_moment_extra.h.

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

Referenced by qbd_blocks_mapmap1().

◆ qbd_bmapbmap1()

template<class T>
QbdBmapBmap1Blocks< T > line::mam::qbd_bmapbmap1 ( const Map< T > & arrival,
const std::vector< T > & pbatch,
const Map< T > & service )

Level blocks of a BMAP/MAP/1 queue.

Parameters
arrivalarrival MAP, whose D1 is split by the batch-size law
pbatchbatch-size probabilities, pbatch[b-1] = P(batch = b)
serviceservice MAP

Definition at line 80 of file qbd_bmapbmap1.h.

References line::mam::QbdBmapBmap1Blocks< T >::A0, line::mam::QbdBmapBmap1Blocks< T >::A0bar, line::mam::QbdBmapBmap1Blocks< T >::A1, line::mam::QbdBmapBmap1Blocks< T >::Am1, line::mam::QbdBmapBmap1Blocks< T >::B0, line::mam::QbdBmapBmap1Blocks< T >::B1, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::eye(), line::InputError::InputError(), kron(), krons(), line::mam::Map< T >::order(), and qbd_bmapbmap1().

Referenced by qbd_bmapbmap1().

◆ qbd_caudal() [1/2]

template<class T>
T line::mam::qbd_caudal ( const Matrix< T > & R)

qbd_caudal with 10000 iterations and tolerance 1e-14.

Definition at line 388 of file qbd_r.h.

References qbd_caudal().

◆ qbd_caudal() [2/2]

template<class T>
T line::mam::qbd_caudal ( const Matrix< T > & R,
unsigned iter_max,
const T & tol )

Caudal characteristic eta = sp(R), the decay rate of the queue-length tail.

R is entrywise non-negative, so its spectral radius is its Perron root and is bracketed by the Collatz-Wielandt bounds

min_i (R x)_i / x_i  <=  sp(R)  <=  max_i (R x)_i / x_i

for any strictly positive x. Power iteration is run on I + R, which is aperiodic whenever R is irreducible and keeps the iterate strictly positive, and the midpoint of the bracket is returned once it is tighter than tol.

This is the same quantity as MATLAB's QBD_Caudal, which brackets it by bisecting on the dominant eigenvalue of A(eta) = B + L eta + F eta^2, and as the JAR's spectralRadiusMapmap1, which takes the largest eigenvalue modulus of R from a full eigendecomposition. The bracket form is preferred here because it needs no eigensolver and reports its own accuracy.

Definition at line 355 of file qbd_r.h.

References line::Matrix< T >::cols(), line::InputError::InputError(), line::mulvec(), line::NumericError::NumericError(), line::ones(), qbd_caudal(), and line::Matrix< T >::rows().

Referenced by map_m1ps_cdfrespt(), qbd_caudal(), qbd_caudal(), and qbd_mapmap1().

◆ qbd_depproc_etaqa()

template<class T>
Map< T > line::mam::qbd_depproc_etaqa ( const Map< T > & arrival,
const Map< T > & service,
std::size_t n )

MAP descriptor of the departure process of a MAP/MAP/1-FCFS queue, ETAQA-truncated at level n (qbd_depproc_etaqa.m).

Parameters
nnumber of explicitly represented levels; the descriptor has n+1 blocks of order na*ns, the last one being the aggregate
arrivalthe arrival MAP
servicethe service MAP

Definition at line 153 of file qbd_depproc.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), and qbd_depproc_etaqa().

Referenced by qbd_depproc_etaqa(), solver_mam_basic_mmap_inner(), and solver_mam_decmmap().

◆ qbd_depproc_etaqa_ps()

template<class T>
Map< T > line::mam::qbd_depproc_etaqa_ps ( const Map< T > & arrival,
const Map< T > & service,
std::size_t n )

MAP descriptor of the departure process of a MAP/MAP/1-PS queue, ETAQA-truncated at level n (qbd_depproc_etaqa_ps.m).

With j jobs sharing the server a completion is a departure of the tagged job with probability 1/j, so the down-block at level j splits into B * (1/j) into D1 and B * (1 - 1/j) into D0.

Definition at line 196 of file qbd_depproc.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), and qbd_depproc_etaqa_ps().

Referenced by qbd_depproc_etaqa_ps(), solver_mam_basic_mmap_inner(), and solver_mam_decmmap().

◆ qbd_depproc_jointmom()

template<class T>
std::vector< T > line::mam::qbd_depproc_jointmom ( const Map< T > & arrival,
const Map< T > & service,
const std::vector< std::pair< unsigned, unsigned > > & iset )

Joint moments E[X_0^i X_1^j] of consecutive inter-departure times of a MAP/MAP/1-FCFS queue (qbd_depproc_jointmom.m).

The initial vector is built from the level-0 vector of the QBD and the first three terms of the geometric tail,

z = [v0 R F, v0 R^2 F, v0 R^3 (I-R)^-1 F] / lambda_s,

normalized to a probability vector, and the moments follow from the three-level block operators

M0 = [L0 F 0; 0 L F; 0 0 L+F],   M1 = [0 0 0; B 0 0; 0 B 0]

as JM = z i! (-M0)^{-i-1} M1 j! (-M0)^{-j} e.

Parameters
isetone (i, j) pair per requested moment
arrivalthe arrival MAP
servicethe service MAP

Definition at line 273 of file qbd_depproc.h.

References line::eye(), line::inverse(), map_lambda(), line::matpow(), line::num_factorial(), line::NumericError::NumericError(), line::ones(), qbd_depproc_jointmom(), qbd_pi(), and line::vecmul().

Referenced by qbd_depproc_jointmom().

◆ qbd_depproc_residual()

template<class T>
T line::mam::qbd_depproc_residual ( const Map< T > & m)

||(D0 + D1) e||_inf, zero for a genuine MAP.

Exposed so a caller can see reference defects 1 and 2 rather than discovering them downstream.

Definition at line 240 of file qbd_depproc.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::num_abs(), and qbd_depproc_residual().

Referenced by qbd_depproc_residual().

◆ qbd_dt_g()

template<class T>
Matrix< T > line::mam::qbd_dt_g ( const Matrix< T > & A0,
const Matrix< T > & A1,
const Matrix< T > & A2,
int max_iter = 200 )

G matrix of a discrete-time QBD by logarithmic reduction (Latouche and Ramaswami).

The blocks are stochastic, so no uniformization is needed; the MATLAB twin reaches the same minimal solution through SMCSolver's cyclic reduction.

Definition at line 522 of file dtime.h.

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

Referenced by q_dt_map_map_1(), and qbd_dt_g().

◆ qbd_fundmat() [1/2]

template<class T>
QbdFundMat< T > line::mam::qbd_fundmat ( const Matrix< T > & B,
const Matrix< T > & L,
const Matrix< T > & F )

qbd_fundmat with the MATLAB defaults, 50 iterations and tolerance 1e-14.

Definition at line 332 of file qbd_r.h.

References qbd_fundmat().

◆ qbd_fundmat() [2/2]

template<class T>
QbdFundMat< T > line::mam::qbd_fundmat ( const Matrix< T > & B,
const Matrix< T > & L,
const Matrix< T > & F,
unsigned iter_max,
const T & tol )

G and R by cyclic reduction (qbd_fundmat.m, the Bini-Meini logarithmic reduction on the raw level blocks).

The blocks are first uniformized by lambda = max(-diag(L)) into a discrete QBD (Bm, Lm, Fm), G is accumulated over doubling horizons, and R is recovered as R = Fm (I - (Lm + Fm G))^-1. The uniformization does not change either G or R: G is a probability matrix of the embedded jump chain, and the R of the discrete chain solves R = Fm + R Lm + R^2 Bm, which is F + R L + R^2 B = 0 after multiplying through by lambda.

Quadratically convergent, so 50 iterations is a generous bound even at utilizations where successive substitution needs millions.

Definition at line 280 of file qbd_r.h.

References line::Matrix< T >::cols(), line::eye(), line::mam::QbdFundMat< T >::G, line::InputError::InputError(), line::inverse(), line::mam::QbdFundMat< T >::iterations, line::matmul(), line::NumericError::NumericError(), qbd_fundmat(), line::mam::QbdFundMat< T >::R, and line::Matrix< T >::rows().

Referenced by qbd_fundmat(), qbd_fundmat(), qbd_mapmap1(), qbd_rg(), qbd_setupdelayoff(), and line::qsys::qsys_mapmc().

◆ qbd_fundmat_laplace()

CQbdFundMat line::mam::qbd_fundmat_laplace ( const CMat & B,
const CMat & L,
const CMat & F,
double precision = 1e-14,
unsigned maxNumIt = 50 )
inline

Port of qbd_fundmat.m at complex argument: cyclic reduction (Bini-Meini logarithmic reduction) on the raw level blocks, with R recovered from G.

The reference uniformizes by lamb = max(-real(diag(L))) – the REAL part, because the shift -sI makes the diagonal complex while the uniformization constant must stay a positive real, and stops on min(norm(BB,inf), norm(BF,inf)), a real quantity too. Both are reproduced.

Definition at line 170 of file mam_transient2.h.

References line::Matrix< T >::cols(), line::eye(), line::mam::CQbdFundMat::G, line::InputError::InputError(), line::mam::CQbdFundMat::iterations, line::matmul(), line::NumericError::NumericError(), qbd_fundmat_laplace(), line::mam::CQbdFundMat::R, and line::Matrix< T >::rows().

Referenced by mam_transient2(), mam_transient2_open(), qbd_fundmat_laplace(), and solver_mam_transient_qbd().

◆ qbd_G_residual()

template<class T>
T line::mam::qbd_G_residual ( const Matrix< T > & B,
const Matrix< T > & L,
const Matrix< T > & F,
const Matrix< T > & G )

Residual of the defining equation of G, ||B + L G + F G^2||_inf.

Definition at line 162 of file qbd_r.h.

References line::matmul(), and qbd_G_residual().

Referenced by qbd_G_residual().

◆ qbd_mapmap1() [1/2]

template<class T>
QbdMapMap1Result< T > line::mam::qbd_mapmap1 ( const Map< T > & arrival,
const Map< T > & service )

qbd_mapmap1 without rescaling and with 20000 materialized levels.

Definition at line 242 of file qbd_mapmap1.h.

References qbd_mapmap1().

◆ qbd_mapmap1() [2/2]

template<class T>
QbdMapMap1Result< T > line::mam::qbd_mapmap1 ( const Map< T > & arrival,
const Map< T > & service_in,
const T & util,
std::size_t max_levels )

MAP/MAP/1 queue (qbd_mapmap1.m).

Differences from the MATLAB reference, both deliberate:

  • QN is the closed form pi_0 R (I - R)^-2 e rather than the truncated sum over the levels that MATLAB and the JAR compute. The truncated value is available as qbd_mapmap1_qlen_truncated(res) for a like-for-like comparison.
  • eta is bracketed by Collatz-Wielandt on R (qbd_caudal) rather than taken from an eigendecomposition; the value is the same spectral radius.
Parameters
utilif positive, rescale the service MAP to mean util / lambda_a
max_levelshow many levels of pqueue to materialize
arrivalthe arrival MAP
service_inthe service MAP, rescaled to the requested utilization

Definition at line 201 of file qbd_mapmap1.h.

References line::mam::QbdMapMap1Result< T >::B, line::mam::QbdMapMap1Result< T >::eta, line::mam::QbdMapMap1Result< T >::F, line::mam::QbdFundMat< T >::G, line::mam::QbdMapMap1Result< T >::G, line::mam::QbdFundMat< T >::iterations, line::mam::QbdMapMap1Result< T >::iterations, line::mam::QbdMapMap1Result< T >::L, line::mam::QbdMapMap1Result< T >::Lbar, map_lambda(), map_scale(), line::matmul(), line::NumericError::NumericError(), line::mam::QbdMapMap1Result< T >::pi0, line::mam::QbdMapMap1Result< T >::pqueue, qbd_caudal(), qbd_fundmat(), qbd_mapmap1(), qbd_mapmap1_blocks(), qbd_pi(), qbd_qlen_factmoment(), line::mam::QbdMapMap1Result< T >::QN, line::mam::QbdFundMat< T >::R, line::mam::QbdMapMap1Result< T >::R, line::mam::QbdMapMap1Result< T >::RN, line::mam::QbdMapMap1Result< T >::service, line::mam::QbdMapMap1Result< T >::U, line::mam::QbdMapMap1Result< T >::UN, and line::mam::QbdMapMap1Result< T >::XN.

Referenced by qbd_mapmap1(), qbd_mapmap1(), line::qsys::qsys_mapmap1(), solver_mam_basic_mmap_inner(), and solver_mam_mapmap1_exact().

◆ qbd_mapmap1_blocks()

template<class T>
QbdMapMap1Blocks< T > line::mam::qbd_mapmap1_blocks ( const Map< T > & arrival,
const Map< T > & service )

◆ qbd_mapmap1_qlen_truncated()

template<class T>
T line::mam::qbd_mapmap1_qlen_truncated ( const QbdMapMap1Result< T > & res)

The mean number in system computed the way MATLAB's qbd_mapmap1 does it, by summing k over the materialized levels.

Provided for a like-for-like comparison against the reference; qbd_mapmap1's QN field is the closed form and is the value to use.

Definition at line 254 of file qbd_mapmap1.h.

References line::mam::QbdMapMap1Result< T >::pqueue, and qbd_mapmap1_qlen_truncated().

Referenced by qbd_mapmap1_qlen_truncated().

◆ qbd_pi() [1/2]

template<class T>
Matrix< T > line::mam::qbd_pi ( const Matrix< T > & B,
const Matrix< T > & Lbar,
const Matrix< T > & R )

qbd_pi with the MATLAB-side defaults, 20000 levels and mass tolerance 1e-10.

Definition at line 453 of file qbd_r.h.

References qbd_pi().

◆ qbd_pi() [2/2]

template<class T>
Matrix< T > line::mam::qbd_pi ( const Matrix< T > & B,
const Matrix< T > & Lbar,
const Matrix< T > & R,
std::size_t max_levels,
const T & mass_tol )

Stationary distribution of a QBD given R (QBD_pi.m, continuous-time branch, default boundary).

The level-zero vector solves pi_0 (Lbar + R B) = 0 normalized by pi_0 (I - R)^-1 e = 1, and pi_{k+1} = pi_k R. Levels are generated until the accumulated mass exceeds 1 - mass_tol or max_levels is reached.

Un-gated: given R this is a linear solve, a matrix inverse and a geometric recursion, all finite sequences of field operations. At Rational the level probabilities are the exact ones implied by the R that was supplied.

Parameters
Bbackward block (QBD_pi's B0)
Lbarlevel-zero local block (QBD_pi's B1)
Rthe rate matrix of the QBD
max_levelslevel truncation used for the returned distribution
mass_tolprobability mass left above the truncation that is tolerated
Returns
(levels x m) matrix, row k holding pi_k

Definition at line 412 of file qbd_r.h.

References line::Matrix< T >::cols(), line::eye(), line::InputError::InputError(), line::inverse(), line::matmul(), line::NumericError::NumericError(), qbd_pi(), line::Matrix< T >::rows(), and line::vecmul().

Referenced by qbd_depproc_jointmom(), qbd_mapmap1(), qbd_pi(), qbd_pi(), and qbd_setupdelayoff().

◆ qbd_qlen_factmoment()

template<class T>
T line::mam::qbd_qlen_factmoment ( const std::vector< T > & pi0,
const Matrix< T > & R,
unsigned m )

Factorial moment of order m of the number in system, computed in closed form from the boundary vector and R:

E[N(N-1)...(N-m+1)] = m! pi_0 R^m (I - R)^-(m+1) e.

Un-gated: given pi_0 and R this is exact matrix algebra. m = 0 returns 1.

Definition at line 134 of file qbd_mapmap1.h.

References line::eye(), line::InputError::InputError(), line::inverse(), line::matmul(), line::matpow(), line::num_factorial(), qbd_qlen_factmoment(), line::Matrix< T >::rows(), and line::vecmul().

Referenced by qbd_mapmap1(), qbd_qlen_factmoment(), and qbd_qlen_moment().

◆ qbd_qlen_moment()

template<class T>
T line::mam::qbd_qlen_moment ( const std::vector< T > & pi0,
const Matrix< T > & R,
unsigned m )

Raw moment of order m of the number in system, E[N^m], assembled from the factorial moments with the Stirling numbers of the second kind, N^m = sum_j S(m,j) N(N-1)...(N-j+1).

Integer combinatorics plus exact matrix algebra, so un-gated and exact at Rational.

Definition at line 153 of file qbd_mapmap1.h.

References qbd_qlen_factmoment(), and qbd_qlen_moment().

Referenced by qbd_qlen_moment().

◆ qbd_R() [1/2]

template<class T>
Matrix< T > line::mam::qbd_R ( const Matrix< T > & B,
const Matrix< T > & L,
const Matrix< T > & F )

qbd_R with the MATLAB defaults, 100000 iterations and tolerance 1e-12.

Definition at line 204 of file qbd_r.h.

References qbd_R().

◆ qbd_R() [2/2]

template<class T>
Matrix< T > line::mam::qbd_R ( const Matrix< T > & B,
const Matrix< T > & L,
const Matrix< T > & F,
unsigned iter_max,
const T & tol )

R by successive substitutions (qbd_R.m): iterate R <- -(F + R^2 B) L^-1.

Linearly convergent, at the rate of the caudal characteristic, so it is slow near saturation; qbd_fundmat is quadratically convergent and is what qbd_mapmap1 uses. Kept because it is the MATLAB entry point of the same name and because its simplicity makes it a useful independent check on the cyclic-reduction result.

Parameters
tolstopping tolerance on ||R_k - R_{k+1}||_1 (MATLAB uses 1e-12)
Bbackward (level down) block A_2
Llocal (within level) block A_1
Fforward (level up) block A_0
iter_maxiteration cap

Definition at line 184 of file qbd_r.h.

References line::inverse(), line::matmul(), and qbd_R().

Referenced by qbd_R(), and qbd_R().

◆ qbd_R_logred() [1/2]

template<class T>
Matrix< T > line::mam::qbd_R_logred ( const Matrix< T > & B,
const Matrix< T > & L,
const Matrix< T > & F )

qbd_R_logred with the MATLAB defaults, 100000 iterations and tolerance 1e-12.

Definition at line 253 of file qbd_r.h.

References qbd_R_logred().

◆ qbd_R_logred() [2/2]

template<class T>
Matrix< T > line::mam::qbd_R_logred ( const Matrix< T > & B,
const Matrix< T > & L,
const Matrix< T > & F,
unsigned iter_max,
const T & tol )

R by logarithmic reduction (qbd_R_logred.m).

Builds the matrix S of the taboo probabilities of ever going down, doubling the horizon at every step, then recovers R = -F (L + F S)^-1. Quadratically convergent; the stopping test is on how close S e is to e, i.e. on how much mass of the downward passage is still unaccounted for.

Definition at line 217 of file qbd_r.h.

References line::eye(), line::inverse(), line::matmul(), line::mulvec(), line::num_abs(), line::ones(), qbd_R_logred(), and line::Matrix< T >::rows().

Referenced by qbd_R_logred(), qbd_R_logred(), and line::qsys::qsys_mapphc().

◆ qbd_R_residual()

template<class T>
T line::mam::qbd_R_residual ( const Matrix< T > & B,
const Matrix< T > & L,
const Matrix< T > & F,
const Matrix< T > & R )

Residual of the defining equation of R, ||F + R L + R^2 B||_inf.

Exact in rational arithmetic, which is what makes it a usable oracle: a residual computed in the same double arithmetic that produced R can be small simply because the error cancels, whereas evaluating the same expression on the exact rationals of B, L, F and on the exact rational lift of R measures only how far R itself is from a solution.

Definition at line 154 of file qbd_r.h.

References line::matmul(), and qbd_R_residual().

Referenced by qbd_R_residual().

◆ qbd_rap() [1/2]

template<class T>
QbdRapResult< T > line::mam::qbd_rap ( const Matrix< T > & A0,
const Matrix< T > & A1,
const Matrix< T > & A2 )

qbd_rap with the reference defaults, B0 = A0, B1 = A1 and 20 levels.

Definition at line 395 of file qbd_rap.h.

References qbd_rap().

◆ qbd_rap() [2/2]

template<class T>
QbdRapResult< T > line::mam::qbd_rap ( const Matrix< T > & A0,
const Matrix< T > & A1,
const Matrix< T > & A2,
const Matrix< T > & B0,
const Matrix< T > & B1,
std::size_t numLevels )

◆ qbd_raprap1() [1/2]

template<class T>
QbdRapRap1Result< T > line::mam::qbd_raprap1 ( const Map< T > & arrival,
const Map< T > & service )

qbd_raprap1 without rescaling the service process.

Definition at line 485 of file qbd_rap.h.

References qbd_raprap1().

◆ qbd_raprap1() [2/2]

template<class T>
QbdRapRap1Result< T > line::mam::qbd_raprap1 ( const Map< T > & arrival,
const Map< T > & service_in,
const T & util )

RAP/RAP/1 queue (qbd_raprap1.m).

The two RAPs are independent, so the QBD phase space is the product of the two phase spaces with the ARRIVAL phase major, phase index (a-1) ns + s. The Kronecker factors must not be swapped: downstream consumers index pqueue by that convention.

The truncation rule of the level series is the one of QBD_pi with MaxNumComp 100: accumulate until the mass reaches 1 - 1e-10, capped at 101 level vectors. qbd_rap returns the exact mean queue length in closed form, but QN here is deliberately the TRUNCATED sum, because that is the documented return value and the JAR and Python ports must cut the tail at the same point; core.QN carries the closed form for comparison.

Parameters
utilif positive, the service RAP is rescaled to mean util/lambda_a
arrivalthe arrival RAP
service_inthe service RAP, rescaled to the requested utilization

Definition at line 432 of file qbd_rap.h.

References line::mam::QbdRapRap1Result< T >::B, line::mam::QbdRapRap1Result< T >::core, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::QbdRapRap1Result< T >::eta, line::eye(), line::mam::QbdRapRap1Result< T >::F, line::mam::QbdRapRap1Result< T >::G, kron(), line::mam::QbdRapRap1Result< T >::L, map_lambda(), map_scale(), line::Matrix< T >::Matrix(), line::mam::Map< T >::order(), line::mam::QbdRapRap1Result< T >::pqueue, qbd_rap(), qbd_raprap1(), line::mam::QbdRapRap1Result< T >::QN, line::mam::QbdRapRap1Result< T >::R, line::mam::QbdRapRap1Result< T >::UN, line::vecmul(), and line::mam::QbdRapRap1Result< T >::XN.

Referenced by qbd_raprap1(), and qbd_raprap1().

◆ qbd_rg() [1/2]

template<class T>
QbdRg< T > line::mam::qbd_rg ( const Map< T > & arrival,
const Map< T > & service )

qbd_rg without rescaling the service process.

Definition at line 121 of file qbd_mapmap1.h.

References qbd_rg().

◆ qbd_rg() [2/2]

template<class T>
QbdRg< T > line::mam::qbd_rg ( const Map< T > & arrival,
const Map< T > & service_in,
const T & util )

R and G of the MAP/MAP/1 QBD (qbd_rg.m).

Gated: qbd_fundmat is iterative.

Parameters
utilif positive, the service MAP is first rescaled to mean util / lambda_arrival, exactly as the optional third argument of qbd_rg.m and qbd_mapmap1.m does through map_scale
arrivalthe arrival MAP
service_inthe service MAP, rescaled to the requested utilization

Definition at line 102 of file qbd_mapmap1.h.

References line::mam::QbdRg< T >::B, line::mam::QbdRg< T >::F, line::mam::QbdFundMat< T >::G, line::mam::QbdRg< T >::G, line::mam::QbdRg< T >::L, line::mam::QbdRg< T >::Lbar, map_lambda(), map_scale(), line::matmul(), qbd_fundmat(), qbd_mapmap1_blocks(), qbd_rg(), line::mam::QbdFundMat< T >::R, line::mam::QbdRg< T >::R, and line::mam::QbdRg< T >::U.

Referenced by qbd_rg(), and qbd_rg().

◆ qbd_setupdelayoff()

template<class T>
T line::mam::qbd_setupdelayoff ( const T & lambda,
const T & mu,
const T & alpharate,
const T & alphascv,
const T & betarate,
const T & betascv )

Mean queue length of the M/M/1 queue with setup delay and delay-off (qbd_setupdelayoff.m).

Parameters
lambdaarrival rate
muservice rate
alpharaterate of the setup phase
alphascvSCV of the setup phase
betaraterate of the delay-off phase
betascvSCV of the delay-off phase

Definition at line 151 of file qbd_setupdelayoff.h.

References coxian_phase_subgen(), qbd_fundmat(), qbd_pi(), qbd_setupdelayoff(), line::mam::QbdFundMat< T >::R, and line::Matrix< T >::rows().

Referenced by qbd_setupdelayoff().

◆ qbd_setupdelayoff_closed()

template<class T>
SetupDelayoffClosed< T > line::mam::qbd_setupdelayoff_closed ( const T & N,
const T & Z,
const T & mu,
const T & alpharate,
const T & alphascv,
const T & betarate,
const T & betascv )

Mean queue length and throughput of a FINITE-POPULATION queue with setup delay and delay-off, a port of matlab/src/api/mam/qbd_setupdelayoff_closed.m.

The closed twin of qbd_setupdelayoff. The population N is finite and Z is the complementary delay, the mean time a customer spends away from this station, so the arrival rate is state dependent, lambda(n) = (N - n)/Z, and the level index is bounded by N. That makes the chain a LEVEL-DEPENDENT QBD over finitely many levels, i.e. a finite CTMC, and it is solved exactly rather than by a matrix-geometric tail.

THE SEMANTICS ARE THE SIMULATOR'S, not the mean-value shortcut's. When the queue empties the server begins a delay-off period; an arrival DURING it finds the server still warm and resumes without setup (Solver_ssj's cancelDelayoff), and only an arrival after the delay-off has expired pays the setup. That is an M/M/1 with setup time AND close-down time. The per-instance cold-start race p_cold*E[setup] + S this replaces raced the delay-off against the per-instance idle time and carried NO queueing term, so it described a serverless instance pool rather than a single-server vacation queue and left the reported response time byte-identical across a tenfold change in the setup mean.

The phase index is overloaded by level exactly as in the open twin: at level 0 phase 1 is the OFF server and the rest are the delay-off; above level 0 the phases are the setup and the last one is the busy server. Only the REACHABLE states are enumerated, because a finite chain cannot carry an unreachable row: it would be absorbing and the stationary solve singular.

ARITHMETIC. Gated on num_traits<T>::has_transcendental, like the open twin: the Coxian fit takes a square root.

Parameters
Npopulation of the closed chain
Zcomplementary delay, the mean time a customer spends away
muservice rate of the station
alpharaterate of the setup phase
alphascvSCV of the setup phase
betaraterate of the delay-off phase
betascvSCV of the delay-off phase

Definition at line 261 of file qbd_setupdelayoff.h.

References coxian_phase_subgen(), line::mc::ctmc_solve(), line::lang::GlobalConstants::FineTol, qbd_setupdelayoff_closed(), line::mam::SetupDelayoffClosed< T >::QN, line::Matrix< T >::rows(), and line::mam::SetupDelayoffClosed< T >::XN.

Referenced by qbd_setupdelayoff_closed(), and solver_mam_ldqbd().

◆ randp()

template<class T>
std::size_t line::mam::randp ( const std::vector< T > & P,
pfqn::McRng & rng )

Draw an index from a discrete law, m3a's randp.

The weights need not be normalized; they must be non-negative and not all zero, which the reference reports rather than assumes.

Definition at line 63 of file map_sample.h.

References line::InputError::InputError(), line::pfqn::mc_uniform01(), and randp().

Referenced by map_sample(), and randp().

◆ rap_sample()

template<class T>
std::vector< T > line::mam::rap_sample ( const Map< T > & m,
std::size_t n,
pfqn::McRng & rng,
const std::vector< T > & a0 = std::vector<T>(),
std::vector< T > * a_out = 0 )

Sample a RAP or a matrix exponential by inverse transform.

There is no embedded jump chain to walk – D0 may carry negative off-diagonals – so each sample is the root of a exp(D0 x) e = u, found by bracketing and bisection, after which the entry law is advanced to a exp(D0 x) D1, renormalized.

Parameters
mthe RAP or ME as a (D0, D1) pair
nnumber of inter-arrival times to draw
rnggenerator, advanced by the call
a0initial entry law; empty selects map_pie
a_outwhen non-null, receives the entry law AFTER the last sample, so a caller drawing one variate at a time can chain the calls and keep the process correlated. A RAP's state is this real-valued vector and not a discrete phase, so it cannot be recovered from the sampled times the way a MAP's can from SampleTrace: without it, repeated n=1 calls silently restart the process from its stationary entry law every time and deliver a RENEWAL stream with the right marginal and no autocorrelation.

Definition at line 249 of file map_sample.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_mean(), map_pie(), line::pfqn::mc_uniform01(), line::NumericError::NumericError(), line::mam::Map< T >::order(), and rap_sample().

Referenced by rap_sample().

◆ rcat_moved_to_ag()

bool line::mam::rcat_moved_to_ag ( const std::string & method,
std::string & why )
inline

True for the four RCAT names that moved to SolverAG, with the redirect message.

It lives here, and is called from check_method BEFORE the unlisted-method throw, because that ordering is the whole point: the names are no longer in list_valid_methods, so a caller carrying an old options.method would otherwise be told only that the method is "unsupported by this solver" and left to guess. check_model_method calls the same helper so the two paths cannot drift into two different messages.

Definition at line 109 of file solver_mam_runner.h.

References rcat_moved_to_ag().

Referenced by check_method(), and rcat_moved_to_ag().

◆ sn_build_fj_sync_map()

template<class T>
FjSyncMap line::mam::sn_build_fj_sync_map ( const qn::NetworkStruct< T > & sn)

sn_build_fj_sync_map.

A node sits on the parallel path of a (Fork, Join) pair when the fork routes to it and it routes to the join, both for at least one class; every such node feeds one sync group at that join. Transcription of matlab/src/api/fj/sn_build_fj_sync_map.m; it belongs in line/api/fj/.

Definition at line 413 of file solver_mam_traffic.h.

References line::mam::FjSyncMap::fork_of_group, line::mam::FjSyncMap::join_of_group, line::mam::FjSyncMap::ngroups, line::mam::FjSyncMap::node_sync, and sn_build_fj_sync_map().

Referenced by sn_build_fj_sync_map(), and solver_mam_basic_mmap_inner().

◆ solver_mam_basic()

template<class T>
mva::MvaSolution< T > line::mam::solver_mam_basic ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

Port of solver_mam_basic.m.

Parameters
Lthe refreshed struct, with non-Markovian processes already gated out by the runner
optthe MAM options; space_max is the arrival superposition budget

Definition at line 1154 of file solver_mam_basic.h.

References line::mva::MvaSolution< T >::C, line::qn::NetworkStruct< T >::classes, line::mam::GlobalConstants::CoarseTol, line::mam::Map< T >::D0, line::mam::Mmap< T >::D0, line::mam::Map< T >::D1, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::qn::NetworkStruct< T >::disabled, line::lang::dist_to_map(), line::mam::GlobalConstants::FineTol, line::mam::GlobalConstants::Immediate, line::qn::NetworkStruct< T >::inchain, line::mva::MvaSolution< T >::iter, line::mva::ChainDemands< T >::Lchain, map_exponential_mean(), map_pie(), map_scale(), map_scale_rate(), line::Matrix< T >::Matrix(), line::mva::MvaSolution< T >::method, mmap_exponential_vec(), mmap_super_safe(), line::qn::NetworkStruct< T >::nchains, line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nodes, line::qn::NodeDef::nodetype, line::qn::NetworkStruct< T >::nof_nodes(), line::qn::NetworkStruct< T >::nstations, line::num_abs(), line::mva::MvaSolution< T >::Q, line::mva::MvaSolution< T >::R, line::qn::NetworkStruct< T >::rates, line::qn::NetworkStruct< T >::rtnodes, line::lang::sched_to_text(), line::qn::NetworkStruct< T >::service, line::mva::sn_get_demands_chain(), solver_mam_basic(), line::qn::NodeDef::station, line::qn::NetworkStruct< T >::stations, line::mva::MvaSolution< T >::Tp, line::mva::MvaSolution< T >::U, line::UnsupportedError::UnsupportedError(), and line::mva::MvaSolution< T >::X.

Referenced by mam_dispatch(), and solver_mam_basic().

◆ solver_mam_basic_mmap()

template<class T>
mva::MvaSolution< T > line::mam::solver_mam_basic_mmap ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

Port of solver_mam_basic_mmap.m, the top-level dispatcher of the MMAP fork-join decomposition: an open model goes straight to the inner algorithm with the arrival rates its sources declare, a closed one through the bisection wrapper.

Definition at line 812 of file solver_mam_basic_mmap.h.

References line::qn::NetworkStruct< T >::classes, line::qn::NetworkStruct< T >::disabled, line::qn::NetworkStruct< T >::inchain, line::qn::NetworkStruct< T >::is_open_model(), line::qn::NetworkStruct< T >::nchains, line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::rates, solver_mam_basic_mmap(), solver_mam_basic_mmap_closed(), and solver_mam_basic_mmap_inner().

Referenced by mam_dispatch(), and solver_mam_basic_mmap().

◆ solver_mam_basic_mmap_closed()

◆ solver_mam_basic_mmap_inner()

template<class T>
mva::MvaSolution< T > line::mam::solver_mam_basic_mmap_inner ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
const MmapDecConfig & cfg,
const std::vector< T > & lambda,
std::size_t * totiter )

Port of solver_mam_basic_mmap_inner.m.

Parameters
Lthe refreshed struct
optthe SolverMAM options; tol is the fixed point's iter_tol
cfgthe two options.config fields the analyzer defaults itself
lambdaper-CLASS surrogate arrival rate, the reference's lambda
totiterout: the sweeps the fixed point took

Definition at line 263 of file solver_mam_basic_mmap.h.

References line::mva::MvaSolution< T >::C, line::qn::NetworkStruct< T >::classes, line::mam::Map< T >::D0, line::mam::Mmap< T >::D0, line::mam::Map< T >::D1, line::mam::Mmap< T >::D1, line::da::da_fpi(), line::qn::NetworkStruct< T >::disabled, line::mam::MmapDecConfig::etaqa_trunc, line::mam::MmapDecConfig::fj_sync_q_len, line::mam::TrafficConfig::fj_sync_q_len, line::InputError::InputError(), line::mam::MmckDetection< T >::isMmck, line::mva::MvaSolution< T >::iter, line::da::FpiOptions::iter_max, line::da::FpiOptions::iter_tol, line::da::FpiResult< T >::iterations, line::mva::MvaSolution< T >::lG, line::qsys::MmckResult< T >::lossProbability, mam_detect_mmck(), map_acf(), map_exponential_mean(), map_mean(), map_normalize(), map_scale(), line::qsys::MmckResult< T >::meanQueueLength, line::mva::MvaSolution< T >::method, line::da::FpiOptions::miniter, mmap_hide_but(), mmap_lambda(), mmapph1fcfs_ncmean(), line::mam::MmckDetection< T >::muRate, line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::node_of_station(), line::qn::NetworkStruct< T >::nodes, line::qn::NetworkStruct< T >::nof_nodes(), line::qn::NetworkStruct< T >::nstations, line::mam::Mmap< T >::order(), line::mva::MvaSolution< T >::Q, qbd_depproc_etaqa(), qbd_depproc_etaqa_ps(), qbd_mapmap1(), line::qsys::qsys_mmck(), line::mva::MvaSolution< T >::R, line::qn::NetworkStruct< T >::rates, line::da::FpiOptions::relative_eps, line::da::FpiOptions::relative_norm, sn_build_fj_sync_map(), solver_mam_basic_mmap_inner(), solver_mam_traffic_mmap(), line::mam::TrafficConfig::space_max, line::qn::NetworkStruct< T >::stations, line::mva::MvaSolution< T >::Tp, traffic_config(), line::mva::MvaSolution< T >::U, line::UnsupportedError::UnsupportedError(), and line::mva::MvaSolution< T >::X.

Referenced by solver_mam_basic_mmap(), solver_mam_basic_mmap_closed(), and solver_mam_basic_mmap_inner().

◆ solver_mam_bgchain()

template<class T>
mva::MvaSolution< T > line::mam::solver_mam_bgchain ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

Definition at line 874 of file solver_mam_bgchain.h.

References line::mva::ChainDemands< T >::alpha, line::mva::MvaSolution< T >::C, line::qn::NetworkStruct< T >::classes, line::Matrix< T >::cols(), line::mam::BgchainStation< T >::cshare, line::mam::Map< T >::D0, line::mam::Mmap< T >::D0, line::mam::Map< T >::D1, line::mam::Mmap< T >::D1, line::mam::Mmap< T >::Dc, line::lang::dist_to_map(), line::mam::BgchainStation< T >::esup, line::qn::NetworkStruct< T >::inchain, line::mva::MvaSolution< T >::iter, line::mva::ChainDemands< T >::Lchain, mam_bgchain_ctmc(), mam_bgchain_env(), mam_bgchain_station(), map_pie(), map_scale(), line::Matrix< T >::Matrix(), mmap_super_safe(), line::mva::ChainDemands< T >::Nchain, line::qn::NetworkStruct< T >::nchains, line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nstations, line::mva::MvaSolution< T >::Q, line::mam::BgchainCtmc< T >::QLen, line::mam::BgchainStation< T >::QLen, line::mva::MvaSolution< T >::R, line::qn::NetworkStruct< T >::rates, line::Matrix< T >::rows(), line::api::SnRtStations< T >::rtst, line::qn::NetworkStruct< T >::service, line::mva::sn_get_demands_chain(), line::api::sn_rt_stations(), solver_mam_bgchain(), line::qn::NetworkStruct< T >::stations, line::mva::ChainDemands< T >::STchain, line::mva::MvaSolution< T >::Tp, line::mam::BgchainCtmc< T >::Tput, line::mva::MvaSolution< T >::U, line::mam::BgchainCtmc< T >::Ubusy, line::UnsupportedError::UnsupportedError(), line::mva::ChainDemands< T >::Vchain, line::api::SnRtStations< T >::Vst, and line::mva::MvaSolution< T >::X.

Referenced by mam_dispatch(), and solver_mam_bgchain().

◆ solver_mam_bmap_map_1()

template<class T>
BmapQueueResult< T > line::mam::solver_mam_bmap_map_1 ( const std::vector< Matrix< T > > & D,
const Map< T > & service,
std::size_t nMoments = 3 )

Port of solver_mam_bmap_map_1.m, mean measures included.

The blocks and the stability test are assembled first, so a malformed input is reported as such before any numerics run. The chain is then handed to ETAQA exactly as the reference hands it: A = [A0 A1 A2 ... A_{K+1}] for the repetitive levels and B = [B0 B1 ... BK] for the boundary, G from MG1_G_ETAQA, the three aggregates from MG1_pi_ETAQA, and the moments from MG1_qlen_ETAQA. nMoments matches the reference's default of 3; the mean queue length is the first of them and the response time follows by Little.

Definition at line 492 of file solver_mam_bmap.h.

References line::mam::BmapMap1Blocks< T >::A0, line::mam::BmapMap1Blocks< T >::A1, line::mam::BmapMap1Blocks< T >::Aup, line::mam::BmapMap1Blocks< T >::B0, line::mam::BmapMap1Blocks< T >::Bup, line::Matrix< T >::cols(), line::mam::BmapQueueResult< T >::fund, line::InputError::InputError(), line::mam::BmapMap1Blocks< T >::lambda, line::Matrix< T >::Matrix(), line::smc::mg1_g_etaqa(), line::smc::mg1_pi_etaqa(), line::smc::mg1_qlen_etaqa(), line::mam::BmapQueueResult< T >::piAgg, line::mam::BmapQueueResult< T >::qlenMoments, line::mam::BmapQueueResult< T >::QN, line::mam::BmapMap1Blocks< T >::rho, line::mam::BmapQueueResult< T >::RN, line::Matrix< T >::rows(), solver_mam_bmap_map_1(), solver_mam_bmap_map_1_blocks(), line::mam::BmapQueueResult< T >::TN, and line::mam::BmapQueueResult< T >::UN.

Referenced by solver_mam_bmap_map_1().

◆ solver_mam_bmap_map_1_blocks()

template<class T>
BmapMap1Blocks< T > line::mam::solver_mam_bmap_map_1_blocks ( const std::vector< Matrix< T > > & D,
const Map< T > & service )

Port of the block assembly and the stability test of solver_mam_bmap_map_1.m.

B0 IS NOT qbd_mapmap1_blocks's Lbar. The reference adds the service completion back onto the level-zero local block, kron(I, S0 + S1), so the service phase process keeps running while the queue is empty and the completion it would have made is absorbed as a self-loop. That is a modelling choice about an idle server, not an oversight, and it makes B0 = A1 + A0 exactly. qbd_mapmap1.h instead stops the service process at level zero with kron(D0, I). The two chains differ, and both are here under their own names.

Definition at line 314 of file solver_mam_bmap.h.

References line::mam::BmapMap1Blocks< T >::A0, line::mam::BmapMap1Blocks< T >::A1, line::mam::BmapMap1Blocks< T >::Aup, line::mam::BmapMap1Blocks< T >::B0, line::mam::BmapMap1Blocks< T >::Bup, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::eye(), line::InputError::InputError(), line::mam::BmapMap1Blocks< T >::K, kron(), line::mam::BmapMap1Blocks< T >::lambda, line::mam::BmapMap1Blocks< T >::m, line::mam::BmapMap1Blocks< T >::ma, map_lambda(), line::mam::BmapMap1Blocks< T >::ms, line::mam::BmapMap1Blocks< T >::mu, line::mam::BmapMap1Blocks< T >::rho, solver_mam_bmap_map_1_blocks(), and line::mam::BmapMap1Blocks< T >::stable.

Referenced by solver_mam_bmap_map_1(), and solver_mam_bmap_map_1_blocks().

◆ solver_mam_decmmap()

template<class T>
mva::MvaSolution< T > line::mam::solver_mam_decmmap ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

Port of solver_mam.m.

Parameters
Lthe refreshed struct; open classes only
optthe SolverMAM options; tol is the fixed point's iter_tol

Definition at line 106 of file solver_mam_decmmap.h.

References line::mva::MvaSolution< T >::C, line::qn::NetworkStruct< T >::classes, line::mam::Map< T >::D0, line::mam::Mmap< T >::D0, line::mam::Mmap< T >::D1, line::da::da_fpi(), line::qn::NetworkStruct< T >::disabled, line::mam::MmapDecConfig::etaqa_trunc, line::qn::NetworkStruct< T >::inchain, line::qn::NetworkStruct< T >::is_open_model(), line::mam::MmckDetection< T >::isMmck, line::mva::MvaSolution< T >::iter, line::da::FpiOptions::iter_max, line::da::FpiOptions::iter_tol, line::da::FpiResult< T >::iterations, line::mva::MvaSolution< T >::lG, line::qsys::MmckResult< T >::lossProbability, mam_detect_mmck(), map_mean(), map_normalize(), map_scale(), line::qsys::MmckResult< T >::meanQueueLength, line::mva::MvaSolution< T >::method, line::da::FpiOptions::miniter, mmap_hide_but(), mmap_lambda(), mmapph1fcfs_ncmean(), line::mam::MmckDetection< T >::muRate, line::qn::NetworkStruct< T >::nchains, line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::node_of_station(), line::qn::NetworkStruct< T >::nodes, line::qn::NetworkStruct< T >::nstations, line::mam::Mmap< T >::order(), line::mva::MvaSolution< T >::Q, qbd_depproc_etaqa(), qbd_depproc_etaqa_ps(), line::qsys::qsys_mmck(), line::mva::MvaSolution< T >::R, line::qn::NetworkStruct< T >::rates, line::da::FpiOptions::relative_norm, solver_mam_decmmap(), solver_mam_traffic(), line::mam::TrafficConfig::space_max, line::qn::NetworkStruct< T >::stations, line::mva::MvaSolution< T >::Tp, traffic_config(), line::mva::MvaSolution< T >::U, line::UnsupportedError::UnsupportedError(), and line::mva::MvaSolution< T >::X.

Referenced by mam_dispatch(), and solver_mam_decmmap().

◆ solver_mam_dt()

◆ solver_mam_fj() [1/2]

template<class T>
mva::MvaSolution< T > line::mam::solver_mam_fj ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

solver_mam_fj.m without the percentile side channel.

Definition at line 534 of file solver_mam_fj.h.

References solver_mam_fj().

◆ solver_mam_fj() [2/2]

template<class T>
mva::MvaSolution< T > line::mam::solver_mam_fj ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
std::vector< std::vector< T > > * percentiles_out )

Port of solver_mam_fj.m.

The analyzer is a thin wrapper: mainFJ returns the response-time percentiles of the whole fork-join subnetwork, the mean is read off that curve by trapezoid, and every station metric the reference reports is an M/M/1 closed form in (lambda, mu) EXCEPT the Join, which carries the synchronisation delay, i.e. the fork-join mean minus one branch response time. Defects 1, 2 and 4 of the header are reproduced deliberately: they are what the reference reports, and the alternative would be a different set of numbers under its method name.

DEFECT 3 IS NOT REPRODUCED. The reference calls mainFJ TWICE per class, on the dense grid for the mean and again on the four stored percentiles, and the second call rebuilds the entire T matrix to read four points off a curve the first call already produced. Here the two grids are CONCATENATED into one call, which is the same inversion of the same phase-type law on a union of grids: returnPer treats every requested percentile independently, so a point's value does not depend on which other points were asked for.

Definition at line 437 of file solver_mam_fj.h.

References line::mam::MamFjParams< T >::arrival, line::mva::MvaSolution< T >::C, line::fj::fj_main(), line::fj::fj_parse_tmode(), line::mam::MamFjInfo::forkNode, line::mva::MvaSolution< T >::iter, line::mam::MamFjInfo::joinNode, line::mam::MamFjInfo::K, mam_fj_dense_percentiles(), mam_fj_extract_params(), mam_fj_is_homogeneous(), mam_fj_stored_percentiles(), line::Matrix< T >::Matrix(), line::qn::NetworkStruct< T >::name, line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nodes, line::qn::NetworkStruct< T >::nstations, line::mam::MamFjInfo::ok, line::mva::MvaSolution< T >::Q, line::mam::MamFjInfo::queueNodes, line::mva::MvaSolution< T >::R, line::mam::MamFjParams< T >::service, solver_mam_fj(), line::qn::NetworkStruct< T >::stations, line::mva::MvaSolution< T >::Tp, line::mva::MvaSolution< T >::U, line::UnsupportedError::UnsupportedError(), line::mam::MamFjInfo::why, and line::mva::MvaSolution< T >::X.

Referenced by mam_dispatch(), solver_mam_fj(), solver_mam_fj(), and solver_mam_fj_percentiles().

◆ solver_mam_fj_percentiles()

template<class T>
std::vector< std::vector< T > > line::mam::solver_mam_fj_percentiles ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
const std::vector< double > & percentiles )

@@SolverMAM/getPerctRespT.m's fork-join path: the percentiles solver_mam_fj.m stores in percResults.RT, one row per class, at the four levels mam_fj_stored_percentiles() names.

A REQUESTED LEVEL IS INTERPOLATED, NOT RE-SOLVED, and outside [0.50, 0.99] it is EXTRAPOLATED off the end segment: the reference reads its stored table with interp1(..., 'linear', 'extrap'). That is reproduced, defect and all. Asking for the 0.999 quantile of a heavy tail therefore continues the 0.95-to-0.99 chord rather than inverting the law again, and the further out the level the worse the estimate – returnPer would answer it exactly, for the price of another solve. The reference's choice is kept because a caller comparing MATLAB against this port must see the same number.

Definition at line 553 of file solver_mam_fj.h.

References mam_fj_stored_percentiles(), solver_mam_fj(), and solver_mam_fj_percentiles().

Referenced by solver_mam_fj_percentiles(), and solver_mam_get_perct_respt().

◆ solver_mam_get_cdf_respt()

template<class T>
std::vector< RespTCdf< T > > line::mam::solver_mam_get_cdf_respt ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

@@SolverMAM/getCdfRespT.m: the response-time CDF per class.

getSjrnT and sjrnT are aliases of this in the reference and are not given separate entry points here; there is nothing for them to do that this does not already do, and a second name for one function is a maintenance cost rather than a feature.

Definition at line 455 of file solver_mam_runner.h.

References check_method(), line::api::Cme, line::api::NonmarkovOptions::order, line::api::Ph, line::api::NonmarkovOptions::phfit, line::api::NonmarkovOptions::preserve_det, line::api::sn_has_nonmarkov(), line::api::sn_nonmarkov_toph(), solver_mam_get_cdf_respt(), and solver_mam_passage_time().

Referenced by solver_mam_get_cdf_respt(), solver_mam_get_perct_respt(), and solver_mam_get_sjrn_t().

◆ solver_mam_get_mam_result()

template<class T>
qsys::BmapM1Result< T > line::mam::solver_mam_get_mam_result ( const qn::NetworkStruct< T > & L)

@@SolverMAM/getMAMResult.m: the M/G/1-type internals of a single queue.

Definition at line 442 of file solver_mam_runner.h.

References solver_mam_get_mam_result(), and solver_mam_getmamresult().

Referenced by solver_mam_get_mam_result().

◆ solver_mam_get_perct_respt()

template<class T>
std::vector< std::vector< T > > line::mam::solver_mam_get_perct_respt ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
const std::vector< double > & percentiles )

@@SolverMAM/getPerctRespT.m: response-time percentiles per class.

TWO PATHS, split by mam_has_fj_percentiles: a homogeneous fork-join model reads the table FJ_codes stored, and everything else inverts the response-time CDF.

Definition at line 523 of file solver_mam_runner.h.

References mam_has_fj_percentiles(), mam_percentiles_from_cdf(), solver_mam_fj_percentiles(), solver_mam_get_cdf_respt(), and solver_mam_get_perct_respt().

Referenced by solver_mam_get_perct_respt().

◆ solver_mam_get_prob()

template<class T>
ProbTable< T > line::mam::solver_mam_get_prob ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
std::size_t node,
const mva::AvgResult< T > & avg )

@@SolverMAM/getProb.m: the joint (level, phase) table at a node.

Definition at line 427 of file solver_mam_runner.h.

References solver_mam_get_prob(), and solver_mam_getprob().

Referenced by solver_mam_get_prob().

◆ solver_mam_get_prob_marg()

template<class T>
std::vector< T > line::mam::solver_mam_get_prob_marg ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
std::size_t ist,
std::size_t jobclass,
const mva::AvgResult< T > & avg )

@@SolverMAM/getProbMarg.m: P(n jobs of one class) at a station.

Definition at line 434 of file solver_mam_runner.h.

References solver_mam_get_prob_marg(), and solver_mam_getprobmarg().

Referenced by solver_mam_get_prob_marg().

◆ solver_mam_get_sjrn_t()

template<class T>
std::vector< RespTCdf< T > > line::mam::solver_mam_get_sjrn_t ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

@@SolverMAM/getSjrnT.m and sjrnT.m, both aliases of getCdfRespT.

Definition at line 482 of file solver_mam_runner.h.

References solver_mam_get_cdf_respt(), and solver_mam_get_sjrn_t().

Referenced by solver_mam_get_sjrn_t().

◆ solver_mam_get_tran_avg()

template<class T>
TranResult< T > line::mam::solver_mam_get_tran_avg ( const qn::NetworkStruct< T > & L,
const MamOptions & opt_in )

Port of @@SolverMAM/getTranAvg.m: transient queue length, utilization and throughput.

The reference forces options.method = 'ldqbd' and options.lang = 'matlab' before delegating, so the transient path is NOT selected by the caller's method; it is fixed. Reproduced: this ignores opt.method entirely.

Which engine runs is decided by mam_transient_qbd_applicable: a correlated or non-Poisson arrival, or a non-renewal service, goes to the Laplace-domain transient QBD, and everything else to the QBD fast path.

Definition at line 548 of file solver_mam_runner.h.

References line::qn::feature_gate(), line::qn::mam_feature_set(), mam_transient_qbd_applicable(), line::qn::FeatureSet::set(), solver_mam_get_tran_avg(), solver_mam_ldqbd_transient(), and solver_mam_transient_qbd().

Referenced by solver_mam_get_tran_avg().

◆ solver_mam_getmamresult()

template<class T>
qsys::BmapM1Result< T > line::mam::solver_mam_getmamresult ( const qn::NetworkStruct< T > & L)

Port of @@SolverMAM/getMAMResult.m: the matrix-analytic internals of a single-queue model, for a BMAP (or MAP) arrival stream into an exponential single server.

The reference's other arm handles a retrial station through qsys_bmapphnn_retrial. That routine IS ported, but the C++ NetworkStruct has no retrial fields at all, so no model this port can build reaches it; the arm is recorded rather than written.

Definition at line 377 of file solver_mam_prob.h.

References line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::lang::dist_to_map(), line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::node_of_station(), line::qn::NetworkStruct< T >::nodes, line::qn::NetworkStruct< T >::nstations, line::qsys::qsys_bmapm1(), line::qn::NetworkStruct< T >::service, solver_mam_getmamresult(), line::qn::NetworkStruct< T >::stations, and line::UnsupportedError::UnsupportedError().

Referenced by solver_mam_get_mam_result(), and solver_mam_getmamresult().

◆ solver_mam_getprob()

template<class T>
ProbTable< T > line::mam::solver_mam_getprob ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
std::size_t node,
const mva::AvgResult< T > & avg )

Port of @@SolverMAM/getProb.m.

Parameters
node1-based NODE index; must be a station
avgthe converged getAvg result, which the closed branch reads throughputs from
Lthe refreshed struct
optSolverMAM's options

Definition at line 227 of file solver_mam_prob.h.

References line::qn::NetworkStruct< T >::classes, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::InputError::InputError(), map_prob(), line::Matrix< T >::Matrix(), line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nodes, line::qn::NetworkStruct< T >::nof_nodes(), line::mam::ProbTable< T >::P, line::qn::JobClass::population, solver_mam_getprob(), and line::UnsupportedError::UnsupportedError().

Referenced by solver_mam_get_prob(), and solver_mam_getprob().

◆ solver_mam_getprobmarg()

template<class T>
std::vector< T > line::mam::solver_mam_getprobmarg ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
std::size_t ist,
std::size_t jobclass,
const mva::AvgResult< T > & avg )

Port of @@SolverMAM/getProbMarg.m: P(n jobs of class jobclass) at station ist, for n = 0..N(jobclass) closed, or over the whole cutoff range open.

Definition at line 316 of file solver_mam_prob.h.

References line::qn::NetworkStruct< T >::classes, line::InputError::InputError(), line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nstations, solver_mam_getprobmarg(), and line::UnsupportedError::UnsupportedError().

Referenced by solver_mam_get_prob_marg(), and solver_mam_getprobmarg().

◆ solver_mam_ldqbd()

template<class T>
LdqbdSolution< T > line::mam::solver_mam_ldqbd ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

Port of solver_mam_ldqbd.m.

Parameters
Lthe refreshed struct; must be single-class, two stations, and either Delay+Queue (closed) or Source+Queue (open)
optthe MAM options; cutoff bounds the open truncation

Definition at line 119 of file solver_mam_ldqbd.h.

References line::mam::LdqbdBlocks< T >::alpharate, line::mam::LdqbdBlocks< T >::alphascv, line::mam::LdqbdBlocks< T >::betarate, line::mam::LdqbdBlocks< T >::betascv, line::mva::MvaSolution< T >::C, line::qn::NetworkStruct< T >::classes, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::mam::LdqbdBlocks< T >::delayRate, line::lang::Distrib< T >::disabled, line::lang::dist_to_map(), line::mam::LdqbdBlocks< T >::hasLLD, line::mam::LdqbdBlocks< T >::hasSetup, line::InputError::InputError(), line::mam::LdqbdBlocks< T >::isOpen, line::mam::LdqbdBlocks< T >::isPH, line::mva::MvaSolution< T >::iter, line::mam::LdqbdBlocks< T >::lambda_eff, line::mam::LdqbdSolution< T >::ld, ldqbd(), ldqbd_mphc(), line::mam::LdqbdBlocks< T >::M, map_mean(), map_pie(), line::Matrix< T >::Matrix(), line::lang::Distrib< T >::mean, line::mam::LdqbdBlocks< T >::mean_service, line::mam::LdqbdBlocks< T >::N, line::qn::NetworkStruct< T >::nclasses, line::mam::LdqbdBlocks< T >::Nlev, line::mam::LdqbdBlocks< T >::nPhases, line::mam::LdqbdBlocks< T >::nServers, line::qn::NetworkStruct< T >::nstations, line::NumericError::NumericError(), line::mam::LdqbdResult< T >::pi, line::mva::MvaSolution< T >::Q, line::mam::LdqbdBlocks< T >::Q0, line::mam::LdqbdBlocks< T >::Q1, line::mam::LdqbdBlocks< T >::Q2, qbd_setupdelayoff_closed(), line::mam::SetupDelayoffClosed< T >::QN, line::mam::LdqbdBlocks< T >::queueIdx, line::mva::MvaSolution< T >::R, line::qn::NetworkStruct< T >::rates, line::mam::LdqbdBlocks< T >::refIdx, line::qn::NetworkStruct< T >::rt, line::lang::Distrib< T >::scv, line::qn::NetworkStruct< T >::service, line::qn::NetworkStruct< T >::setupparam, line::mam::LdqbdBlocks< T >::sf, line::mam::LdqbdSolution< T >::sol, solver_mam_ldqbd(), line::qn::NetworkStruct< T >::stateful_of_station(), line::qn::NetworkStruct< T >::stations, line::mva::MvaSolution< T >::Tp, line::mva::MvaSolution< T >::U, line::UnsupportedError::UnsupportedError(), line::mam::LdqbdBlocks< T >::utilPeak, line::mva::MvaSolution< T >::X, and line::mam::SetupDelayoffClosed< T >::XN.

Referenced by mam_dispatch(), and solver_mam_ldqbd().

◆ solver_mam_ldqbd_avg()

template<class T>
LdqbdAvg< T > line::mam::solver_mam_ldqbd_avg ( const LdqbdBlocks< T > & ld,
const std::vector< T > & piflat_in,
const std::vector< std::size_t > & levelOf )

Port of solver_mam_ldqbd_avg.m: map a distribution over the flat state space to means.

NOT THE STATIONARY DISTRIBUTION. This mirrors the metric formulas of solver_mam_ldqbd but applies them to whatever vector it is handed – in practice the TIME-AVERAGE over an environment stage's sojourn, which is not a stationary law of anything. That is why the formulas are written out again here rather than shared: the stationary versions in solver_mam_ldqbd reach for quantities (the level recursion's own R matrices) that only exist at the fixed point.

The vector is clipped at zero and renormalized first, as the reference does: a transient vector that a quadrature has pushed a hair negative is a numerical artifact of the propagation, not a signed measure to be propagated further.

Definition at line 127 of file solver_mam_ldqbd_flatten.h.

References line::mam::LdqbdBlocks< T >::delayRate, line::InputError::InputError(), line::mam::LdqbdBlocks< T >::isOpen, line::mam::LdqbdBlocks< T >::lambda_eff, line::mam::LdqbdBlocks< T >::M, line::Matrix< T >::Matrix(), line::mam::LdqbdBlocks< T >::N, line::mam::LdqbdBlocks< T >::Nlev, line::mam::LdqbdAvg< T >::QN, line::mam::LdqbdBlocks< T >::queueIdx, line::mam::LdqbdBlocks< T >::refIdx, line::mam::LdqbdAvg< T >::RN, line::mam::LdqbdBlocks< T >::sf, solver_mam_ldqbd_avg(), line::mam::LdqbdAvg< T >::TN, line::mam::LdqbdAvg< T >::UN, and line::mam::LdqbdBlocks< T >::utilPeak.

Referenced by solver_mam_ldqbd_avg().

◆ solver_mam_ldqbd_flatten()

◆ solver_mam_ldqbd_transient()

◆ solver_mam_map_bmap_1()

template<class T>
BmapQueueResult< T > line::mam::solver_mam_map_bmap_1 ( const Map< T > & arrival,
const std::vector< Matrix< T > > & D )

Port of solver_mam_map_bmap_1.m, mean measures included.

The GI/M/1-type chain is stacked as A = [A0; A1; ...; A_{K+1}] and B = [B1; B2; ...; B_{K+1}; 0], which is the reference's own layout down to the trailing zero block its zeros(m*(K+1)+m, m) allocation leaves unfilled. R comes from GIM1_R_ETAQA, the aggregates and the mean queue length from GIM1_pi_ETAQA and GIM1_qlen_ETAQA, both with A0 as the Boundary block. The reference asks for the FIRST moment only on this side, and so does this.

Definition at line 541 of file solver_mam_bmap.h.

References line::mam::MapBmap1Blocks< T >::A0, line::mam::MapBmap1Blocks< T >::A1, line::mam::MapBmap1Blocks< T >::Adown, line::mam::MapBmap1Blocks< T >::B1, line::mam::MapBmap1Blocks< T >::Bto0, line::Matrix< T >::cols(), line::mam::BmapQueueResult< T >::fund, line::smc::gim1_pi_etaqa(), line::smc::gim1_qlen_etaqa(), line::smc::gim1_r_etaqa(), line::mam::MapBmap1Blocks< T >::lambda, line::mam::MapBmap1Blocks< T >::m, line::Matrix< T >::Matrix(), line::mam::BmapQueueResult< T >::piAgg, line::mam::BmapQueueResult< T >::qlenMoments, line::mam::BmapQueueResult< T >::QN, line::mam::MapBmap1Blocks< T >::rho, line::mam::BmapQueueResult< T >::RN, line::Matrix< T >::rows(), solver_mam_map_bmap_1(), solver_mam_map_bmap_1_blocks(), line::mam::BmapQueueResult< T >::TN, and line::mam::BmapQueueResult< T >::UN.

Referenced by solver_mam_map_bmap_1().

◆ solver_mam_map_bmap_1_blocks()

template<class T>
MapBmap1Blocks< T > line::mam::solver_mam_map_bmap_1_blocks ( const Map< T > & arrival,
const std::vector< Matrix< T > > & D )

Port of the block assembly, the generator validation and the stability test of solver_mam_map_bmap_1.m.

THE BOUNDARY IS WHERE THE CLIPPING LIVES. Bto0[j-1] collects every batch of size k >= j, so an oversized batch empties the queue instead of driving the level negative, and B1 collects the whole service mass at level zero as a self-loop. Nothing is dropped: for every boundary level j the total outflow A0 + A1 + sum_{k<j} Adown[k-1] + Bto0[j-1] is again kron(C0+C1, I) + kron(I, sum_k D_k), whose rows sum to zero. That identity is the whole justification for the convention and is asserted in the tests.

ONE REFERENCE BRANCH IS UNREACHABLE HERE and is therefore not transcribed: K = bmapSvc.getNumberOfPhases() - 1 reads the PHASE count where the batch count is meant, so the BMAP-object path mis-sizes D for any process whose order differs from its largest batch. This port takes the matrices directly, which is the reference's own cell-array path and the correct one.

Definition at line 386 of file solver_mam_bmap.h.

References line::mam::MapBmap1Blocks< T >::A0, line::mam::MapBmap1Blocks< T >::A1, line::mam::MapBmap1Blocks< T >::Adown, line::mam::MapBmap1Blocks< T >::B1, line::mam::MapBmap1Blocks< T >::Bto0, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::eye(), line::InputError::InputError(), line::mam::MapBmap1Blocks< T >::K, kron(), line::mam::MapBmap1Blocks< T >::lambda, line::mam::MapBmap1Blocks< T >::m, line::mam::MapBmap1Blocks< T >::ma, map_lambda(), line::mam::MapBmap1Blocks< T >::ms, line::mam::MapBmap1Blocks< T >::mu, line::mam::MapBmap1Blocks< T >::rho, solver_mam_map_bmap_1_blocks(), and line::mam::MapBmap1Blocks< T >::stable.

Referenced by solver_mam_map_bmap_1(), and solver_mam_map_bmap_1_blocks().

◆ solver_mam_mapmap1_exact()

◆ solver_mam_passage_time()

◆ solver_mam_retrial()

template<class T>
mva::MvaSolution< T > line::mam::solver_mam_retrial ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
const MamRetrialConfig & cfg = MamRetrialConfig() )

Port of solver_mam_retrial.m.

Parameters
Lthe refreshed struct, with non-Markovian processes already gated out by the runner
optthe MAM options; none of them reaches the engine, see defect 1
cfgthe orbit truncation controls

Definition at line 351 of file solver_mam_retrial.h.

References line::mva::MvaSolution< T >::C, line::qn::NetworkStruct< T >::classes, line::mam::MamRetrialInfo::cls, line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::lang::dist_to_map(), line::qn::NetworkStruct< T >::droprule, line::InputError::InputError(), line::mva::MvaSolution< T >::iter, line::qsys::BmapPhNnRetrialResult< T >::L_orbit, mam_retrial_detect(), map_pie(), line::Matrix< T >::Matrix(), line::qn::RetrialParam< T >::max_attempts, line::qsys::BmapPhNnRetrialOptions::maxLevel, line::qsys::BmapPhNnRetrialResult< T >::N_server, line::qn::NetworkStruct< T >::nclasses, line::mam::MamRetrialInfo::nservers, line::qn::NetworkStruct< T >::nstations, line::NumericError::NumericError(), line::mam::MamRetrialInfo::ok, line::mam::Map< T >::order(), line::mva::MvaSolution< T >::Q, line::qsys::qsys_bmapphnn_retrial(), line::mam::MamRetrialInfo::R, line::mva::MvaSolution< T >::R, line::qn::RetrialParam< T >::retrial_proc, line::qn::RetrialParam< T >::retrial_rate, line::qn::NetworkStruct< T >::retrialparam, line::qn::NetworkStruct< T >::service, solver_mam_retrial(), line::mam::MamRetrialInfo::source, line::mam::MamRetrialInfo::station, line::qn::NetworkStruct< T >::stations, line::qsys::BmapPhNnRetrialResult< T >::throughput, line::mva::MvaSolution< T >::Tp, line::qsys::BmapPhNnRetrialResult< T >::truncLevel, line::mva::MvaSolution< T >::U, line::UnsupportedError::UnsupportedError(), line::qsys::BmapPhNnRetrialResult< T >::utilization, line::mam::MamRetrialInfo::why, and line::mva::MvaSolution< T >::X.

Referenced by mam_dispatch(), and solver_mam_retrial().

◆ solver_mam_run_analyzer()

template<class T>
mva::AvgResult< T > line::mam::solver_mam_run_analyzer ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

◆ solver_mam_solve()

◆ solver_mam_traffic()

template<class T>
std::vector< Mmap< T > > line::mam::solver_mam_traffic ( const qn::NetworkStruct< T > & sn,
const DepTable< T > & DEP,
const TrafficConfig & config )

Port of solver_mam_traffic.m.

Parameters
DEPstation-indexed: DEP[ist][r] is the class-r departure process of station ist (0-based), an empty Map standing for MATLAB's [], "this class does not depart from here"
snthe refreshed network struct
configthe options.config fields the traffic analyzer reads
Returns
node-indexed arrival descriptors of length nnodes; an entry of order 0 is MATLAB's []

Definition at line 448 of file solver_mam_traffic.h.

References line::mc::dtmc_stochcomp(), line::lang::GlobalConstants::FineTol, line::InputError::InputError(), line::mam::TrafficConfig::merge, mmap_normalize(), line::npfqn::npfqn_traffic_merge(), line::npfqn::npfqn_traffic_split_cs(), line::mam::Mmap< T >::order(), and solver_mam_traffic().

Referenced by solver_mam_decmmap(), and solver_mam_traffic().

◆ solver_mam_traffic_mmap()

template<class T>
std::vector< Mmap< T > > line::mam::solver_mam_traffic_mmap ( const qn::NetworkStruct< T > & sn,
const DepTable< T > & DEP,
const TrafficConfig & config,
const FjSyncMap & fjSyncMap )

Port of solver_mam_traffic_mmap.m, the fork-join aware traffic step.

It differs from solver_mam_traffic in three places: DEP is NODE-indexed, Fork and Join nodes produce outgoing links, and the flows arriving at a join along one sync group are combined with mmap_max rather than superposed – a join fires when its slowest branch delivers, which superposition, being the union of the two point processes, would get badly wrong.

Parameters
DEPnode-indexed: DEP[ind][r], 0-based over nodes
fjSyncMapfrom sn_build_fj_sync_map
snthe refreshed network struct
configthe options.config fields the traffic analyzer reads

Definition at line 516 of file solver_mam_traffic.h.

References line::mc::dtmc_stochcomp(), line::lang::GlobalConstants::FineTol, line::mam::TrafficConfig::fj_sync_q_len, line::InputError::InputError(), line::mam::TrafficConfig::merge, mmap_max(), mmap_normalize(), line::mam::FjSyncMap::node_sync, line::npfqn::npfqn_traffic_merge(), line::npfqn::npfqn_traffic_split_cs(), line::mam::Mmap< T >::order(), solver_mam_traffic_mmap(), and line::mam::TrafficConfig::space_max.

Referenced by solver_mam_basic_mmap_inner(), and solver_mam_traffic_mmap().

◆ solver_mam_transient_qbd()

◆ solver_mna_closed()

template<class T>
mva::MvaSolution< T > line::mam::solver_mna_closed ( const qn::NetworkStruct< T > & L,
const MamOptions & opt )

◆ solver_mna_open()

template<class T>
mva::MvaSolution< T > line::mam::solver_mna_open ( const qn::NetworkStruct< T > & L,
const MamOptions & opt,
const MnaConfig & cfg = MnaConfig() )

Port of solver_mna_open.m.

Parameters
Lthe refreshed struct; open chains only
optSolverMAM's options; tol drives the saturation test and doubles as the fixed point's iter_tol, which SolverOptions('MAM') leaves at the same 1e-4
cfgthe options.config fields the analyzer reads

Definition at line 379 of file solver_mna.h.

References line::mva::MvaSolution< T >::C, line::qn::NetworkStruct< T >::cap, line::mam::Mmap< T >::classes(), line::qn::NetworkStruct< T >::classes, line::da::da_fpi(), line::da::da_traffic_superpos(), line::qn::NetworkStruct< T >::disabled, line::qn::NetworkStruct< T >::inchain, line::mam::MmckDetection< T >::isMmck, line::mva::MvaSolution< T >::iter, line::da::FpiOptions::iter_max, line::da::FpiOptions::iter_tol, line::da::FpiResult< T >::iterations, line::mva::MvaSolution< T >::lG, line::qsys::MmckResult< T >::lossProbability, mam_detect_mmck(), line::qsys::MmckResult< T >::meanQueueLength, line::mva::MvaSolution< T >::method, mmapph1fcfs_ncmean(), line::mam::MmckDetection< T >::muRate, line::da::FpiOptions::nanstop, line::qn::NetworkStruct< T >::nchains, line::qn::NetworkStruct< T >::nclasses, line::npfqn::npfqn_traffic_split_rr(), line::qn::NetworkStruct< T >::nstations, line::qn::JobClass::population, line::mva::MvaSolution< T >::Q, line::qsys::qsys_mmck(), line::mva::MvaSolution< T >::R, line::qn::NetworkStruct< T >::rates, line::lang::sched_to_text(), line::qn::NetworkStruct< T >::scv, solver_mna_open(), line::qn::NetworkStruct< T >::stations, line::mva::MvaSolution< T >::Tp, line::mva::MvaSolution< T >::U, line::UnsupportedError::UnsupportedError(), and line::mva::MvaSolution< T >::X.

Referenced by mam_dispatch(), and solver_mna_open().

◆ taylor_series_adaptive()

template<class T>
TaylorSeriesResult< T > line::mam::taylor_series_adaptive ( const LibQbdProcess< T > & proc,
const std::vector< std::vector< T > > & pi0,
double error,
double max_time )

libQBD's TaylorSeriesAdaptive, restricted to the reference grid that solver_mam_ldqbd_transient reads (get_reference_times and get_reference_dists); the interpolation to arbitrary points is not ported because no caller in this tree asks for it.

Parameters
pi0initial law, one row vector per level
errorper-step truncation target (the reference passes options.tol)
max_timeadvance until the grid covers this horizon
procthe level-dependent QBD being integrated

Definition at line 256 of file libqbd_taylor.h.

References line::mam::TaylorSeriesResult< T >::dists, line::mam::LibQbdProcess< T >::empty(), gammainc_lower(), line::InputError::InputError(), line::mam::LibQbdProcess< T >::min_element(), line::mam::LibQbdProcess< T >::mul_row(), line::NumericError::NumericError(), taylor_series_adaptive(), and line::mam::TaylorSeriesResult< T >::times.

Referenced by solver_mam_ldqbd_transient(), and taylor_series_adaptive().

◆ traffic_config()

TrafficConfig line::mam::traffic_config ( const MamOptions & opt)
inline

The traffic step's view of SolverOptions('MAM').

Definition at line 122 of file solver_mam_traffic.h.

References line::mam::TrafficConfig::space_max, and traffic_config().

Referenced by solver_mam_basic_mmap_inner(), solver_mam_decmmap(), and traffic_config().

Variable Documentation

◆ LDQBD_MPHC_MAX_CONFIGS

std::size_t line::mam::LDQBD_MPHC_MAX_CONFIGS = 2000
inlineconstexpr

The widest level is the repeating one, and the LD-QBD recursion inverts one matrix of that order per level, so that is the size worth guarding.

Definition at line 51 of file ldqbd_mphc.h.

Referenced by ldqbd_mphc().