comparison toolboxes/FullBNT-1.0.7/bnt/potentials/@scgpot/scgpot.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 = scgpot(ddom, cheaddom, ctaildom, node_sizes, scgpotc)
2 % SCGPOT Make a stable CG potential.
3 % pot = scgpot(ddom, cheaddom, ctaildom, node_sizes, scgpotc)
4 %
5 % ddom is discrete nodes contains in the potential
6 % cheaddom is head nodes constains in the potential
7 % ctaildom is tail nodes contains in the potential
8 % node_sizes(i) is the size of the i'th node.
9 % scgpotc is list of scgcpot objects.
10
11 pot.ddom = ddom;
12 pot.cheaddom = cheaddom;
13 pot.ctaildom = ctaildom;
14 pot.domain = myunion(ddom, myunion(cheaddom, ctaildom));
15 pot.dsizes = node_sizes(pot.ddom);
16 pot.dsize = prod(node_sizes(pot.ddom));
17 pot.cheadsizes = node_sizes(pot.cheaddom);
18 pot.cheadsize = sum(node_sizes(pot.cheaddom));
19 pot.ctailsizes = node_sizes(pot.ctaildom);
20 pot.ctailsize = sum(node_sizes(pot.ctaildom));
21
22 if nargin < 5
23 scgpotc = cell(1, pot.dsize);
24 for i=1:pot.dsize
25 scgpotc{i} = scgcpot(pot.cheadsize, pot.ctailsize);
26 end
27 end
28 pot.scgpotc = scgpotc;
29
30 pot = class(pot, 'scgpot');