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

Function redRing

kernel/GBEngine/kstd2.cc:945–1044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

943}
944
945int redRing (LObject* h,kStrategy strat)
946{
947 if (strat->tl<0) return 1;
948 if (h->IsNull()) return 0; // spoly is zero (can only occur with zero divisors)
949
950 int at/*,i*/;
951 long d;
952 int j = 0;
953 int pass = 0;
954 // poly zeroPoly = NULL;
955
956// TODO warum SetpFDeg notwendig?
957 h->SetpFDeg();
958 assume(h->pFDeg() == h->FDeg);
959 long reddeg = h->GetpFDeg();
960
961 h->SetShortExpVector();
962 loop
963 {
964 j = kFindDivisibleByInT(strat, h);
965 if (j < 0)
966 {
967 // over ZZ: cleanup coefficients by complete reduction with monomials
968 postReduceByMon(h, strat);
969 if(h->p == NULL)
970 {
971 kDeleteLcm(h);
972 h->Clear();
973 return 0;
974 }
975 if(nIsZero(pGetCoeff(h->p))) return 2;
976 j = kFindDivisibleByInT(strat, h);
977 if(j < 0)
978 {
979 if(strat->tl >= 0)
980 h->i_r1 = strat->tl;
981 else
982 h->i_r1 = -1;
983 if (h->GetLmTailRing() == NULL)
984 {
985 kDeleteLcm(h);
986 h->Clear();
987 return 0;
988 }
989 return 1;
990 }
991 }
992 //printf("\nFound one: ");pWrite(strat->T[j].p);
993 //enterT(*h, strat);
994 ksReducePoly(h, &(strat->T[j]), NULL, NULL, NULL, strat); // with debug output
995 //printf("\nAfter small red: ");pWrite(h->p);
996 if (h->GetLmTailRing() == NULL)
997 {
998 kDeleteLcm(h);
999 h->Clear();
1000 return 0;
1001 }
1002 h->SetShortExpVector();

Callers 6

redSigRingFunction · 0.85
kstd2.ccFile · 0.85
sbaFunction · 0.85
enterOneStrongPolySigFunction · 0.85
enterOnePairSigRingFunction · 0.85
enterExtendedSpolySigFunction · 0.85

Calls 15

kFindDivisibleByInTFunction · 0.85
postReduceByMonFunction · 0.85
kDeleteLcmFunction · 0.85
ksReducePolyFunction · 0.85
enterLFunction · 0.85
IsNullMethod · 0.80
SetpFDegMethod · 0.80
pFDegMethod · 0.80
GetpFDegMethod · 0.80
SetShortExpVectorMethod · 0.80
ClearMethod · 0.80
GetLmTailRingMethod · 0.80

Tested by

no test coverage detected