1%{ @file sn_rtnodes_to_rtorig.m
2 % @brief Converts node routing matrix to the original routing matrix format
4 % @author LINE Development Team
8 % @brief Converts node routing matrix to the original routing matrix format
11 % This function converts the node-level routing matrix to the original
12 % routing matrix format, excluding
class-switching
nodes.
16 % [rtorigcell, rtorig] = sn_rtnodes_to_rtorig(sn)
21 % <tr><th>Name<th>Description
22 % <tr><td>sn<td>Network structure
27 % <tr><th>Name<th>Description
28 % <tr><td>rtorigcell<td>Cell array representation of the routing matrix
29 % <tr><td>rtorig<td>Sparse matrix representation of the routing matrix
32function [rtorigcell,rtorig] = sn_rtnodes_to_rtorig(sn)
38 if startsWith(sn.nodenames{ind},
'CS_')
47 colToKeep(end+1) = (ind-1)*K+k;
51rtorig = dtmc_stochcomp(rtnodes, colToKeep);
52rtorigcell = cellzeros(K,K,csshift,csshift);
54% for cache rt, replace NaNs for unknown probabilities with 0
55rtorig(isnan(rtorig)) = 0;
58 if sn.nodetype(ind) ~= NodeType.Sink
62 rtorigcell{r,s}(ind,jnd) = rtorig((ind-1)*K+r,(jnd-1)*K+s);