MCPcopy Create free account
hub / github.com/Singular/Singular / ksReducePolyGCD

Function ksReducePolyGCD

kernel/GBEngine/kspoly.cc:344–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342
343#ifdef STDZ_EXCHANGE_DURING_REDUCTION
344int ksReducePolyGCD(LObject* PR,
345 TObject* PW,
346 poly spNoether,
347 number *coef,
348 kStrategy strat)
349{
350#ifdef KDEBUG
351 red_count++;
352#ifdef TEST_OPT_DEBUG_RED
353// if (TEST_OPT_DEBUG)
354// {
355// Print("Red %d:", red_count); PR->wrp(); Print(" with:");
356// PW->wrp();
357// //printf("\necart(PR)-ecart(PW): %i\n",PR->ecart-PW->ecart);
358// //pWrite(PR->p);
359// }
360#endif
361#endif
362 int ret = 0;
363 ring tailRing = PR->tailRing;
364 if (strat!=NULL)
365 {
366 kTest_L(PR,strat);
367 kTest_T(PW,strat);
368 }
369
370 poly p1 = PR->GetLmTailRing();
371 poly p2 = PW->GetLmTailRing();
372 poly t2 = pNext(p2), lm = pOne();
373 assume(p1 != NULL && p2 != NULL);// Attention, we have rings and there LC(p2) and LC(p1) are special
374 p_CheckPolyRing(p1, tailRing);
375 p_CheckPolyRing(p2, tailRing);
376
377 pAssume1(p2 != NULL && p1 != NULL &&
378 p_DivisibleBy(p2, p1, tailRing));
379
380 pAssume1(p_GetComp(p1, tailRing) == p_GetComp(p2, tailRing) ||
381 (p_GetComp(p2, tailRing) == 0 &&
382 p_MaxComp(pNext(p2),tailRing) == 0));
383
384#ifdef HAVE_PLURAL
385 if (rIsPluralRing(currRing))
386 {
387 // for the time being: we know currRing==strat->tailRing
388 // no exp-bound checking needed
389 // (only needed if exp-bound(tailring)<exp-b(currRing))
390 if (PR->bucket!=NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,TRUE);
391 else
392 {
393 poly _p = (PR->t_p != NULL ? PR->t_p : PR->p);
394 assume(_p != NULL);
395 nc_PolyPolyRed(_p, p2,coef, currRing);
396 if (PR->t_p!=NULL) PR->t_p=_p; else PR->p=_p;
397 PR->pLength=0; // usually not used, GetpLength re-computes it if needed
398 }
399 return 0;
400 }
401#endif

Callers 2

redRing_ZFunction · 0.85
redRing_Z_SFunction · 0.85

Calls 15

kTest_LFunction · 0.85
kTest_TFunction · 0.85
p_CheckPolyRingFunction · 0.85
p_DivisibleByFunction · 0.85
p_MaxCompFunction · 0.85
rIsPluralRingFunction · 0.85
nc_kBucketPolyRed_ZFunction · 0.85
nc_PolyPolyRedFunction · 0.85
p_LmExpVectorAddIsOkFunction · 0.85
p_ExpVectorAddFunction · 0.85
kStratChangeTailRingFunction · 0.85
p_ExpVectorSubFunction · 0.85

Tested by

no test coverage detected