From 0c3341d8c2670975a02b365e0649a7262578b300 Mon Sep 17 00:00:00 2001 From: Florian Stecker Date: Tue, 2 Oct 2018 18:09:52 -0500 Subject: [PATCH] improved idealbounds a bit, but thrown it out of Makefile --- Makefile | 17 +++++++++-------- idealbounds.c | 20 +++++++++++++++++--- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index ef0f5c4..58d0a19 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,19 @@ HEADERS=weyl.h thickenings.h queue.h bitvec.h SPECIAL_OPTIONS=-O3 -flto -funroll-loops -Winline OPTIONS=-m64 -march=native -mtune=native -std=gnu99 -D_GNU_SOURCE $(SPECIAL_OPTIONS) +NAME=enumerate-balanced-ideals -all: enumerate idealbounds graph +all: enumerate graph + +$(NAME).tar.bz2: $(NAME) $(HEADERS) enumerate.c weyl.c thickenings.c + tar cjhf $(NAME).tar.bz2 $(NAME)/enumerate.c $(NAME)/weyl.c $(NAME)/thickenings.c $(NAME)/weyl.h $(NAME)/thickenings.h $(NAME)/queue.h $(NAME)/bitvec.h $(NAME)/Makefile $(NAME)/graph.c + +$(NAME): + ln -s . $(NAME) enumerate: enumerate.o weyl.o thickenings.o gcc $(OPTIONS) -o enumerate enumerate.o thickenings.o weyl.o -idealbounds: idealbounds.o weyl.o - gcc $(OPTIONS) -o idealbounds idealbounds.o weyl.o - graph: graph.o weyl.o gcc $(OPTIONS) -o graph graph.o weyl.o @@ -26,11 +30,8 @@ thickenings.o: thickenings.c $(HEADERS) weyl.o: weyl.c $(HEADERS) gcc $(OPTIONS) -c weyl.c -idealbounds.o: idealbounds.c $(HEADERS) - gcc $(OPTIONS) -c idealbounds.c - graph.o: graph.c $(HEADERS) gcc $(OPTIONS) -c graph.c clean: - rm -f enumerate idealbounds graph thickenings.o weyl.o enumerate.o idealbounds.o graph.o + rm -f enumerate graph thickenings.o weyl.o enumerate.o graph.o $(NAME) $(NAME).tar.bz2 diff --git a/idealbounds.c b/idealbounds.c index f857fb3..c6b003f 100644 --- a/idealbounds.c +++ b/idealbounds.c @@ -5,10 +5,24 @@ #include #include +static char* alphabetize(weylgroup_element_t *e, char *str) +{ + if(e->wordlength == 0) + sprintf(str, "1"); + else { + for(int j = 0; j < e->wordlength; j++) + str[j] = e->word[j] + 'a'; + str[e->wordlength] = 0; + } + + return str; +} + int main(int argc, char *argv[]) { semisimple_type_t type; simple_type_t simple; + char buf[100]; simple.series = 'A'; simple.rank = atoi(argv[1]); @@ -43,12 +57,12 @@ int main(int argc, char *argv[]) } } if(!found) { - printf("%d %d not found\n", i, dq->cosets[i].min->wordlength); + printf("%s %d not found\n", alphabetize(dq->cosets[i].min, buf), dq->cosets[i].min->wordlength); if(dq->cosets[i].min->wordlength < minimum) minimum = dq->cosets[i].min->wordlength; - break; +// break; } else { - printf("%d %d found\n", i, dq->cosets[i].min->wordlength); + printf("%s %d found\n", alphabetize(dq->cosets[i].min, buf), dq->cosets[i].min->wordlength); } }