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