From 2a297a74ca828db0c929ef3463c018e6f88bfb3c Mon Sep 17 00:00:00 2001 From: Florian Stecker Date: Mon, 14 Nov 2016 11:54:52 +0100 Subject: [PATCH] find fixpoints in simplified graph --- generate.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/generate.c b/generate.c index 818ac16..649f659 100644 --- a/generate.c +++ b/generate.c @@ -10,6 +10,7 @@ int main(int argc, const char *argv[]) semisimple_type_t type; unsigned long right_invariance, left_invariance; int rank, order, hyperplanes, cosets; + int fixpoints; node_t *graph; @@ -74,17 +75,30 @@ int main(int argc, const char *argv[]) } fprintf(stderr, "\n\n"); - // enumerate balanced thickenings + fixpoints = 0; + for(int i = 0; i < cosets; i++) + if(graph[i].opposite == i) { + if(fixpoints == 0) + fprintf(stderr, "No thickenings since the longest element fixes the following cosets: %s", alphabetize(graph[i].word, graph[i].wordlength, alphabet, string_buffer1)); + else + fprintf(stderr, " %s", alphabetize(graph[i].word, graph[i].wordlength, alphabet, string_buffer1)); + fixpoints++; + } - fwrite(&type.n, sizeof(int), 1, stdout); - fwrite(type.factors, sizeof(simple_type_t), type.n, stdout); - fwrite(&left_invariance, sizeof(unsigned long), type.n, stdout); - fwrite(&right_invariance, sizeof(unsigned long), type.n, stdout); + if(fixpoints > 0) { + fprintf(stderr, "\n\n"); + } else { - long count = enumerate_balanced_thickenings(type, graph, cosets, alphabet, stdout); + // enumerate balanced thickenings + fwrite(&type.n, sizeof(int), 1, stdout); + fwrite(type.factors, sizeof(simple_type_t), type.n, stdout); + fwrite(&left_invariance, sizeof(unsigned long), type.n, stdout); + fwrite(&right_invariance, sizeof(unsigned long), type.n, stdout); - fprintf(stderr, "\n"); - fprintf(stderr, "Found %ld balanced thickenings\n\n", count); + long count = enumerate_balanced_thickenings(type, graph, cosets, alphabet, stdout); + + fprintf(stderr, "Found %ld balanced thickenings\n\n", count); + } graph_free(type, graph); free(type.factors);