diff options
author | Thomas White <taw@physics.org> | 2010-07-13 14:36:43 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:53 +0100 |
commit | 864acfc1096a75478c792289cc178e8d345fc689 (patch) | |
tree | e70066cf59196b580911c7042651ecd0323b86e4 /src/symmetry.c | |
parent | dcdc5ea10c6525434bb2058fbc09e0159c8fcba5 (diff) |
Take the union of available twin ops, not just the subgroup with the highest number
Diffstat (limited to 'src/symmetry.c')
-rw-r--r-- | src/symmetry.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/symmetry.c b/src/symmetry.c index bca06b48..055d7d60 100644 --- a/src/symmetry.c +++ b/src/symmetry.c @@ -311,8 +311,7 @@ static ReflItemList *coset_decomp(signed int hs, signed int ks, signed int ls, ReflItemList *get_twins(ReflItemList *items, const char *sym) { int i; - int n_twins = 1; - ReflItemList *max_ops = NULL; + ReflItemList *ops = new_items();; /* Run the coset decomposition for every reflection in the "pattern", * and see which gives the highest number of possibilities. This @@ -322,7 +321,7 @@ ReflItemList *get_twins(ReflItemList *items, const char *sym) signed int h, k, l; struct refl_item *item; - ReflItemList *ops; + ReflItemList *new_ops; item = get_item(items, i); @@ -330,14 +329,11 @@ ReflItemList *get_twins(ReflItemList *items, const char *sym) k = item->k; l = item->l; - ops = coset_decomp(h, k, l, sym); - if ( num_items(ops) > n_twins ) { - n_twins = num_items(ops); - delete_items(max_ops); - max_ops = ops; - } + new_ops = coset_decomp(h, k, l, sym); + union_op_items(ops, new_ops); + delete_items(new_ops); } - return max_ops; + return ops; } |