allpy
changeset 484:c3dc06b7fdcf
geomatrical_cores(): fix a bug with infinity cores
if ac_count == 0 the number of geometrical cores should not
be limited
author | boris (netbook) <bnagaev@gmail.com> |
---|---|
date | Fri, 18 Feb 2011 19:04:43 +0300 |
parents | bcc658a78e61 |
children | e57eb57e6328 807e1e71bc33 |
files | allpy/structure.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line diff
1.1 --- a/allpy/structure.py Fri Feb 18 18:59:44 2011 +0300 1.2 +++ b/allpy/structure.py Fri Feb 18 19:04:43 2011 +0300 1.3 @@ -197,7 +197,7 @@ 1.4 difference is less then ac_new_atoms, current GC is skipped 1.5 difference = part of new atoms in current core 1.6 * ac_count -- max number of cores (including main core) 1.7 - -1 means infinity 1.8 + 0 means infinity 1.9 1.10 cost is calculated as 1 / (delta + 1) 1.11 delta in [0, +inf) => cost in (0, 1] 1.12 @@ -234,7 +234,7 @@ 1.13 break 1.14 else: 1.15 GCs.append(clique) 1.16 - if len(GCs) >= ac_count: 1.17 + if ac_count != 0 and len(GCs) >= ac_count: 1.18 break 1.19 return GCs 1.20