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

C++17 implementation of LINE, templated on the number type: one algorithm source runs in IEEE double, in exact rationals, or in fixed high-precision binary floating point. The tree is header-only apart from the command-line front end, so the headers under cpp/include/line are both the interface and the implementation.

Arithmetic backends

line/num/number.h defines num_traits<T> with is_exact and has_transcendental. An algorithm that needs log, exp or pow static_asserts on has_transcendental, so instantiating an inherently inexact algorithm at exact arithmetic is a compile error rather than a silent fallback. The default backends are the header-only, permissively licensed Boost.Multiprecision types; GMP and MPFR are opt-in (-DLINE_MP_USE_GMP=ON) because their LGPL terms constrain redistribution.

Layout

  • line/api – the algorithm layer, one directory per domain (pfqn, npfqn, mam, mc, cache, lossn, lqn, qsys, sn, ...), mirroring matlab/src/api and jline.api.
  • line/lang – model classes (networks, nodes, classes, distributions) and the layered-network structures.
  • line/solvers – solver implementations (mva, nc, ctmc, fluid, mam, ssa, ln, env, ba, uq, auto).
  • line/io – readers and writers for the JSON model interchange format and the LQN XML interchange.
  • line/num – number traits and the arithmetic backends.
  • line/reg – the method registry.
  • line/util – shared helpers.

Related documentation

The MATLAB API is documented separately (Sphinx, sphinx-matlab/), the Java API by Javadoc (javadoc/), and the Python API by Sphinx (sphinx/). The reference semantics for every ported algorithm are the MATLAB ones; where this port deviates deliberately, the deviation is stated in the header prose of the routine concerned.

Documenting a header

A header's file-level prose lives in a Doxygen block placed after the include guard and before the includes, and that block MUST open with a @file line, on its own, followed by the summary sentence and then the detail:

#ifndef LINE_API_PFQN_MVA_H
#define LINE_API_PFQN_MVA_H

(open a Doxygen comment)
 * @file
 * Exact Mean Value Analysis for closed product-form networks.
 *
 * ... derivation, porting notes, deliberate deviations ...
(close it)

The @file line is not optional. Without it the block cannot be attached to the file, so Doxygen hands it to the next documentable entity it meets – which, after the include lines, is line. Until this was fixed every such block landed there: 960 of 980 header pages carried no description at all, and line carried a stray sentence from an unrelated header. Write @file bare, with no filename argument: an argument goes stale on a rename, and a hand-written one is how the single malformed site in the tree arose.

Give every public entry point an explicit @brief as well. A doc block that opens with @param produces no brief at all, so the function appears in the namespace listing as a bare signature. Do not lean on JAVADOC_AUTOBRIEF for these: it ends the brief at the first full stop followed by a space, which truncates on "i.i.d.", "e.g." and initials.

Never write a bare slash-star sequence inside a Doxygen block. It opens a nested comment that is never closed, and Doxygen silently drops the WHOLE header – which is why the example above says "open a Doxygen comment" instead of showing the characters.