Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/potentials/@scgpot/pot_to_marginal.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 m = pot_to_marginal(pot) | |
2 % POT_TO_MARGINAL Convert a scgpot to a marginal structure. | |
3 % m = pot_to_marginal(pot) | |
4 | |
5 assert(isempty(pot.ctaildom)) | |
6 m.domain = pot.domain; | |
7 n = pot.cheadsize; | |
8 d = pot.dsize; | |
9 | |
10 if n==0 | |
11 m.mu = []; | |
12 m.Sigma = []; | |
13 else | |
14 m.mu = zeros(n, d); | |
15 m.Sigma = zeros(n, n, d); | |
16 end | |
17 %m.T = 0*myones(pot.dsizes); | |
18 m.T = 0*myones(pot.dsize); | |
19 for i=1:pot.dsize | |
20 potc = struct(pot.scgpotc{i}); % violate privacy of object | |
21 if n > 0 | |
22 m.mu(:,i) = potc.A; | |
23 m.Sigma(:,:,i) = potc.C; | |
24 end | |
25 m.T(i) = potc.p; | |
26 end | |
27 if isvectorBNT(m.T) | |
28 m.T = m.T(:)'; | |
29 end |