From 84a7190c4bd7893e1bfdd37522a46fb0d085ed5c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 17 Jul 2010 20:27:57 +0200 Subject: Twin law idiot check --- src/symmetry.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/symmetry.c') 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; } -- cgit v1.2.3