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

Function scComputeHC

kernel/combinatorics/hdegree.cc:1074–1138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1072}
1073
1074void scComputeHC(ideal S, ideal Q, int ak, poly &hEdge)
1075{
1076 id_LmTest(S, currRing);
1077 if (Q!=NULL) id_LmTest(Q, currRing);
1078
1079 int i;
1080 int k = ak;
1081 if (rField_is_Ring(currRing) && (currRing->OrdSgn == -1))
1082 {
1083 //consider just monic generators (over rings with zero-divisors)
1084 ideal SS=id_Head(S,currRing);
1085 for(i=0;i<=idElem(S);i++)
1086 {
1087 if((SS->m[i]!=NULL)
1088 && ((p_IsPurePower(SS->m[i],currRing)==0)
1089 ||(!n_IsUnit(pGetCoeff(SS->m[i]), currRing->cf))))
1090 {
1091 p_Delete(&SS->m[i],currRing);
1092 }
1093 }
1094 S=id_Copy(SS,currRing);
1095 idSkipZeroes(S);
1096 }
1097 #if 0
1098 printf("\nThis is HC:\n");
1099 for(int ii=0;ii<=idElem(S);ii++)
1100 {
1101 pWrite(S->m[ii]);
1102 }
1103 //getchar();
1104 #endif
1105 if(idElem(S) == 0)
1106 return;
1107 hNvar = (currRing->N);
1108 hexist = hInit(S, Q, &hNexist);
1109 if (k!=0)
1110 hComp(hexist, hNexist, k, hexist, &hNstc);
1111 else
1112 hNstc = hNexist;
1113 assume(hNexist > 0);
1114 hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
1115 hvar = (varset)omAlloc((hNvar + 1) * sizeof(int));
1116 hpure = (scmon)omAlloc((1 + (hNvar * hNvar)) * sizeof(int));
1117 stcmem = hCreate(hNvar - 1);
1118 for (i = hNvar; i>0; i--)
1119 hvar[i] = i;
1120 hStaircase(hexist, &hNstc, hvar, hNvar);
1121 if ((hNvar > 2) && (hNstc > 10))
1122 hOrdSupp(hexist, hNstc, hvar, hNvar);
1123 memset(hpure, 0, (hNvar + 1) * sizeof(int));
1124 hPure(hexist, 0, &hNstc, hvar, hNvar, hpure, &hNpure);
1125 hLexS(hexist, hNstc, hvar, hNvar);
1126 if (hEdge!=NULL)
1127 pLmFree(hEdge);
1128 hEdge = pInit();
1129 pWork = pInit();
1130 hHedgeStep(hpure, hexist, hNstc, hvar, hNvar,hEdge);
1131 pSetComp(hEdge,ak);

Callers 3

iiHighCornerFunction · 0.85
spectrumComputeFunction · 0.85
newHEdgeFunction · 0.85

Calls 15

id_HeadFunction · 0.85
idElemFunction · 0.85
p_IsPurePowerFunction · 0.85
n_IsUnitFunction · 0.85
p_DeleteFunction · 0.85
id_CopyFunction · 0.85
idSkipZeroesFunction · 0.85
pWriteFunction · 0.85
hInitFunction · 0.85
hCompFunction · 0.85
hCreateFunction · 0.85
hStaircaseFunction · 0.85

Tested by

no test coverage detected