Changeset c8523f in git for kernel/GBEngine
- Timestamp:
- Oct 7, 2015, 4:51:45 PM (9 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
- Children:
- 212806f6073de03851c64acb881326ea4667bad2
- Parents:
- 03305393d877240ff162abbfb9e1b9c1f14214e85d9204728b9fa909f073b21e83c172b0b49dc2e2
- Location:
- kernel/GBEngine
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/kspoly.cc
r033053 rc8523f 49 49 Print("Red %d:", red_count); PR->wrp(); Print(" with:"); 50 50 PW->wrp(); 51 //printf("\necart(PR)-ecart(PW): %i\n",PR->ecart-PW->ecart); 52 //pWrite(PR->p); 51 53 } 52 54 #endif … … 159 161 { 160 162 Print(" to: "); PR->wrp(); Print("\n"); 163 //printf("\nt^%i ", PR->ecart);pWrite(pHead(PR->p)); 161 164 } 162 165 #endif -
kernel/GBEngine/kstd1.cc
r033053 rc8523f 402 402 PrintS("\n No poly in T divides h.\n"); 403 403 } 404 //getchar(); 404 405 #endif 405 406 if (j < 0) … … 734 735 loop 735 736 { 737 #if ADIDEBUG_NF 738 for(int ii=0;ii<=strat->tl;ii++) 739 { 740 printf("\nT[%i]:\nt^%i ",ii,strat->T[ii].ecart); 741 pWrite(strat->T[ii].p); 742 } 743 //getchar(); 744 #endif 736 745 if (j > strat->tl) 737 746 { … … 813 822 if (H.p == NULL) 814 823 return NULL; 824 #if 0 825 //kÃŒrzeste=1, kleinste ecart = 0 826 int dummy=0; 827 int z=-1; 828 for(int ii=0; ii<=strat->tl;ii++) 829 { 830 if(pLmIsConstant(strat->T[ii].p)) 831 { 832 printf("\nFound one:\n");pWrite(strat->T[ii].p); 833 if(dummy==0 && strat->T[ii].ecart < strat->T[z].ecart) 834 { 835 z = ii; 836 } 837 if(dummy == 1 && strat->T[ii].length < strat->T[z].length) 838 { 839 z = ii; 840 } 841 } 842 } 843 printf("\n!!!!!!!!!!!!!!!!! z = %i\n",z); 844 if(z!=-1) 845 { 846 enterOneStrongPoly(z,H.p,H.ecart,0,strat,-1 , TRUE); 847 } 848 #endif 815 849 } 816 850 else … … 825 859 #if ADIDEBUG_NF 826 860 printf("\nAfter the small reduction it looks like this:\n");pWrite(H.p); 827 getchar();861 //getchar(); 828 862 #endif 829 863 /*- try to reduce the s-polynomial -*/ … … 1667 1701 printf("\nBefore Ll = %i\n", strat->Ll); 1668 1702 #endif 1669 red_result = strat->red(&strat->P,strat); 1703 #ifdef HAVE_RINGS 1704 if(rField_is_Ring(strat->tailRing) && rHasLocalOrMixedOrdering(currRing)) 1705 { 1706 int inittl = strat->tl; 1707 red_result = strat->red(&strat->P,strat); 1708 strat->tl = inittl; 1709 } 1710 else 1711 #endif 1712 red_result = strat->red(&strat->P,strat); 1670 1713 #if ADIDEBUG 1671 1714 printf("\nThis is P nach red:\n");p_Write(strat->P.p,strat->tailRing);p_Write(strat->P.p1,strat->tailRing);p_Write(strat->P.p2,strat->tailRing); … … 1699 1742 1700 1743 // put in T 1701 enterT(strat->P,strat); 1744 #ifdef HAVE_RINGS 1745 if(rField_is_Ring(strat->tailRing) && rHasLocalOrMixedOrdering(currRing)) 1746 { 1747 int inittl = strat->tl; 1748 enterT(strat->P,strat); 1749 strat->tl = inittl+1; 1750 } 1751 else 1752 enterT(strat->P,strat); 1753 #endif 1702 1754 // build new pairs 1703 1755 #ifdef HAVE_RINGS -
kernel/GBEngine/kstd2.cc
r5d9204 rc8523f 1558 1558 } 1559 1559 #endif 1560 getchar();1560 //getchar(); 1561 1561 #endif 1562 1562 #ifdef KDEBUG -
kernel/GBEngine/kutil.cc
r033053 rc8523f 1168 1168 void enterOnePairRing (int i,poly p,int ecart, int isFromQ,kStrategy strat, int atR = -1) 1169 1169 { 1170 number s, t; 1170 #if 0 1171 assume(i<=strat->sl); 1172 int l,j,compare,compareCoeff; 1173 LObject Lp; 1174 if (strat->interred_flag) return; 1175 #ifdef KDEBUG 1176 Lp.ecart=0; Lp.length=0; 1177 #endif 1178 /*- computes the lcm(s[i],p) -*/ 1179 Lp.lcm = pInit(); 1180 pSetCoeff0(Lp.lcm, n_Lcm(pGetCoeff(p), pGetCoeff(strat->S[i]), currRing->cf)); 1181 1182 // Lp.lcm == 0 1183 if (nIsZero(pGetCoeff(Lp.lcm))) 1184 { 1185 #ifdef KDEBUG 1186 if (TEST_OPT_DEBUG) 1187 { 1188 PrintS("--- Lp.lcm == 0\n"); 1189 PrintS("p:"); 1190 wrp(p); 1191 Print(" strat->S[%d]:", i); 1192 wrp(strat->S[i]); 1193 PrintLn(); 1194 } 1195 #endif 1196 strat->cp++; 1197 pLmDelete(Lp.lcm); 1198 return; 1199 } 1200 // basic product criterion 1201 pLcm(p,strat->S[i],Lp.lcm); 1202 1203 pSetm(Lp.lcm); 1204 assume(!strat->sugarCrit); 1205 if (pHasNotCF(p,strat->S[i]) && n_IsUnit(pGetCoeff(p),currRing->cf) 1206 && n_IsUnit(pGetCoeff(strat->S[i]),currRing->cf)) 1207 { 1208 #ifdef KDEBUG 1209 if (TEST_OPT_DEBUG) 1210 { 1211 PrintS("--- product criterion func enterOnePairRing type 1\n"); 1212 PrintS("p:"); 1213 wrp(p); 1214 Print(" strat->S[%d]:", i); 1215 wrp(strat->S[i]); 1216 PrintLn(); 1217 } 1218 #endif 1219 strat->cp++; 1220 pLmDelete(Lp.lcm); 1221 return; 1222 } 1223 assume(!strat->fromT); 1224 /* 1225 *the set B collects the pairs of type (S[j],p) 1226 *suppose (r,p) is in B and (s,p) is the new pair and lcm(s,p) != lcm(r,p) 1227 *if the leading term of s devides lcm(r,p) then (r,p) will be canceled 1228 *if the leading term of r devides lcm(s,p) then (s,p) will not enter B 1229 */ 1230 for(j = strat->Bl;j>=0;j--) 1231 { 1232 compare=pDivCompRing(strat->B[j].lcm,Lp.lcm); 1233 compareCoeff = n_DivComp(pGetCoeff(strat->B[j].lcm), pGetCoeff(Lp.lcm), currRing->cf); 1234 if ((compareCoeff == pDivComp_EQUAL) || (compare == compareCoeff)) 1235 { 1236 if (compare == 1) 1237 { 1238 strat->c3++; 1239 #ifdef KDEBUG 1240 if (TEST_OPT_DEBUG) 1241 { 1242 PrintS("--- chain criterion type 1\n"); 1243 PrintS("strat->B[j]:"); 1244 wrp(strat->B[j].lcm); 1245 PrintS(" Lp.lcm:"); 1246 wrp(Lp.lcm); 1247 PrintLn(); 1248 } 1249 #endif 1250 if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0)) 1251 { 1252 pLmDelete(Lp.lcm); 1253 return; 1254 } 1255 break; 1256 } 1257 else 1258 if (compare == -1) 1259 { 1260 #ifdef KDEBUG 1261 if (TEST_OPT_DEBUG) 1262 { 1263 PrintS("--- chain criterion type 2\n"); 1264 Print("strat->B[%d].lcm:",j); 1265 wrp(strat->B[j].lcm); 1266 PrintS(" Lp.lcm:"); 1267 wrp(Lp.lcm); 1268 PrintLn(); 1269 } 1270 #endif 1271 deleteInL(strat->B,&strat->Bl,j,strat); 1272 strat->c3++; 1273 } 1274 } 1275 if ((compare == pDivComp_EQUAL) && (compareCoeff != 2)) 1276 { 1277 if (compareCoeff == pDivComp_LESS) 1278 { 1279 #ifdef KDEBUG 1280 if (TEST_OPT_DEBUG) 1281 { 1282 PrintS("--- chain criterion type 3\n"); 1283 Print("strat->B[%d].lcm:", j); 1284 wrp(strat->B[j].lcm); 1285 PrintS(" Lp.lcm:"); 1286 wrp(Lp.lcm); 1287 PrintLn(); 1288 } 1289 #endif 1290 strat->c3++; 1291 if ((strat->fromQ==NULL) || (isFromQ==0) || (strat->fromQ[i]==0)) 1292 { 1293 pLmDelete(Lp.lcm); 1294 return; 1295 } 1296 break; 1297 } 1298 else 1299 // Add hint for same LM and LC (later) (TODO Oliver) 1300 // if (compareCoeff == pDivComp_GREATER) 1301 { 1302 #ifdef KDEBUG 1303 if (TEST_OPT_DEBUG) 1304 { 1305 PrintS("--- chain criterion type 4\n"); 1306 Print("strat->B[%d].lcm:", j); 1307 wrp(strat->B[j].lcm); 1308 PrintS(" Lp.lcm:"); 1309 wrp(Lp.lcm); 1310 PrintLn(); 1311 } 1312 #endif 1313 deleteInL(strat->B,&strat->Bl,j,strat); 1314 strat->c3++; 1315 } 1316 } 1317 } 1318 /* 1319 *the pair (S[i],p) enters B if the spoly != 0 1320 */ 1321 /*- compute the short s-polynomial -*/ 1322 if ((strat->S[i]==NULL) || (p==NULL)) 1323 { 1324 #ifdef KDEBUG 1325 if (TEST_OPT_DEBUG) 1326 { 1327 PrintS("--- spoly = NULL\n"); 1328 } 1329 #endif 1330 pLmDelete(Lp.lcm); 1331 return; 1332 } 1333 if ((strat->fromQ!=NULL) && (isFromQ!=0) && (strat->fromQ[i]!=0)) 1334 { 1335 // Is from a previous computed GB, therefore we know that spoly will 1336 // reduce to zero. Oliver. 1337 WarnS("Could we come here? 8738947389"); 1338 Lp.p=NULL; 1339 } 1340 else 1341 { 1342 Lp.p = ksCreateShortSpoly(strat->S[i], p, strat->tailRing); 1343 } 1344 if (Lp.p == NULL) 1345 { 1346 #ifdef KDEBUG 1347 if (TEST_OPT_DEBUG) 1348 { 1349 PrintS("--- spoly = NULL\n"); 1350 } 1351 #endif 1352 /*- the case that the s-poly is 0 -*/ 1353 if (strat->pairtest==NULL) initPairtest(strat); 1354 strat->pairtest[i] = TRUE;/*- hint for spoly(S^[i],p)=0 -*/ 1355 strat->pairtest[strat->sl+1] = TRUE; 1356 /*hint for spoly(S[i],p) == 0 for some i,0 <= i <= sl*/ 1357 /* 1358 *suppose we have (s,r),(r,p),(s,p) and spoly(s,p) == 0 and (r,p) is 1359 *still in B (i.e. lcm(r,p) == lcm(s,p) or the leading term of s does not 1360 *devide lcm(r,p)). In the last case (s,r) can be canceled if the leading 1361 *term of p devides the lcm(s,r) 1362 *(this canceling should be done here because 1363 *the case lcm(s,p) == lcm(s,r) is not covered in chainCrit) 1364 *the first case is handeled in chainCrit 1365 */ 1366 pLmDelete(Lp.lcm); 1367 } 1368 else 1369 { 1370 /*- the pair (S[i],p) enters B -*/ 1371 Lp.p1 = strat->S[i]; 1372 Lp.p2 = p; 1373 1374 pNext(Lp.p) = strat->tail; 1375 1376 if (atR >= 0) 1377 { 1378 Lp.i_r2 = atR; 1379 Lp.i_r1 = strat->S_2_R[i]; 1380 } 1381 strat->initEcartPair(&Lp,strat->S[i],p,strat->ecartS[i],ecart); 1382 l = strat->posInL(strat->L,strat->Ll,&Lp,strat); 1383 enterL(&strat->L,&strat->Ll,&strat->Lmax,Lp,l); 1384 } 1385 #else 1171 1386 assume(i<=strat->sl); 1172 1387 assume(atR >= 0); … … 1312 1527 } 1313 1528 #endif 1529 number s, t; 1314 1530 poly m1, m2, gcd; 1315 1531 #if ADIDEBUG … … 1333 1549 if(pm1 == NULL) 1334 1550 { 1335 pDelete(&sim2); 1336 pDelete(&pm1); 1337 pDelete(&m1); 1338 pDelete(&m2); 1551 //pDelete(&sim2); 1552 //pDelete(&pm1); 1553 //pDelete(&gcd); 1554 //pDelete(&m1); 1555 //pDelete(&m2); 1339 1556 return; 1340 1557 } 1341 1558 else 1342 1559 { 1343 gcd = p _Copy(pm1, strat->tailRing);1560 gcd = pCopy(pm1); 1344 1561 pDelete(&pm1); 1345 1562 pDelete(&sim2); … … 1408 1625 enterL(&strat->B,&strat->Bl,&strat->Bmax,h,posx); 1409 1626 kTest_TS(strat); 1627 #endif 1410 1628 } 1411 1629 … … 1415 1633 */ 1416 1634 1417 BOOLEAN enterOneStrongPoly (int i,poly p,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR = -1)1635 BOOLEAN enterOneStrongPoly (int i,poly p,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR, bool redMoraNF) 1418 1636 { 1419 1637 number d, s, t; 1420 assume(i<=strat->sl);1421 1638 assume(atR >= 0); 1422 poly m1, m2, gcd; 1423 1424 d = n_ExtGcd(pGetCoeff(p), pGetCoeff(strat->S[i]), &s, &t, currRing->cf); 1639 poly m1, m2, gcd,si; 1640 if(!redMoraNF) 1641 { 1642 assume(i<=strat->sl); 1643 si = strat->S[i]; 1644 } 1645 else 1646 { 1647 assume(i<=strat->tl); 1648 si = strat->T[i].p; 1649 } 1650 //printf("\n--------------------------------\n"); 1651 //pWrite(p);pWrite(si); 1652 d = n_ExtGcd(pGetCoeff(p), pGetCoeff(si), &s, &t, currRing->cf); 1425 1653 1426 1654 if (nIsZero(s) || nIsZero(t)) // evtl. durch divBy tests ersetzen … … 1432 1660 } 1433 1661 1434 k_GetStrongLeadTerms(p, s trat->S[i], currRing, m1, m2, gcd, strat->tailRing);1662 k_GetStrongLeadTerms(p, si, currRing, m1, m2, gcd, strat->tailRing); 1435 1663 //p_Test(m1,strat->tailRing); 1436 1664 //p_Test(m2,strat->tailRing); 1437 while (! kCheckStrongCreation(atR, m1, i, m2, strat) ) 1438 { 1439 memset(&(strat->P), 0, sizeof(strat->P)); 1440 kStratChangeTailRing(strat); 1441 strat->P = *(strat->R[atR]); 1442 p_LmFree(m1, strat->tailRing); 1443 p_LmFree(m2, strat->tailRing); 1444 p_LmFree(gcd, currRing); 1445 k_GetStrongLeadTerms(p, strat->S[i], currRing, m1, m2, gcd, strat->tailRing); 1446 } 1665 /*if(!redMoraNF) 1666 { 1667 while (! kCheckStrongCreation(atR, m1, i, m2, strat) ) 1668 { 1669 memset(&(strat->P), 0, sizeof(strat->P)); 1670 kStratChangeTailRing(strat); 1671 strat->P = *(strat->R[atR]); 1672 p_LmFree(m1, strat->tailRing); 1673 p_LmFree(m2, strat->tailRing); 1674 p_LmFree(gcd, currRing); 1675 k_GetStrongLeadTerms(p, si, currRing, m1, m2, gcd, strat->tailRing); 1676 } 1677 }*/ 1447 1678 pSetCoeff0(m1, s); 1448 1679 pSetCoeff0(m2, t); … … 1450 1681 p_Test(m1,strat->tailRing); 1451 1682 p_Test(m2,strat->tailRing); 1452 1683 //printf("\n===================================\n"); 1684 //pWrite(m1);pWrite(m2);pWrite(gcd); 1453 1685 #ifdef KDEBUG 1454 1686 if (TEST_OPT_DEBUG) … … 1465 1697 wrp(p); 1466 1698 Print("\n strat->S[%d]: ", i); 1467 wrp(s trat->S[i]);1699 wrp(si); 1468 1700 PrintS(" ---> "); 1469 1701 } 1470 1702 #endif 1471 1472 pNext(gcd) = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(s trat->S[i]), m2, strat->tailRing), strat->tailRing);1703 1704 pNext(gcd) = p_Add_q(pp_Mult_mm(pNext(p), m1, strat->tailRing), pp_Mult_mm(pNext(si), m2, strat->tailRing), strat->tailRing); 1473 1705 p_LmDelete(m1, strat->tailRing); 1474 1706 p_LmDelete(m2, strat->tailRing); 1475 1476 1707 #ifdef KDEBUG 1477 1708 if (TEST_OPT_DEBUG) … … 1488 1719 h.pCleardenom(); 1489 1720 strat->initEcart(&h); 1490 if (strat->Ll==-1)1491 posx =0;1492 else1493 posx = strat->posInL(strat->L,strat->Ll,&h,strat);1494 1721 h.sev = pGetShortExpVector(h.p); 1495 1722 h.i_r1 = -1;h.i_r2 = -1; 1496 1723 if (currRing!=strat->tailRing) 1497 { 1498 if (h.t_p==NULL) /* may already been set by pLdeg() in initEcart */ 1499 h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing); 1500 } 1501 #if 1 1502 h.p1 = p;h.p2 = strat->S[i]; 1503 #endif 1504 if (atR >= 0) 1724 h.t_p = k_LmInit_currRing_2_tailRing(h.p, strat->tailRing); 1725 if(!redMoraNF) 1726 { 1727 #if 1 1728 h.p1 = p;h.p2 = strat->S[i]; 1729 #endif 1730 if (atR >= 0) 1505 1731 { 1506 1732 h.i_r2 = strat->S_2_R[i]; … … 1512 1738 h.i_r2 = -1; 1513 1739 } 1514 enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx); 1740 if (strat->Ll==-1) 1741 posx =0; 1742 else 1743 posx = strat->posInL(strat->L,strat->Ll,&h,strat); 1744 enterL(&strat->L,&strat->Ll,&strat->Lmax,h,posx); 1745 } 1746 else 1747 { 1748 enterT_strong(h, strat,strat->tl+1); 1749 } 1750 //#if 1 1515 1751 #if ADIDEBUG 1516 printf("\nThis strong poly was added to L:\n");pWrite(h.p);pWrite(h.p1);pWrite(h.p2); printf("\ni_r1 = %i, i_r2 = %i\n",h.i_r1, h.i_r2);pWrite(strat->T[h.i_r1].p);pWrite(strat->T[h.i_r2].p);1752 printf("\nThis strong poly was added to L:\n");pWrite(h.p);pWrite(h.p1);pWrite(h.p2); 1517 1753 #endif 1518 1754 return TRUE; … … 3064 3300 } 3065 3301 #if 1 3302 3066 3303 if (new_pair) 3067 3304 { … … 3747 3984 && ((iCompH<=strat->syzComp)||(strat->syzComp==0))) 3748 3985 { 3749 enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR );3986 enterOneStrongPoly(j,h,ecart,isFromQ,strat, atR, FALSE); 3750 3987 } 3751 3988 } … … 3879 4116 void superenterpairs (poly h,int k,int ecart,int pos,kStrategy strat, int atR) 3880 4117 { 4118 #if ADIDEBUG 4119 PrintS("\nEnter superenterpairs\n"); 4120 int iii = strat->Ll; 4121 printf("\nstrat->tl = %i\n",strat->tl); 4122 #endif 3881 4123 assume (rField_is_Ring(currRing)); 3882 4124 // enter also zero divisor * poly, if this is non zero and of smaller degree 3883 4125 if (!(rField_is_Domain(currRing))) enterExtendedSpoly(h, strat); 4126 #if ADIDEBUG 4127 if(iii==strat->Ll) 4128 { 4129 PrintS("\n enterExtendedSpoly has not changed the list L.\n"); 4130 } 4131 else 4132 { 4133 PrintLn(); 4134 PrintS("\n enterExtendedSpoly changed the list L:\n"); 4135 for(iii=0;iii<=strat->Ll;iii++) 4136 { 4137 Print("\n L[%d]:\n",iii); 4138 PrintS(" ");p_Write(strat->L[iii].p1,strat->tailRing); 4139 PrintS(" ");p_Write(strat->L[iii].p2,strat->tailRing); 4140 PrintS(" ");p_Write(strat->L[iii].p,strat->tailRing); 4141 } 4142 } 4143 printf("\nstrat->tl = %i\n",strat->tl); 4144 iii = strat->Ll; 4145 #endif 3884 4146 initenterpairs(h, k, ecart, 0, strat, atR); 4147 #if ADIDEBUG 4148 if(iii==strat->Ll) 4149 { 4150 PrintS("\n initenterpairs has not changed the list L.\n"); 4151 } 4152 else 4153 { 4154 PrintS("\n initenterpairs changed the list L:\n"); 4155 for(iii=0;iii<=strat->Ll;iii++) 4156 { 4157 Print("\n L[%d]:\n",iii); 4158 PrintS(" ");p_Write(strat->L[iii].p1,strat->tailRing); 4159 PrintS(" ");p_Write(strat->L[iii].p2,strat->tailRing); 4160 PrintS(" ");p_Write(strat->L[iii].p,strat->tailRing); 4161 } 4162 } 4163 printf("\nstrat->tl = %i\n",strat->tl); 4164 iii = strat->Ll; 4165 #endif 3885 4166 initenterstrongPairs(h, k, ecart, 0, strat, atR); 4167 #if ADIDEBUG 4168 if(iii==strat->Ll) 4169 { 4170 PrintS("\n initenterstrongPairs has not changed the list L.\n"); 4171 } 4172 else 4173 { 4174 PrintS("\n initenterstrongPairs changed the list L:\n"); 4175 for(iii=0;iii<=strat->Ll;iii++) 4176 { 4177 Print("\n L[%d]:\n",iii); 4178 PrintS(" ");p_Write(strat->L[iii].p1,strat->tailRing); 4179 PrintS(" ");p_Write(strat->L[iii].p2,strat->tailRing); 4180 PrintS(" ");p_Write(strat->L[iii].p,strat->tailRing); 4181 } 4182 } 4183 printf("\nstrat->tl = %i\n",strat->tl); 4184 PrintS("\nEnd of superenterpairs\n"); 4185 #endif 3886 4186 clearSbatch(h, k, pos, strat); 4187 #if ADIDEBUG 4188 printf("\nstrat->tl = %i\n",strat->tl); 4189 #endif 3887 4190 } 3888 4191 #endif … … 3899 4202 assume (!rField_is_Ring(currRing)); 3900 4203 #endif 4204 #if ADIDEBUG 4205 Print("\n Vor initenterpairs: The new pair list L -- after superenterpairs in loop\n"); 4206 for(int iii=0;iii<=strat->Ll;iii++) 4207 { 4208 printf("\n L[%d]:\n",iii); 4209 PrintS(" ");p_Write(strat->L[iii].p,strat->tailRing); 4210 PrintS(" ");p_Write(strat->L[iii].p1,strat->tailRing); 4211 PrintS(" ");p_Write(strat->L[iii].p2,strat->tailRing); 4212 } 4213 #endif 4214 3901 4215 initenterpairs(h,k,ecart,0,strat, atR); 4216 4217 #if ADIDEBUG 4218 Print("\n Nach initenterpairs: The new pair list L -- after superenterpairs in loop \n"); 4219 for(int iii=0;iii<=strat->Ll;iii++) 4220 { 4221 printf("\n L[%d]:\n",iii); 4222 PrintS(" ");p_Write(strat->L[iii].p,strat->tailRing); 4223 PrintS(" ");p_Write(strat->L[iii].p1,strat->tailRing); 4224 PrintS(" ");p_Write(strat->L[iii].p2,strat->tailRing); 4225 } 4226 #endif 4227 3902 4228 if ( (!strat->fromT) 3903 4229 && ((strat->syzComp==0) … … 3912 4238 j++; 3913 4239 } 3914 } 4240 //Print("end clearS sl=%d\n",strat->sl); 4241 } 4242 // PrintS("end enterpairs\n"); 3915 4243 } 3916 4244 … … 7697 8025 } 7698 8026 #endif 8027 7699 8028 #ifdef HAVE_TAIL_RING 7700 8029 if (currRing!=strat->tailRing) … … 7735 8064 } 7736 8065 strat->T[atT] = (TObject) p; 8066 #if ADIDEBUG 8067 printf("\nenterT: add in position %i\n",atT); 8068 pWrite(p.p); 8069 #endif 8070 //printf("\nenterT: neue hingefÃŒgt: lÀnge = %i, ecart = %i\n",p.length,p.ecart); 7737 8071 7738 8072 if (strat->tailRing != currRing && pNext(p.p) != NULL) … … 7746 8080 assume(p.sev == 0 || pGetShortExpVector(p.p) == p.sev); 7747 8081 strat->sevT[atT] = (p.sev == 0 ? pGetShortExpVector(p.p) : p.sev); 8082 #ifdef HAVE_RINGS 8083 if(rField_is_Ring(currRing) && 8084 rHasLocalOrMixedOrdering(currRing) && !n_IsUnit(p.p->coef, currRing->cf)) 8085 { 8086 #if ADIDEBUG_NF 8087 printf("\nDas ist p:\n");pWrite(p.p); 8088 #endif 8089 for(i=strat->tl;i>=0;i--) 8090 { 8091 if(strat->T[i].ecart <= p.ecart && pLmDivisibleBy(strat->T[i].p,p.p)) 8092 { 8093 #if ADIDEBUG_NF 8094 printf("\nFound one: %i\n",i);pWrite(strat->T[i].p); 8095 #endif 8096 enterOneStrongPoly(i,p.p,p.ecart,0,strat,0 , TRUE); 8097 } 8098 } 8099 } 8100 /* 8101 printf("\nThis is T:\n"); 8102 for(i=strat->tl;i>=0;i--) 8103 { 8104 pWrite(strat->T[i].p); 8105 } 8106 //getchar();*/ 8107 #endif 8108 kTest_T(&(strat->T[atT])); 8109 } 8110 8111 /*2 8112 * puts p to the set T at position atT 8113 */ 8114 void enterT_strong(LObject &p, kStrategy strat, int atT) 8115 { 8116 int i; 8117 8118 pp_Test(p.p, currRing, p.tailRing); 8119 assume(strat->tailRing == p.tailRing); 8120 // redMoraNF complains about this -- but, we don't really 8121 // neeed this so far 8122 assume(p.pLength == 0 || pLength(p.p) == p.pLength || rIsSyzIndexRing(currRing)); // modulo syzring 8123 assume(p.FDeg == p.pFDeg()); 8124 assume(!p.is_normalized || nIsOne(pGetCoeff(p.p))); 8125 8126 #ifdef KDEBUG 8127 // do not put an LObject twice into T: 8128 for(i=strat->tl;i>=0;i--) 8129 { 8130 if (p.p==strat->T[i].p) 8131 { 8132 printf("already in T at pos %d of %d, atT=%d\n",i,strat->tl,atT); 8133 return; 8134 } 8135 } 8136 #endif 8137 8138 #ifdef HAVE_TAIL_RING 8139 if (currRing!=strat->tailRing) 8140 { 8141 p.t_p=p.GetLmTailRing(); 8142 } 8143 #endif 8144 strat->newt = TRUE; 8145 if (atT < 0) 8146 atT = strat->posInT(strat->T, strat->tl, p); 8147 if (strat->tl == strat->tmax-1) 8148 enlargeT(strat->T,strat->R,strat->sevT,strat->tmax,setmaxTinc); 8149 if (atT <= strat->tl) 8150 { 8151 #ifdef ENTER_USE_MEMMOVE 8152 memmove(&(strat->T[atT+1]), &(strat->T[atT]), 8153 (strat->tl-atT+1)*sizeof(TObject)); 8154 memmove(&(strat->sevT[atT+1]), &(strat->sevT[atT]), 8155 (strat->tl-atT+1)*sizeof(unsigned long)); 8156 #endif 8157 for (i=strat->tl+1; i>=atT+1; i--) 8158 { 8159 #ifndef ENTER_USE_MEMMOVE 8160 strat->T[i] = strat->T[i-1]; 8161 strat->sevT[i] = strat->sevT[i-1]; 8162 #endif 8163 strat->R[strat->T[i].i_r] = &(strat->T[i]); 8164 } 8165 } 8166 8167 if ((strat->tailBin != NULL) && (pNext(p.p) != NULL)) 8168 { 8169 pNext(p.p)=p_ShallowCopyDelete(pNext(p.p), 8170 (strat->tailRing != NULL ? 8171 strat->tailRing : currRing), 8172 strat->tailBin); 8173 if (p.t_p != NULL) pNext(p.t_p) = pNext(p.p); 8174 } 8175 strat->T[atT] = (TObject) p; 8176 #if ADIDEBUG 8177 printf("\nenterT_strong: add in position %i\n",atT); 8178 pWrite(p.p); 8179 #endif 8180 //printf("\nenterT_strong: neue hingefÃŒgt: lÀnge = %i, ecart = %i\n",p.length,p.ecart); 8181 8182 if (strat->tailRing != currRing && pNext(p.p) != NULL) 8183 strat->T[atT].max = p_GetMaxExpP(pNext(p.p), strat->tailRing); 8184 else 8185 strat->T[atT].max = NULL; 8186 8187 strat->tl++; 8188 strat->R[strat->tl] = &(strat->T[atT]); 8189 strat->T[atT].i_r = strat->tl; 8190 assume(p.sev == 0 || pGetShortExpVector(p.p) == p.sev); 8191 strat->sevT[atT] = (p.sev == 0 ? pGetShortExpVector(p.p) : p.sev); 8192 #if 0 8193 #ifdef HAVE_RINGS 8194 if(rField_is_Ring(currRing) && !n_IsUnit(p.p->coef, currRing->cf)) 8195 { 8196 #if ADIDEBUG_NF 8197 printf("\nDas ist p:\n");pWrite(p.p); 8198 #endif 8199 for(i=strat->tl;i>=0;i--) 8200 { 8201 if(strat->T[i].ecart <= p.ecart && pLmDivisibleBy(strat->T[i].p,p.p)) 8202 { 8203 #if ADIDEBUG_NF 8204 printf("\nFound one: %i\n",i);pWrite(strat->T[i].p); 8205 #endif 8206 enterOneStrongPoly(i,p.p,p.ecart,0,strat,0 , TRUE); 8207 } 8208 } 8209 } 8210 /* 8211 printf("\nThis is T:\n"); 8212 for(i=strat->tl;i>=0;i--) 8213 { 8214 pWrite(strat->T[i].p); 8215 } 8216 //getchar();*/ 8217 #endif 8218 #endif 7748 8219 kTest_T(&(strat->T[atT])); 7749 8220 } … … 8156 8627 updateS(TRUE,strat); 8157 8628 } 8158 //if (strat->fromQ!=NULL) omFreeSize(strat->fromQ,IDELEMS(strat->Shdl)*sizeof(int));8159 //strat->fromQ=NULL;8629 if (strat->fromQ!=NULL) omFreeSize(strat->fromQ,IDELEMS(strat->Shdl)*sizeof(int)); 8630 strat->fromQ=NULL; 8160 8631 assume(kTest_TS(strat)); 8161 8632 } … … 8790 9261 if((posconst != -1) && (!nIsZero(F->m[posconst]->coef))) 8791 9262 { 8792 //pDelete(&pmon);9263 pmon = pCopy(F->m[posconst]); 8793 9264 idDelete(&F); 8794 //idDelete(&monred);8795 return NULL;9265 idDelete(&monred); 9266 return pmon; 8796 9267 } 8797 9268 int idelemQ = 0; … … 8809 9280 if((posconst != -1) && (!nIsZero(monred->m[posconst]->coef))) 8810 9281 { 9282 pmon = pCopy(monred->m[posconst]); 8811 9283 idDelete(&F); 8812 9284 idDelete(&monred); 8813 return NULL;9285 return pmon; 8814 9286 } 8815 9287 } … … 8835 9307 II->m[i+1] = II->m[i]; 8836 9308 II->m[0] = pOne(); 8837 ideal syz = idSyzygies(II, isNotHomog, NULL); 8838 //idPrint(syz); 9309 ideal syz = idSyzygies(II, isNotHomog, NULL); 8839 9310 poly integer = NULL; 8840 9311 for(int i = IDELEMS(syz)-1;i>=0; i--) … … 8842 9313 if(pGetComp(syz->m[i]) == 1) 8843 9314 { 8844 integer = pHead(syz->m[i]); 8845 pSetComp(integer,0); 8846 if(pIsConstant(integer)) 9315 if(pIsConstant(syz->m[i])) 8847 9316 { 9317 integer = pHead(syz->m[i]); 9318 pSetComp(integer, 0); 8848 9319 break; 8849 9320 } … … 8854 9325 pmon = prMapR(integer, nMap2, QQ_ring, origR); 8855 9326 idDelete(&F); 8856 //idDelete(&monred);8857 //idDelete(&II);8858 //idDelete(&one);8859 //idDelete(&syz);8860 //pDelete(&integer);9327 idDelete(&monred); 9328 idDelete(&II); 9329 idDelete(&one); 9330 idDelete(&syz); 9331 pDelete(&integer); 8861 9332 rDelete(QQ_ring); 8862 9333 return pmon; … … 8933 9404 } 8934 9405 idDelete(&F); 8935 //idDelete(&monred);8936 //idDelete(&II);8937 //idDelete(&one);8938 //pDelete(&pmon);9406 idDelete(&monred); 9407 idDelete(&II); 9408 idDelete(&one); 9409 pDelete(&pmon); 8939 9410 rDelete(QQ_ring); 8940 9411 return NULL; … … 8958 9429 if(pNext(strat->S[i]) == NULL) 8959 9430 { 9431 //pWrite(p); 9432 //pWrite(strat->S[i]); 8960 9433 while(ok == FALSE) 8961 9434 { 8962 9435 if(pLmDivisibleBy(strat->S[i], p)) 8963 9436 { 8964 number c = currRing->cf->cfIntMod(p->coef, strat->S[i]->coef, currRing->cf); 8965 pSetCoeff(p,c); 9437 p->coef = currRing->cf->cfIntMod(p->coef, strat->S[i]->coef, currRing->cf); 8966 9438 } 8967 9439 if(nIsZero(p->coef)) … … 8980 9452 if(pLmDivisibleBy(strat->S[i], pp)) 8981 9453 { 8982 number c = currRing->cf->cfIntMod(pp->coef, strat->S[i]->coef, currRing->cf); 8983 pSetCoeff(pp,c); 9454 pp->coef = currRing->cf->cfIntMod(pp->coef, strat->S[i]->coef, currRing->cf); 8984 9455 if(nIsZero(pp->coef)) 8985 9456 { … … 9028 9499 if(pLmDivisibleBy(strat->S[j], p)) 9029 9500 { 9030 number n = currRing->cf->cfIntMod(p->coef, strat->S[j]->coef, currRing->cf);9031 p SetCoeff(p,n);9501 //nDelete(&(p->coef)); 9502 p->coef = currRing->cf->cfIntMod(p->coef, strat->S[j]->coef, currRing->cf); 9032 9503 } 9033 9504 pp = pNext(p); … … 9042 9513 if(pLmDivisibleBy(strat->S[j], pp)) 9043 9514 { 9044 number n = currRing->cf->cfIntMod(pp->coef, strat->S[j]->coef, currRing->cf);9045 p SetCoeff(pp,n);9515 //nDelete(&(pp->coef)); 9516 pp->coef = currRing->cf->cfIntMod(pp->coef, strat->S[j]->coef, currRing->cf); 9046 9517 if(nIsZero(pp->coef)) 9047 9518 { -
kernel/GBEngine/kutil.h
r033053 rc8523f 503 503 void entersets (LObject h); 504 504 void pairs (); 505 BOOLEAN enterOneStrongPoly (int i,poly p,int /*ecart*/, int /*isFromQ*/,kStrategy strat, int atR = -1, bool redMoraNF = FALSE); 505 506 void message (int i,int* reduc,int* olddeg,kStrategy strat,int red_result); 506 507 void messageStat (int hilbcount,kStrategy strat); … … 529 530 void enterSyz (LObject &p,kStrategy strat, int atT); 530 531 void enterT (LObject &p,kStrategy strat, int atT = -1); 532 void enterT_strong (LObject &p,kStrategy strat, int atT = -1); 531 533 void cancelunit (LObject* p,BOOLEAN inNF=FALSE); 532 534 void HEckeTest (poly pp,kStrategy strat);
Note: See TracChangeset
for help on using the changeset viewer.