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

◆ reductions()

enum ComputationStatusCode res_comp::reductions ( int level,
int deg )
private

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

1025{
1026 res_pair *p;
1027 if (M2_gbTrace >= 5)
1028 {
1029 buffer o;
1030 o << "reductions(" << level << ", " << deg << ")" << newline;
1031 emit(o.str());
1032 }
1033 sort_pairs(level, deg);
1034 res_degree *mypairs = get_degree_set(level, deg);
1035 if (mypairs != nullptr)
1036 while ((p = mypairs->next_pair) != nullptr)
1037 {
1038 mypairs->next_pair = p->next;
1039 handle_pair(p);
1040
1041 mypairs->nleft--;
1042 resn[level]->nleft--;
1043 nleft--;
1044 if (stop_.pair_limit > 0 && npairs - nleft >= stop_.pair_limit)
1045 return COMP_DONE_PAIR_LIMIT;
1046 if (stop_.syzygy_limit > 0 && nminimal >= stop_.syzygy_limit)
1049 }
1050 return COMP_COMPUTING;
1051}
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_pair(res_pair *p)
Definition res-a1.cpp:1075
int nleft
Definition res-a1.hpp:33
res_pair * next_pair
Definition res-a1.hpp:28
@ 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_pair(), M2_gbTrace, newline, res_degree::next_pair, nleft, res_degree::nleft, nminimal, npairs, p, sort_pairs(), Computation::stop_, buffer::str(), and system_interrupted().

Referenced by start_computation().