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

◆ process_pair()

void binomialGB_comp::process_pair ( binomial_s_pair p)
private

Definition at line 1096 of file gb-toric.cpp.

1097{
1098 bool ismin, subringmin;
1099 binomial f;
1100
1101 if (s.f2 == nullptr)
1102 {
1103 // A generator
1104 ismin = true;
1105 subringmin = true;
1106 f = R->copy_binomial(
1107 s.f1->f); // This is probably being left for garbage...
1108 }
1109 else
1110 {
1111 if (s.f1->smaller != nullptr || s.f2->smaller != nullptr)
1112 {
1113 if (s.f1->smaller != s.f2 && s.f2->smaller != s.f1)
1114 {
1115 return;
1116 }
1117 }
1118
1119 if (M2_gbTrace >= 5)
1120 {
1121 buffer o;
1122 o << "pair [";
1123 R->elem_text_out(o, s.f1->f);
1124 o << " ";
1125 R->elem_text_out(o, s.f2->f);
1126 o << "]" << newline;
1127 emit(o.str());
1128 }
1129 if (!R->calc_s_pair(s, f))
1130 {
1131 // The pair already reduces to zero.
1132 return;
1133 }
1134 ismin = false;
1135 subringmin = (R->weight(s.lcm) > 0);
1136 }
1137
1138 if (Gmin->reduce(f))
1139 {
1140 if (M2_gbTrace >= 5)
1141 {
1142 buffer o;
1143 o << " reduced to ";
1144 R->elem_text_out(o, f);
1145 emit_line(o.str());
1146 }
1147 subringmin = (subringmin && R->weight(f.lead) == 0);
1148 binomial_gb_elem *p = new binomial_gb_elem(f);
1149 Gmin->make_new_pairs(Pairs, p);
1150 Gmin->minimalize_and_insert(p);
1151 if (ismin) mingens.push_back(p);
1152 if (subringmin) mingens_subring.push_back(p);
1153 G.push_back(p);
1154 }
1155 else
1156 R->remove_binomial(f);
1157}
binomial_ring * R
Definition gb-toric.hpp:313
binomialGB * Gmin
Definition gb-toric.hpp:315
binomial_s_pair_set * Pairs
Definition gb-toric.hpp:314
char * str()
Definition buffer.hpp:72
int p
void size_t s
Definition m2-mem.cpp:271
char newline[]
Definition m2-types.cpp:49
int M2_gbTrace
Definition m2-types.cpp:52
tbb::flow::graph G
monomial0 lead
Definition gb-toric.hpp:51
void emit_line(const char *s)
Definition text-io.cpp:47
void emit(const char *s)
Definition text-io.cpp:41

References emit(), emit_line(), G, Gmin, binomial::lead, M2_gbTrace, newline, p, Pairs, R, s, and buffer::str().

Referenced by start_computation().