annotate toolboxes/FullBNT-1.0.7/bnt/general/compute_minimal_interface.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function clqs = compute_minimal_interface(intra, inter)
wolffd@0 2
wolffd@0 3 int = compute_fwd_interface(intra, inter);
wolffd@0 4 ss = length(intra);
wolffd@0 5 Z = zeros(ss);
wolffd@0 6 dag = [intra inter;
wolffd@0 7 Z intra];
wolffd@0 8 G = moralize(dag);
wolffd@0 9 intra2 = G(1:ss,1:ss);
wolffd@0 10 inter2 = G(1:ss,(1:ss)+ss);
wolffd@0 11 G = unroll_dbn_topology(intra2, inter2, ss);
wolffd@0 12 T = ss;
wolffd@0 13 last_slice = (1:ss) + (T-1)*ss;
wolffd@0 14 G = (G + G')/2; % mk symmetric
wolffd@0 15 G2 = (expm(full(G)) > 0); % closure of graph
wolffd@0 16 G3 = G2(last_slice, last_slice);
wolffd@0 17 [c,v] = scc(G3); % connected components
wolffd@0 18 ncomp = size(v,1);
wolffd@0 19 clqs = cell(1,ncomp);
wolffd@0 20 for i=1:ncomp
wolffd@0 21 ndx = find(v(i,:)>0);
wolffd@0 22 clqs{i} = v(i,ndx);
wolffd@0 23 clqs{i} = myintersect(clqs{i}, int);
wolffd@0 24 end
wolffd@0 25