Daniel@0: function pot = mk_initial_pot(pot_type, dom, ns, cnodes, onodes) Daniel@0: % MK_INITIAL_POT A "initial" potential is one which has not had any evidence entered into it. Daniel@0: % pot = mk_initial_pot(pot_type, domain, node_sizes, cnodes, onodes) Daniel@0: % Daniel@0: % pot_type is one of 'd', 'g', 'cg' or 'u' Daniel@0: % domain is the set of nodes to be included in the potential. Daniel@0: % node_sizes(i) is the size of node i. Daniel@0: Daniel@0: switch pot_type Daniel@0: case 'd', Daniel@0: ns(onodes) = 1; Daniel@0: pot = dpot(dom, ns(dom)); Daniel@0: case 'u', Daniel@0: ns(onodes) = 1; Daniel@0: pot = upot(dom, ns(dom)); Daniel@0: case 'g', Daniel@0: ns(onodes) = 0; Daniel@0: pot = cpot(dom, ns(dom)); Daniel@0: case 'cg', Daniel@0: dnodes = mysetdiff(1:length(ns), cnodes); Daniel@0: ddom = myintersect(dnodes, dom); Daniel@0: cdom = myintersect(cnodes, dom); Daniel@0: dobs = myintersect(dnodes, onodes); Daniel@0: cobs = myintersect(cnodes, onodes); Daniel@0: ns(dobs) = 1; Daniel@0: ns(cobs) = 0; Daniel@0: pot = cgpot(ddom, cdom, ns); Daniel@0: end Daniel@0: