wolffd@0: function [clpot, seppot] = init_pot(engine, clqs, pots, pot_type, onodes, ndx) wolffd@0: % INIT_POT Initialise potentials with evidence (jtree_inf) wolffd@0: % function [clpot, seppot] = init_pot(engine, clqs, pots, pot_type, onodes) wolffd@0: wolffd@0: cliques = engine.cliques; wolffd@0: bnet = bnet_from_engine(engine); wolffd@0: % Set the clique potentials to all 1s wolffd@0: C = length(cliques); wolffd@0: clpot = cell(1,C); wolffd@0: for i=1:C wolffd@0: clpot{i} = mk_initial_pot(pot_type, cliques{i}, bnet.node_sizes(:), bnet.cnodes(:), onodes); wolffd@0: end wolffd@0: wolffd@0: % Multiply on specified potentials wolffd@0: for i=1:length(clqs) wolffd@0: c = clqs(i); wolffd@0: clpot{c} = multiply_by_pot(clpot{c}, pots{i}); wolffd@0: end wolffd@0: wolffd@0: seppot = cell(C,C); % implicitely initialized to 1