Daniel@0: function [pot, loglik] = normalize_pot(pot) Daniel@0: % NORMALIZE_POT Convert the discrete potential Pr(X,E) into Pr(X|E) and return log Pr(E). Daniel@0: % [pot, loglik] = normalize_pot(pot) Daniel@0: Daniel@0: if isempty(pot.T) %add to process sparse Daniel@0: loglik = 0; Daniel@0: return; Daniel@0: end Daniel@0: [pot.T, lik] = normalise(pot.T); Daniel@0: loglik = log(lik + (lik==0)*eps); Daniel@0: Daniel@0: