Mercurial > hg > camir-aes2014
annotate toolboxes/FullBNT-1.0.7/bnt/potentials/@scgpot/combine_pots.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
rev | line source |
---|---|
wolffd@0 | 1 function pot = combine_pots(pot1, pot2) |
wolffd@0 | 2 % COMBINE_POTS combine two potentials |
wolffd@0 | 3 % pot = combine_pots(pot1, pot2) |
wolffd@0 | 4 |
wolffd@0 | 5 % Reduce both potentials before trying to combine them. |
wolffd@0 | 6 % Cf. "Stable Local computation with Conditional Gaussian Distributions", page 9 |
wolffd@0 | 7 % Consider again two potentials with minimal tail |
wolffd@0 | 8 |
wolffd@0 | 9 % Guarantee minimal tails. If pot1 or pot2 are minimal, they are not changed |
wolffd@0 | 10 pot1 = reduce_pot(pot1); |
wolffd@0 | 11 pot2 = reduce_pot(pot2); |
wolffd@0 | 12 |
wolffd@0 | 13 %if the intersect set of these two potentials' head conts. combination is undifined |
wolffd@0 | 14 if ~isempty( myintersect(pot1.cheaddom, pot2.cheaddom) ) |
wolffd@0 | 15 return; |
wolffd@0 | 16 end |
wolffd@0 | 17 |
wolffd@0 | 18 if isempty( myintersect(pot1.domain, pot2.cheaddom) ) | isempty( myintersect(pot2.domain, pot1.cheaddom)) |
wolffd@0 | 19 % if satisfy the condition of directed combine |
wolffd@0 | 20 pot = direct_combine_pots(pot1, pot2); |
wolffd@0 | 21 else |
wolffd@0 | 22 % perform recursive combine |
wolffd@0 | 23 pot = recursive_combine_pots(pot1, pot2); |
wolffd@0 | 24 end |