LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mexify.m
1% @brief MATLAB Coder script to generate MEX functions for mc_ module.
2%
3% This script generates MEX (MATLAB Executable) versions of Markov chain
4% functions for improved performance.
5%
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
17%
18% See also CODER, CODER.CONFIG, CODER.TYPEOF, CODEGEN.
19
20%% Create configuration object of class 'coder.CodeConfig'.
21cfg = coder.config('mex','ecoder',false);
22cfg.GenerateReport = false;
23cfg.ReportPotentialDifferences = false;
24cfg.GenCodeOnly = false;
25
26%% Define common types
27scal_type = coder.typeof(0);
28mat_type = coder.typeof(0,[Inf Inf],[1 1]);
29
30%% ===== Infinitesimal generator =====
31
32% ctmc_makeinfgen(Q) -> Q
33codegen -config cfg ctmc_makeinfgen -args {mat_type}
34
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])}
37
38%% ===== Random generator =====
39
40% ctmc_rand(n) -> Q
41codegen -config cfg ctmc_rand -args {scal_type}