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

◆ s_pair_step()

int GB_comp::s_pair_step ( )
private

Definition at line 593 of file gb-homog2.cpp.

599{
600 s_pair *p = _spairs->remove();
601 if (p == nullptr) return SPAIR_DONE;
602 if (p->degree != _this_degree)
603 {
604 _spairs->put_back(p);
605 return SPAIR_DONE;
606 }
607
608 if (M2_gbTrace == 100)
609 {
610 // Traces the computation, in its way
611 emit("Computing spair ");
612 debug_out(p);
613 }
616
617 gbvector *f = p->f;
618 gbvector *fsyz = p->fsyz;
619 p->f = nullptr;
620 p->fsyz = nullptr;
621 remove_pair(p);
622
623 gb_reduce(f, fsyz);
624 if (!_GR->gbvector_is_zero(f))
625 {
626 if (M2_gbTrace == 100)
627 {
628 buffer o;
629 o << " inserting GB element " << _n_gb;
630 _GR->gbvector_text_out(o, _F, f);
631 o << newline;
632 emit(o.str());
633 }
634 gb_insert(f, fsyz, 0);
635 return SPAIR_GB;
636 }
637 if (!_GR->gbvector_is_zero(fsyz))
638 {
639 if (_collect_syz)
640 {
641 // vec fsyzvec = _GR->gbvector_to_vec(_Fsyz,fsyz);
642 _syz.push_back(fsyz);
643 _n_syz++;
644 return SPAIR_SYZ;
645 }
646 else
647 _GR->gbvector_remove(fsyz);
648 }
649
650 return SPAIR_ZERO;
651}
int _n_pairs_computed
Definition gb-homog2.hpp:94
int _n_gb
Definition gb-homog2.hpp:92
void gb_reduce(gbvector *&f, gbvector *&fsyz)
int _n_syz
Definition gb-homog2.hpp:96
void remove_pair(s_pair *&p)
bool _collect_syz
const FreeModule * _F
Definition gb-homog2.hpp:73
void gb_insert(gbvector *f, gbvector *fsyz, int ismin)
int _this_degree
Definition gb-homog2.hpp:75
void compute_s_pair(s_pair *p)
s_pair_heap * _spairs
Definition gb-homog2.hpp:82
GBRing * _GR
Definition gb-homog2.hpp:68
void debug_out(s_pair *q) const
char * str()
Definition buffer.hpp:72
const int SPAIR_ZERO
Definition comp-gb.hpp:53
const int SPAIR_DONE
Definition comp-gb.hpp:50
const int SPAIR_GB
Definition comp-gb.hpp:51
const int SPAIR_SYZ
Definition comp-gb.hpp:52
int p
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 _collect_syz, _F, _GR, _n_gb, _n_pairs_computed, _n_syz, _spairs, _this_degree, compute_s_pair(), debug_out(), emit(), gb_insert(), gb_reduce(), M2_gbTrace, newline, p, remove_pair(), SPAIR_DONE, SPAIR_GB, SPAIR_SYZ, SPAIR_ZERO, and buffer::str().

Referenced by start_computation().