wolffd@0: function pot = CPD_to_pot(pot_type, CPD, domain, ns, cnodes, evidence) wolffd@0: % CPD_TO_POT Convert a CPD to a potential of the specified form, incorporating any evidence wolffd@0: % pot = CPD_to_pot(pot_type, CPD, domain, node_sizes, cnodes, evidence) wolffd@0: % wolffd@0: % pot_type is one of 'd', 'g', or 'cg'. wolffd@0: % domain is the domain of CPD. wolffd@0: % node_sizes(i) is the size of node i. wolffd@0: % cnodes = the cts nodes wolffd@0: % evidence{i} is the evidence on the i'th node. wolffd@0: wolffd@0: switch pot_type wolffd@0: case 'd', wolffd@0: pot = CPD_to_dpot(CPD, domain, ns, cnodes, evidence); wolffd@0: case 'g', wolffd@0: pot = CPD_to_cpot(CPD, domain, ns, cnodes, evidence); wolffd@0: case 'cg', wolffd@0: pot = CPD_to_cgpot(CPD, domain, ns, cnodes, evidence); wolffd@0: otherwise, wolffd@0: error(['can''t handle pot_type ' pot_type]); wolffd@0: end wolffd@0: