41 #define WITH_BUCKET //Use of buckets in EXPERIMENT3 (Product criterion) 42 #define WITH_SCHREYER_ORD 44 #define USE_CHAINCRIT0 46 #define USE_REGULARITY 67 for (i=old_hilbs->
length()+deg-1;i>=deg;i--)
68 (*shifted_old_hilbs)[
i] = (*old_hilbs)[i-deg];
69 for (i=old_hilbs->
length()-1;i>=0;i--)
70 (*old_hilb1)[
i] = (*old_hilbs)[
i]-(*shifted_old_hilbs)[
i];
71 for (i=old_hilbs->
length()+deg-1;i>=old_hilbs->
length();i--)
72 (*old_hilb1)[
i] = -(*shifted_old_hilbs)[
i];
73 for (i=new_hilbs->
length()-1;i>=0;i--)
74 (*new_hilb1)[
i] = (*new_hilbs)[
i];
76 while ((i<biggest_length) && isRegular)
78 isRegular = isRegular && ((*old_hilb1)[
i] == (*new_hilb1)[
i]);
85 delete shifted_old_hilbs;
97 while ((i<syzstr->length) && (!
idIs0(syzstr->
res[i])))
99 Print(
"aktueller hoechster index ist: %d\n",(*syzstr->
Tl)[i]);
100 Print(
"der %d-te modul ist:\n",i);
102 PrintS(
"Seine Darstellung:\n");
118 ideal current_ideal,current_repr;
125 neg_gen =
pNeg(neg_gen);
139 current_ideal = syzstr->
res[index-1];
141 current_tl = (*syzstr->
Tl)[index-1];
145 current_ideal = old_ideal;
146 current_repr = old_repr;
149 if (!
idIs0(current_ideal))
154 current_ideal->rank+current_tl);
156 current_ideal->rank);
162 while ((start>0) && (syzstr->
res[index]->m[start-1]==
NULL)) start--;
173 if (
idIs0(totake[index]))
176 current_ideal->rank+current_tl);
181 start_ttk =
IDELEMS(totake[index]);
182 while ((start_ttk>0) && (totake[index]->
m[start_ttk-1]==
NULL)) start_ttk--;
189 totake[index]->
m[j] =
NULL;
195 if (current_ideal->m[
i]!=
NULL)
205 if ((*syzstr->
Tl)[index]!=0)
211 if (totake[index-1]->
m[
i]!=
NULL)
213 if ((index==1) && ((
i==
IDELEMS(current_ideal) ||
214 (totake[index-1]->m[
i+1]==
NULL))))
break;
215 totake[
index]->m[
i+start_ttk] =
221 totake[
index]->m[i+start_ttk] =
pAdd(totake[index]->
m[i+start_ttk],pp);
225 (*syzstr->
Tl)[index] += current_tl;
248 if (resPairs[i].p1!=
NULL)
249 assume(resPairs[i].p1==old_generators->m[resPairs[i].ind1]);
251 assume(resPairs[i].
p2==old_generators->m[resPairs[i].ind2]);
264 int length=syzstr->
length;
265 int syzIndex=length-1,
i,
j;
269 while ((syzIndex!=0) && (res[syzIndex]==
NULL)) syzIndex--;
272 for(i=0;i<
IDELEMS(res[syzIndex]);i++)
274 #ifdef USE_REGULARITY 281 p = res[syzIndex]->m[
i];
293 PrintS(
"error in the resolvent\n");
309 int index,ideal new_generators,ideal new_repr,
int crit_comp)
311 if (
idIs0(new_generators))
return;
312 ideal old_generators=syzstr->
res[
index];
314 int i=0,
j,
k,kk,og_elem=0,og_idel=
IDELEMS(old_generators),
l=*l_pairs,jj,ll,j1;
322 while ((og_elem<og_idel) && (old_generators->m[og_elem]!=
NULL))
324 if ((index>0) && (
pGetComp(old_generators->m[og_elem])<=crit_comp))
328 while ((
l>0) && ((*resPairs)[
l-1].
lcm==
NULL))
l--;
329 while ((i<
IDELEMS(new_generators)) && (new_generators->m[i]!=
NULL))
332 if (
IDELEMS(old_generators)==og_elem)
340 kk =
pGetComp(new_generators->m[i]);
342 while ((
j<og_elem) && (old_generators->m[
j]!=
NULL) &&
344 while ((
j<og_elem) && (old_generators->m[
j]!=
NULL) &&
346 for (jj=og_elem;jj>
j;jj--)
348 old_generators->m[jj] = old_generators->m[jj-1];
349 old_repr->m[jj] = old_repr->m[jj-1];
351 old_generators->m[
j] = new_generators->m[
i];
352 new_generators->m[
i] =
NULL;
353 old_repr->m[
j] = new_repr->m[
i];
354 new_repr->m[
i] =
NULL;
356 for (jj=0;jj<*l_pairs;jj++)
360 if ((*resPairs)[jj].ind1>=j) (*resPairs)[jj].ind1++;
361 if ((*resPairs)[jj].
ind2>=j) (*resPairs)[jj].ind2++;
365 for (jj=og_ini;jj<og_elem;jj++)
367 if ((j!=jj) && (
pGetComp(old_generators->m[jj])==
pGetComp(old_generators->m[j])))
370 pLcm(old_generators->m[jj],old_generators->m[j],p);
387 #ifdef USE_CHAINCRIT0 392 p1 =
pDivide(p,old_generators->m[jj]);
393 p2 =
pDivide(prs[j1],old_generators->m[j1]);
398 while ((ti<
l) && (((*resPairs)[ti].ind1!=j1)|| ((*resPairs)[ti].
ind2!=jj))) ti++;
418 for (jj=og_ini;jj<og_elem;jj++)
425 for (ll=0;ll<*l_pairs;ll++)
427 temp[ll].p = (*resPairs)[ll].p;
428 temp[ll].p1 = (*resPairs)[ll].p1;
429 temp[ll].p2 = (*resPairs)[ll].p2;
430 temp[ll].syz = (*resPairs)[ll].syz;
431 temp[ll].lcm = (*resPairs)[ll].lcm;
432 temp[ll].ind1 = (*resPairs)[ll].ind1;
433 temp[ll].ind2 = (*resPairs)[ll].ind2;
434 temp[ll].syzind = (*resPairs)[ll].syzind;
435 temp[ll].order = (*resPairs)[ll].order;
436 temp[ll].isNotMinimal = (*resPairs)[ll].isNotMinimal;
445 tso.p1 = old_generators->m[jj];
446 tso.p2 = old_generators->m[
j];
450 tso.isNotMinimal =
NULL;
455 Print(
"erzeuge Paar im Modul %d,%d mit: \n",index,tso.order);
516 int * gen_length,
int * secgen_length,
int * tored_length)
518 int i=
IDELEMS(red)-1,num_mon,num_tail;
522 while ((i>0) && (red->m[i-1]==
NULL)) i--;
529 num_tail = *tored_length-1;
565 *tored_length = num_mon+num_tail;
586 if ((j>=
i) || (p==
NULL))
break;
608 int * gen_length,
int* orp_l,
int * tored_l,
int * syzred_l)
610 int num_mon,num_tail,syz_l;
620 num_tail = *tored_l-1;
637 *tored_l = num_mon+num_tail;
650 ideal new_repr,
int * ogm_l,
int * orp_l)
652 SObject tso = resPairs[itso];
654 ideal old_generators=syzstr->
res[
index];
656 int og_idel=
IDELEMS(old_generators),ng_place=
IDELEMS(new_generators);
666 int syz_place=
IDELEMS(syzygies);
668 while ((syz_place>0) && (syzygies->m[syz_place-1]==
NULL)) syz_place--;
669 while ((ng_place>0) && (new_generators->m[ng_place-1]==
NULL)) ng_place--;
670 while ((og_idel>0) && (old_generators->m[og_idel-1]==
NULL)) og_idel--;
671 assume (tso.ind1<og_idel);
672 assume (tso.ind2<og_idel);
673 assume (tso.ind1!=tso.ind2);
674 assume (tso.p1 == old_generators->m[tso.ind1]);
675 assume (tso.p2 == old_generators->m[tso.ind2]);
676 tso.p1 = old_generators->m[tso.ind1];
677 tso.p2 = old_generators->m[tso.ind2];
678 if ((tso.p1!=
NULL) && (tso.p2!=
NULL))
686 toReplace = tso.ind1+1;
688 toReplace = tso.ind2+1;
692 if ((index==0) && (old_generators->rank==1) &&
704 pp =
pCopy(old_repr->m[tso.ind2]);
714 pp =
pCopy(old_repr->m[tso.ind1]);
724 tso.syz =
pMult(p,
pCopy(old_repr->m[tso.ind2]));
737 tso.syz =
pCopy(old_repr->m[tso.ind1]);
746 p =
pCopy(old_repr->m[tso.ind2]);
753 tso.syz =
pAdd(p,tso.syz);
765 Print(
"reduziere Paar im Module %d mit: \n",index);
773 if ((tso.p!=
NULL) && (!deleteP))
784 while ((j<ng_place) && (!
pDivisibleBy(new_generators->m[j],p))) j++;
785 if (j>=ng_place)
break;
841 PrintS(
"Shit happens!\n");
844 Print(
"erhalte Paar im Module %d mit: \n",index);
852 pDelete(&old_generators->m[toReplace-1]);
853 pDelete(&old_repr->m[toReplace-1]);
854 for (i=toReplace-1;i<og_idel-1;i++)
856 old_generators->m[
i] = old_generators->m[i+1];
857 old_repr->m[
i] = old_repr->m[i+1];
859 old_generators->m[og_idel-1] =
NULL;
860 old_repr->m[og_idel-1] =
NULL;
861 for (i=itso+1;i<
l;i++)
865 if ((resPairs[i].ind1==toReplace-1)||(resPairs[i].
ind2==toReplace-1))
869 if (resPairs[i].ind1>=toReplace)
870 (resPairs[
i].ind1)--;
871 if (resPairs[i].
ind2>=toReplace)
872 (resPairs[
i].ind2)--;
882 if (ng_place>=
IDELEMS(new_generators))
896 new_generators->m[ng_place] = tso.p;
898 new_repr->m[ng_place] = tso.syz;
912 else if (
pGetComp(tso.syz)<=crit_comp)
918 if (syz_place>=
IDELEMS(syzygies))
923 syzygies->m[syz_place] = tso.syz;
925 pNorm(syzygies->m[syz_place]);
928 resPairs[itso] = tso;
937 ideal new_generators,ideal new_repr,
int crit_comp,
syStrategy syzstr,
941 int i,
j,actdeg=resPairs[0].order;
946 for (j=
IDELEMS(syzstr->
res[index])-1;j>=0;j--)
948 if (syzstr->
res[index]->m[j]!=
NULL)
960 Print(
"(%d,%d)",index,resPairs[0].order);
961 while (resPairs[i].order==actdeg)
964 redOnePair(resPairs,i,l_pairs,syzygies,crit_comp,syzstr,index,
965 new_generators, new_repr,ogm_l,orp_l);
972 if (!
idIs0(new_generators))
974 else if (resPairs[0].
lcm==
NULL)
981 actdeg = resPairs[0].order;
999 int index,
int next_comp)
1002 int l_pairs=2*og_idel;
1003 ideal syzygies=
idInit(16,syzstr->
res[index]->rank+1);
1004 if ((
idIs0(new_generators)) || (new_generators->m[0]==
NULL))
1006 WerrorS(
"Hier ist was faul!\n");
1013 new_generators,new_repr,next_comp);
1014 if (
redPairs(resPairs,l_pairs,syzygies, new_generators,new_repr,
1015 next_comp,syzstr,index))
break;
1025 int * g_l,
int * p_l,
int crit_comp)
1035 if ((add_generators->m[j]!=
NULL) && (
pDivisibleBy(add_generators->m[j],p)))
1053 int index,ideal add_generators,ideal ,ideal ,
1054 ideal ,
int ,
int* first_new)
1056 int i=*first_new,
l=*l_pairs,
j,ll,j1,add_idel=
IDELEMS(add_generators);
1057 ideal
pairs=
idInit(add_idel,add_generators->rank);
1063 while ((l>0) && ((*resPairs)[l-1].
lcm==
NULL)) l--;
1064 while ((i<add_idel) && (add_generators->m[i]!=
NULL))
1071 pLcm(add_generators->m[j],add_generators->m[i],p);
1088 #ifdef USE_CHAINCRIT 1093 p1 =
pDivide(p,add_generators->m[j]);
1094 p2 =
pDivide(prs[j1],add_generators->m[j1]);
1099 while ((ti<l) && (((*resPairs)[ti].ind1!=j1)|| ((*resPairs)[ti].
ind2!=j))) ti++;
1126 for (ll=0;ll<*l_pairs;ll++)
1128 temp[ll].p = (*resPairs)[ll].p;
1129 temp[ll].p1 = (*resPairs)[ll].p1;
1130 temp[ll].p2 = (*resPairs)[ll].p2;
1131 temp[ll].syz = (*resPairs)[ll].syz;
1132 temp[ll].lcm = (*resPairs)[ll].lcm;
1133 temp[ll].ind1 = (*resPairs)[ll].ind1;
1134 temp[ll].ind2 = (*resPairs)[ll].ind2;
1135 temp[ll].syzind = (*resPairs)[ll].syzind;
1136 temp[ll].order = (*resPairs)[ll].order;
1137 temp[ll].isNotMinimal = (*resPairs)[ll].isNotMinimal;
1146 tso.p1 = add_generators->m[
j];
1147 tso.p2 = add_generators->m[
i];
1151 tso.isNotMinimal =
NULL;
1156 Print(
"erzeuge Paar im Modul %d,%d mit: \n",index,tso.order);
1179 ideal new_generators, ideal new_repr,
int * next_place_add,
int ** g_l,
1183 syStrategy syzstr,
int ,ideal add_generators, ideal add_repr,
1184 ideal new_generators, ideal new_repr,
int * next_place_add,
int ** g_l,
1188 SObject tso = resPairs[itso];
1190 int ng_place=
IDELEMS(new_generators);
1198 assume (tso.ind1<*next_place_add);
1199 assume (tso.ind2<*next_place_add);
1200 assume (tso.ind1!=tso.ind2);
1201 assume (tso.p1 == add_generators->m[tso.ind1]);
1202 assume (tso.p2 == add_generators->m[tso.ind2]);
1203 tso.p1 = add_generators->m[tso.ind1];
1204 tso.p2 = add_generators->m[tso.ind2];
1205 if ((tso.p1!=
NULL) && (tso.p2!=
NULL))
1209 #ifdef USE_PROD_CRIT 1217 poly pp1,pp2,tp1,tp2;
1218 poly sp1=
pCopy(add_repr->m[tso.ind1]),sp2=
pCopy(add_repr->m[tso.ind2]);
1249 sp1 =
pMult(p2,sp1);
1250 sp2 =
pMult(p1,sp2);
1251 tso.p =
pSub(tp1,tp2);
1252 tso.syz =
pSub(sp1,sp2);
1260 tso.syz =
pCopy(add_repr->m[tso.ind1]);
1269 p =
pCopy(add_repr->m[tso.ind2]);
1276 tso.syz =
pAdd(p,tso.syz);
1280 Print(
"reduziere Paar im Module %d mit: \n",
index);
1295 if (j>=*next_place_add)
break;
1315 PrintS(
"Shit happens!\n");
1318 Print(
"erhalte Paar im Module %d mit: \n",
index);
1336 if (*next_place_add>=
IDELEMS(add_generators))
1341 (
IDELEMS(add_generators)+16)*
sizeof(
int));
1342 IDELEMS(add_generators) += 16;
1346 add_generators->m[*next_place_add] = tso.p;
1347 add_repr->m[*next_place_add] = tso.syz;
1348 (*g_l)[*next_place_add] = tso.length;
1349 (*next_place_add)++;
1353 while ((ng_place>0) && (new_generators->m[ng_place-1]==
NULL) &&
1354 (new_repr->m[ng_place-1]==
NULL)) ng_place--;
1355 if (ng_place>=
IDELEMS(new_generators))
1358 IDELEMS(new_generators) += 16;
1362 new_generators->m[ng_place] = tso.p;
1363 new_repr->m[ng_place] = tso.syz;
1367 resPairs[itso] = tso;
1375 int index,ideal add_generators,ideal add_repr,ideal new_generators,
1376 ideal new_repr,
int crit_comp,
int * red_deg,
int * next_place_add,
int **g_l,
1384 Print(
"(%d,%d)",index,resPairs[0].order);
1385 while ((i<l_pairs) && (resPairs[i].order==*red_deg))
1390 deg_soc = totake[index-1]->m[
pGetComp(resPairs[i].p1)-1];
1391 redOnePairHIndex(resPairs,i,crit_comp,syzstr,index, add_generators,add_repr,
1392 new_generators, new_repr,next_place_add,g_l,deg_soc);
1399 *red_deg = resPairs[0].order;
1412 ideal new_generators, ideal new_repr, ideal add_generators,
1416 int i=0,
j,next_new_el;
1417 int idel_temp=
IDELEMS(temp_generators);
1419 int p_length,red_deg,l_pairs=
IDELEMS(add_generators);
1428 if (syzstr->
res[index]->m[
j]!=
NULL)
1432 next_place_add =
IDELEMS(add_generators);
1433 while ((next_place_add>0) && (add_generators->m[next_place_add-1]==
NULL))
1436 next_new_el = next_place_add;
1438 while ((i<idel_temp) && (temp_generators->m[i]!=
NULL))
1441 #ifdef USE_REGULARITY 1446 while ((i<idel_temp) && (temp_generators->m[i]!=
NULL))
1448 pDelete(&temp_generators->m[i]);
1455 while ((i<idel_temp) && (
p_FDeg(temp_generators->m[i],
currRing)==next_deg))
1457 next_p = temp_generators->m[
i];
1458 temp_generators->m[
i] =
NULL;
1459 next_p =
normalize(next_p,add_generators,syzstr,gen_length,&p_length,
1470 next_p =
syRedTailSyz(next_p,add_generators,syzstr->
res[index],crit_comp,syzstr,
1471 gen_length,secgen_length,&p_length);
1474 if (next_place_add>=
IDELEMS(add_generators))
1479 (
IDELEMS(add_generators)+16)*
sizeof(
int));
1480 IDELEMS(add_generators) += 16;
1483 add_generators->m[next_place_add] = next_p;
1484 if (totake[index]==
NULL)
1486 if ((*syzstr->
Tl)[index]==
IDELEMS(totake[index]))
1489 (*syzstr->
Tl)[index]+16-
IDELEMS(totake[index]));
1490 for (
j=
IDELEMS(totake[index]);
j<(*syzstr->
Tl)[index]+16;
j++)
1491 totake[index]->
m[
j] =
NULL;
1492 IDELEMS(totake[index]) = (*syzstr->
Tl)[index]+16;
1495 totake[
index]->m[(*syzstr->
Tl)[index]] =
pCopy(next_p);
1497 totake[
index]->m[(*syzstr->
Tl)[index]] =
pHead(next_p);
1500 #ifdef WITH_SCHREYER_ORD 1501 add_repr->m[next_place_add] =
pHead(add_generators->m[next_place_add]);
1503 add_repr->m[next_place_add] =
pOne();
1505 ((*syzstr->
Tl)[index])++;
1506 pSetComp(add_repr->m[next_place_add],(*syzstr->
Tl)[index]);
1508 gen_length[next_place_add] = p_length;
1519 if ((next_place_add>next_new_el) || (next_deg<0))
1523 while (pairs_left && ((next_deg<0) || (red_deg<= next_deg)))
1526 add_repr,new_generators,new_repr,crit_comp,&next_new_el);
1528 add_repr,new_generators,new_repr,crit_comp,&red_deg,&next_place_add,&gen_length,
1545 ideal old_generators= syzstr->
res[
index];
1547 int i,
j=0,ii=
IDELEMS(old_generators)-1,dummy;
1552 for (i=0;i<
IDELEMS(old_generators);i++)
1554 if (old_generators->m[i]!=
NULL)
1556 g_l[
i] =
pLength(old_generators->m[i]);
1559 for (i=
IDELEMS(new_generators)-1;i>=0;i--)
1561 if (new_generators->m[i]!=
NULL)
1564 pLength(new_generators->m[i]));
1570 if ((j>=ii) || (p==
NULL))
break;
1571 if ((old_generators->m[j]!=
NULL) &&
1589 for (j=
IDELEMS(new_repr)-1;j>=0;j--)
1591 result->m[
j] = new_repr->m[
j];
1593 pNorm(result->m[j]);
1594 new_repr->m[
j] =
NULL;
1606 ideal temp_generators =
idInit(
IDELEMS(new_generators),new_generators->rank);
1608 ideal add_generators =
idInit(
IDELEMS(new_generators),new_generators->rank);
1611 int j,jj,
k,deg_p,idel_temp=
IDELEMS(temp_generators);
1614 for (j=
IDELEMS(new_generators)-1;j>=0;j--)
1616 if (new_generators->m[j]!=
NULL)
1618 p = new_generators->m[
j];
1619 new_generators->m[
j] =
NULL;
1627 if (deg_p<min_deg) min_deg = deg_p;
1630 while ((k<idel_temp) && (temp_generators->m[k]!=
NULL) &&
1632 for (jj=idel_temp-1;jj>
k;jj--)
1634 temp_generators->m[jj] = temp_generators->m[jj-1];
1636 temp_generators->m[
k] =
p;
1641 add_generators,add_repr,syzstr,index,next_comp,totake);
1643 while ((j>0) && (syzstr->
res[index]->m[j-1]==
NULL)) j--;
1645 while ((jj>0) && (add_generators->m[jj-1]==
NULL)) jj--;
1657 syzstr->
res[
index]->m[j+
k] = add_generators->m[
k];
1659 add_generators->m[
k] =
NULL;
1660 add_repr->m[
k] =
NULL;
1696 int ng_idel=
IDELEMS(new_generators);
1697 ideal new_repr =
idInit(ng_idel, crit_comp+ng_idel);
1707 for (i=0;i<ng_idel;i++)
1709 if (new_generators->m[i]!=
NULL)
1714 if (totake[index]==
NULL)
1716 if ((*syzstr->
Tl)[index]>=
IDELEMS(totake[index]))
1719 (*syzstr->
Tl)[index]+16-
IDELEMS(totake[index]));
1720 for (j=
IDELEMS(totake[index]);j<(*syzstr->
Tl)[index]+16;j++)
1721 totake[index]->
m[j] =
NULL;
1722 IDELEMS(totake[index]) = (*syzstr->
Tl)[index]+16;
1725 totake[
index]->m[(*syzstr->
Tl)[index]] =
pCopy(new_generators->m[i]);
1727 totake[
index]->m[(*syzstr->
Tl)[index]] =
pHead(new_generators->m[i]);
1729 #ifdef WITH_SCHREYER_ORD 1730 new_repr->m[
i] =
pHead(new_generators->m[i]);
1732 new_repr->m[
i] =
pOne();
1734 ((*syzstr->
Tl)[index])++;
1735 pSetComp(new_repr->m[i],(*syzstr->
Tl)[index]);
1741 PrintS(
"Add new generators:\n");
1743 PrintS(
"with representaions:\n");
1746 result =
kosz_std(new_generators,new_repr,syzstr,index,crit_comp);
1750 result =
kosz_ext(new_generators,new_repr,syzstr,index,crit_comp,totake);
1764 int crit_comp,t_comp,next_deg,old_tl;
1765 ideal temp=
NULL,old_ideal,old_repr;
1780 if (origR!=syzstr->
syRing)
1790 if (temp->m[0]!=
NULL)
1795 for (j=
IDELEMS(temp)-2;j>=0;j--)
1798 if (jj>maxdeg) maxdeg = jj;
1800 while (!
idIs0(temp))
1803 for (j=
IDELEMS(temp)-1;j>=0;j--)
1805 if (temp->m[j]!=
NULL)
1815 temp1->m[
k] = temp->m[
j];
1826 #ifdef USE_REGULARITY 1827 int last_generator=
IDELEMS(temp)-1;
1828 while ((last_generator>=0) && (temp->m[last_generator]==
NULL))
1834 syzstr->
Tl =
new intvec(*length+1);
1838 ideal temp_gens,old_std;
1840 if (rk_arg>1) syzstr->
res[0]->rank = rk_arg;
1846 if (temp->m[i]!=
NULL)
1848 new_generators->m[0] =
kNF(syzstr->
res[0],
currRing->qideal,temp->m[i]);
1850 pNorm(new_generators->m[0]);
1852 next_gen =
pCopy(new_generators->m[0]);
1854 if (!
idIs0(new_generators))
1857 while (
index<=*length)
1863 old_tl = (*syzstr->
Tl)[0];
1866 t_comp = (*syzstr->
Tl)[
index];
1867 if (
index==0) crit_comp = t_comp;
1877 #ifdef USE_REGULARITY 1878 if ((
index==0) && (!isRegular) && (i==last_generator))
1910 PrintS(
"\n not regular\n");
1921 new_generators = temp_gens;
1925 if (
idIs0(new_generators))
break;
1928 if (!
idIs0(new_generators))
1930 for (j=0;j<
IDELEMS(new_generators);j++)
1932 if (new_generators->m[j]!=
NULL)
1934 pDelete(&new_generators->m[j]);
1935 new_generators->m[
j] =
NULL;
1953 Print(
"The %d-th syzygy-module is now:\n",
index);
1977 if (!
idIs0(totake[index]))
1979 for(i=0;i<
IDELEMS(totake[index]);i++)
1981 if (totake[index]->
m[i]!=
NULL)
1995 PrintS(
"Da ist was faul!!!\n");
1996 Print(
"Aber: Regularitaet %d, Grad %ld\n",
2016 if (origR!=syzstr->
syRing)
static void redOnePair(SSet resPairs, int itso, int l, ideal syzygies, int crit_comp, syStrategy syzstr, int index, ideal new_generators, ideal new_repr, int *ogm_l, int *orp_l)
#define pSetmComp(p)
TODO:
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
#define omRealloc0Size(addr, o_size, size)
static FORCE_INLINE number n_Gcd(number a, number b, const coeffs r)
in Z: return the gcd of 'a' and 'b' in Z/nZ, Z/2^kZ: computed as in the case Z in Z/pZ...
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
static ideal syAppendSyz(ideal new_generators, syStrategy syzstr, int index, int crit_comp, resolvente totake)
static void updatePairsHIndex(SSet *resPairs, int *l_pairs, syStrategy, int index, ideal add_generators, ideal, ideal, ideal, int, int *first_new)
#define idDelete(H)
delete an ideal
Compatiblity layer for legacy polynomial operations (over currRing)
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
void syReorder_Kosz(syStrategy syzstr)
static ideal kosz_ext(ideal new_generators, ideal new_repr, syStrategy syzstr, int index, int next_comp, resolvente totake)
static void syCreateRegularExtension(syStrategy syzstr, ideal old_ideal, ideal old_repr, int old_tl, poly next_generator, resolvente totake)
#define omFreeSize(addr, size)
const poly kBucketGetLm(kBucket_pt bucket)
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
void WerrorS(const char *s)
static void updatePairs(SSet *resPairs, int *l_pairs, syStrategy syzstr, int index, ideal new_generators, ideal new_repr, int crit_comp)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
#define pGetComp(p)
Component.
intvec * hHstdSeries(ideal S, intvec *modulweight, intvec *wdegree, ideal Q, ring tailRing)
static ideal kosz_std(ideal new_generators, ideal new_repr, syStrategy syzstr, int index, int next_comp)
void idShow(const ideal id, const ring lmRing, const ring tailRing, const int debugPrint)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
poly initial(const poly p, const ring r, const gfan::ZVector &w)
Returns the initial form of p with respect to w.
void id_Shift(ideal M, int s, const ring r)
void syEnterPair(syStrategy syzstr, SObject *so, int *sPlength, int index)
void kBucketDestroy(kBucket_pt *bucket_pt)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
static BOOLEAN redPairs(SSet resPairs, int l_pairs, ideal syzygies, ideal new_generators, ideal new_repr, int crit_comp, syStrategy syzstr, int index)
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
static void redOnePairHIndex(SSet resPairs, int itso, int crit_comp, syStrategy syzstr, int, ideal add_generators, ideal add_repr, ideal new_generators, ideal new_repr, int *next_place_add, int **g_l, poly deg_soc)
ring rAssure_dp_C(const ring r)
static BOOLEAN reducePairsHIndex(SSet resPairs, int l_pairs, syStrategy syzstr, int index, ideal add_generators, ideal add_repr, ideal new_generators, ideal new_repr, int crit_comp, int *red_deg, int *next_place_add, int **g_l, resolvente totake)
static long p_FDeg(const poly p, const ring r)
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
static int si_max(const int a, const int b)
void PrintS(const char *s)
resolvente sySchreyerResolvente(ideal arg, int maxlength, int *length, BOOLEAN isMonomial=FALSE, BOOLEAN notReplace=FALSE)
static unsigned pLength(poly a)
void kBucket_Minus_m_Mult_p(kBucket_pt bucket, poly m, poly p, int *l, poly spNoether)
Bpoly == Bpoly - m*p; where m is a monom Does not destroy p and m assume (*l <= 0 || pLength(p) == *l...
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static int index(p_Length length, p_Ord ord)
void sySPRedSyz_Kosz(syStrategy syzstr, poly redWith, poly syz, poly q=NULL, int l_syz=-1)
void rChangeCurrRing(ring r)
void p_Shift(poly *p, int i, const ring r)
shifts components of the vector p by i
static poly syRedTailSyz(poly tored, ideal red, ideal sec_red, int crit_comp, syStrategy syzstr, int *gen_length, int *secgen_length, int *tored_length)
ideal idInit(int idsize, int rank)
initialise an ideal / module
static void syTestPairs(SSet resPairs, int length, ideal old_generators)
#define pDivisibleBy(a, b)
returns TRUE, if leading monom of a divides leading monom of b i.e., if there exists a expvector c > ...
static BOOLEAN syIsRegular(ideal old_ideal, ideal new_ideal, int deg)
static void procedeNextGenerators(ideal temp_generators, ideal, ideal new_generators, ideal new_repr, ideal add_generators, ideal add_repr, syStrategy syzstr, int index, int crit_comp, resolvente totake)
void pEnlargeSet(poly **p, int l, int increment)
void rDelete(ring r)
unconditionally deletes fields in r
ring rAssure_C_dp(const ring r)
static BOOLEAN syRedSyzPair(syStrategy syzstr, int index, int *g_l, int *orp_l)
void pNorm(poly p, const ring R=currRing)
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
void syInitializePair(SObject *so)
static BOOLEAN syRedSyz(kBucket_pt bucket, ideal red, int crit_comp, int *g_l)
syStrategy syKosz(ideal arg, int *length)
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
static ideal normalizeOldPart(ideal new_generators, ideal new_repr, syStrategy syzstr, int index, int)
void syDeletePair(SObject *so)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
#define pCopy(p)
return a copy of the poly