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

◆ s_pair_step()

int GBinhom_comp::s_pair_step ( s_pair * p)
private

Definition at line 676 of file gb-sugarless.cpp.

682{
683 n_computed++;
684 if (M2_gbTrace >= 8)
685 {
686 buffer o;
687 o << "--- computing pair ";
688 debug_out(o, p);
689 o << " ----" << newline;
690 emit(o.str());
691 }
692 int minlevel = (p->syz_type == SPAIR_GEN);
693 int compute_pair = (p->compare_num >= 0); // MES: change field name
694 if (compute_pair)
695 {
697
698 if (!gb_reduce(p->f, p->fsyz)) return SPAIR_DEFERRED;
699 }
700 gbvector *f = p->f;
701 gbvector *fsyz = p->fsyz;
702 p->f = nullptr;
703 p->fsyz = nullptr;
704 if (p->first != nullptr)
705 {
706 // Then 'p' should be the first element on the p->first->pair_list
707 assert(p->first->pair_list == p);
708 p->first->pair_list = p->next_same;
709 }
710 remove_pair(p);
711
712 if (!compute_pair) return SPAIR_REMOVED;
713
714 if (!GR->gbvector_is_zero(f))
715 {
716 gb_insert(f, fsyz, minlevel);
717 if (M2_gbTrace >= 8)
718 {
719 buffer o;
720 o << " gb " << last_gb_num - 1 << " = ";
721 GR->gbvector_text_out(o, F, f);
722 emit_line(o.str());
723 }
724 return SPAIR_GB;
725 }
726 if (!GR->gbvector_is_zero(fsyz))
727 {
728 if (M2_gbTrace >= 8)
729 {
730 buffer o;
731 o << " syz = ";
732 GR->gbvector_text_out(o, Fsyz, fsyz);
733 emit_line(o.str());
734 }
735 if (collect_syz)
736 {
737 vec fsyzvec = originalR->translate_gbvector_to_vec(Fsyz, fsyz);
738 n_syz++;
739 syz.append(fsyzvec);
740 return SPAIR_SYZ;
741 }
742 else
743 GR->gbvector_remove(fsyz);
744 }
745 return SPAIR_ZERO;
746}
void gb_insert(gbvector *f, gbvector *fsyz, int minlevel)
const FreeModule * Fsyz
const FreeModule * F
void compute_s_pair(s_pair *p)
int gb_reduce(gbvector *&f, gbvector *&fsyz)
MatrixConstructor syz
void remove_pair(s_pair *&p)
void debug_out(s_pair *q) const
const PolynomialRing * originalR
char * str()
Definition buffer.hpp:72
const int SPAIR_ZERO
Definition comp-gb.hpp:53
const int SPAIR_GB
Definition comp-gb.hpp:51
const int SPAIR_SYZ
Definition comp-gb.hpp:52
const int SPAIR_DEFERRED
Definition comp-gb.hpp:59
const int SPAIR_GEN
Definition comp-gb.hpp:55
const int SPAIR_REMOVED
Definition comp-gb.hpp:58
int p
char newline[]
Definition m2-types.cpp:49
int M2_gbTrace
Definition m2-types.cpp:52
void emit_line(const char *s)
Definition text-io.cpp:47
void emit(const char *s)
Definition text-io.cpp:41

References collect_syz, compute_s_pair(), debug_out(), emit(), emit_line(), F, Fsyz, gb_insert(), gb_reduce(), GR, last_gb_num, M2_gbTrace, n_computed, n_syz, newline, originalR, p, remove_pair(), SPAIR_DEFERRED, SPAIR_GB, SPAIR_GEN, SPAIR_REMOVED, SPAIR_SYZ, SPAIR_ZERO, buffer::str(), and syz.

Referenced by start_computation().