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

◆ do_pairs()

enum ComputationStatusCode res2_comp::do_pairs ( int level,
int degree )

Definition at line 109 of file res-a0.cpp.

110{
111 // Find the first pair in this degree, and count the number of
112 // pairs to compute in this degree.
113 // If this number is 0, continue
114 res2_pair *p;
115
116 if (M2_gbTrace >= 2)
117 {
118 p = resn[level]->next_pair;
119 int nelems = 0;
120 while (p != nullptr && p->degree == degree)
121 {
122 if (p->syz_type == SYZ2_S_PAIR || p->syz_type == SYZ2_MAYBE_MINIMAL)
123 nelems++;
124 p = p->next;
125 }
126 if (nelems > 0)
127 {
128 buffer o;
129 o << "[" << degree << " " << level << " " << nelems << "]";
130 emit(o.str());
131 }
132 }
133 for (p = resn[level]->next_pair; p != nullptr; p = p->next)
134 {
135 if (p->degree != degree) break;
136 resn[level]->next_pair = p->next;
137 if (p->syz_type == SYZ2_S_PAIR || p->syz_type == SYZ2_MAYBE_MINIMAL)
138 {
139 handle_pair(p);
140 if (stop_.pair_limit > 0 && npairs - nleft >= stop_.pair_limit)
142 // if (--PairLimit == 0) return COMP_DONE_PAIR_LIMIT;
143 if (stop_.syzygy_limit > 0 && nminimal >= stop_.syzygy_limit)
145 }
147 }
148 return COMP_COMPUTING;
149}
StopConditions stop_
Definition comp.hpp:75
char * str()
Definition buffer.hpp:72
int nminimal
Definition res-a0.hpp:183
int npairs
Definition res-a0.hpp:182
void handle_pair(res2_pair *p)
Definition res-a0.cpp:1647
int nleft
Definition res-a0.hpp:181
@ 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()
int M2_gbTrace
Definition m2-types.cpp:52
@ SYZ2_MAYBE_MINIMAL
@ SYZ2_S_PAIR
void emit(const char *s)
Definition text-io.cpp:41

References COMP_COMPUTING, COMP_DONE_PAIR_LIMIT, COMP_DONE_SYZYGY_LIMIT, COMP_INTERRUPTED, emit(), handle_pair(), M2_gbTrace, nleft, nminimal, npairs, p, Computation::stop_, buffer::str(), system_interrupted(), SYZ2_MAYBE_MINIMAL, and SYZ2_S_PAIR.

Referenced by do_all_pairs().