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