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