LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Toggle main menu visibility
Loading...
Searching...
No Matches
ctmc_solve_reducible.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_MC_CTMC_SOLVE_REDUCIBLE_H
6
#define LINE_API_MC_CTMC_SOLVE_REDUCIBLE_H
7
8
/**
9
* @file
10
* @ingroup api_mc
11
* Limiting distribution of a CTMC whose generator may be reducible.
12
*
13
* Templated port of matlab/src/api/mc/ctmc_solve_reducible.m and
14
* jar/src/main/java/jline/api/mc/Ctmc_solve_reducible.java: the generator is
15
* uniformized and handed to dtmc_solve_reducible, which does all the work. The
16
* uniformized chain has the same strongly connected components and the same
17
* limiting distribution as the CTMC, so nothing is lost by the detour, and the
18
* component logic lives in exactly one place.
19
*
20
* EXACT. Uniformization at the deterministic rate (21/20) max|Q| is a field
21
* operation and the reducible solver carries no tolerance either, so a
22
* generator with rational rates yields the exact limiting distribution. This
23
* is the routine ctmc_courtois uses for its diagonal blocks, which is how the
24
* exactness reaches the aggregation methods' microprobabilities.
25
*/
26
27
#include <cstddef>
28
#include <vector>
29
30
#include "
line/api/mc/ctmc_randomization.h
"
31
#include "
line/api/mc/dtmc_solve_reducible.h
"
32
#include "
line/num/number.h
"
33
#include "
line/util/error.h
"
34
#include "
line/util/matrix.h
"
35
36
namespace
line
{
37
namespace
mc
{
38
39
/**
40
* @brief Limiting distribution of a CTMC whose generator may be reducible.
41
*
42
* @param Q generator
43
* @param pi0 initial distribution; empty to let the routine pick one
44
* @param zeroColTol column-sum threshold below which a state counts as unreachable
45
*/
46
template
<
class
T>
47
ReducibleResult<T>
ctmc_solve_reducible
(
const
Matrix<T>
& Q,
const
std::vector<T>& pi0,
48
double
zeroColTol = 1e-12) {
49
const
std::size_t n = Q.
rows
();
50
if
(Q.
cols
() != n)
throw
InputError
(
"ctmc_solve_reducible: generator is not square"
);
51
return
dtmc_solve_reducible
(
ctmc_randomization
(Q).P, pi0, zeroColTol);
52
}
53
54
/** Overload without an initial vector. */
55
template
<
class
T>
56
ReducibleResult<T>
ctmc_solve_reducible
(
const
Matrix<T>
& Q,
double
zeroColTol = 1e-12) {
57
return
ctmc_solve_reducible
(Q, std::vector<T>(), zeroColTol);
58
}
59
60
}
// namespace mc
61
}
// namespace line
62
63
#endif
// LINE_API_MC_CTMC_SOLVE_REDUCIBLE_H
line::InputError::InputError
InputError(const std::string &what)
Definition
error.h:39
line::Matrix
Definition
matrix.h:56
line::Matrix::cols
std::size_t cols() const
Definition
matrix.h:90
line::Matrix::rows
std::size_t rows() const
Definition
matrix.h:89
ctmc_randomization.h
Uniformization (randomization) of a CTMC: the embedded DTMC P = I + Q/q.
dtmc_solve_reducible.h
Limiting distribution of a discrete-time Markov chain whose transition matrix may be reducible.
error.h
The exception types the port throws.
matrix.h
Dense matrix and non-owning view.
line::mc
Definition
ctmc_bicgstab.h:59
line::mc::dtmc_solve_reducible
ReducibleResult< T > dtmc_solve_reducible(const Matrix< T > &P, const std::vector< T > &pin, double zeroColTol=1e-12)
Limiting distribution of a discrete-time Markov chain whose transition matrix may be reducible.
Definition
dtmc_solve_reducible.h:120
line::mc::ctmc_solve_reducible
ReducibleResult< T > ctmc_solve_reducible(const Matrix< T > &Q, const std::vector< T > &pi0, double zeroColTol=1e-12)
Limiting distribution of a CTMC whose generator may be reducible.
Definition
ctmc_solve_reducible.h:47
line::mc::ctmc_randomization
RandomizationResult< T > ctmc_randomization(const Matrix< T > &Q, const T &q)
Uniformization (randomization) of a CTMC: the embedded DTMC P = I + Q/q.
Definition
ctmc_randomization.h:66
line
Definition
aoi_dist2ph.h:52
number.h
Number-type abstraction for the templated API port.
line::mc::ReducibleResult
Definition
dtmc_solve_reducible.h:58
include
line
api
mc
ctmc_solve_reducible.h
Generated by
1.18.0