LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
spn_tinvariants.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_SPN_SPN_TINVARIANTS_H
6#define LINE_API_SPN_SPN_TINVARIANTS_H
7
8/**
9 * @file
10 * @ingroup api_spn
11 * Minimal-support T-invariants of a stochastic Petri net (Murata 1989, sec. V;
12 * Haverkort 1998, sec. 14.2): the non-negative integer firing-count vectors x
13 * with C x = 0, by the same Farkas elimination as spn_sinvariants run on C'.
14 * Each row of X is a firing-count vector over the (transition, mode) events.
15 * A T-invariant is a structural property: inhibitor arcs, priorities and the
16 * timed/immediate split do not enter C and are ignored. MATLAB twin:
17 * matlab/src/api/spn/spn_tinvariants.m.
18 */
19
20#include <cstddef>
21#include <vector>
22
24
25namespace line {
26namespace spn {
27
29 std::vector<std::size_t> transitions; ///< 1-based node index of each event
30 std::vector<std::size_t> modes; ///< 0-based mode index of each event
31 std::vector<std::vector<long long>> X; ///< one minimal-support T-invariant per row
32};
33
34template <class T>
36 const detail::SpnNet net = detail::spn_build_net(sn, "spn_tinvariants");
38 out.transitions = net.transitions;
39 out.modes = net.modes;
40 out.X = detail::spn_farkas(detail::spn_transpose(net.C, net.E), net.n);
41 return out;
42}
43
44} // namespace spn
45} // namespace line
46
47#endif // LINE_API_SPN_SPN_TINVARIANTS_H
A network plus its refreshed NetworkStruct.
SpnTInvariants spn_tinvariants(const qn::NetworkStruct< T > &sn)
Conservation laws of a layered queueing network, enumerated from its structure.
Definition aoi_dist2ph.h:52
Shared net model of the Petri-net property functions (spn_tinvariants, spn_siphons,...
std::vector< std::size_t > transitions
1-based node index of each event
std::vector< std::vector< long long > > X
one minimal-support T-invariant per row
std::vector< std::size_t > modes
0-based mode index of each event