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

Equilibrium distribution of a discrete-time Markov chain, and stochastic complementation. More...

#include <cstddef>
#include <cstring>
#include <mutex>
#include <type_traits>
#include <utility>
#include <vector>
#include "line/api/mc/ctmc_solve.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for dtmc_solve.h:

Go to the source code of this file.

Classes

struct  line::mc::StochCompResult< T >

Namespaces

namespace  line
namespace  line::mc

Functions

template<class T>
std::vector< T > line::mc::dtmc_solve (const Matrix< T > &P)
 Stationary distribution of a stochastic matrix P.
template<class T>
StochCompResult< T > line::mc::ctmc_stochcomp (const Matrix< T > &Q, const std::vector< std::size_t > &I)
template<class T>
StochCompResult< T > line::mc::ctmc_stochcomp (const Matrix< T > &Q)
 Default subset: the first ceil(n/2) states, as in MATLAB.

Detailed Description

Equilibrium distribution of a discrete-time Markov chain, and stochastic complementation.

dtmc_solve is the port of matlab/lib/kpctoolbox/mc/dtmc_solve.m: the stationary vector of P is the stationary vector of the generator P - I, so the whole implementation delegates to ctmc_solve. Keeping that delegation literal matters for parity, since every reducibility and trimming rule then lives in exactly one place.

ctmc_stochcomp is the port of matlab/src/api/mc/ctmc_stochcomp.m: the stochastic complement of the state subset I, S = Q11 + Q12 (-Q22)^-1 Q21, which is itself a generator on I with the same stationary distribution up to renormalization. The MATLAB version switches to GMRES above 6000 states; there is no iterative path here yet, and none is needed for the exact arithmetic, where an iterative method has no meaning.

Definition in file dtmc_solve.h.