annotate toolboxes/FullBNT-1.0.7/bnt/potentials/@scgpot/combine_pots.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function pot = combine_pots(pot1, pot2)
Daniel@0 2 % COMBINE_POTS combine two potentials
Daniel@0 3 % pot = combine_pots(pot1, pot2)
Daniel@0 4
Daniel@0 5 % Reduce both potentials before trying to combine them.
Daniel@0 6 % Cf. "Stable Local computation with Conditional Gaussian Distributions", page 9
Daniel@0 7 % Consider again two potentials with minimal tail
Daniel@0 8
Daniel@0 9 % Guarantee minimal tails. If pot1 or pot2 are minimal, they are not changed
Daniel@0 10 pot1 = reduce_pot(pot1);
Daniel@0 11 pot2 = reduce_pot(pot2);
Daniel@0 12
Daniel@0 13 %if the intersect set of these two potentials' head conts. combination is undifined
Daniel@0 14 if ~isempty( myintersect(pot1.cheaddom, pot2.cheaddom) )
Daniel@0 15 return;
Daniel@0 16 end
Daniel@0 17
Daniel@0 18 if isempty( myintersect(pot1.domain, pot2.cheaddom) ) | isempty( myintersect(pot2.domain, pot1.cheaddom))
Daniel@0 19 % if satisfy the condition of directed combine
Daniel@0 20 pot = direct_combine_pots(pot1, pot2);
Daniel@0 21 else
Daniel@0 22 % perform recursive combine
Daniel@0 23 pot = recursive_combine_pots(pot1, pot2);
Daniel@0 24 end