annotate toolboxes/FullBNT-1.0.7/bnt/potentials/@scgcpot/scgcpot.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 = scgcpot(cheadsize, ctailsize, p, A, B, C)
wolffd@0 2 % SCGCPOT Make a base object of stable conditional gaussian potential.
wolffd@0 3 % pot = scgcpot(cheadsize, ctailsize, p, A, B, C)
wolffd@0 4 %
wolffd@0 5 % cheadsize is the demension of head nodes.
wolffd@0 6 % ctailsize is the demension of tail nodes.
wolffd@0 7 % r = cheadsize, s = ctailsize
wolffd@0 8 % p is discrete probability.
wolffd@0 9 % A is table of r*1 vectors;
wolffd@0 10 % B is r*s matrices
wolffd@0 11 % C is r*r positive semidefinite symmetric matrices
wolffd@0 12
wolffd@0 13 if nargin < 3
wolffd@0 14 p = 1;
wolffd@0 15 end
wolffd@0 16 if nargin < 4
wolffd@0 17 A = zeros(cheadsize,1);
wolffd@0 18 end
wolffd@0 19 if nargin < 5
wolffd@0 20 B = zeros(cheadsize,ctailsize);
wolffd@0 21 end
wolffd@0 22 if nargin < 6
wolffd@0 23 C = zeros(cheadsize,cheadsize);
wolffd@0 24 end
wolffd@0 25
wolffd@0 26 if isempty(A)
wolffd@0 27 A = zeros(cheadsize,1);
wolffd@0 28 end
wolffd@0 29 if isempty(B)
wolffd@0 30 B = zeros(cheadsize,ctailsize);
wolffd@0 31 end
wolffd@0 32 if isempty(C)
wolffd@0 33 C = zeros(cheadsize,cheadsize);
wolffd@0 34 end
wolffd@0 35
wolffd@0 36 pot.cheadsize = cheadsize;
wolffd@0 37 pot.ctailsize = ctailsize;
wolffd@0 38
wolffd@0 39 pot.p = p;
wolffd@0 40 pot.A = A;
wolffd@0 41 pot.B = B;
wolffd@0 42 pot.C = C;
wolffd@0 43 %if cheadsize == 0
wolffd@0 44 % pot.A = [];
wolffd@0 45 %end
wolffd@0 46 %if ctailsize == 0
wolffd@0 47 % pot.B = [];
wolffd@0 48 %end
wolffd@0 49 pot = class(pot, 'scgcpot');