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

Function ksReducePolyBound

kernel/GBEngine/kspoly.cc:591–729  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591int ksReducePolyBound(LObject* PR,
592 TObject* PW,
593 int /*bound*/,
594 poly spNoether,
595 number *coef,
596 kStrategy strat)
597{
598#ifdef KDEBUG
599 red_count++;
600#ifdef TEST_OPT_DEBUG_RED
601 if (TEST_OPT_DEBUG)
602 {
603 Print("Red %d:", red_count); PR->wrp(); Print(" with:");
604 PW->wrp();
605 //printf("\necart(PR)-ecart(PW): %i\n",PR->ecart-PW->ecart);
606 //pWrite(PR->p);
607 }
608#endif
609#endif
610 int ret = 0;
611 ring tailRing = PR->tailRing;
612 if (strat!=NULL)
613 {
614 kTest_L(PR,strat);
615 kTest_T(PW,strat);
616 }
617
618 poly p1 = PR->GetLmTailRing(); // p2 | p1
619 poly p2 = PW->GetLmTailRing(); // i.e. will reduce p1 with p2; lm = LT(p1) / LM(p2)
620 poly t2 = pNext(p2), lm = p1; // t2 = p2 - LT(p2); really compute P = LC(p2)*p1 - LT(p1)/LM(p2)*p2
621 assume(p1 != NULL && p2 != NULL);// Attention, we have rings and there LC(p2) and LC(p1) are special
622 p_CheckPolyRing(p1, tailRing);
623 p_CheckPolyRing(p2, tailRing);
624
625 pAssume1(p2 != NULL && p1 != NULL &&
626 p_DivisibleBy(p2, p1, tailRing));
627
628 pAssume1(p_GetComp(p1, tailRing) == p_GetComp(p2, tailRing) ||
629 (p_GetComp(p2, tailRing) == 0 &&
630 p_MaxComp(pNext(p2),tailRing) == 0));
631
632#ifdef HAVE_PLURAL
633 if (rIsPluralRing(currRing))
634 {
635 // for the time being: we know currRing==strat->tailRing
636 // no exp-bound checking needed
637 // (only needed if exp-bound(tailring)<exp-b(currRing))
638 if (PR->bucket!=NULL) nc_kBucketPolyRed_Z(PR->bucket, p2,coef,FALSE);
639 else
640 {
641 poly _p = (PR->t_p != NULL ? PR->t_p : PR->p);
642 assume(_p != NULL);
643 nc_PolyPolyRed(_p, p2,coef, currRing);
644 if (PR->t_p!=NULL) PR->t_p=_p; else PR->p=_p;
645 PR->pLength=0; // usually not used, GetpLength re-computes it if needed
646 }
647 return 0;
648 }

Callers 1

ksReducePolyTailBoundFunction · 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
n_InitFunction · 0.85
p_ExpVectorSubFunction · 0.85
p_LmExpVectorAddIsOkFunction · 0.85
p_ExpVectorAddFunction · 0.85

Tested by

no test coverage detected