1function [S,Q11,Q12,Q21,Q22,T]=ctmc_stochcomp(Q,I)
2% [S,Q11,Q12,Q21,Q22,T] = CTMC_STOCHCOMP(Q,I)
3% Copyright (c) 2012-2026, Imperial College London
8isSelected =
false(1, length(Q));
10 isSelected(I(idx)) =
true;
12Ic = zeros(1, length(Q) - length(I));
25% Iterative path. The backslash below factorizes
the whole complement block, so
26% its fill-in
is what limits
the model above
the dispatch threshold rather than
27%
the arithmetic. One ILUT factorization serves every
column of Q21. The direct
28% solve stays
the default and remains
the fallback when a
column fails.
29GMRES_MIN_STATES = 6000;
31if size(Q22,1) > GMRES_MIN_STATES
32 [T,gflag] = ctmc_gmres_multi(-Q22, Q21);