#include #include #include #include #include #include #include #include #include "treewalk.hpp" using namespace std; using namespace std::chrono; fstream file_out; bool checkpoint; bool stack_correct; #define SIGNAL_CHECKPOINT SIGUSR2 void signal_checkpoint_handler(int signum){ checkpoint=true; } void treat(const Semigroup& m){ int q=ceil(float(m.conductor)/float(m.min)); unsigned int rho=q*m.min-m.conductor; if(m.wilf<=rho){ if((m.wilf<0) or (m.wilf<=rho and m.e>2 and m.left_primitive>1 and q>=4)){ output(m,file_out); } } } void walk(Stack& stack){ Semigroup *current,*son; Semigroup temp; while(not stack.is_empty() and not checkpoint){ current = stack.pop(); if(not cut(*current)){ if(current->genus < MAX_GENUS - 1){ auto it=generator_iter(*current); ind_t pos=0; while (it.move_next()){ son=stack.pushed(); remove_generator(*son, *current, it.get_gen(),pos++); treat(*son); } } else{ auto it = generator_iter(*current); ind_t pos=0; while (it.move_next()){ remove_generator(temp, *current, it.get_gen(),pos++); treat(temp); } } } } } int main(int argc, char **argv){ if(argc!=2){ cerr<<"Usage : "<