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

◆ compute_s_pair()

void gbA::compute_s_pair ( spair * p)
private

Definition at line 1313 of file gb-default.cpp.

1314{
1315 POLY f, g;
1316 int i, j;
1317 if (M2_gbTrace >= 5 && M2_gbTrace != 15)
1318 {
1319 buffer o;
1320 spair_text_out(o, p);
1321 emit_line(o.str());
1322 }
1323 if (p->type > SPAIR::SPAIR_SKEW) return;
1324 R->gbvector_remove(p->lead_of_spoly);
1325 p->lead_of_spoly = nullptr;
1326 i = get_resolved_gb_index(p->x.pair.i);
1327 f = gb[i]->g;
1328 if (p->type == SPAIR::SPAIR_SKEW)
1329 {
1330 const int *mon = R->skew_monomial_var(p->x.pair.j);
1331 R->gbvector_mult_by_term(
1332 _F, _Fsyz, R->one(), mon, f.f, f.fsyz, p->f(), p->fsyz());
1333 }
1334 else if (p->type == SPAIR::SPAIR_GCD_ZZ)
1335 {
1336 j = get_resolved_gb_index(p->x.pair.j);
1337 g = gb[j]->g;
1338 R->gbvector_combine_lead_terms_ZZ(
1339 _F, _Fsyz, f.f, f.fsyz, g.f, g.fsyz, p->f(), p->fsyz());
1340 }
1341 else
1342 {
1343 j = get_resolved_gb_index(p->x.pair.j);
1344 g = gb[j]->g;
1345 R->gbvector_cancel_lead_terms(
1346 _F, _Fsyz, f.f, f.fsyz, g.f, g.fsyz, p->f(), p->fsyz());
1347 }
1348 p->type = SPAIR::SPAIR_ELEM;
1349 if (M2_gbTrace >= 5 && M2_gbTrace != 15)
1350 {
1351 buffer o;
1352 o << " ";
1353 R->gbvector_text_out(o, _F, p->f());
1354 emit_line(o.str());
1355 }
1356}
char * str()
Definition buffer.hpp:72
int get_resolved_gb_index(int i) const
void spair_text_out(buffer &o, spair *p)
GBRing * R
const FreeModule * _F
const FreeModule * _Fsyz
@ SPAIR_GCD_ZZ
@ SPAIR_SKEW
@ SPAIR_ELEM
void gb(IntermediateBasis &F, int n)
int p
int M2_gbTrace
Definition m2-types.cpp:52
#define POLY(q)
Definition poly.cpp:23
gbvector * fsyz
Definition gbring.hpp:99
gbvector * f
Definition gbring.hpp:98
void emit_line(const char *s)
Definition text-io.cpp:47

References _F, _Fsyz, emit_line(), POLY::f, POLY::fsyz, gb(), get_resolved_gb_index(), M2_gbTrace, p, POLY, R, SPAIR_ELEM, SPAIR_GCD_ZZ, SPAIR_SKEW, spair_text_out(), and buffer::str().

Referenced by reduce_kk(), and reduce_ZZ().