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;
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");
113 ideal old_repr,
int old_tl, poly next_generator,
resolvente totake)
116 poly gen=
pCopy(next_generator),
p;
117 poly neg_gen=
pCopy(next_generator);
118 ideal current_ideal,current_repr;
120 poly w_gen=
pHead(next_generator);
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]);
250 if (resPairs[i].p2!=
NULL)
251 assume(resPairs[i].p2==old_generators->m[resPairs[i].ind2]);
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 =
pMDivide(p,old_generators->m[jj]);
393 p2 =
pMDivide(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;
588 if ((j>=
i) || (p==
NULL))
break;
611 int * gen_length,
int* orp_l,
int * tored_l,
int * syzred_l)
613 int num_mon,num_tail,syz_l;
623 num_tail = *tored_l-1;
627 dummy = syRedSyzPair(syzstr,
index,gen_length,orp_l);
640 *tored_l = num_mon+num_tail;
653 ideal new_repr,
int * ogm_l,
int * orp_l)
655 SObject tso = resPairs[itso];
657 ideal old_generators=syzstr->
res[
index];
659 int og_idel=
IDELEMS(old_generators),ng_place=
IDELEMS(new_generators);
669 int syz_place=
IDELEMS(syzygies);
671 while ((syz_place>0) && (syzygies->m[syz_place-1]==
NULL)) syz_place--;
672 while ((ng_place>0) && (new_generators->m[ng_place-1]==
NULL)) ng_place--;
673 while ((og_idel>0) && (old_generators->m[og_idel-1]==
NULL)) og_idel--;
674 assume (tso.ind1<og_idel);
675 assume (tso.ind2<og_idel);
676 assume (tso.ind1!=tso.ind2);
677 assume (tso.p1 == old_generators->m[tso.ind1]);
678 assume (tso.p2 == old_generators->m[tso.ind2]);
679 tso.p1 = old_generators->m[tso.ind1];
680 tso.p2 = old_generators->m[tso.ind2];
681 if ((tso.p1!=
NULL) && (tso.p2!=
NULL))
689 toReplace = tso.ind1+1;
691 toReplace = tso.ind2+1;
695 if ((index==0) && (old_generators->rank==1) &&
707 pp =
pCopy(old_repr->m[tso.ind2]);
717 pp =
pCopy(old_repr->m[tso.ind1]);
727 tso.syz =
pMult(p,
pCopy(old_repr->m[tso.ind2]));
740 tso.syz =
pCopy(old_repr->m[tso.ind1]);
749 p =
pCopy(old_repr->m[tso.ind2]);
756 tso.syz =
pAdd(p,tso.syz);
768 Print(
"reduziere Paar im Module %d mit: \n",index);
776 if ((tso.p!=
NULL) && (!deleteP))
787 while ((j<ng_place) && (!
pDivisibleBy(new_generators->m[j],p))) j++;
788 if (j>=ng_place)
break;
844 PrintS(
"Shit happens!\n");
847 Print(
"erhalte Paar im Module %d mit: \n",index);
855 pDelete(&old_generators->m[toReplace-1]);
856 pDelete(&old_repr->m[toReplace-1]);
857 for (i=toReplace-1;i<og_idel-1;i++)
859 old_generators->m[
i] = old_generators->m[i+1];
860 old_repr->m[
i] = old_repr->m[i+1];
862 old_generators->m[og_idel-1] =
NULL;
863 old_repr->m[og_idel-1] =
NULL;
864 for (i=itso+1;i<
l;i++)
868 if ((resPairs[i].ind1==toReplace-1)||(resPairs[i].
ind2==toReplace-1))
872 if (resPairs[i].ind1>=toReplace)
873 (resPairs[
i].ind1)--;
874 if (resPairs[i].
ind2>=toReplace)
875 (resPairs[
i].ind2)--;
885 if (ng_place>=
IDELEMS(new_generators))
899 new_generators->m[ng_place] = tso.p;
901 new_repr->m[ng_place] = tso.syz;
915 else if (
pGetComp(tso.syz)<=crit_comp)
921 if (syz_place>=
IDELEMS(syzygies))
926 syzygies->m[syz_place] = tso.syz;
928 pNorm(syzygies->m[syz_place]);
931 resPairs[itso] = tso;
940 ideal new_generators,ideal new_repr,
int crit_comp,
syStrategy syzstr,
944 int i,
j,actdeg=resPairs[0].order;
949 for (j=
IDELEMS(syzstr->
res[index])-1;j>=0;j--)
951 if (syzstr->
res[index]->m[j]!=
NULL)
963 Print(
"(%d,%d)",index,resPairs[0].order);
964 while (resPairs[i].order==actdeg)
967 redOnePair(resPairs,i,l_pairs,syzygies,crit_comp,syzstr,index,
968 new_generators, new_repr,ogm_l,orp_l);
975 if (!
idIs0(new_generators))
977 else if (resPairs[0].
lcm==
NULL)
984 actdeg = resPairs[0].order;
1002 int index,
int next_comp)
1005 int l_pairs=2*og_idel;
1006 ideal syzygies=
idInit(16,syzstr->
res[index]->rank+1);
1007 if ((
idIs0(new_generators)) || (new_generators->m[0]==
NULL))
1009 WerrorS(
"Hier ist was faul!\n");
1016 new_generators,new_repr,next_comp);
1017 if (
redPairs(resPairs,l_pairs,syzygies, new_generators,new_repr,
1018 next_comp,syzstr,index))
break;
1028 int * g_l,
int * p_l,
int crit_comp)
1038 if ((add_generators->m[j]!=
NULL) && (
pDivisibleBy(add_generators->m[j],p)))
1056 int index,ideal add_generators,ideal ,ideal ,
1057 ideal ,
int ,
int* first_new)
1059 int i=*first_new,
l=*l_pairs,
j,ll,j1,add_idel=
IDELEMS(add_generators);
1060 ideal
pairs=
idInit(add_idel,add_generators->rank);
1066 while ((l>0) && ((*resPairs)[l-1].
lcm==
NULL)) l--;
1067 while ((i<add_idel) && (add_generators->m[i]!=
NULL))
1074 pLcm(add_generators->m[j],add_generators->m[i],p);
1091 #ifdef USE_CHAINCRIT 1096 p1 =
pMDivide(p,add_generators->m[j]);
1097 p2 =
pMDivide(prs[j1],add_generators->m[j1]);
1102 while ((ti<l) && (((*resPairs)[ti].ind1!=j1)|| ((*resPairs)[ti].
ind2!=j))) ti++;
1129 for (ll=0;ll<*l_pairs;ll++)
1131 temp[ll].p = (*resPairs)[ll].p;
1132 temp[ll].p1 = (*resPairs)[ll].p1;
1133 temp[ll].p2 = (*resPairs)[ll].p2;
1134 temp[ll].syz = (*resPairs)[ll].syz;
1135 temp[ll].lcm = (*resPairs)[ll].lcm;
1136 temp[ll].ind1 = (*resPairs)[ll].ind1;
1137 temp[ll].ind2 = (*resPairs)[ll].ind2;
1138 temp[ll].syzind = (*resPairs)[ll].syzind;
1139 temp[ll].order = (*resPairs)[ll].order;
1140 temp[ll].isNotMinimal = (*resPairs)[ll].isNotMinimal;
1149 tso.p1 = add_generators->m[
j];
1150 tso.p2 = add_generators->m[
i];
1154 tso.isNotMinimal =
NULL;
1159 Print(
"erzeuge Paar im Modul %d,%d mit: \n",index,tso.order);
1182 ideal new_generators, ideal new_repr,
int * next_place_add,
int ** g_l,
1186 syStrategy syzstr,
int ,ideal add_generators, ideal add_repr,
1187 ideal new_generators, ideal new_repr,
int * next_place_add,
int ** g_l,
1191 SObject tso = resPairs[itso];
1193 int ng_place=
IDELEMS(new_generators);
1201 assume (tso.ind1<*next_place_add);
1202 assume (tso.ind2<*next_place_add);
1203 assume (tso.ind1!=tso.ind2);
1204 assume (tso.p1 == add_generators->m[tso.ind1]);
1205 assume (tso.p2 == add_generators->m[tso.ind2]);
1206 tso.p1 = add_generators->m[tso.ind1];
1207 tso.p2 = add_generators->m[tso.ind2];
1208 if ((tso.p1!=
NULL) && (tso.p2!=
NULL))
1212 #ifdef USE_PROD_CRIT 1218 poly p1=
pCopy(tso.p1);
1219 poly p2=
pCopy(tso.p2);
1220 poly pp1,pp2,tp1,tp2;
1221 poly sp1=
pCopy(add_repr->m[tso.ind1]),sp2=
pCopy(add_repr->m[tso.ind2]);
1252 sp1 =
pMult(p2,sp1);
1253 sp2 =
pMult(p1,sp2);
1254 tso.p =
pSub(tp1,tp2);
1255 tso.syz =
pSub(sp1,sp2);
1263 tso.syz =
pCopy(add_repr->m[tso.ind1]);
1264 poly tt =
pMDivide(tso.lcm,tso.p1);
1272 p =
pCopy(add_repr->m[tso.ind2]);
1279 tso.syz =
pAdd(p,tso.syz);
1283 Print(
"reduziere Paar im Module %d mit: \n",
index);
1298 if (j>=*next_place_add)
break;
1318 PrintS(
"Shit happens!\n");
1321 Print(
"erhalte Paar im Module %d mit: \n",
index);
1339 if (*next_place_add>=
IDELEMS(add_generators))
1344 (
IDELEMS(add_generators)+16)*
sizeof(
int));
1345 IDELEMS(add_generators) += 16;
1349 add_generators->m[*next_place_add] = tso.p;
1350 add_repr->m[*next_place_add] = tso.syz;
1351 (*g_l)[*next_place_add] = tso.length;
1352 (*next_place_add)++;
1356 while ((ng_place>0) && (new_generators->m[ng_place-1]==
NULL) &&
1357 (new_repr->m[ng_place-1]==
NULL)) ng_place--;
1358 if (ng_place>=
IDELEMS(new_generators))
1361 IDELEMS(new_generators) += 16;
1365 new_generators->m[ng_place] = tso.p;
1366 new_repr->m[ng_place] = tso.syz;
1370 resPairs[itso] = tso;
1378 int index,ideal add_generators,ideal add_repr,ideal new_generators,
1379 ideal new_repr,
int crit_comp,
int * red_deg,
int * next_place_add,
int **g_l,
1387 Print(
"(%d,%d)",index,resPairs[0].order);
1388 while ((i<l_pairs) && (resPairs[i].order==*red_deg))
1393 deg_soc = totake[index-1]->m[
pGetComp(resPairs[i].p1)-1];
1394 redOnePairHIndex(resPairs,i,crit_comp,syzstr,index, add_generators,add_repr,
1395 new_generators, new_repr,next_place_add,g_l,deg_soc);
1402 *red_deg = resPairs[0].order;
1415 ideal new_generators, ideal new_repr, ideal add_generators,
1419 int i=0,
j,next_new_el;
1420 int idel_temp=
IDELEMS(temp_generators);
1422 int p_length,red_deg,l_pairs=
IDELEMS(add_generators);
1431 if (syzstr->
res[index]->m[
j]!=
NULL)
1435 next_place_add =
IDELEMS(add_generators);
1436 while ((next_place_add>0) && (add_generators->m[next_place_add-1]==
NULL))
1439 next_new_el = next_place_add;
1441 while ((i<idel_temp) && (temp_generators->m[i]!=
NULL))
1444 #ifdef USE_REGULARITY 1449 while ((i<idel_temp) && (temp_generators->m[i]!=
NULL))
1451 pDelete(&temp_generators->m[i]);
1458 while ((i<idel_temp) && (
p_FDeg(temp_generators->m[i],
currRing)==next_deg))
1460 next_p = temp_generators->m[
i];
1461 temp_generators->m[
i] =
NULL;
1462 next_p =
normalize(next_p,add_generators,syzstr,gen_length,&p_length,
1473 next_p =
syRedTailSyz(next_p,add_generators,syzstr->
res[index],crit_comp,syzstr,
1474 gen_length,secgen_length,&p_length);
1477 if (next_place_add>=
IDELEMS(add_generators))
1482 (
IDELEMS(add_generators)+16)*
sizeof(
int));
1483 IDELEMS(add_generators) += 16;
1486 add_generators->m[next_place_add] = next_p;
1487 if (totake[index]==
NULL)
1489 if ((*syzstr->
Tl)[index]==
IDELEMS(totake[index]))
1492 (*syzstr->
Tl)[index]+16-
IDELEMS(totake[index]));
1493 for (
j=
IDELEMS(totake[index]);
j<(*syzstr->
Tl)[index]+16;
j++)
1494 totake[index]->
m[
j] =
NULL;
1495 IDELEMS(totake[index]) = (*syzstr->
Tl)[index]+16;
1498 totake[
index]->m[(*syzstr->
Tl)[index]] =
pCopy(next_p);
1500 totake[
index]->m[(*syzstr->
Tl)[index]] =
pHead(next_p);
1503 #ifdef WITH_SCHREYER_ORD 1504 add_repr->m[next_place_add] =
pHead(add_generators->m[next_place_add]);
1506 add_repr->m[next_place_add] =
pOne();
1508 ((*syzstr->
Tl)[index])++;
1509 pSetComp(add_repr->m[next_place_add],(*syzstr->
Tl)[index]);
1511 gen_length[next_place_add] = p_length;
1522 if ((next_place_add>next_new_el) || (next_deg<0))
1526 while (pairs_left && ((next_deg<0) || (red_deg<= next_deg)))
1529 add_repr,new_generators,new_repr,crit_comp,&next_new_el);
1531 add_repr,new_generators,new_repr,crit_comp,&red_deg,&next_place_add,&gen_length,
1548 ideal old_generators= syzstr->
res[
index];
1550 int i,
j=0,ii=
IDELEMS(old_generators)-1,dummy;
1555 for (i=0;i<
IDELEMS(old_generators);i++)
1557 if (old_generators->m[i]!=
NULL)
1559 g_l[
i] =
pLength(old_generators->m[i]);
1562 for (i=
IDELEMS(new_generators)-1;i>=0;i--)
1564 if (new_generators->m[i]!=
NULL)
1567 pLength(new_generators->m[i]));
1573 if ((j>=ii) || (p==
NULL))
break;
1574 if ((old_generators->m[j]!=
NULL) &&
1592 for (j=
IDELEMS(new_repr)-1;j>=0;j--)
1594 result->m[
j] = new_repr->m[
j];
1596 pNorm(result->m[j]);
1597 new_repr->m[
j] =
NULL;
1609 ideal temp_generators =
idInit(
IDELEMS(new_generators),new_generators->rank);
1611 ideal add_generators =
idInit(
IDELEMS(new_generators),new_generators->rank);
1614 int j,jj,
k,deg_p,idel_temp=
IDELEMS(temp_generators);
1617 for (j=
IDELEMS(new_generators)-1;j>=0;j--)
1619 if (new_generators->m[j]!=
NULL)
1621 p = new_generators->m[
j];
1622 new_generators->m[
j] =
NULL;
1630 if (deg_p<min_deg) min_deg = deg_p;
1633 while ((k<idel_temp) && (temp_generators->m[k]!=
NULL) &&
1635 for (jj=idel_temp-1;jj>
k;jj--)
1637 temp_generators->m[jj] = temp_generators->m[jj-1];
1639 temp_generators->m[
k] =
p;
1644 add_generators,add_repr,syzstr,index,next_comp,totake);
1646 while ((j>0) && (syzstr->
res[index]->m[j-1]==
NULL)) j--;
1648 while ((jj>0) && (add_generators->m[jj-1]==
NULL)) jj--;
1660 syzstr->
res[
index]->m[j+
k] = add_generators->m[
k];
1662 add_generators->m[
k] =
NULL;
1663 add_repr->m[
k] =
NULL;
1699 int ng_idel=
IDELEMS(new_generators);
1700 ideal new_repr =
idInit(ng_idel, crit_comp+ng_idel);
1710 for (i=0;i<ng_idel;i++)
1712 if (new_generators->m[i]!=
NULL)
1717 if (totake[index]==
NULL)
1719 if ((*syzstr->
Tl)[index]>=
IDELEMS(totake[index]))
1722 (*syzstr->
Tl)[index]+16-
IDELEMS(totake[index]));
1723 for (j=
IDELEMS(totake[index]);j<(*syzstr->
Tl)[index]+16;j++)
1724 totake[index]->
m[j] =
NULL;
1725 IDELEMS(totake[index]) = (*syzstr->
Tl)[index]+16;
1728 totake[
index]->m[(*syzstr->
Tl)[index]] =
pCopy(new_generators->m[i]);
1730 totake[
index]->m[(*syzstr->
Tl)[index]] =
pHead(new_generators->m[i]);
1732 #ifdef WITH_SCHREYER_ORD 1733 new_repr->m[
i] =
pHead(new_generators->m[i]);
1735 new_repr->m[
i] =
pOne();
1737 ((*syzstr->
Tl)[index])++;
1738 pSetComp(new_repr->m[i],(*syzstr->
Tl)[index]);
1744 PrintS(
"Add new generators:\n");
1746 PrintS(
"with representaions:\n");
1749 result =
kosz_std(new_generators,new_repr,syzstr,index,crit_comp);
1753 result =
kosz_ext(new_generators,new_repr,syzstr,index,crit_comp,totake);
1767 int crit_comp,t_comp,next_deg,old_tl;
1768 ideal temp=
NULL,old_ideal,old_repr;
1783 if (origR!=syzstr->
syRing)
1793 if (temp->m[0]!=
NULL)
1798 for (j=
IDELEMS(temp)-2;j>=0;j--)
1801 if (jj>maxdeg) maxdeg = jj;
1803 while (!
idIs0(temp))
1806 for (j=
IDELEMS(temp)-1;j>=0;j--)
1808 if (temp->m[j]!=
NULL)
1818 temp1->m[
k] = temp->m[
j];
1829 #ifdef USE_REGULARITY 1830 int last_generator=
IDELEMS(temp)-1;
1831 while ((last_generator>=0) && (temp->m[last_generator]==
NULL))
1837 syzstr->
Tl =
new intvec(*length+1);
1841 ideal temp_gens,old_std;
1843 if (rk_arg>1) syzstr->
res[0]->rank = rk_arg;
1849 if (temp->m[i]!=
NULL)
1851 new_generators->m[0] =
kNF(syzstr->
res[0],
currRing->qideal,temp->m[i]);
1853 pNorm(new_generators->m[0]);
1855 next_gen =
pCopy(new_generators->m[0]);
1857 if (!
idIs0(new_generators))
1860 while (
index<=*length)
1866 old_tl = (*syzstr->
Tl)[0];
1869 t_comp = (*syzstr->
Tl)[
index];
1870 if (
index==0) crit_comp = t_comp;
1880 #ifdef USE_REGULARITY 1881 if ((
index==0) && (!isRegular) && (i==last_generator))
1913 PrintS(
"\n not regular\n");
1924 new_generators = temp_gens;
1928 if (
idIs0(new_generators))
break;
1931 if (!
idIs0(new_generators))
1933 for (j=0;j<
IDELEMS(new_generators);j++)
1935 if (new_generators->m[j]!=
NULL)
1937 pDelete(&new_generators->m[j]);
1938 new_generators->m[
j] =
NULL;
1956 Print(
"The %d-th syzygy-module is now:\n",
index);
1980 if (!
idIs0(totake[index]))
1982 for(i=0;i<
IDELEMS(totake[index]);i++)
1984 if (totake[index]->
m[i]!=
NULL)
1998 PrintS(
"Da ist was faul!!!\n");
1999 Print(
"Aber: Regularitaet %d, Grad %ld\n",
2019 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)
#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 __p_Mult_nn(p, n, r)
#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)
void pNorm(poly p, const ring R=currRing)
static BOOLEAN length(leftv result, leftv arg)
ideal id_Head(ideal h, const ring r)
returns the ideals of initial terms
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
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