comparison toolboxes/FullBNT-1.0.7/bnt/CPDs/@root_CPD/convert_to_pot.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
1 function pot = convert_to_pot(CPD, pot_type, domain, evidence)
2 % CONVERT_TO_POT Convert a root CPD to one or more potentials
3 % pots = convert_to_pot(CPD, pot_type, domain, evidence)
4
5 assert(length(domain)==1);
6 assert(~isempty(evidence(domain)));
7 T = 1;
8
9 sz = CPD.sizes;
10 ns = zeros(1, max(domain));
11 ns(domain) = sz;
12
13 switch pot_type
14 case 'u',
15 pot = upot(domain, 1, T, 0);
16 case 'd',
17 ns(domain) = 1;
18 pot = dpot(domain, ns(domain), T);
19 case {'c','g'},
20 ns(domain) = 0;
21 pot = cpot(domain, ns(domain), 0);
22 case 'cg',
23 ddom = [];
24 cdom = domain; % we assume the root node is cts
25 %pot = cgpot(ddom, cdom, ns, {cpot([],[],0)});
26 pot = cgpot(ddom, cdom, ns);
27 end
28