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

Function MpolyInitialForm

Singular/walk.cc:723–757  ·  view source on GitHub ↗

* return an initial form of the polynom g w.r.t. a weight vector curr_weight * *****************************************************************************/

Source from the content-addressed store, hash-verified

721 * return an initial form of the polynom g w.r.t. a weight vector curr_weight *
722 *****************************************************************************/
723static poly MpolyInitialForm(poly g, intvec* curr_weight)
724{
725 if(g == NULL)
726 {
727 return NULL;
728 }
729 mpz_t max; mpz_init(max);
730 mpz_t maxtmp; mpz_init(maxtmp);
731
732 poly hg, in_w_g = NULL;
733
734 while(g != NULL)
735 {
736 hg = g;
737 pIter(g);
738 MLmWeightedDegree_gmp(maxtmp, hg, curr_weight);
739
740 if(mpz_cmp(maxtmp, max)>0)
741 {
742 mpz_set(max, maxtmp);
743 if (in_w_g!=NULL) pDelete(&in_w_g);
744 in_w_g = pHead(hg);
745 }
746 else
747 {
748 if(mpz_cmp(maxtmp, max)==0)
749 {
750 in_w_g = pAdd(in_w_g, pHead(hg));
751 }
752 }
753 }
754 mpz_clear(maxtmp);
755 mpz_clear(max);
756 return in_w_g;
757}
758
759/************************************************************************
760 * compute the initial form of an ideal <G> w.r.t. a weight vector iva *

Callers 4

MwalkInitialFormFunction · 0.85
test_w_in_ConeCCFunction · 0.85
TranMImprovwalkFunction · 0.85
walk.ccFile · 0.85

Calls 1

MLmWeightedDegree_gmpFunction · 0.85

Tested by 1

test_w_in_ConeCCFunction · 0.68