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_stochcomp - setdiff() not supported
8% ctmc_courtois, ctmc_kms - cell array args (MS), dtmc_solve dependency
9% ctmc_takahashi - cell array args, dtmc_solve, ctmc_randomization
10% ctmc_multi - cell array args, ctmc_solve_reducible
11% ctmc_simulate - exprnd() not supported
12% ctmc_uniformization - speye(), sparse() not supported
13% ctmc_transient - function handles (@ctmc_transientode)
14% ctmc_ssg, ctmc_ssg_reachability - State class OOP methods
15% dtmc_solve_reducible - stronglyconncomp() not supported
16% ctmc_solve_reducible - depends on dtmc_solve_reducible
17% ctmc_solve_reducible_blkdecomp - stronglyconncomp() not supported
19% See also CODER, CODER.CONFIG, CODER.TYPEOF, CODEGEN.
21%% Create configuration object of class 'coder.CodeConfig'.
22cfg = coder.config('mex','ecoder',false);
23cfg.GenerateReport =
false;
24cfg.ReportPotentialDifferences =
false;
25cfg.GenCodeOnly =
false;
28scal_type = coder.typeof(0);
29mat_type = coder.typeof(0,[Inf Inf],[1 1]);
31%% ===== Infinitesimal generator =====
33% ctmc_makeinfgen(Q) -> Q
34codegen -config cfg ctmc_makeinfgen -args {mat_type}
36%% ===== Random generator =====
39codegen -config cfg ctmc_rand -args {scal_type}