Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/bnt/potentials/@cgpot/cgpot.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 = cgpot(ddom, cdom, node_sizes, can, mom, subtype) | |
2 % CPOT Make a canonical CG potential. | |
3 % function pot = cgpot(ddom, cdom, node_sizes, can, mom, subtype) | |
4 % | |
5 % node_sizes(i) is the size of the i'th node. | |
6 % can and mom default to 0s. | |
7 % subtype defaults to 'c'. | |
8 | |
9 if nargin < 6, subtype = 'c'; end | |
10 | |
11 pot.ddom = ddom; | |
12 pot.cdom = cdom; | |
13 node_sizes = node_sizes(:)'; % row vectors print better | |
14 pot.domain = myunion(ddom, cdom); | |
15 pot.dsizes = node_sizes(pot.ddom); | |
16 pot.dsize = prod(node_sizes(pot.ddom)); | |
17 pot.csizes = node_sizes(pot.cdom); | |
18 pot.csize = sum(node_sizes(pot.cdom)); | |
19 pot.subtype = subtype; | |
20 | |
21 if nargin < 4 | |
22 can = cell(1, pot.dsize); | |
23 for i=1:pot.dsize | |
24 can{i} = cpot(cdom, node_sizes(cdom)); | |
25 end | |
26 end | |
27 pot.can = can; | |
28 | |
29 if nargin < 5 | |
30 mom = cell(1, pot.dsize); | |
31 for i=1:pot.dsize | |
32 mom{i} = mpot(cdom, node_sizes(cdom)); | |
33 end | |
34 end | |
35 pot.mom = mom; | |
36 | |
37 pot = class(pot, 'cgpot'); | |
38 |