aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2010-07-17 20:27:57 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:54 +0100
commit84a7190c4bd7893e1bfdd37522a46fb0d085ed5c (patch)
tree093e470a1c758d1351cb9fee8ab354d9c2e8d2ff /src
parentc7958ff5372b985f334ca028448059e3af716a0f (diff)
Twin law idiot check
Diffstat (limited to 'src')
-rw-r--r--src/symmetry.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/symmetry.c b/src/symmetry.c
index e304de48..4bc8d115 100644
--- a/src/symmetry.c
+++ b/src/symmetry.c
@@ -315,7 +315,8 @@ static ReflItemList *coset_decomp(signed int hs, signed int ks, signed int ls,
ReflItemList *get_twins(ReflItemList *items, const char *holo, const char *mero)
{
int i;
- ReflItemList *ops = new_items();;
+ ReflItemList *ops = new_items();
+ int expected, actual;
/* Run the coset decomposition for every reflection in the "pattern",
* and see which gives the highest number of possibilities. This
@@ -339,5 +340,15 @@ ReflItemList *get_twins(ReflItemList *items, const char *holo, const char *mero)
}
+ /* Idiot check */
+ actual = num_items(ops);
+ expected = num_general_equivs(holo) / num_general_equivs(mero);
+ if ( actual != expected ) {
+ ERROR("I couldn't find the number of twin laws that I expected."
+ " This is an internal error, and shouldn't happen. "
+ "Sorry.\n");
+ abort();
+ }
+
return ops;
}