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

◆ mark_pair()

int GBinhom_comp::mark_pair ( gb_elem * p,
gb_elem * q ) const
private

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

237{
238 s_pair *r;
239 for (r = p->pair_list; r != nullptr; r = r->next_same)
240 if (r->second == q)
241 {
242 if (r->compare_num >= 0)
243 {
244 r->compare_num = -1;
245 if (M2_gbTrace >= 8)
246 {
247 buffer o;
248 o << "---- removed pair ";
249 debug_out(o, r);
250 emit_line(o.str());
251 }
252 return 1;
253 }
254 else
255 return 0;
256 }
257 for (r = q->pair_list; r != nullptr; r = r->next_same)
258 if (r->second == p)
259 {
260 if (r->compare_num >= 0)
261 {
262 r->compare_num = -1;
263 if (M2_gbTrace >= 8)
264 {
265 buffer o;
266 o << "---- removed pair ";
267 debug_out(o, r);
268 emit_line(o.str());
269 }
270 return 1;
271 }
272 else
273 return 0;
274 }
275 return 0;
276}
void debug_out(s_pair *q) const
char * str()
Definition buffer.hpp:72
int p
int M2_gbTrace
Definition m2-types.cpp:52
s_pair * pair_list
Definition spair.hpp:57
gb_elem * second
Definition spair.hpp:97
int compare_num
Definition spair.hpp:93
s_pair * next_same
Definition spair.hpp:91
void emit_line(const char *s)
Definition text-io.cpp:47

References s_pair::compare_num, debug_out(), emit_line(), M2_gbTrace, s_pair::next_same, p, gb_elem::pair_list, s_pair::second, and buffer::str().

Referenced by find_pairs().