1% @brief MATLAB Coder script to generate MEX functions
for mc_
module.
3% This script generates MEX (MATLAB Executable) versions of Markov chain
4% functions for improved performance.
6% Skipped functions (Coder-incompatible):
7% ctmc_courtois, ctmc_kms - cell array args (MS), dtmc_solve dependency
8% ctmc_takahashi - cell array args, dtmc_solve, ctmc_randomization
9% ctmc_multi - cell array args, ctmc_solve_reducible
10% ctmc_simulate - exprnd() not supported
11% ctmc_uniformization - speye(), sparse() not supported
12% ctmc_transient - function handles (@ctmc_transientode)
13% ctmc_ssg, ctmc_ssg_reachability - State class OOP methods
14% dtmc_solve_reducible - stronglyconncomp() not supported
15% ctmc_solve_reducible - depends on dtmc_solve_reducible
16% ctmc_solve_reducible_blkdecomp - stronglyconncomp() not supported
18% See also CODER, CODER.CONFIG, CODER.TYPEOF, CODEGEN.
20%% Create configuration object of class 'coder.CodeConfig'.
21cfg = coder.config('mex','ecoder',false);
22cfg.GenerateReport =
false;
23cfg.ReportPotentialDifferences =
false;
24cfg.GenCodeOnly =
false;
27scal_type = coder.typeof(0);
28mat_type = coder.typeof(0,[Inf Inf],[1 1]);
30%% ===== Infinitesimal generator =====
32% ctmc_makeinfgen(Q) -> Q
33codegen -config cfg ctmc_makeinfgen -args {mat_type}
35% ctmc_stochcomp(Q, I) -> [S, Q11, Q12, Q21, Q22, T]
36codegen -config cfg ctmc_stochcomp -args {mat_type, coder.typeof(0,[1 Inf],[0 1])}
38%% ===== Random generator =====
41codegen -config cfg ctmc_rand -args {scal_type}