LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
pfqn_gflinearizer.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2026, QORE Lab, Imperial College London
3 * All rights reserved.
4 */
5#ifndef LINE_API_PFQN_GFLINEARIZER_H
6#define LINE_API_PFQN_GFLINEARIZER_H
7
8/**
9 * @file
10 * @ingroup api_pfqn
11 * Generalized fixed-point Linearizer with a single scaling exponent shared by
12 * every class (De Souza e Silva and Muntz).
13 *
14 * Templated port of matlab/src/api/pfqn/pfqn_gflinearizer.m, cross-checked
15 * against jar/src/main/java/jline/api/pfqn/mva/Pfqn_gflinearizer.java. Both
16 * references simply broadcast the scalar alpha over the R classes and call the
17 * extended form.
18 *
19 * Arithmetic: TRANSCENDENTAL-GATED, inherited from pfqn_egflinearizer. Here
20 * the gate is doubly justified: the inner Core loop stops on a tolerance, and
21 * a scalar alpha is a genuine real exponent (pfqn_linearizermx uses 2.0, but
22 * nothing constrains it to an integer), so N_r^alpha has no meaning in an
23 * exact field.
24 */
25
26#include <cstddef>
27#include <vector>
28
31#include "line/num/number.h"
32#include "line/util/matrix.h"
33
34namespace line {
35namespace pfqn {
36
37/**
38 * @brief Generalized fixed-point Linearizer with a single scaling exponent
39 * shared by every class (De Souza e Silva and Muntz).
40 *
41 * @param alpha scaling exponent shared by every class
42 * @param L (M x R) service demands
43 * @param N (R) population per class
44 * @param Z (K x R) think times
45 * @param type per-station scheduling strategy
46 * @param tol convergence tolerance
47 * @param maxiter iteration cap
48 * @param QN0 queue lengths that warm-start the iteration; empty for a cold start
49 * @see pfqn_egflinearizer for the remaining arguments
50 */
51template <class T>
52LinearizerResult<T> pfqn_gflinearizer(const Matrix<T>& L, const std::vector<int>& N,
53 const Matrix<T>& Z, const std::vector<SchedStrategy>& type,
54 double tol, int maxiter, const T& alpha,
55 const Matrix<T>& QN0) {
56 // runtime gating rationale: see _kb/03-api-layer.md (cpp port notes: pfqn)
57 const std::vector<T> alphav(N.size(), alpha);
58 return pfqn_egflinearizer(L, N, Z, type, tol, maxiter, alphav, QN0);
59}
60
61template <class T>
62LinearizerResult<T> pfqn_gflinearizer(const Matrix<T>& L, const std::vector<int>& N,
63 const Matrix<T>& Z, const T& alpha) {
64 return pfqn_gflinearizer(L, N, Z, std::vector<SchedStrategy>(), 1e-8, 1000, alpha,
65 Matrix<T>());
66}
67
68} // namespace pfqn
69} // namespace line
70
71#endif // LINE_API_PFQN_GFLINEARIZER_H
Dense matrix and non-owning view.
LinearizerResult< T > pfqn_gflinearizer(const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< SchedStrategy > &type, double tol, int maxiter, const T &alpha, const Matrix< T > &QN0)
Generalized fixed-point Linearizer with a single scaling exponent shared by every class (De Souza e S...
LinearizerResult< T > pfqn_egflinearizer(const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< SchedStrategy > &type, double tol, int maxiter, const std::vector< T > &alpha, const Matrix< T > &QN0, int npasses=3)
Extended generalized fixed-point Linearizer (De Souza e Silva and Muntz's generalization of Chandy an...
Number-type abstraction for the templated API port.
Scaffolding shared by the approximate-MVA family.
Extended generalized fixed-point Linearizer (De Souza e Silva and Muntz's generalization of Chandy an...
Return value of the Linearizer family, mirroring [Q,U,W,C,X,totiter].