Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/graph/children.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function cs = children(adj_mat, i, t) | |
2 % CHILDREN Return the indices of a node's children in sorted order | |
3 % c = children(adj_mat, i, t) | |
4 % | |
5 % t is an optional argument: if present, dag is assumed to be a 2-slice DBN | |
6 | |
7 if nargin < 3 | |
8 cs = find(adj_mat(i,:)); | |
9 else | |
10 if t==1 | |
11 cs = find(adj_mat(i,:)); | |
12 else | |
13 ss = length(adj_mat)/2; | |
14 j = i+ss; | |
15 cs = find(adj_mat(j,:)) + (t-2)*ss; | |
16 end | |
17 end |