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

Function redRing_S

kernel/GBEngine/kstd2.cc:1047–1100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1045}
1046
1047static int redRing_S (LObject* h,kStrategy strat)
1048{
1049 if (strat->sl<0) return 1;
1050 if (h->IsNull()) return 0; // spoly is zero (can only occur with zero divisors)
1051
1052 int j = 0;
1053 int pass = 0;
1054 // poly zeroPoly = NULL;
1055
1056 h->SetpFDeg();
1057 assume(h->pFDeg() == h->FDeg);
1058 int max_ind;
1059
1060 h->SetShortExpVector();
1061 loop
1062 {
1063 max_ind=strat->sl;
1064 j = kFindDivisibleByInS(strat, &max_ind, h);
1065 if (j < 0)
1066 {
1067 // over ZZ: cleanup coefficients by complete reduction with monomials
1068 postReduceByMon(h, strat);
1069 if(h->p == NULL)
1070 {
1071 h->Clear();
1072 return 0;
1073 }
1074 if(nIsZero(pGetCoeff(h->p))) return 2;
1075 max_ind=strat->sl;
1076 j = kFindDivisibleByInS(strat, &max_ind,h);
1077 if(j < 0)
1078 {
1079 if (h->GetLmTailRing() == NULL)
1080 {
1081 h->Clear();
1082 return 0;
1083 }
1084 return 1;
1085 }
1086 }
1087 //printf("\nFound one: ");pWrite(strat->T[j].p);
1088 //enterT(*h, strat);
1089 TObject tj(strat->S[j]);
1090 ksReducePoly(h, &tj, NULL, NULL, NULL, strat); // with debug output
1091 //printf("\nAfter small red: ");pWrite(h->p);
1092 if (h->GetLmTailRing() == NULL)
1093 {
1094 h->Clear();
1095 return 0;
1096 }
1097 h->SetShortExpVector();
1098 /*- try to reduce the s-polynomial -*/
1099 pass++;
1100 }
1101}
1102
1103/*2

Callers 1

redNFFunction · 0.85

Calls 9

kFindDivisibleByInSFunction · 0.85
postReduceByMonFunction · 0.85
ksReducePolyFunction · 0.85
IsNullMethod · 0.80
SetpFDegMethod · 0.80
pFDegMethod · 0.80
SetShortExpVectorMethod · 0.80
ClearMethod · 0.80
GetLmTailRingMethod · 0.80

Tested by

no test coverage detected