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;
252 if (resPairs[i].p1!=
NULL)
253 assume(resPairs[i].p1==old_generators->m[resPairs[i].ind1]);
255 assume(resPairs[i].
p2==old_generators->m[resPairs[i].ind2]);
268 int length=syzstr->
length;
269 int syzIndex=length-1,
i,
j;
273 while ((syzIndex!=0) && (res[syzIndex]==
NULL)) syzIndex--;
276 for(i=0;i<
IDELEMS(res[syzIndex]);i++)
278 #ifdef USE_REGULARITY 285 p = res[syzIndex]->m[
i];
297 PrintS(
"error in the resolvent\n");
313 int index,ideal new_generators,ideal new_repr,
int crit_comp)
315 if (
idIs0(new_generators))
return;
316 ideal old_generators=syzstr->
res[
index];
318 int i=0,
j,
k,kk,og_elem=0,og_idel=
IDELEMS(old_generators),
l=*l_pairs,jj,ll,j1;
326 while ((og_elem<og_idel) && (old_generators->m[og_elem]!=
NULL))
328 if ((index>0) && (
pGetComp(old_generators->m[og_elem])<=crit_comp))
332 while ((
l>0) && ((*resPairs)[
l-1].
lcm==
NULL))
l--;
333 while ((i<
IDELEMS(new_generators)) && (new_generators->m[i]!=
NULL))
336 if (
IDELEMS(old_generators)==og_elem)
344 kk =
pGetComp(new_generators->m[i]);
346 while ((
j<og_elem) && (old_generators->m[
j]!=
NULL) &&
348 while ((
j<og_elem) && (old_generators->m[
j]!=
NULL) &&
350 for (jj=og_elem;jj>
j;jj--)
352 old_generators->m[jj] = old_generators->m[jj-1];
353 old_repr->m[jj] = old_repr->m[jj-1];
355 old_generators->m[
j] = new_generators->m[
i];
356 new_generators->m[
i] =
NULL;
357 old_repr->m[
j] = new_repr->m[
i];
358 new_repr->m[
i] =
NULL;
360 for (jj=0;jj<*l_pairs;jj++)
364 if ((*resPairs)[jj].ind1>=j) (*resPairs)[jj].ind1++;
365 if ((*resPairs)[jj].
ind2>=j) (*resPairs)[jj].ind2++;
369 for (jj=og_ini;jj<og_elem;jj++)
371 if ((j!=jj) && (
pGetComp(old_generators->m[jj])==
pGetComp(old_generators->m[j])))
374 pLcm(old_generators->m[jj],old_generators->m[j],p);
391 #ifdef USE_CHAINCRIT0 396 p1 =
pDivide(p,old_generators->m[jj]);
397 p2 =
pDivide(prs[j1],old_generators->m[j1]);
402 while ((ti<
l) && (((*resPairs)[ti].ind1!=j1)|| ((*resPairs)[ti].
ind2!=jj))) ti++;
422 for (jj=og_ini;jj<og_elem;jj++)
429 for (ll=0;ll<*l_pairs;ll++)
431 temp[ll].p = (*resPairs)[ll].p;
432 temp[ll].p1 = (*resPairs)[ll].p1;
433 temp[ll].p2 = (*resPairs)[ll].p2;
434 temp[ll].syz = (*resPairs)[ll].syz;
435 temp[ll].lcm = (*resPairs)[ll].lcm;
436 temp[ll].ind1 = (*resPairs)[ll].ind1;
437 temp[ll].ind2 = (*resPairs)[ll].ind2;
438 temp[ll].syzind = (*resPairs)[ll].syzind;
439 temp[ll].order = (*resPairs)[ll].order;
440 temp[ll].isNotMinimal = (*resPairs)[ll].isNotMinimal;
449 tso.p1 = old_generators->m[jj];
450 tso.p2 = old_generators->m[
j];
454 tso.isNotMinimal =
NULL;
459 Print(
"erzeuge Paar im Modul %d,%d mit: \n",index,tso.order);
520 int * gen_length,
int * secgen_length,
int * tored_length)
522 int i=
IDELEMS(red)-1,num_mon,num_tail;
526 while ((i>0) && (red->m[i-1]==
NULL)) i--;
533 num_tail = *tored_length-1;
569 *tored_length = num_mon+num_tail;
590 if ((j>=
i) || (p==
NULL))
break;
612 int * gen_length,
int* orp_l,
int * tored_l,
int * syzred_l)
614 int num_mon,num_tail,syz_l;
624 num_tail = *tored_l-1;
641 *tored_l = num_mon+num_tail;
653 int crit_comp,
syStrategy syzstr,
int index,ideal new_generators,
654 ideal new_repr,
int * ogm_l,
int * orp_l)
656 SObject tso = resPairs[itso];
658 ideal old_generators=syzstr->
res[
index];
660 int og_idel=
IDELEMS(old_generators),ng_place=
IDELEMS(new_generators);
670 int syz_place=
IDELEMS(syzygies);
672 while ((syz_place>0) && (syzygies->m[syz_place-1]==
NULL)) syz_place--;
673 while ((ng_place>0) && (new_generators->m[ng_place-1]==
NULL)) ng_place--;
674 while ((og_idel>0) && (old_generators->m[og_idel-1]==
NULL)) og_idel--;
675 assume (tso.ind1<og_idel);
676 assume (tso.ind2<og_idel);
677 assume (tso.ind1!=tso.ind2);
678 assume (tso.p1 == old_generators->m[tso.ind1]);
679 assume (tso.p2 == old_generators->m[tso.ind2]);
680 tso.p1 = old_generators->m[tso.ind1];
681 tso.p2 = old_generators->m[tso.ind2];
682 if ((tso.p1!=
NULL) && (tso.p2!=
NULL))
690 toReplace = tso.ind1+1;
692 toReplace = tso.ind2+1;
696 if ((index==0) && (old_generators->rank==1) &&
708 pp =
pCopy(old_repr->m[tso.ind2]);
718 pp =
pCopy(old_repr->m[tso.ind1]);
728 tso.syz =
pMult(p,
pCopy(old_repr->m[tso.ind2]));
741 tso.syz =
pCopy(old_repr->m[tso.ind1]);
750 p =
pCopy(old_repr->m[tso.ind2]);
757 tso.syz =
pAdd(p,tso.syz);
769 Print(
"reduziere Paar im Module %d mit: \n",index);
777 if ((tso.p!=
NULL) && (!deleteP))
788 while ((j<ng_place) && (!
pDivisibleBy(new_generators->m[j],p))) j++;
789 if (j>=ng_place)
break;
845 PrintS(
"Shit happens!\n");
848 Print(
"erhalte Paar im Module %d mit: \n",index);
856 pDelete(&old_generators->m[toReplace-1]);
857 pDelete(&old_repr->m[toReplace-1]);
858 for (i=toReplace-1;i<og_idel-1;i++)
860 old_generators->m[
i] = old_generators->m[i+1];
861 old_repr->m[
i] = old_repr->m[i+1];
863 old_generators->m[og_idel-1] =
NULL;
864 old_repr->m[og_idel-1] =
NULL;
865 for (i=itso+1;i<
l;i++)
869 if ((resPairs[i].ind1==toReplace-1)||(resPairs[i].
ind2==toReplace-1))
873 if (resPairs[i].ind1>=toReplace)
874 (resPairs[
i].ind1)--;
875 if (resPairs[i].
ind2>=toReplace)
876 (resPairs[
i].ind2)--;
886 if (ng_place>=
IDELEMS(new_generators))
900 new_generators->m[ng_place] = tso.p;
902 new_repr->m[ng_place] = tso.syz;
916 else if (
pGetComp(tso.syz)<=crit_comp)
922 if (syz_place>=
IDELEMS(syzygies))
927 syzygies->m[syz_place] = tso.syz;
929 pNorm(syzygies->m[syz_place]);
932 resPairs[itso] = tso;
941 ideal new_generators,ideal new_repr,
int crit_comp,
syStrategy syzstr,
945 int i,
j,actdeg=resPairs[0].order;
950 for (j=
IDELEMS(syzstr->
res[index])-1;j>=0;j--)
952 if (syzstr->
res[index]->m[j]!=
NULL)
964 Print(
"(%d,%d)",index,resPairs[0].order);
965 while (resPairs[i].order==actdeg)
968 redOnePair(resPairs,i,l_pairs,syzygies,crit_comp,syzstr,index,
969 new_generators, new_repr,ogm_l,orp_l);
976 if (!
idIs0(new_generators))
978 else if (resPairs[0].
lcm==
NULL)
985 actdeg = resPairs[0].order;
1003 int index,
int next_comp)
1006 int l_pairs=2*og_idel;
1007 ideal syzygies=
idInit(16,syzstr->
res[index]->rank+1);
1008 if ((
idIs0(new_generators)) || (new_generators->m[0]==
NULL))
1010 Werror(
"Hier ist was faul!\n");
1017 new_generators,new_repr,next_comp);
1018 if (
redPairs(resPairs,l_pairs,syzygies, new_generators,new_repr,
1019 next_comp,syzstr,index))
break;
1029 int * g_l,
int * p_l,
int crit_comp)
1039 if ((add_generators->m[j]!=
NULL) && (
pDivisibleBy(add_generators->m[j],p)))
1057 int index,ideal add_generators,ideal ,ideal ,
1058 ideal ,
int ,
int* first_new)
1060 int i=*first_new,
l=*l_pairs,
j,ll,j1,add_idel=
IDELEMS(add_generators);
1061 ideal
pairs=
idInit(add_idel,add_generators->rank);
1067 while ((l>0) && ((*resPairs)[l-1].
lcm==
NULL)) l--;
1068 while ((i<add_idel) && (add_generators->m[i]!=
NULL))
1075 pLcm(add_generators->m[j],add_generators->m[i],p);
1092 #ifdef USE_CHAINCRIT 1097 p1 =
pDivide(p,add_generators->m[j]);
1098 p2 =
pDivide(prs[j1],add_generators->m[j1]);
1103 while ((ti<l) && (((*resPairs)[ti].ind1!=j1)|| ((*resPairs)[ti].
ind2!=j))) ti++;
1130 for (ll=0;ll<*l_pairs;ll++)
1132 temp[ll].p = (*resPairs)[ll].p;
1133 temp[ll].p1 = (*resPairs)[ll].p1;
1134 temp[ll].p2 = (*resPairs)[ll].p2;
1135 temp[ll].syz = (*resPairs)[ll].syz;
1136 temp[ll].lcm = (*resPairs)[ll].lcm;
1137 temp[ll].ind1 = (*resPairs)[ll].ind1;
1138 temp[ll].ind2 = (*resPairs)[ll].ind2;
1139 temp[ll].syzind = (*resPairs)[ll].syzind;
1140 temp[ll].order = (*resPairs)[ll].order;
1141 temp[ll].isNotMinimal = (*resPairs)[ll].isNotMinimal;
1150 tso.p1 = add_generators->m[
j];
1151 tso.p2 = add_generators->m[
i];
1155 tso.isNotMinimal =
NULL;
1160 Print(
"erzeuge Paar im Modul %d,%d mit: \n",index,tso.order);
1182 syStrategy syzstr,
int index,ideal add_generators, ideal add_repr,
1183 ideal new_generators, ideal new_repr,
int * next_place_add,
int ** g_l,
1187 syStrategy syzstr,
int ,ideal add_generators, ideal add_repr,
1188 ideal new_generators, ideal new_repr,
int * next_place_add,
int ** g_l,
1192 SObject tso = resPairs[itso];
1194 int ng_place=
IDELEMS(new_generators);
1202 assume (tso.ind1<*next_place_add);
1203 assume (tso.ind2<*next_place_add);
1204 assume (tso.ind1!=tso.ind2);
1205 assume (tso.p1 == add_generators->m[tso.ind1]);
1206 assume (tso.p2 == add_generators->m[tso.ind2]);
1207 tso.p1 = add_generators->m[tso.ind1];
1208 tso.p2 = add_generators->m[tso.ind2];
1209 if ((tso.p1!=
NULL) && (tso.p2!=
NULL))
1213 #ifdef USE_PROD_CRIT 1221 poly pp1,pp2,tp1,tp2;
1222 poly sp1=
pCopy(add_repr->m[tso.ind1]),sp2=
pCopy(add_repr->m[tso.ind2]);
1253 sp1 =
pMult(p2,sp1);
1254 sp2 =
pMult(p1,sp2);
1255 tso.p =
pSub(tp1,tp2);
1256 tso.syz =
pSub(sp1,sp2);
1264 tso.syz =
pCopy(add_repr->m[tso.ind1]);
1273 p =
pCopy(add_repr->m[tso.ind2]);
1280 tso.syz =
pAdd(p,tso.syz);
1284 Print(
"reduziere Paar im Module %d mit: \n",index);
1299 if (j>=*next_place_add)
break;
1319 PrintS(
"Shit happens!\n");
1322 Print(
"erhalte Paar im Module %d mit: \n",index);
1340 if (*next_place_add>=
IDELEMS(add_generators))
1345 (
IDELEMS(add_generators)+16)*
sizeof(
int));
1346 IDELEMS(add_generators) += 16;
1350 add_generators->m[*next_place_add] = tso.p;
1351 add_repr->m[*next_place_add] = tso.syz;
1352 (*g_l)[*next_place_add] = tso.length;
1353 (*next_place_add)++;
1357 while ((ng_place>0) && (new_generators->m[ng_place-1]==
NULL) &&
1358 (new_repr->m[ng_place-1]==
NULL)) ng_place--;
1359 if (ng_place>=
IDELEMS(new_generators))
1362 IDELEMS(new_generators) += 16;
1366 new_generators->m[ng_place] = tso.p;
1367 new_repr->m[ng_place] = tso.syz;
1371 resPairs[itso] = tso;
1379 int index,ideal add_generators,ideal add_repr,ideal new_generators,
1380 ideal new_repr,
int crit_comp,
int * red_deg,
int * next_place_add,
int **g_l,
1388 Print(
"(%d,%d)",index,resPairs[0].order);
1389 while ((i<l_pairs) && (resPairs[i].order==*red_deg))
1394 deg_soc = totake[index-1]->m[
pGetComp(resPairs[i].p1)-1];
1395 redOnePairHIndex(resPairs,i,crit_comp,syzstr,index, add_generators,add_repr,
1396 new_generators, new_repr,next_place_add,g_l,deg_soc);
1403 *red_deg = resPairs[0].order;
1416 ideal new_generators, ideal new_repr, ideal add_generators,
1417 ideal add_repr,
syStrategy syzstr,
int index,
int crit_comp,
1420 int i=0,
j,next_new_el;
1421 int idel_temp=
IDELEMS(temp_generators);
1423 int p_length,red_deg,l_pairs=
IDELEMS(add_generators);
1432 if (syzstr->
res[index]->m[
j]!=
NULL)
1436 next_place_add =
IDELEMS(add_generators);
1437 while ((next_place_add>0) && (add_generators->m[next_place_add-1]==
NULL))
1440 next_new_el = next_place_add;
1442 while ((i<idel_temp) && (temp_generators->m[i]!=
NULL))
1445 #ifdef USE_REGULARITY 1450 while ((i<idel_temp) && (temp_generators->m[i]!=
NULL))
1452 pDelete(&temp_generators->m[i]);
1459 while ((i<idel_temp) && (
p_FDeg(temp_generators->m[i],
currRing)==next_deg))
1461 next_p = temp_generators->m[
i];
1462 temp_generators->m[
i] =
NULL;
1463 next_p =
normalize(next_p,add_generators,syzstr,gen_length,&p_length,
1474 next_p =
syRedTailSyz(next_p,add_generators,syzstr->
res[index],crit_comp,syzstr,
1475 gen_length,secgen_length,&p_length);
1478 if (next_place_add>=
IDELEMS(add_generators))
1483 (
IDELEMS(add_generators)+16)*
sizeof(
int));
1484 IDELEMS(add_generators) += 16;
1487 add_generators->m[next_place_add] = next_p;
1488 if (totake[index]==
NULL)
1490 if ((*syzstr->
Tl)[index]==
IDELEMS(totake[index]))
1493 (*syzstr->
Tl)[index]+16-
IDELEMS(totake[index]));
1494 for (
j=
IDELEMS(totake[index]);
j<(*syzstr->
Tl)[index]+16;
j++)
1495 totake[index]->
m[
j] =
NULL;
1496 IDELEMS(totake[index]) = (*syzstr->
Tl)[index]+16;
1499 totake[
index]->m[(*syzstr->
Tl)[index]] =
pCopy(next_p);
1501 totake[
index]->m[(*syzstr->
Tl)[index]] =
pHead(next_p);
1504 #ifdef WITH_SCHREYER_ORD 1505 add_repr->m[next_place_add] =
pHead(add_generators->m[next_place_add]);
1507 add_repr->m[next_place_add] =
pOne();
1509 ((*syzstr->
Tl)[index])++;
1510 pSetComp(add_repr->m[next_place_add],(*syzstr->
Tl)[index]);
1512 gen_length[next_place_add] = p_length;
1523 if ((next_place_add>next_new_el) || (next_deg<0))
1527 while (pairs_left && ((next_deg<0) || (red_deg<= next_deg)))
1530 add_repr,new_generators,new_repr,crit_comp,&next_new_el);
1532 add_repr,new_generators,new_repr,crit_comp,&red_deg,&next_place_add,&gen_length,
1549 ideal old_generators= syzstr->
res[
index];
1551 int i,
j=0,ii=
IDELEMS(old_generators)-1,dummy;
1556 for (i=0;i<
IDELEMS(old_generators);i++)
1558 if (old_generators->m[i]!=
NULL)
1560 g_l[
i] =
pLength(old_generators->m[i]);
1563 for (i=
IDELEMS(new_generators)-1;i>=0;i--)
1565 if (new_generators->m[i]!=
NULL)
1568 pLength(new_generators->m[i]));
1574 if ((j>=ii) || (p==
NULL))
break;
1575 if ((old_generators->m[j]!=
NULL) &&
1593 for (j=
IDELEMS(new_repr)-1;j>=0;j--)
1595 result->m[
j] = new_repr->m[
j];
1597 pNorm(result->m[j]);
1598 new_repr->m[
j] =
NULL;
1610 ideal temp_generators =
idInit(
IDELEMS(new_generators),new_generators->rank);
1612 ideal add_generators =
idInit(
IDELEMS(new_generators),new_generators->rank);
1615 int j,jj,
k,deg_p,idel_temp=
IDELEMS(temp_generators);
1618 for (j=
IDELEMS(new_generators)-1;j>=0;j--)
1620 if (new_generators->m[j]!=
NULL)
1622 p = new_generators->m[
j];
1623 new_generators->m[
j] =
NULL;
1631 if (deg_p<min_deg) min_deg = deg_p;
1634 while ((k<idel_temp) && (temp_generators->m[k]!=
NULL) &&
1636 for (jj=idel_temp-1;jj>
k;jj--)
1638 temp_generators->m[jj] = temp_generators->m[jj-1];
1640 temp_generators->m[
k] =
p;
1645 add_generators,add_repr,syzstr,index,next_comp,totake);
1647 while ((j>0) && (syzstr->
res[index]->m[j-1]==
NULL)) j--;
1649 while ((jj>0) && (add_generators->m[jj-1]==
NULL)) jj--;
1661 syzstr->
res[
index]->m[j+
k] = add_generators->m[
k];
1663 add_generators->m[
k] =
NULL;
1664 add_repr->m[
k] =
NULL;
1700 int ng_idel=
IDELEMS(new_generators);
1701 ideal new_repr =
idInit(ng_idel, crit_comp+ng_idel);
1711 for (i=0;i<ng_idel;i++)
1713 if (new_generators->m[i]!=
NULL)
1718 if (totake[index]==
NULL)
1720 if ((*syzstr->
Tl)[index]>=
IDELEMS(totake[index]))
1723 (*syzstr->
Tl)[index]+16-
IDELEMS(totake[index]));
1724 for (j=
IDELEMS(totake[index]);j<(*syzstr->
Tl)[index]+16;j++)
1725 totake[index]->
m[j] =
NULL;
1726 IDELEMS(totake[index]) = (*syzstr->
Tl)[index]+16;
1729 totake[
index]->m[(*syzstr->
Tl)[index]] =
pCopy(new_generators->m[i]);
1731 totake[
index]->m[(*syzstr->
Tl)[index]] =
pHead(new_generators->m[i]);
1733 #ifdef WITH_SCHREYER_ORD 1734 new_repr->m[
i] =
pHead(new_generators->m[i]);
1736 new_repr->m[
i] =
pOne();
1738 ((*syzstr->
Tl)[index])++;
1739 pSetComp(new_repr->m[i],(*syzstr->
Tl)[index]);
1745 PrintS(
"Add new generators:\n");
1747 PrintS(
"with representaions:\n");
1750 result =
kosz_std(new_generators,new_repr,syzstr,index,crit_comp);
1754 result =
kosz_ext(new_generators,new_repr,syzstr,index,crit_comp,totake);
1767 int i,
j,jj,
k=0,index=0,rk_arg;
1768 int crit_comp,t_comp,next_deg,old_tl;
1769 ideal temp=
NULL,old_ideal,old_repr;
1784 if (origR!=syzstr->
syRing)
1794 if (temp->m[0]!=
NULL)
1799 for (j=
IDELEMS(temp)-2;j>=0;j--)
1802 if (jj>maxdeg) maxdeg = jj;
1804 while (!
idIs0(temp))
1807 for (j=
IDELEMS(temp)-1;j>=0;j--)
1809 if (temp->m[j]!=
NULL)
1819 temp1->m[
k] = temp->m[
j];
1830 #ifdef USE_REGULARITY 1831 int last_generator=
IDELEMS(temp)-1;
1832 while ((last_generator>=0) && (temp->m[last_generator]==
NULL))
1838 syzstr->
Tl =
new intvec(*length+1);
1842 ideal temp_gens,old_std;
1844 if (rk_arg>1) syzstr->
res[0]->rank = rk_arg;
1850 if (temp->m[i]!=
NULL)
1852 new_generators->m[0] =
kNF(syzstr->
res[0],
currRing->qideal,temp->m[i]);
1854 pNorm(new_generators->m[0]);
1856 next_gen =
pCopy(new_generators->m[0]);
1858 if (!
idIs0(new_generators))
1861 while (index<=*length)
1867 old_tl = (*syzstr->
Tl)[0];
1870 t_comp = (*syzstr->
Tl)[index];
1871 if (index==0) crit_comp = t_comp;
1872 temp_gens =
syAppendSyz(new_generators,syzstr, index,crit_comp,totake);
1881 #ifdef USE_REGULARITY 1882 if ((index==0) && (!isRegular) && (i==last_generator))
1914 PrintS(
"\n not regular\n");
1925 new_generators = temp_gens;
1929 if (
idIs0(new_generators))
break;
1932 if (!
idIs0(new_generators))
1934 for (j=0;j<
IDELEMS(new_generators);j++)
1936 if (new_generators->m[j]!=
NULL)
1938 pDelete(&new_generators->m[j]);
1939 new_generators->m[
j] =
NULL;
1954 while ((index<=*length) && (syzstr->
fullres[index]!=
NULL))
1957 Print(
"The %d-th syzygy-module is now:\n",index);
1967 if (!
idIs0(totake[index]))
1981 if (!
idIs0(totake[index]))
1983 for(i=0;i<
IDELEMS(totake[index]);i++)
1985 if (totake[index]->
m[i]!=
NULL)
1999 PrintS(
"Da ist was faul!!!\n");
2000 Print(
"Aber: Regularitaet %d, Grad %ld\n",
2020 if (origR!=syzstr->
syRing)
2024 while ((index<=*length) && (syzstr->
fullres[index]!=
NULL))
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)
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 int pLength(poly a)
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)
poly initial(const poly p, const ring r, const gfan::ZVector w)
Returns the initial form of p with respect to w.
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
#define pGetExp(p, i)
Exponent.
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)
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 Werror(const char *fmt,...)
void syDeletePair(SObject *so)
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
#define pCopy(p)
return a copy of the poly