Mercurial > hg > mauch-mirex-2010
annotate _FullBNT/BNT/general/compute_minimal_interface.m @ 9:4ea6619cb3f5 tip
removed log files
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:55:11 +0100 |
parents | b5b38998ef3b |
children |
rev | line source |
---|---|
matthiasm@8 | 1 function clqs = compute_minimal_interface(intra, inter) |
matthiasm@8 | 2 |
matthiasm@8 | 3 int = compute_fwd_interface(intra, inter); |
matthiasm@8 | 4 ss = length(intra); |
matthiasm@8 | 5 Z = zeros(ss); |
matthiasm@8 | 6 dag = [intra inter; |
matthiasm@8 | 7 Z intra]; |
matthiasm@8 | 8 G = moralize(dag); |
matthiasm@8 | 9 intra2 = G(1:ss,1:ss); |
matthiasm@8 | 10 inter2 = G(1:ss,(1:ss)+ss); |
matthiasm@8 | 11 G = unroll_dbn_topology(intra2, inter2, ss); |
matthiasm@8 | 12 T = ss; |
matthiasm@8 | 13 last_slice = (1:ss) + (T-1)*ss; |
matthiasm@8 | 14 G = (G + G')/2; % mk symmetric |
matthiasm@8 | 15 G2 = (expm(full(G)) > 0); % closure of graph |
matthiasm@8 | 16 G3 = G2(last_slice, last_slice); |
matthiasm@8 | 17 [c,v] = scc(G3); % connected components |
matthiasm@8 | 18 ncomp = size(v,1); |
matthiasm@8 | 19 clqs = cell(1,ncomp); |
matthiasm@8 | 20 for i=1:ncomp |
matthiasm@8 | 21 ndx = find(v(i,:)>0); |
matthiasm@8 | 22 clqs{i} = v(i,ndx); |
matthiasm@8 | 23 clqs{i} = myintersect(clqs{i}, int); |
matthiasm@8 | 24 end |
matthiasm@8 | 25 |