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