Daniel@0: function b = back1(engine, bfuture, f, t) Daniel@0: Daniel@0: if t ~= 1 Daniel@0: error('mixed up time stamps') Daniel@0: end Daniel@0: bnet = bnet_from_engine(engine); Daniel@0: ss = bnet.nnodes_per_slice; Daniel@0: Daniel@0: int = engine.interface; Daniel@0: D = engine.in_clq; % from J2 Daniel@0: C = engine.int_clq1; % from J1 Daniel@0: phiD = marginalize_pot(bfuture.clpot{D}, int, engine.maximize); Daniel@0: phiC = marginalize_pot(f.clpot{C}, int, engine.maximize); Daniel@0: ratio = divide_by_pot(phiD, phiC); Daniel@0: f.clpot{C} = multiply_by_pot(f.clpot{C}, ratio); Daniel@0: Daniel@0: [b.clpot, seppot] = distribute_evidence(engine.jtree_engine1, f.clpot, f.seppot); Daniel@0: for c=1:length(b.clpot) Daniel@0: [b.clpot{c}, ll(c)] = normalize_pot(b.clpot{c}); Daniel@0: end Daniel@0: b.t = t;