comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function pot = combine_pots(pot1, pot2)
2 % COMBINE_POTS combine two potentials
3 % pot = combine_pots(pot1, pot2)
4
5 % Reduce both potentials before trying to combine them.
6 % Cf. "Stable Local computation with Conditional Gaussian Distributions", page 9
7 % Consider again two potentials with minimal tail
8
9 % Guarantee minimal tails. If pot1 or pot2 are minimal, they are not changed
10 pot1 = reduce_pot(pot1);
11 pot2 = reduce_pot(pot2);
12
13 %if the intersect set of these two potentials' head conts. combination is undifined
14 if ~isempty( myintersect(pot1.cheaddom, pot2.cheaddom) )
15 return;
16 end
17
18 if isempty( myintersect(pot1.domain, pot2.cheaddom) ) | isempty( myintersect(pot2.domain, pot1.cheaddom))
19 % if satisfy the condition of directed combine
20 pot = direct_combine_pots(pot1, pot2);
21 else
22 % perform recursive combine
23 pot = recursive_combine_pots(pot1, pot2);
24 end