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

Load-dependent rates of the functional server f(n) = n + c. More...

#include <cmath>
#include <limits>
#include <cstddef>
#include <vector>
#include "line/api/pfqn/pfqn_asympt_common.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for pfqn_fnc.h:

Go to the source code of this file.

Classes

struct  line::pfqn::FncResult< T >
 Return value of pfqn_fnc, mirroring [mu, c]. More...

Namespaces

namespace  line
namespace  line::pfqn

Functions

template<class T>
Matrix< T > line::pfqn::pfqn_fnc_at (const Matrix< T > &alpha, const std::vector< T > &c)
 Rates for a given offset vector c (the two-argument MATLAB branch).
template<class T>
FncResult< T > line::pfqn::pfqn_fnc (const Matrix< T > &alpha)
 Automatic offset search (the one-argument MATLAB branch).
template<class T>
FncResult< T > line::pfqn::pfqn_fnc (const Matrix< T > &alpha, const std::vector< T > &c)

Detailed Description

Load-dependent rates of the functional server f(n) = n + c.

Templated port of matlab/src/api/pfqn/pfqn_fnc.m (Casale, "On Single-Class Load-Dependent Normalizing Constant Equations", QEST 2006). Given the balance-function increments alpha(i,n) of an existing station, the rates mu(i,n) of the functional server are peeled off by

mu(i,1) = alpha(i,1)/(1 + c_i) mu(i,n) = alphanum(n,n-1) alpha(i,1) / (prod_{k<n} mu(i,k)) / (1 - rho) rho = sum_{k=1}^{n-1} (alphanum(n,k) - alphaden(n,k)) / prod_{j<=k} mu(i,j)

with alphanum(n,k) = prod_{j=0}^{k-1} alpha(i,n-j) and alphaden(n,k) = prod_{j=0}^{k-1} alpha(i,n-1-j).

OFFSET SEARCH. With no c supplied the reference tries c = 0, then c = -1/2, then walks c upwards in steps of 0.05 until every rate is finite or c reaches 2. The port keeps that ladder, including its two documented repairs: the zero-column guard (a caller that shifted a single-column mu gets an M x 0 result rather than an out-of-range index, which used to break SolverNC 'exact' on every closed model of total population one), and the fact that c is a length-M vector rather than a scalar.

NON-FINITE RATES. MATLAB maps NaN and any |mu| > 1e15 to Inf and then saturates each row from its first Inf onwards. The port keeps both, since a downstream load-dependent solver reads Inf as "this station cannot hold that many jobs" and would misread a large finite rate as a physical one. The 1e15 threshold is a floating-point guard and is a double constant in every arithmetic, exactly as in the reference.

ARITHMETIC. The recursion is a finite sequence of field operations, so it is EXACT in rational arithmetic and is deliberately left ungated – but the automatic offset ladder tests finiteness, which is a floating-point notion; with an exact type the first ladder step that produces no division by zero is accepted.

Definition in file pfqn_fnc.h.