Macaulay2 Engine
Loading...
Searching...
No Matches

◆ gens()

enum ComputationStatusCode res_comp::gens ( int deg)
private

Definition at line 964 of file res-a1.cpp.

965{
966 if (M2_gbTrace >= 5)
967 {
968 buffer o;
969 o << "gens(" << deg << ")" << newline;
970 emit(o.str());
971 }
972 // preconditions: reductions(2,deg), gens(deg-1)
973 res_pair *p;
974 res_degree *mypairs = get_degree_set(1, deg);
975 if (mypairs != nullptr)
976 {
977 while ((p = mypairs->next_gen) != nullptr)
978 {
979 mypairs->next_gen = p->next;
980 handle_gen(p); // Consumes 'p'
981
982 mypairs->nleft--;
983 resn[1]->nleft--;
984 nleft--;
985 if (stop_.pair_limit > 0 && npairs - nleft >= stop_.pair_limit)
987 if (stop_.syzygy_limit > 0 && nminimal >= stop_.syzygy_limit)
990 }
991
992 sort_pairs(1, deg); // Sort the level 1 GB elements
993 }
994 return COMP_COMPUTING;
995}
StopConditions stop_
Definition comp.hpp:75
char * str()
Definition buffer.hpp:72
void sort_pairs(int level, int deg)
Definition res-a1.cpp:481
int nleft
Definition res-a1.hpp:109
int nminimal
Definition res-a1.hpp:111
int npairs
Definition res-a1.hpp:110
res_degree * get_degree_set(int level, int d) const
Definition res-a1.cpp:200
void handle_gen(res_pair *p)
Definition res-a1.cpp:1053
res_pair * next_gen
Definition res-a1.hpp:29
int nleft
Definition res-a1.hpp:33
@ COMP_DONE_PAIR_LIMIT
Definition computation.h:64
@ COMP_DONE_SYZYGY_LIMIT
Definition computation.h:63
@ COMP_COMPUTING
Definition computation.h:71
@ COMP_INTERRUPTED
Definition computation.h:57
int p
bool system_interrupted()
char newline[]
Definition m2-types.cpp:49
int M2_gbTrace
Definition m2-types.cpp:52
void emit(const char *s)
Definition text-io.cpp:41

References COMP_COMPUTING, COMP_DONE_PAIR_LIMIT, COMP_DONE_SYZYGY_LIMIT, COMP_INTERRUPTED, emit(), get_degree_set(), handle_gen(), M2_gbTrace, newline, res_degree::next_gen, nleft, res_degree::nleft, nminimal, npairs, p, sort_pairs(), Computation::stop_, buffer::str(), and system_interrupted().

Referenced by start_computation().