To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / _FullBNT / BNT / general / compute_minimal_interface.m @ 8:b5b38998ef3b
History | View | Annotate | Download (626 Bytes)
| 1 |
function clqs = compute_minimal_interface(intra, inter) |
|---|---|
| 2 |
|
| 3 |
int = compute_fwd_interface(intra, inter); |
| 4 |
ss = length(intra); |
| 5 |
Z = zeros(ss); |
| 6 |
dag = [intra inter; |
| 7 |
Z intra]; |
| 8 |
G = moralize(dag); |
| 9 |
intra2 = G(1:ss,1:ss); |
| 10 |
inter2 = G(1:ss,(1:ss)+ss); |
| 11 |
G = unroll_dbn_topology(intra2, inter2, ss); |
| 12 |
T = ss; |
| 13 |
last_slice = (1:ss) + (T-1)*ss; |
| 14 |
G = (G + G')/2; % mk symmetric |
| 15 |
G2 = (expm(full(G)) > 0); % closure of graph |
| 16 |
G3 = G2(last_slice, last_slice); |
| 17 |
[c,v] = scc(G3); % connected components |
| 18 |
ncomp = size(v,1); |
| 19 |
clqs = cell(1,ncomp); |
| 20 |
for i=1:ncomp |
| 21 |
ndx = find(v(i,:)>0); |
| 22 |
clqs{i} = v(i,ndx);
|
| 23 |
clqs{i} = myintersect(clqs{i}, int);
|
| 24 |
end |
| 25 |
|