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

Moment linearizer: approximate first and second queue-length moments of a large closed product-form network. More...

#include <cstddef>
#include <vector>
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for pfqn_momlin.h:

Go to the source code of this file.

Classes

struct  line::pfqn::MomlinResult< T >
 Return value of pfqn_momlin, mirroring [Q, X, U, R, QVar, QCov, dQ]. More...

Namespaces

namespace  line
namespace  line::pfqn

Functions

template<class T>
MomlinResult< T > line::pfqn::pfqn_momlin (const Matrix< T > &L, const std::vector< int > &N, const std::vector< T > &Z, const T &tol, int maxiter)
 Moment linearizer: approximate first and second queue-length moments of a large closed product-form network.
template<class T>
MomlinResult< T > line::pfqn::pfqn_momlin (const Matrix< T > &L, const std::vector< int > &N, const std::vector< T > &Z)
 Overload with the reference's defaults (tol 1e-8, maxiter 1000).

Detailed Description

Moment linearizer: approximate first and second queue-length moments of a large closed product-form network.

Templated port of matlab/src/api/pfqn/pfqn_momlin.m.

Means come from the Schweitzer-Bard AMVA fixed point. Second moments use the exact product-form identity

Cov[n_{i,r}, n_{j,s}] = D_{j,s} dQ_{i,r} / dD_{j,s},

with the demand derivatives obtained by differentiating the AMVA fixed point itself, which gives a LINEAR fixed point in dQ that is iterated to convergence per parameter (j, s0). Both moments therefore carry the Schweitzer-Bard error and are exact only where Schweitzer-Bard is; for exact moments on tractable models use the pfqn_sens family, which differentiates the exact MVA or CoMoM recursion instead.

Arithmetic: no transcendental is used anywhere, so the routine is left UNGATED and will instantiate at Rational. That is of limited practical use: the fixed point converges to its limit only asymptotically, so at Rational the iterates are exact but their numerators and denominators grow with every sweep and the tolerance test is met only after the same number of sweeps as in floating point, at far greater cost. Use double or Real for this one; the exact instantiation exists so that no call site is refused, not because it buys accuracy the algorithm does not have.

REFERENCE DEFECTS: none found. The reference reassigns R (the class count) to the residence-time output on its last line, which is legal MATLAB and is correct because every use of the class count precedes it; the port keeps the two separate.

Definition in file pfqn_momlin.h.