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 / graph / family.m @ 8:b5b38998ef3b
History | View | Annotate | Download (381 Bytes)
| 1 |
function f = family(A,i,t) |
|---|---|
| 2 |
% FAMILY Return the indices of parents and self in sorted order |
| 3 |
% f = family(dag,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 |
f = [parents(A,i) i]; |
| 9 |
else |
| 10 |
if t == 1 |
| 11 |
f = [parents(A,i) i]; |
| 12 |
else |
| 13 |
ss = length(A)/2; |
| 14 |
j = i+ss; |
| 15 |
f = [parents(A,j) j] + (t-2)*ss; |
| 16 |
end |
| 17 |
end |