Mercurial > hg > camir-aes2014
annotate toolboxes/FullBNT-1.0.7/bnt/potentials/@upot/upot.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 = upot(domain, sizes, p, u) |
wolffd@0 | 2 % UPOT Make a discrete utility potential. |
wolffd@0 | 3 % pot = upot(domain, sizes, p, u) |
wolffd@0 | 4 % |
wolffd@0 | 5 % sizes(i) is the size of the i'th domain element. |
wolffd@0 | 6 % p defaults to all 1s, u defaults to all 0s. |
wolffd@0 | 7 |
wolffd@0 | 8 if nargin < 3, p = myones(sizes); end |
wolffd@0 | 9 if nargin < 4, u = 0*myones(sizes); end |
wolffd@0 | 10 |
wolffd@0 | 11 pot.domain = domain; |
wolffd@0 | 12 pot.p = myreshape(p, sizes); |
wolffd@0 | 13 pot.u = myreshape(u, sizes); |
wolffd@0 | 14 pot.sizes = sizes(:)'; |
wolffd@0 | 15 pot = class(pot, 'upot'); |