comparison toolboxes/FullBNT-1.0.7/bnt/potentials/mk_initial_pot.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 pot = mk_initial_pot(pot_type, dom, ns, cnodes, onodes)
2 % MK_INITIAL_POT A "initial" potential is one which has not had any evidence entered into it.
3 % pot = mk_initial_pot(pot_type, domain, node_sizes, cnodes, onodes)
4 %
5 % pot_type is one of 'd', 'g', 'cg' or 'u'
6 % domain is the set of nodes to be included in the potential.
7 % node_sizes(i) is the size of node i.
8
9 switch pot_type
10 case 'd',
11 ns(onodes) = 1;
12 pot = dpot(dom, ns(dom));
13 case 'u',
14 ns(onodes) = 1;
15 pot = upot(dom, ns(dom));
16 case 'g',
17 ns(onodes) = 0;
18 pot = cpot(dom, ns(dom));
19 case 'cg',
20 dnodes = mysetdiff(1:length(ns), cnodes);
21 ddom = myintersect(dnodes, dom);
22 cdom = myintersect(cnodes, dom);
23 dobs = myintersect(dnodes, onodes);
24 cobs = myintersect(cnodes, onodes);
25 ns(dobs) = 1;
26 ns(cobs) = 0;
27 pot = cgpot(ddom, cdom, ns);
28 end
29