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

◆ start_computation()

void GaussElimComputation::start_computation ( )
virtual

Implements GBComputation.

Definition at line 216 of file gauss.cpp.

217{
218 if (status() == COMP_DONE) return;
219 for (; row >= 0; row--)
220 {
221 if (gb_list[row] == nullptr) continue;
222 while (reduce_list[row] != nullptr)
223 {
224 gm_elem *p = reduce_list[row];
225 reduce_list[row] = p->next;
226 p->next = nullptr;
227 reduce(gb_list[row], p); // replaces p
228 if (M2_gbTrace >= 3)
229 {
230 if (p->f == nullptr)
231 {
232 if (p->fsyz == nullptr)
233 emit_wrapped("o");
234 else
235 emit_wrapped("z");
236 }
237 else
238 emit_wrapped("r");
239 }
240 else
241 {
242 }
243 insert(p);
244 n_pairs++;
245 if (system_interrupted())
246 {
248 return;
249 }
250 if (n_pairs == stop_.pair_limit)
251 {
253 return;
254 }
255 if (n_syz == stop_.syzygy_limit)
256 {
258 return;
259 }
260 }
261 }
262 // Now auto reduce these
263 for (int r = 1; r < gens->n_rows(); r++)
264 {
265 if (gb_list[r] == nullptr) continue;
266 reduce(gb_list[r]->f, gb_list[r]->fsyz, true);
267 }
268 if (M2_gbTrace >= 10)
269 {
270 buffer o;
271 text_out(o);
272 emit(o.str());
273 }
275}
enum ComputationStatusCode status() const
Definition comp.hpp:100
enum ComputationStatusCode set_status(enum ComputationStatusCode)
Definition comp.cpp:66
StopConditions stop_
Definition comp.hpp:75
gm_elem ** reduce_list
Definition gauss.hpp:62
gm_elem ** gb_list
Definition gauss.hpp:63
const Matrix * gens
Definition gauss.hpp:67
void reduce(gm_elem *&p, gm_elem *q)
Definition gauss.cpp:130
void insert(gm_elem *p)
Definition gauss.cpp:32
virtual void text_out(buffer &o) const
Definition gauss.cpp:315
char * str()
Definition buffer.hpp:72
@ COMP_DONE_PAIR_LIMIT
Definition computation.h:64
@ COMP_DONE
Definition computation.h:60
@ COMP_DONE_SYZYGY_LIMIT
Definition computation.h:63
@ COMP_INTERRUPTED
Definition computation.h:57
int p
bool system_interrupted()
int M2_gbTrace
Definition m2-types.cpp:52
void emit_wrapped(const char *s)
Definition text-io.cpp:27
void emit(const char *s)
Definition text-io.cpp:41

References COMP_DONE, COMP_DONE_PAIR_LIMIT, COMP_DONE_SYZYGY_LIMIT, COMP_INTERRUPTED, emit(), emit_wrapped(), gb_list, gens, insert(), M2_gbTrace, n_pairs, n_syz, p, reduce(), reduce_list, row, Computation::set_status(), Computation::status(), Computation::stop_, buffer::str(), system_interrupted(), and text_out().

Referenced by SchreyerFrame::rankUsingSparseMatrix().