Mercurial > hg > camir-ismir2012
comparison toolboxes/FullBNT-1.0.7/bnt/potentials/@scgcpot/reduce_pot.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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:cc4b1211e677 |
---|---|
1 function [reduced_pot,successful] = reduce(pot,tailnodes) | |
2 % Executes the reduce operation defined in | |
3 % Stable Local Computation with Conditional Gaussian Distributions | |
4 % Steffen L. Lauritzen | |
5 % Frank Jensen | |
6 % September 1999 | |
7 % The potential pot is reduced if B contains any zero columns | |
8 % The test are restricted to the positions in tailnodes. | |
9 % Any columns successfully deleted are entered in the array successful | |
10 | |
11 if nargin < 2 | |
12 tailnodes = 1:pot.ctailsize; | |
13 end | |
14 | |
15 successful = []; | |
16 | |
17 % Look for all columns beeing equal to zero | |
18 for i = tailnodes | |
19 if ~any(pot.B(:,i)) | |
20 successful = [successful i]; | |
21 end | |
22 end | |
23 | |
24 remain = mysetdiff(1:pot.ctailsize,successful); | |
25 | |
26 % Erase the zero-columns and decrease the tailsize | |
27 pot.B = pot.B(:,remain); | |
28 pot.ctailsize = pot.ctailsize - length(successful); | |
29 | |
30 % Return the reduced potential | |
31 reduced_pot = pot; | |
32 |