My Project  UNKNOWN_GIT_VERSION
Functions | Variables
syz1.cc File Reference
#include "kernel/mod2.h"
#include "misc/mylimits.h"
#include "omalloc/omalloc.h"
#include "misc/options.h"
#include "misc/intvec.h"
#include "coeffs/numbers.h"
#include "polys/monomials/ring.h"
#include "polys/kbuckets.h"
#include "polys/prCopy.h"
#include "kernel/polys.h"
#include "kernel/GBEngine/kstd1.h"
#include "kernel/GBEngine/kutil.h"
#include "kernel/combinatorics/stairc.h"
#include "kernel/ideals.h"
#include "kernel/GBEngine/syz.h"

Go to the source code of this file.

Functions

void p_Setm_Syz (poly p, ring r, int *Components, long *ShiftedComponents)
 
void syDeletePair (SObject *so)
 
void syInitializePair (SObject *so)
 
void syCopyPair (SObject *argso, SObject *imso)
 
void syCompactifyPairSet (SSet sPairs, int sPlength, int first)
 
void syCompactify1 (SSet sPairs, int *sPlength, int first)
 
poly syRedtail (poly p, syStrategy syzstr, int index)
 
static int syChMin (intvec *iv)
 
SRes syInitRes (ideal arg, int *length, intvec *Tl, intvec *cw)
 
long syReorderShiftedComponents (long *sc, int n)
 
static void pResetSetm (poly p)
 
void syResetShiftedComponents (syStrategy syzstr, int index, int hilb)
 
static BOOLEAN syOrder (poly p, syStrategy syzstr, int index, int realcomp)
 
static intvecsyLinStrat (SSet nextPairs, syStrategy syzstr, int howmuch, int index)
 
void syEnlargeFields (syStrategy syzstr, int index)
 
static void syRedNextPairs (SSet nextPairs, syStrategy syzstr, int howmuch, int index)
 
static void syRedGenerOfCurrDeg (syStrategy syzstr, int deg, int index)
 
void syEnterPair (SSet sPairs, SObject *so, int *sPlength, int)
 
void syEnterPair (syStrategy syzstr, SObject *so, int *sPlength, int index)
 
static void syCreateNewPairs (syStrategy syzstr, int index, int newEl)
 
static SSet syChosePairsPutIn (syStrategy syzstr, int *index, int *howmuch, int *actdeg, int an, int en)
 
SSet syChosePairs (syStrategy syzstr, int *index, int *howmuch, int *actdeg)
 
int syInitSyzMod (syStrategy syzstr, int index, int init)
 
void syKillComputation (syStrategy syzstr, ring r)
 
resolvente syReorder (resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
 
intvecsyBettiOfComputation (syStrategy syzstr, BOOLEAN minim, int *row_shift, intvec *weights)
 
int sySize (syStrategy syzstr)
 
int syDim (syStrategy syzstr)
 
syStrategy syCopy (syStrategy syzstr)
 
static void syPrintEmptySpaces (int i)
 
static void syPrintEmptySpaces1 (int i)
 
static int syLengthInt (int i)
 
void syPrint (syStrategy syzstr, const char *sn)
 
static poly syStripOutCopy (poly p, intvec *toStrip)
 
static poly syMinimizeP1 (int toMin, syStrategy syzstr, intvec *ordn, int index, intvec *toStrip)
 
void syKillEmptyEntres (resolvente res, int length)
 
static intvecsyToStrip (syStrategy syzstr, int index)
 
static intvecsyOrdPairs (SSet sPairs, int length)
 
static resolvente syReadOutMinimalRes (syStrategy syzstr, BOOLEAN computeStd=FALSE)
 
syStrategy syMinimize (syStrategy syzstr)
 
syStrategy syLaScala3 (ideal arg, int *length)
 
syStrategy syLaScala (ideal arg, int &maxlength, intvec *weights)
 

Variables

int * currcomponents =NULL
 
long * currShiftedComponents =NULL
 

Function Documentation

◆ p_Setm_Syz()

void p_Setm_Syz ( poly  p,
ring  r,
int *  Components,
long *  ShiftedComponents 
)

Definition at line 522 of file p_polys.cc.

524 {
525  _components = Components;
526  _componentsShifted = ShiftedComponents;
528  p_Setm_General(p, r);

◆ pResetSetm()

static void pResetSetm ( poly  p)
static

Definition at line 394 of file syz1.cc.

396 {
397 #ifdef PDEBUG
398  poly q = p;
399 #endif
400  while (p!= NULL)
401  {
402  pSetm(p);
403  pIter(p);
404  }
405 #ifdef PDEBUG
406  pTest(q);
407 #endif

◆ syBettiOfComputation()

intvec* syBettiOfComputation ( syStrategy  syzstr,
BOOLEAN  minim,
int *  row_shift,
intvec weights 
)

Don't change the syzstr???

Definition at line 1755 of file syz1.cc.

1758 {
1759  int dummy;
1760  BOOLEAN std_weights=TRUE;
1761  if ((weights!=NULL)
1762  && (syzstr->betti!=NULL)
1763  && (syzstr->weights!=NULL) && (syzstr->weights[0]!=NULL))
1764  {
1765  int i;
1766  for(i=weights->length()-1; i>=0; i--)
1767  {
1768  //Print("test %d: %d - %d\n",i,(*weights)[i], (*(syzstr->weights[0]))[i]);
1769  if ((*weights)[i]!=(*(syzstr->weights[0]))[i])
1770  {
1771  std_weights=FALSE;
1772  break;
1773  }
1774  }
1775  }
1776  if ((syzstr->betti!=NULL)
1777  && (std_weights))
1778  {
1779  if (minim || (syzstr->resPairs!=NULL))
1780  return ivCopy(syzstr->betti);
1781  }
1782 
1783  resolvente fullres = syzstr->fullres;
1784  resolvente minres = syzstr->minres;
1785  const int length = syzstr->length;
1786 
1787  if ((fullres==NULL) && (minres==NULL))
1788  {
1789  if (syzstr->hilb_coeffs==NULL)
1790  { // LA SCALA
1791  fullres = syReorder(syzstr->res, length, syzstr);
1792  }
1793  else
1794  { // HRES
1795  minres = syReorder(syzstr->orderedRes, length, syzstr);
1796  syKillEmptyEntres(minres, length);
1797  }
1798  }
1799 
1800  intvec *result=NULL;
1801 
1802  if (fullres!=NULL)
1803  result = syBetti(fullres,length,&dummy,weights,minim,row_shift);
1804  else
1805  result = syBetti(minres,length,&dummy,weights,minim,row_shift);
1806 
1807 
1808  return result; /// Don't change the syzstr???
1809 
1810  // TODO: cleanup thses!
1811  if( fullres != NULL && syzstr->fullres == NULL )
1812  syzstr->fullres = fullres;
1813  if( minres != NULL && syzstr->minres == NULL )
1814  syzstr->minres = minres;
1815 
1816  if ((result!=NULL)
1817  && ((minim) || (syzstr->resPairs!=NULL))
1818  && std_weights
1819  && (syzstr->betti==NULL))
1820  {
1821  syzstr->betti = ivCopy(result); // cache the result...
1822  }
1823 
1824  return result;

◆ syChMin()

static int syChMin ( intvec iv)
static

Definition at line 270 of file syz1.cc.

272 {
273  int i,j=-1,r=-1;
274 
275  for (i=iv->length()-1;i>=0;i--)
276  {
277  if ((*iv)[i]>=0)
278  {
279  if ((j<0) || ((*iv)[i]<j))
280  {
281  j = (*iv)[i];
282  r = i;
283  }
284  }
285  }
286  return r;

◆ syChosePairs()

SSet syChosePairs ( syStrategy  syzstr,
int *  index,
int *  howmuch,
int *  actdeg 
)

Definition at line 1288 of file syz1.cc.

1290 {
1291  return syChosePairsPutIn(syzstr,index,howmuch,actdeg,0,syzstr->length);

◆ syChosePairsPutIn()

static SSet syChosePairsPutIn ( syStrategy  syzstr,
int *  index,
int *  howmuch,
int *  actdeg,
int  an,
int  en 
)
static

Definition at line 1181 of file syz1.cc.

1184 {
1185  int newdeg=*actdeg,newindex=-1,i,t,sldeg;
1186  SSet result;
1187  SRes resPairs=syzstr->resPairs;
1188 
1189  if (an>syzstr->length) return NULL;
1190  if (en>syzstr->length) en=syzstr->length;
1191  while (*index<en)
1192  {
1193  if (resPairs[*index]!=NULL)
1194  {
1195  sldeg = (*actdeg)+*index;
1196  i = 0;
1197  if (*index!=0)
1198  {
1199  while ((i<(*syzstr->Tl)[*index]))
1200  {
1201  if ((resPairs[*index])[i].lcm!=NULL)
1202  {
1203  if ((resPairs[*index])[i].order == sldeg)
1204  {
1205  result = &(resPairs[*index])[i];
1206  *howmuch =1;
1207  i++;
1208  while ((i<(*syzstr->Tl)[*index]) && ((resPairs[*index])[i].lcm!=NULL)
1209  && ((resPairs[*index])[i].order == sldeg))
1210  {
1211  i++;
1212  (*howmuch)++;
1213  }
1214  return result;
1215  }
1216  }
1217  i++;
1218  }
1219  }
1220  else
1221  {
1222  while ((i<(*syzstr->Tl)[*index]))
1223  {
1224  if ((resPairs[*index])[i].syz!=NULL)
1225  {
1226  if ((resPairs[*index])[i].order == sldeg)
1227  {
1228  result = &(resPairs[*index])[i];
1229  (*howmuch) =1;
1230  i++;
1231  while ((i<(*syzstr->Tl)[*index]) && ((resPairs[*index])[i].syz!=NULL)
1232  && ((resPairs[*index])[i].order == *actdeg))
1233  {
1234  i++;
1235  (*howmuch)++;
1236  }
1237  return result;
1238  }
1239  }
1240  i++;
1241  }
1242  }
1243  }
1244  (*index)++;
1245  }
1246  *index = an;
1247  //if (TEST_OPT_PROT) Print("(Euler:%d)",euler);
1248  while (*index<en)
1249  {
1250  if (resPairs[*index]!=NULL)
1251  {
1252  i = 0;
1253  while ((i<(*syzstr->Tl)[*index]))
1254  {
1255  t = *actdeg+*index;
1256  if (((resPairs[*index])[i].lcm!=NULL) ||
1257  ((resPairs[*index])[i].syz!=NULL))
1258  {
1259  if ((resPairs[*index])[i].order > t)
1260  t = (resPairs[*index])[i].order;
1261  }
1262  if ((t>*actdeg+*index) && ((newdeg==*actdeg) || (t<newdeg+*index)))
1263  {
1264  newdeg = t-*index;
1265  newindex = *index;
1266  break;
1267  }
1268  i++;
1269  }
1270  }
1271  (*index)++;
1272  }
1273  if (newdeg>*actdeg)
1274  {
1275  *actdeg = newdeg;
1276  *index = newindex;
1277  return syChosePairsPutIn(syzstr,index,howmuch,actdeg,an,en);
1278  }
1279  else return NULL;

◆ syCompactify1()

void syCompactify1 ( SSet  sPairs,
int *  sPlength,
int  first 
)

Definition at line 132 of file syz1.cc.

134 {
135  int k=first,kk=0;
136 
137  while (k+kk<*sPlength)
138  {
139  if (sPairs[k+kk].lcm!=NULL)
140  {
141  if (kk>0) syCopyPair(&sPairs[k+kk],&sPairs[k]);
142  k++;
143  }
144  else
145  {
146  kk++;
147  }
148  }
149  while (k<*sPlength)
150  {
151  syInitializePair(&sPairs[k]);
152  k++;
153  }
154  *sPlength -= kk;

◆ syCompactifyPairSet()

void syCompactifyPairSet ( SSet  sPairs,
int  sPlength,
int  first 
)

Definition at line 104 of file syz1.cc.

106 {
107  int k=first,kk=0;
108 
109  while (k+kk<sPlength)
110  {
111  if (sPairs[k+kk].lcm!=NULL)
112  {
113  if (kk>0) syCopyPair(&sPairs[k+kk],&sPairs[k]);
114  k++;
115  }
116  else
117  {
118  kk++;
119  }
120  }
121  while (k<sPlength)
122  {
123  syInitializePair(&sPairs[k]);
124  k++;
125  }

◆ syCopy()

syStrategy syCopy ( syStrategy  syzstr)

Definition at line 1884 of file syz1.cc.

1886 {
1887  syStrategy result=syzstr;
1888  (result->references)++;
1889  return result;

◆ syCopyPair()

void syCopyPair ( SObject *  argso,
SObject *  imso 
)

Definition at line 82 of file syz1.cc.

84 {
85  *imso=*argso;
86  (*argso).p = NULL;
87  (*argso).p1 = NULL;
88  (*argso).p2 = NULL;
89  (*argso).lcm = NULL;
90  (*argso).syz = NULL;
91  (*argso).ind1 = 0;
92  (*argso).ind2 = 0;
93  (*argso).syzind = -1;
94  (*argso).order = 0;
95  (*argso).isNotMinimal = NULL;
96  (*argso).length = -1;
97  (*argso).reference = -1;

◆ syCreateNewPairs()

static void syCreateNewPairs ( syStrategy  syzstr,
int  index,
int  newEl 
)
static

Definition at line 1069 of file syz1.cc.

1071 {
1072  SSet temp;
1073  SObject tso;
1074  int i,ii,j,k=IDELEMS(syzstr->res[index]),l=(*syzstr->Tl)[index],ll;
1075  int first,pos,jj,j1;
1076  int * bci=syzstr->backcomponents[index];
1077  poly p,q;
1078  polyset rs=syzstr->res[index]->m,nPm;
1079 
1080 
1081  while ((k>0) && (rs[k-1]==NULL)) k--;
1082  if (newEl>=k) return;
1083 
1084  long * ShiftedComponents = syzstr->ShiftedComponents[index];
1085  int* Components = syzstr->truecomponents[index];
1086 
1087  ideal nP=idInit(k,syzstr->res[index]->rank);
1088  nPm=nP->m;
1089  while ((l>0) && ((syzstr->resPairs[index])[l-1].p1==NULL)) l--;
1090  for (j=newEl;j<k;j++)
1091  {
1092  q = rs[j];
1093  first = syzstr->Firstelem[index-1][pGetComp(q)]-1;
1094  pos = first+syzstr->Howmuch[index-1][pGetComp(q)];
1095  for (i=first;i<pos;i++)
1096  {
1097  jj = bci[i];
1098  if (jj>=j) break;
1099  p = pOne();
1100  pLcm(rs[jj],q,p);
1101  pSetComp(p,j+1);
1102  p_Setm_Syz(p, currRing, Components, ShiftedComponents);
1103  ii = first;
1104  loop
1105  {
1106  j1 = bci[ii];
1107  if (nPm[j1]!=NULL)
1108  {
1109  if (pLmDivisibleByNoComp(nPm[j1],p))
1110  {
1111  pDelete(&p);
1112  break;
1113  }
1114  else if (pLmDivisibleByNoComp(p,nPm[j1]))
1115  {
1116  pDelete(&(nPm[j1]));
1117  //break;
1118  }
1119  }
1120  ii++;
1121  if (ii>=pos) break;
1122  }
1123  if (p!=NULL)
1124  {
1125  nPm[jj] = p;
1126  }
1127  }
1128  for (i=first;i<pos;i++)
1129  {
1130  ii = bci[i];
1131  if (nPm[ii]!=NULL)
1132  {
1133  if (l>=(*syzstr->Tl)[index])
1134  {
1135  temp = (SSet)omAlloc0(((*syzstr->Tl)[index]+16)*sizeof(SObject));
1136  for (ll=0;ll<(*syzstr->Tl)[index];ll++)
1137  {
1138  temp[ll].p = (syzstr->resPairs[index])[ll].p;
1139  temp[ll].p1 = (syzstr->resPairs[index])[ll].p1;
1140  temp[ll].p2 = (syzstr->resPairs[index])[ll].p2;
1141  temp[ll].syz = (syzstr->resPairs[index])[ll].syz;
1142  temp[ll].lcm = (syzstr->resPairs[index])[ll].lcm;
1143  temp[ll].ind1 = (syzstr->resPairs[index])[ll].ind1;
1144  temp[ll].ind2 = (syzstr->resPairs[index])[ll].ind2;
1145  temp[ll].syzind = (syzstr->resPairs[index])[ll].syzind;
1146  temp[ll].order = (syzstr->resPairs[index])[ll].order;
1147  temp[ll].isNotMinimal = (syzstr->resPairs[index])[ll].isNotMinimal;
1148  }
1149  if (syzstr->resPairs[index] != NULL) // OB: ????
1150  omFreeSize((ADDRESS)syzstr->resPairs[index],(*syzstr->Tl)[index]*sizeof(SObject));
1151  (*syzstr->Tl)[index] += 16;
1152  syzstr->resPairs[index] = temp;
1153  }
1154  tso.lcm = p = nPm[ii];
1155  nPm[ii] = NULL;
1156  tso.order = pTotaldegree(p);
1157  if ((syzstr->cw!=NULL) && (index>0) && (pGetComp(q)>0))
1158  {
1159  int ii=index-1,jj=pGetComp(q);
1160  while (ii>0)
1161  {
1162  jj = pGetComp(syzstr->res[ii]->m[jj-1]);
1163  ii--;
1164  }
1165  tso.order += (*syzstr->cw)[jj-1];
1166  }
1167  tso.p1 = rs[ii];
1168  tso.p2 = q;
1169  tso.ind1 = ii;
1170  tso.ind2 = j;
1171  tso.syzind = -1;
1172  tso.isNotMinimal = NULL;
1173  tso.p = NULL;
1174  tso.syz = NULL;
1175  syEnterPair(syzstr->resPairs[index],&tso,&l,index);
1176  }
1177  }
1178  }
1179  idDelete(&nP);

◆ syDeletePair()

void syDeletePair ( SObject *  so)

Definition at line 44 of file syz1.cc.

46 {
47  pDelete(&(*so).p);
48  pDelete(&(*so).lcm);
49  pDelete(&(*so).syz);
50  (*so).p1 = NULL;
51  (*so).p2 = NULL;
52  (*so).ind1 = 0;
53  (*so).ind2 = 0;
54  (*so).syzind = -1;
55  (*so).order = 0;
56  (*so).isNotMinimal = NULL;
57  (*so).length = -1;
58  (*so).reference = -1;

◆ syDim()

int syDim ( syStrategy  syzstr)

Definition at line 1849 of file syz1.cc.

1851 {
1852  int i,l;
1853  if (syzstr->resPairs!=NULL)
1854  {
1855  SRes rP=syzstr->resPairs;
1856 
1857  l = syzstr->length;
1858  while ((l>0) && (rP[l-1]==NULL)) l--;
1859  if (l==0) return -1;
1860  l--;
1861  while (l>=0)
1862  {
1863  i = 0;
1864  while ((i<(*syzstr->Tl)[l]) &&
1865  ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL)) &&
1866  (rP[l][i].isNotMinimal!=NULL))
1867  {
1868  i++;
1869  }
1870  if ((i<(*syzstr->Tl)[l]) &&
1871  ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL)) &&
1872  (rP[l][i].isNotMinimal==NULL))
1873  return l;
1874  l--;
1875  }
1876  return l;
1877  }
1878  else
1879  return sySize(syzstr);

◆ syEnlargeFields()

void syEnlargeFields ( syStrategy  syzstr,
int  index 
)

Definition at line 734 of file syz1.cc.

736 {
737  pEnlargeSet(&(syzstr->res[index]->m),IDELEMS(syzstr->res[index]),16);
739  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
740  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
741  syzstr->ShiftedComponents[index]
742  =(long*)omRealloc0Size((ADDRESS)syzstr->ShiftedComponents[index],
743  (IDELEMS(syzstr->res[index])+1)*sizeof(long),
744  (IDELEMS(syzstr->res[index])+17)*sizeof(long));
746  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
747  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
748  syzstr->Howmuch[index]=(int*)omRealloc0Size((ADDRESS)syzstr->Howmuch[index],
749  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
750  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
751  syzstr->Firstelem[index]=(int*)omRealloc0Size((ADDRESS)syzstr->Firstelem[index],
752  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
753  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
754  syzstr->elemLength[index]=(int*)omRealloc0Size((ADDRESS)syzstr->elemLength[index],
755  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
756  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
757  syzstr->sev[index]=(unsigned long*)omRealloc0Size((ADDRESS)syzstr->sev[index],
758  (IDELEMS(syzstr->res[index])+1)*sizeof(unsigned long),
759  (IDELEMS(syzstr->res[index])+17)*sizeof(unsigned long));
760  IDELEMS(syzstr->res[index]) += 16;
761  pEnlargeSet(&(syzstr->orderedRes[index]->m),IDELEMS(syzstr->orderedRes[index]),16);
762  IDELEMS(syzstr->orderedRes[index]) += 16;

◆ syEnterPair() [1/2]

void syEnterPair ( SSet  sPairs,
SObject *  so,
int *  sPlength,
int   
)

Definition at line 985 of file syz1.cc.

987 {
988  int ll,k,no=(*so).order,sP=*sPlength,i;
989 
990  if ((sP==0) || (sPairs[sP-1].order<=no))
991  ll = sP;
992  else if (sP==1)
993  ll = 0;
994  else
995  {
996  int an=0,en=sP-1;
997  loop
998  {
999  if (an>=en-1)
1000  {
1001  if ((sPairs[an].order<=no) && (sPairs[an+1].order>no))
1002  {
1003  ll = an+1;
1004  break;
1005  }
1006  else if ((sPairs[en].order<=no) && (sPairs[en+1].order>no))
1007  {
1008  ll = en+1;
1009  break;
1010  }
1011  else if (sPairs[an].order>no)
1012  {
1013  ll = an;
1014  break;
1015  }
1016  else
1017  {
1018  PrintS("Hier ist was faul!\n");
1019  break;
1020  }
1021  }
1022  i=(an+en) / 2;
1023  if (sPairs[i].order <= no)
1024  an=i;
1025  else
1026  en=i;
1027  }
1028  }
1029  for (k=(*sPlength);k>ll;k--)
1030  {
1031  syCopyPair(&sPairs[k-1],&sPairs[k]);
1032  }
1033  syCopyPair(so,&sPairs[ll]);
1034  (*sPlength)++;

◆ syEnterPair() [2/2]

void syEnterPair ( syStrategy  syzstr,
SObject *  so,
int *  sPlength,
int  index 
)

Definition at line 1035 of file syz1.cc.

1037 {
1038  int ll;
1039 
1040  if (*sPlength>=(*syzstr->Tl)[index])
1041  {
1042  SSet temp = (SSet)omAlloc0(((*syzstr->Tl)[index]+16)*sizeof(SObject));
1043  for (ll=0;ll<(*syzstr->Tl)[index];ll++)
1044  {
1045  temp[ll].p = (syzstr->resPairs[index])[ll].p;
1046  temp[ll].p1 = (syzstr->resPairs[index])[ll].p1;
1047  temp[ll].p2 = (syzstr->resPairs[index])[ll].p2;
1048  temp[ll].syz = (syzstr->resPairs[index])[ll].syz;
1049  temp[ll].lcm = (syzstr->resPairs[index])[ll].lcm;
1050  temp[ll].ind1 = (syzstr->resPairs[index])[ll].ind1;
1051  temp[ll].ind2 = (syzstr->resPairs[index])[ll].ind2;
1052  temp[ll].syzind = (syzstr->resPairs[index])[ll].syzind;
1053  temp[ll].order = (syzstr->resPairs[index])[ll].order;
1054  temp[ll].isNotMinimal = (syzstr->resPairs[index])[ll].isNotMinimal;
1055  temp[ll].length = (syzstr->resPairs[index])[ll].length;
1056  temp[ll].reference = (syzstr->resPairs[index])[ll].reference;
1057  }
1058  if (syzstr->resPairs[index] != NULL) // OB: ?????
1059  omFreeSize((ADDRESS)syzstr->resPairs[index],(*syzstr->Tl)[index]*sizeof(SObject));
1060  (*syzstr->Tl)[index] += 16;
1061  syzstr->resPairs[index] = temp;
1062  }
1063  syEnterPair(syzstr->resPairs[index],so,sPlength,index);

◆ syInitializePair()

void syInitializePair ( SObject *  so)

Definition at line 63 of file syz1.cc.

65 {
66  (*so).p = NULL;
67  (*so).lcm = NULL;
68  (*so).syz = NULL;
69  (*so).p1 = NULL;
70  (*so).p2 = NULL;
71  (*so).ind1 = 0;
72  (*so).ind2 = 0;
73  (*so).syzind = -1;
74  (*so).order = 0;
75  (*so).isNotMinimal = NULL;
76  (*so).length = -1;
77  (*so).reference = -1;

◆ syInitRes()

SRes syInitRes ( ideal  arg,
int *  length,
intvec Tl,
intvec cw 
)

Definition at line 293 of file syz1.cc.

295 {
296  if (idIs0(arg)) return NULL;
297  SRes resPairs = (SRes)omAlloc0(*length*sizeof(SSet));
298  resPairs[0] = (SSet)omAlloc0(IDELEMS(arg)*sizeof(SObject));
299  intvec * iv=NULL;
300  int i,j;
301 
302  if (id_RankFreeModule(arg,currRing)==0)
303  {
304  iv = idSort(arg);
305  for (i=0;i<IDELEMS(arg);i++)
306  {
307  (resPairs[0])[i].syz = /*pCopy*/(arg->m[(*iv)[i]-1]);
308  arg->m[(*iv)[i]-1] = NULL;
309  (resPairs[0])[i].order = pTotaldegree((resPairs[0])[i].syz);
310  }
311  }
312  else
313  {
314  iv = new intvec(IDELEMS(arg),1,-1);
315  for (i=0;i<IDELEMS(arg);i++)
316  {
317  (*iv)[i] = pTotaldegree(arg->m[i])+(*cw)[pGetComp(arg->m[i])-1];
318  }
319  for (i=0;i<IDELEMS(arg);i++)
320  {
321  j = syChMin(iv);
322  if (j<0) break;
323  (resPairs[0])[i].syz = arg->m[j];
324  arg->m[j] = NULL;
325  (resPairs[0])[i].order = (*iv)[j];
326  (*iv)[j] = -1;
327  }
328  }
329  if (iv!=NULL) delete iv;
330  (*Tl)[0] = IDELEMS(arg);
331  return resPairs;

◆ syInitSyzMod()

int syInitSyzMod ( syStrategy  syzstr,
int  index,
int  init 
)

Definition at line 1459 of file syz1.cc.

1461 {
1462  int result;
1463 
1464  if (syzstr->res[index]==NULL)
1465  {
1466  syzstr->res[index] = idInit(init-1,1);
1467  syzstr->truecomponents[index] = (int*)omAlloc0(init*sizeof(int));
1468  syzstr->ShiftedComponents[index] = (long*)omAlloc0(init*sizeof(long));
1469  if (index==0)
1470  {
1471  for (int i=0;i<init;i++)
1472  {
1473  syzstr->truecomponents[0][i] = i;
1474  syzstr->ShiftedComponents[0][i] = (i)*SYZ_SHIFT_BASE;
1475  }
1476  }
1477  syzstr->backcomponents[index] = (int*)omAlloc0(init*sizeof(int));
1478  syzstr->Howmuch[index] = (int*)omAlloc0(init*sizeof(int));
1479  syzstr->Firstelem[index] = (int*)omAlloc0(init*sizeof(int));
1480  syzstr->elemLength[index] = (int*)omAlloc0(init*sizeof(int));
1481  syzstr->orderedRes[index] = idInit(init-1,1);
1482  syzstr->sev[index] = (unsigned long*) omAlloc0(init*sizeof(unsigned long));
1483  result = 0;
1484  }
1485  else
1486  {
1487  result = IDELEMS(syzstr->res[index]);
1488  while ((result>0) && (syzstr->res[index]->m[result-1]==NULL)) result--;
1489  }
1490  return result;

◆ syKillComputation()

void syKillComputation ( syStrategy  syzstr,
ring  r 
)

Definition at line 1495 of file syz1.cc.

1497 {
1498  if (syzstr->references>0)
1499  {
1500  (syzstr->references)--;
1501  }
1502  else
1503  {
1504  int i,j;
1505  if (syzstr->minres!=NULL)
1506  {
1507  for (i=0;i<syzstr->length;i++)
1508  {
1509  if (syzstr->minres[i]!=NULL)
1510  {
1511  id_Delete(&(syzstr->minres[i]),r);
1512  }
1513  }
1514  omFreeSize((ADDRESS)syzstr->minres,(syzstr->length+1)*sizeof(ideal));
1515  }
1516  if (syzstr->fullres!=NULL)
1517  {
1518  for (i=0;i<syzstr->length;i++)
1519  {
1520  if (syzstr->fullres[i]!=NULL)
1521  {
1522  id_Delete(&(syzstr->fullres[i]),r);
1523  }
1524  }
1525  omFreeSize((ADDRESS)syzstr->fullres,(syzstr->length+1)*sizeof(ideal));
1526  }
1527  if (syzstr->weights!=NULL)
1528  {
1529  for (i=0;i<syzstr->length;i++)
1530  {
1531  if (syzstr->weights[i]!=NULL)
1532  {
1533  delete syzstr->weights[i];
1534  }
1535  }
1536  omFreeSize((ADDRESS)syzstr->weights,syzstr->length*sizeof(intvec*));
1537  }
1538 
1539  ring sr=syzstr->syRing;
1540  if (sr==NULL) sr=r;
1541 
1542  if (syzstr->resPairs!=NULL)
1543  {
1544  for (i=0;i<syzstr->length;i++)
1545  {
1546  for (j=0;j<(*syzstr->Tl)[i];j++)
1547  {
1548  if ((syzstr->resPairs[i])[j].lcm!=NULL)
1549  p_Delete(&((syzstr->resPairs[i])[j].lcm),sr);
1550  if ((i>0) && ((syzstr->resPairs[i])[j].syz!=NULL))
1551  p_Delete(&((syzstr->resPairs[i])[j].syz),sr);
1552  }
1553  if (syzstr->orderedRes[i]!=NULL)
1554  {
1555  for (j=0;j<IDELEMS(syzstr->orderedRes[i]);j++)
1556  {
1557  syzstr->orderedRes[i]->m[j] = NULL;
1558  }
1559  id_Delete(&(syzstr->orderedRes[i]),sr);
1560  }
1561  if (syzstr->truecomponents[i]!=NULL)
1562  {
1563  omFreeSize((ADDRESS)syzstr->truecomponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1564  syzstr->truecomponents[i]=NULL;
1565  omFreeSize((ADDRESS)syzstr->ShiftedComponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(long));
1566  syzstr->ShiftedComponents[i]=NULL;
1567  }
1568  if (syzstr->backcomponents[i]!=NULL)
1569  {
1570  omFreeSize((ADDRESS)syzstr->backcomponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1571  syzstr->backcomponents[i]=NULL;
1572  }
1573  if (syzstr->Howmuch[i]!=NULL)
1574  {
1575  omFreeSize((ADDRESS)syzstr->Howmuch[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1576  syzstr->Howmuch[i]=NULL;
1577  }
1578  if (syzstr->Firstelem[i]!=NULL)
1579  {
1580  omFreeSize((ADDRESS)syzstr->Firstelem[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1581  syzstr->Firstelem[i]=NULL;
1582  }
1583  if (syzstr->elemLength[i]!=NULL)
1584  {
1585  omFreeSize((ADDRESS)syzstr->elemLength[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1586  syzstr->elemLength[i]=NULL;
1587  }
1588  if (syzstr->res[i]!=NULL)
1589  {
1590  for (j=0;j<IDELEMS(syzstr->res[i]);j++)
1591  {
1592  if (syzstr->res[i]->m[j]!=NULL)
1593  p_Delete(&(syzstr->res[i]->m[j]),sr);
1594  }
1595  }
1596  if ((syzstr->hilb_coeffs!=NULL)
1597  && (syzstr->hilb_coeffs[i]!=NULL))
1598  delete syzstr->hilb_coeffs[i];
1599  if (syzstr->sev[i] != NULL)
1600  omFreeSize((ADDRESS)syzstr->sev[i], (IDELEMS(syzstr->res[i])+1)*sizeof(unsigned long));
1601  id_Delete(&(syzstr->res[i]),sr);
1602  if (syzstr->resPairs[i] != NULL) // OB: ????
1603  omFreeSize((ADDRESS)syzstr->resPairs[i],(*syzstr->Tl)[i]*sizeof(SObject));
1604  }
1605  omFreeSize((ADDRESS)syzstr->resPairs,syzstr->length*sizeof(SObject*));
1606  omFreeSize((ADDRESS)syzstr->res,(syzstr->length+1)*sizeof(ideal));
1607  omFreeSize((ADDRESS)syzstr->orderedRes,(syzstr->length+1)*sizeof(ideal));
1608  omFreeSize((ADDRESS)syzstr->elemLength,(syzstr->length+1)*sizeof(int*));
1609  omFreeSize((ADDRESS)syzstr->truecomponents,(syzstr->length+1)*sizeof(int*));
1610  omFreeSize((ADDRESS)syzstr->ShiftedComponents,(syzstr->length+1)*sizeof(long*));
1611  if (syzstr->sev != NULL)
1612  omFreeSize(((ADDRESS)syzstr->sev), (syzstr->length+1)*sizeof(unsigned long*));
1613  omFreeSize((ADDRESS)syzstr->backcomponents,(syzstr->length+1)*sizeof(int*));
1614  omFreeSize((ADDRESS)syzstr->Howmuch,(syzstr->length+1)*sizeof(int*));
1615  omFreeSize((ADDRESS)syzstr->Firstelem,(syzstr->length+1)*sizeof(int*));
1616  if (syzstr->hilb_coeffs!=NULL)
1617  omFreeSize((ADDRESS)syzstr->hilb_coeffs,(syzstr->length+1)*sizeof(intvec*));
1618  }
1619  if (syzstr->cw!=NULL)
1620  delete syzstr->cw;
1621  if (syzstr->betti!=NULL)
1622  delete syzstr->betti;
1623  if (syzstr->resolution!=NULL)
1624  delete syzstr->resolution;
1625  if (syzstr->Tl!=NULL)
1626  delete syzstr->Tl;
1627  if ((syzstr->syRing != NULL) && (syzstr->syRing != r))
1628  {
1629  if(syzstr->syRing->typ[1].ord_typ == ro_syzcomp)
1630  rChangeSComps(NULL, NULL, 0, syzstr->syRing);
1631 
1632  rDelete(syzstr->syRing);
1633  }
1634  omFreeSize((ADDRESS)syzstr, sizeof(ssyStrategy));
1635  }

◆ syKillEmptyEntres()

void syKillEmptyEntres ( resolvente  res,
int  length 
)

Definition at line 2200 of file syz1.cc.

2202 {
2203  int i,j,jj,k,rj;
2204  intvec * changes;
2205  poly p;
2206  ideal ri;
2207 
2208  for (i=0;i<length;i++)
2209  {
2210  ri = res[i];
2211  if (ri!=NULL)
2212  {
2213  rj = IDELEMS(ri);
2214  changes = new intvec(rj+1,1,-1);
2215  while ((rj>0) && (ri->m[rj-1]==NULL)) rj--;
2216  j = k = 0;
2217  while (j+k<rj)
2218  {
2219  if (ri->m[j+k]!=NULL)
2220  {
2221  ri->m[j] = ri->m[j+k];
2222  (*changes)[j+k+1] = j+1;
2223  j++;
2224  }
2225  else
2226  {
2227  k++;
2228  }
2229  }
2230  for (jj=j;jj<rj;jj++)
2231  ri->m[jj] = NULL;
2232  if (res[i+1]!=NULL)
2233  {
2234  ri = res[i+1];
2235  for (j=IDELEMS(ri)-1;j>=0;j--)
2236  {
2237  p = ri->m[j];
2238  while (p!=NULL)
2239  {
2240  pSetComp(p,(*changes)[pGetComp(p)]);
2241  pSetm(p);
2242  pIter(p);
2243  }
2244  }
2245  }
2246  delete changes;
2247  }
2248  }

◆ syLaScala()

syStrategy syLaScala ( ideal  arg,
int &  maxlength,
intvec weights 
)

Definition at line 2559 of file syz1.cc.

2561 {
2562  int i,j,actdeg=32000,index=0;
2563  int howmuch;
2564  ideal temp;
2565  SSet nextPairs;
2566  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
2567  ring origR = currRing;
2568 
2569  if(weights!= NULL)
2570  syzstr->cw = new intvec(weights);
2571  else
2572  syzstr->cw = NULL;
2573 
2574  if ((idIs0(arg)) ||
2575  ((id_RankFreeModule(arg,currRing)>0) && (!idTestHomModule(arg, NULL, syzstr->cw))))
2576  {
2578  syzstr->length = 1;
2579  syzstr->minres[0] = idInit(1,arg->rank);
2580  return syzstr;
2581  }
2582 
2583 
2584  //crit = 0;
2585  //euler = -1;
2586 
2587  if( maxlength > 0 )
2588  syzstr->length = maxlength; // = (currRing->N)+2;
2589  else
2590  syzstr->length = maxlength = (currRing->N)+2;
2591 
2592  // Creare dp,S ring and change to it
2593  syzstr->syRing = rAssure_dp_S(origR);
2594  assume(syzstr->syRing != origR);
2595  assume(syzstr->syRing->typ[1].ord_typ == ro_syzcomp);
2596  rChangeCurrRing(syzstr->syRing);
2597 
2598  // set initial ShiftedComps
2599  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
2600  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
2601  for (i=0;i<=arg->rank;i++)
2602  {
2604  currcomponents[i] = i;
2605  }
2607 /*--- initializes the data structures---------------*/
2608  syzstr->Tl = new intvec(maxlength);
2609  temp = idInit(IDELEMS(arg),arg->rank);
2610  for (i=0;i<IDELEMS(arg);i++)
2611  {
2612  temp->m[i] = prCopyR( arg->m[i], origR, currRing);
2613  if (temp->m[i]!=NULL)
2614  {
2615  j = pTotaldegree(temp->m[i]);
2616  if (j<actdeg) actdeg = j;
2617  }
2618  }
2619  idTest(temp);
2620  idSkipZeroes(temp);
2621  idTest(temp);
2622  syzstr->resPairs = syInitRes(temp,&maxlength,syzstr->Tl,syzstr->cw);
2623  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
2624  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(long));
2625 
2626  syzstr->res = (resolvente)omAlloc0((maxlength+1)*sizeof(ideal));
2627  syzstr->orderedRes = (resolvente)omAlloc0((maxlength+1)*sizeof(ideal));
2628  syzstr->elemLength = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2629 
2630  syzstr->truecomponents = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2631  syzstr->ShiftedComponents = (long**)omAlloc0((maxlength+1)*sizeof(long*));
2632 
2633  syzstr->backcomponents = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2634  syzstr->Howmuch = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2635  syzstr->Firstelem = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2636  syzstr->sev = (unsigned long **) omAlloc0((maxlength+1)*sizeof(unsigned long *));
2637 
2638  assume( syzstr->length == maxlength );
2639 
2640  syzstr->bucket = kBucketCreate(currRing);
2641  int len0=id_RankFreeModule(temp,currRing)+1;
2642 
2643  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2644  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2645 /*--- computes the resolution ----------------------*/
2646  while (nextPairs!=NULL)
2647  {
2648  if (TEST_OPT_PROT) Print("%d",actdeg);
2649  if (TEST_OPT_PROT) Print("(m%d)",index);
2650  if (index==0)
2651  i = syInitSyzMod(syzstr,index,len0);
2652  else
2653  i = syInitSyzMod(syzstr,index);
2654  currcomponents = syzstr->truecomponents[si_max(index-1,0)];
2657  IDELEMS(syzstr->res[si_max(index-1,0)]), currRing);
2658  j = syInitSyzMod(syzstr,index+1);
2659  if (index>0)
2660  {
2661  syRedNextPairs(nextPairs,syzstr,howmuch,index);
2662  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
2663  }
2664  else
2665  syRedGenerOfCurrDeg(syzstr,actdeg,index+1);
2666 /*--- creates new pairs -----------------------------*/
2667  syCreateNewPairs(syzstr,index,i);
2668  if (index<(maxlength-1))
2669  {
2670  syCreateNewPairs(syzstr,index+1,j);
2671  }
2672  index++;
2673  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2674  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2675  }
2676  if (temp!=NULL) idDelete(&temp);
2677  kBucketDestroy(&(syzstr->bucket));
2678  if (origR != syzstr->syRing)
2679  rChangeCurrRing(origR);
2680  if (TEST_OPT_PROT) PrintLn();
2681  return syzstr;

◆ syLaScala3()

syStrategy syLaScala3 ( ideal  arg,
int *  length 
)

Definition at line 2433 of file syz1.cc.

2435 {
2436  int i,j,actdeg=32000,index=0;
2437  int howmuch;
2438  ideal temp;
2439  SSet nextPairs;
2440  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
2441  ring origR = currRing;
2442 
2443  if ((idIs0(arg)) ||
2444  ((id_RankFreeModule(arg,currRing)>0) && (!idHomModule(arg,NULL,&(syzstr->cw)))))
2445  {
2447  syzstr->length = 1;
2448  syzstr->minres[0] = idInit(1,arg->rank);
2449  return syzstr;
2450  }
2451 
2452  //crit = 0;
2453  //euler = -1;
2454  syzstr->length = *length = (currRing->N)+2;
2455 
2456  // Creare dp,S ring and change to it
2457  syzstr->syRing = rAssure_dp_S(origR);
2458  assume(syzstr->syRing != origR); // why?
2459  rChangeCurrRing(syzstr->syRing);
2460 
2461  // set initial ShiftedComps
2462  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
2463  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
2464  for (i=0;i<=arg->rank;i++)
2465  {
2467  currcomponents[i] = i;
2468  }
2470 /*--- initializes the data structures---------------*/
2471  syzstr->Tl = new intvec(*length);
2472  temp = idInit(IDELEMS(arg),arg->rank);
2473  for (i=0;i<IDELEMS(arg);i++)
2474  {
2475  temp->m[i] = prCopyR( arg->m[i], origR, syzstr->syRing);
2476  if (temp->m[i]!=NULL)
2477  {
2478  j = pTotaldegree(temp->m[i]);
2479  if (j<actdeg) actdeg = j;
2480  }
2481  }
2482  idTest(temp);
2483  idSkipZeroes(temp);
2484  idTest(temp);
2485  syzstr->resPairs = syInitRes(temp,length,syzstr->Tl,syzstr->cw);
2486  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
2487  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(long));
2488  syzstr->res = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
2489  syzstr->orderedRes = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
2490  syzstr->elemLength = (int**)omAlloc0((*length+1)*sizeof(int*));
2491  syzstr->truecomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
2492  syzstr->ShiftedComponents = (long**)omAlloc0((*length+1)*sizeof(long*));
2493  syzstr->backcomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
2494  syzstr->Howmuch = (int**)omAlloc0((*length+1)*sizeof(int*));
2495  syzstr->Firstelem = (int**)omAlloc0((*length+1)*sizeof(int*));
2496  syzstr->sev = (unsigned long **) omAlloc0((*length+1)*sizeof(unsigned long *));
2497  syzstr->bucket = kBucketCreate(currRing);
2498  int len0=id_RankFreeModule(temp,currRing)+1;
2499 
2500  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2501  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2502 /*--- computes the resolution ----------------------*/
2503  while (nextPairs!=NULL)
2504  {
2505  if (TEST_OPT_PROT) Print("%d",actdeg);
2506  if (TEST_OPT_PROT) Print("(m%d)",index);
2507  if (index==0)
2508  i = syInitSyzMod(syzstr,index,len0);
2509  else
2510  i = syInitSyzMod(syzstr,index);
2511  currcomponents = syzstr->truecomponents[si_max(index-1,0)];
2514  IDELEMS(syzstr->res[si_max(index-1,0)]), currRing);
2515  j = syInitSyzMod(syzstr,index+1);
2516  if (index>0)
2517  {
2518  syRedNextPairs(nextPairs,syzstr,howmuch,index);
2519  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
2520  }
2521  else
2522  syRedGenerOfCurrDeg(syzstr,actdeg,index+1);
2523 /*--- creates new pairs -----------------------------*/
2524  syCreateNewPairs(syzstr,index,i);
2525  if (index<(*length)-1)
2526  {
2527  syCreateNewPairs(syzstr,index+1,j);
2528  }
2529  index++;
2530  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2531  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2532  }
2533  if (temp!=NULL) idDelete(&temp);
2534  kBucketDestroy(&(syzstr->bucket));
2535 
2536  if (origR != syzstr->syRing)
2537  rChangeCurrRing(origR);
2538 
2539  if (TEST_OPT_PROT) PrintLn();
2540 
2541  assume(syzstr->minres==NULL); assume(syzstr->fullres ==NULL);
2542  assume(syzstr->resPairs!=NULL); assume(syzstr->hilb_coeffs==NULL);
2543  assume(syzstr->res!=NULL);
2544 
2545  if(! TEST_OPT_NO_SYZ_MINIM )
2546  syzstr->minres = syReadOutMinimalRes(syzstr);
2547  else
2548  syzstr->fullres = syReorder(syzstr->res, syzstr->length, syzstr); // buggy? (betti...?)
2549 
2550  return syzstr;

◆ syLengthInt()

static int syLengthInt ( int  i)
static

Definition at line 1918 of file syz1.cc.

1920 {
1921  int j=0;
1922 
1923  if (i==0) return 1;
1924  while (i!=0)
1925  {
1926  j++;
1927  i = i/10;
1928  }
1929  return j;

◆ syLinStrat()

static intvec* syLinStrat ( SSet  nextPairs,
syStrategy  syzstr,
int  howmuch,
int  index 
)
static

Definition at line 649 of file syz1.cc.

652 {
653  int i=howmuch-1,i1=0,i2,i3,l,ll;
654  int ** Fin=syzstr->Firstelem;
655  int ** Hin=syzstr->Howmuch;
656  ideal o_r=syzstr->orderedRes[index+1];
657  intvec *result=new intvec(howmuch+1);
658  intvec *spl=new intvec(howmuch,1,-1);
659  BOOLEAN isDivisible;
660  SObject tso;
661 
662  while (i>=0)
663  {
664  tso = nextPairs[i];
665  isDivisible = FALSE;
666  if (syzstr->res[index+1]!=NULL)
667  {
668  l = Fin[index][pGetComp(tso.lcm)]-1;
669  if (l>=0)
670  {
671  ll = l+Hin[index][pGetComp(tso.lcm)];
672  while ((l<ll) && (!isDivisible))
673  {
674  if (o_r->m[l]!=NULL)
675  {
676  isDivisible = isDivisible ||
677  pLmDivisibleByNoComp(o_r->m[l],tso.lcm);
678  }
679  l++;
680  }
681  }
682  }
683  if (isDivisible)
684  {
685  syDeletePair(&nextPairs[i]);
686  //crit++;
687  }
688  else
689  {
690  pTest(tso.p2);
691  pTest(tso.p1);
692  nextPairs[i].p =
693  ksOldCreateSpoly(tso.p2, tso.p1,NULL);
694  (*spl)[i] = pLength(nextPairs[i].p);
695  }
696  i--;
697  }
698  i3 = 0;
699  loop
700  {
701  i2 = -1;
702  for (i1=0;i1<howmuch;i1++)
703  {
704  if (i2==-1)
705  {
706  if ((*spl)[i1]!=-1)
707  {
708  i2 = i1;
709  }
710  }
711  else
712  {
713  if (((*spl)[i1]>=0) && ((*spl)[i1]<(*spl)[i2]))
714  {
715  i2 = i1;
716  }
717  }
718  }
719  if (i2>=0)
720  {
721  (*result)[i3] = i2+1;
722  (*spl)[i2] = -1;
723  i3++;
724  }
725  else
726  {
727  break;
728  }
729  }
730  delete spl;
731  return result;

◆ syMinimize()

syStrategy syMinimize ( syStrategy  syzstr)

Definition at line 2394 of file syz1.cc.

2396 {
2397  if (syzstr->minres==NULL)
2398  {
2399  if (syzstr->resolution!=NULL)
2400  {
2401  // need to clear syzstr->resolution, as we are
2402  // now displaying the minres instead of fullres
2403  delete syzstr->resolution;
2404  syzstr->resolution=NULL;
2405  }
2406  if (syzstr->resPairs!=NULL)
2407  {
2408  if (syzstr->hilb_coeffs==NULL)
2409  {
2410  // La Scala Resolution
2411  syzstr->minres = syReadOutMinimalRes(syzstr);
2412  }
2413  else
2414  { // HRES
2415  syzstr->minres = syReorder(syzstr->orderedRes,syzstr->length,syzstr);
2416  }
2417  }
2418  else if (syzstr->fullres!=NULL)
2419  {
2420  syMinimizeResolvente(syzstr->fullres,syzstr->length,1);
2421  syzstr->minres = syzstr->fullres;
2422  syzstr->fullres = NULL;
2423  }
2424  }
2425  (syzstr->references)++;
2426  return syzstr;

◆ syMinimizeP1()

static poly syMinimizeP1 ( int  toMin,
syStrategy  syzstr,
intvec ordn,
int  index,
intvec toStrip 
)
static

Definition at line 2151 of file syz1.cc.

2154 {
2155  int ii=0,i,tc,lp,ltS=-1;
2156  poly p,mp=NULL,pp;
2157  SSet sPairs=syzstr->resPairs[index];
2158  poly tempStripped=NULL;
2159 
2160  pp = syStripOutCopy(syzstr->res[index+1]->m[toMin],toStrip);
2161  kBucketInit(syzstr->bucket,pp,-1);
2162  while ((ii<ordn->length()) && ((*ordn)[ii]!=-1) &&
2163  (sPairs[(*ordn)[ii]].syzind!=toMin))
2164  {
2165  ii++;
2166  }
2167  while (ii>=0)
2168  {
2169  i = (*ordn)[ii];
2170  if (sPairs[i].isNotMinimal!=NULL)
2171  {
2172  tempStripped =
2173  syStripOutCopy(syzstr->res[index+1]->m[sPairs[i].syzind],toStrip);
2174  tc = pGetComp(sPairs[i].isNotMinimal);
2175  //p = pTakeOutComp1(&tempStripped,tc);
2176  int lu;
2177  pTakeOutComp(&tempStripped,tc,&p,&lu);
2178  kBucketTakeOutComp(syzstr->bucket,tc,&mp,&lp);
2179  mp = pDivideM(mp,p);
2180  while (mp!=NULL)
2181  {
2182  p = pNext(mp);
2183  pNext(mp) = NULL;
2184  ltS = -1;
2185  kBucket_Minus_m_Mult_p(syzstr->bucket,mp,tempStripped,&ltS);
2186  pDelete(&mp);
2187  mp = p;
2188  }
2189  pDelete(&mp);
2190  pDelete(&tempStripped);
2191  }
2192  ii--;
2193  }
2194  kBucketClear(syzstr->bucket,&pp,&lp);
2195  return pp;

◆ syOrder()

static BOOLEAN syOrder ( poly  p,
syStrategy  syzstr,
int  index,
int  realcomp 
)
static

Definition at line 461 of file syz1.cc.

464 {
465  int i=IDELEMS(syzstr->res[index-1])+1,j=0,k,tc,orc,ie=realcomp-1;
466  int *trind1=syzstr->truecomponents[index-1];
467  int *trind=syzstr->truecomponents[index];
468  long *shind=syzstr->ShiftedComponents[index];
469  int *bc=syzstr->backcomponents[index];
470  int *F1=syzstr->Firstelem[index-1];
471  int *H1=syzstr->Howmuch[index-1];
472  polyset o_r=syzstr->orderedRes[index]->m;
473  BOOLEAN ret = FALSE;
474 
475  // if != 0, then new element can go into same component
476  // i.e., we do not need to leave space in shifted components
477  long same_comp = 0;
478 
479  if (p==NULL) return FALSE;
480  if (realcomp==0) realcomp=1;
481 
482  if (index>1)
483  tc = trind1[pGetComp(p)]-1;
484  else
485  tc = pGetComp(p)-1;
486  loop //while ((j<ie) && (trind1[orc]<=tc+1))
487  {
488  if (j>=ie)
489  break;
490  else
491  {
492  orc = pGetComp(o_r[j]);
493  if (trind1[orc]>tc+1) break;
494  else if (trind1[orc] == tc+1)
495  {
496  same_comp = 1;
497  }
498  else
499  {
500  assume(same_comp == 0);
501  }
502  j += H1[orc];
503  }
504  }
505  if (j>ie)
506  {
507  WerrorS("orderedRes to small");
508  return FALSE;
509  }
510  ie++;
511  if (j == (ie -1))
512  {
513  // new element is the last in ordered module
514  if (same_comp == 0)
515  same_comp = SYZ_SHIFT_BASE;
516 
517  // test wheter we have enough space for new shifted component
518  if ((LONG_MAX - same_comp) <= shind[ie-1])
519  {
520  long new_space = syReorderShiftedComponents(shind, ie);
521  assume((LONG_MAX - same_comp) > shind[ie-1]);
522  ret = TRUE;
523  if (TEST_OPT_PROT) Print("(T%ld)", new_space);
524  }
525 
526  // yes, then set new shifted component
527  assume(ie == 1 || shind[ie-1] > 0);
528  shind[ie] = shind[ie-1] + same_comp;
529  }
530  else
531  {
532  // new element must come in between
533  // i.e. at place j+1
534  long prev, next;
535 
536  // test whether new component can get shifted value
537  prev = shind[j];
538  next = shind[j+1];
539  assume(next > prev);
540  if ((same_comp && prev + 2 >= next) || (!same_comp && next - prev < 4))
541  {
542  long new_space = syReorderShiftedComponents(shind, ie);
543  prev = shind[j];
544  next = shind[j+1];
545  assume((same_comp && prev + 2 < next) || (!same_comp && next - prev >= 4));
546  ret = TRUE;
547  if (TEST_OPT_PROT) Print("(B%ld)", new_space);
548  }
549 
550  // make room for insertion of j+1 shifted component
551  for (k=ie; k > j+1; k--) shind[k] = shind[k-1];
552 
553  if (same_comp)
554  {
555  // can simply add one
556  shind[j+1] = prev + 1;
557  assume(shind[j+1] + 1 < shind[j+2]);
558  }
559  else
560  {
561  // need to leave more breathing room - i.e. value goes in
562  // between
563  shind[j+1] = prev + ((next - prev) >> 1);
564  assume (shind[j] + 1 < shind[j+1] && shind[j+1] + 1 < shind[j+2]);
565  }
566  }
567 
568  if (o_r[j]!=NULL)
569  {
570  for (k=ie-1;k>j;k--)
571  {
572  o_r[k] = o_r[k-1];
573  bc[k] = bc[k-1];
574  }
575  }
576  o_r[j] = p;
577  bc[j] = realcomp-1;
578  (H1[pGetComp(p)])++;
579  for (k=0;k<i;k++)
580  {
581  if (F1[k]>j)
582  (F1[k])++;
583  }
584  if (F1[pGetComp(p)]==0)
585  F1[pGetComp(p)]=j+1;
586  for (k=0;k<IDELEMS((syzstr->res)[index]);k++)
587  {
588  if (trind[k]>j)
589  trind[k] += 1;
590  }
591  for (k=IDELEMS((syzstr->res)[index])-1;k>realcomp;k--)
592  trind[k] = trind[k-1];
593  trind[realcomp] = j+1;
594  return ret;

◆ syOrdPairs()

static intvec* syOrdPairs ( SSet  sPairs,
int  length 
)
static

Definition at line 2275 of file syz1.cc.

2277 {
2278  intvec * result=new intvec(length,1,-1);
2279  int i,j=0,k=-1,l,ii;
2280 
2281  loop
2282  {
2283  l = -1;
2284  for(i=0;i<length;i++)
2285  {
2286  if (sPairs[i].syzind>k)
2287  {
2288  if (l==-1)
2289  {
2290  l = sPairs[i].syzind;
2291  ii = i;
2292  }
2293  else
2294  {
2295  if (sPairs[i].syzind<l)
2296  {
2297  l = sPairs[i].syzind;
2298  ii = i;
2299  }
2300  }
2301  }
2302  }
2303  if (l==-1) break;
2304  (*result)[j] = ii;
2305  j++;
2306  k = l;
2307  }
2308  return result;

◆ syPrint()

void syPrint ( syStrategy  syzstr,
const char *  sn 
)

Definition at line 1934 of file syz1.cc.

1936 {
1937  if ( (syzstr->resPairs==NULL) &&
1938  (syzstr->fullres==NULL) &&
1939  (syzstr->minres==NULL) &&
1940  (syzstr->resolution == NULL) )
1941  {
1942  PrintS("No resolution defined\n");
1943  return;
1944  }
1945 
1946  intvec* resolution = syzstr->resolution;
1947 
1948  if (resolution==NULL)
1949  {
1950  if (syzstr->resPairs!=NULL)
1951  {
1952  resolution = new intvec(syzstr->length+1);
1953  SRes rP = syzstr->resPairs;
1954 // assume(idRankFreeModule(syzstr->res[1], (syzstr->syRing != NULL ? syzstr->syRing : currRing))==syzstr->res[1]->rank);
1955  (*resolution)[0] = syzstr->res[1]->rank;
1956  int k=0;
1957  while ((k<syzstr->length) && (rP[k]!=NULL))
1958  {
1959  int j = 0;
1960  while ((j<(*syzstr->Tl)[k]) &&
1961  ((rP[k][j].lcm!=NULL) || (rP[k][j].syz!=NULL)))
1962  {
1963  if (rP[k][j].isNotMinimal==NULL)
1964  ((*resolution)[k+1])++;
1965  j++;
1966  }
1967  k++;
1968  }
1969  }
1970  else
1971  {
1972  resolution = new intvec(syzstr->length+2);
1973  resolvente rr;
1974  if (syzstr->minres!=NULL)
1975  rr = syzstr->minres;
1976  else
1977  rr = syzstr->fullres;
1978  (*resolution)[0]
1979  = si_max(1,(int)id_RankFreeModule(rr[0],
1980  (syzstr->syRing != NULL ? syzstr->syRing : currRing)));
1981  int k=0;
1982  while ((k<syzstr->length) && (rr[k]!=NULL))
1983  {
1984  (*resolution)[k+1] = idElem(rr[k]);
1985  k++;
1986  }
1987  }
1988  }
1989 
1990  int sl=strlen(sn);
1991  syPrintEmptySpaces1(sl);
1992  int k = 0;
1993  loop
1994  {
1995  if ((k>=resolution->length()) || ((*resolution)[k]==0))
1996  break;
1997  Print("%d",(*resolution)[k]);
1998  syPrintEmptySpaces1(sl+5);
1999  k++;
2000  }
2001  PrintLn();
2002  k = 0;
2003  loop
2004  {
2005  if ((k>=resolution->length()) || ((*resolution)[k]==0))
2006  break;
2007  PrintS(sn);
2008  if (((k+1)>=resolution->length()) || ((*resolution)[(k+1)]==0))
2009  break;
2010  PrintS(" <-- ");
2011  syPrintEmptySpaces((*resolution)[k]);
2012  k++;
2013  }
2014  PrintLn();
2015  PrintLn();
2016  k = 0;
2017  loop
2018  {
2019  if ((k>=resolution->length()) || ((*resolution)[k]==0))
2020  break;
2021  Print("%d",k);
2022  syPrintEmptySpaces1(sl+5+syLengthInt((*resolution)[k])-
2023  syLengthInt(k));
2024  k++;
2025  }
2026  PrintLn();
2027  if (syzstr->minres==NULL)
2028  {
2029  PrintS("resolution not minimized yet\n");
2030  }
2031 
2032  if (syzstr->resolution == NULL) syzstr->resolution = resolution;

◆ syPrintEmptySpaces()

static void syPrintEmptySpaces ( int  i)
static

Definition at line 1894 of file syz1.cc.

1896 {
1897  if (i!=0)
1898  {
1899  PrintS(" ");
1900  syPrintEmptySpaces(i/10);
1901  }

◆ syPrintEmptySpaces1()

static void syPrintEmptySpaces1 ( int  i)
static

Definition at line 1906 of file syz1.cc.

1908 {
1909  if (i!=0)
1910  {
1911  PrintS(" ");
1913  }

◆ syReadOutMinimalRes()

static resolvente syReadOutMinimalRes ( syStrategy  syzstr,
BOOLEAN  computeStd = FALSE 
)
static

Definition at line 2313 of file syz1.cc.

2316 {
2317  intvec * Strip, * ordn;
2318  resolvente tres=(resolvente)omAlloc0((syzstr->length+1)*sizeof(ideal));
2319  ring origR = currRing;
2320 
2321 //Print("Hier ");
2322  if (computeStd)
2323  {
2324  tres[0] = syzstr->res[1];
2325  syzstr->res[1] = idInit(IDELEMS(tres[0]),tres[0]->rank);
2326  return tres;
2327  }
2328  int i,l,index,i1;
2329  SSet sPairs;
2330 
2331  assume(syzstr->syRing != NULL);
2332  rChangeCurrRing(syzstr->syRing);
2333 //Print("laeufts ");
2334  syzstr->bucket = kBucketCreate(syzstr->syRing);
2335  for (index=syzstr->length-1;index>0;index--)
2336  {
2337  if (syzstr->resPairs[index]!=NULL)
2338  {
2339 //Print("ideal %d: \n",index);
2340  currcomponents = syzstr->truecomponents[index];
2343  IDELEMS(syzstr->res[index]), currRing);
2344  sPairs = syzstr->resPairs[index];
2345  Strip = syToStrip(syzstr,index);
2346  tres[index+1] = idInit(IDELEMS(syzstr->res[index+1]),syzstr->res[index+1]->rank);
2347  i1 = (*syzstr->Tl)[index];
2348 //Print("i1= %d\n",i1);
2349  ordn = syOrdPairs(sPairs,i1);
2350  for (i=0;i<i1;i++)
2351  {
2352  if ((sPairs[i].isNotMinimal==NULL) && (sPairs[i].lcm!=NULL))
2353  {
2354  l = sPairs[i].syzind;
2355 //Print("Minimiere Poly %d: ",l);pWrite(syzstr->res[index+1]->m[l]);
2356  tres[index+1]->m[l] =
2357  syMinimizeP1(l,syzstr,ordn,index,Strip);
2358  }
2359  }
2360  delete Strip;
2361  delete ordn;
2362  Strip = NULL;
2363  }
2364  }
2365  currcomponents = syzstr->truecomponents[0];
2368  IDELEMS(syzstr->res[0]), currRing);
2369  tres[1] = idInit(IDELEMS(syzstr->res[1]),syzstr->res[1]->rank);
2370  sPairs = syzstr->resPairs[0];
2371  for (i=(*syzstr->Tl)[0]-1;i>=0;i--)
2372  {
2373  if (sPairs[i].syzind>=0)
2374  {
2375  tres[1]->m[sPairs[i].syzind] = pCopy(syzstr->res[1]->m[sPairs[i].syzind]);
2376  }
2377  }
2378 /*--- changes to the original ring------------------*/
2379  kBucketDestroy(&syzstr->bucket);
2380  if (syzstr->syRing != NULL)
2381  {
2382  rChangeCurrRing(origR);
2383  // Thomas: now make sure that all data which you need is pFetchCopied
2384  // maybe incoporate it into syReorder ??
2385  }
2386  tres = syReorder(tres,syzstr->length,syzstr,FALSE,syzstr->res);
2387  syKillEmptyEntres(tres,syzstr->length);
2388  idSkipZeroes(tres[0]);
2389  return tres;

◆ syRedGenerOfCurrDeg()

static void syRedGenerOfCurrDeg ( syStrategy  syzstr,
int  deg,
int  index 
)
static

Definition at line 915 of file syz1.cc.

917 {
918  ideal res=syzstr->res[index];
919  int i=0,j,k=IDELEMS(res);
920  SSet sPairs=syzstr->resPairs[index-1];
921 
922  while ((k>0) && (res->m[k-1]==NULL)) k--;
923  while ((i<(*syzstr->Tl)[index-1]) && (((sPairs)[i].syz==NULL) ||
924  ((sPairs)[i].order<deg)))
925  i++;
926  if ((i>=(*syzstr->Tl)[index-1]) || ((sPairs)[i].order>deg)) return;
927  while ((i<(*syzstr->Tl)[index-1]) && (((sPairs)[i].syz==NULL) ||
928  ((sPairs)[i].order==deg)))
929  {
930  if ((sPairs)[i].syz!=NULL)
931  {
932  j = k-1;
933  while ((j>=0) && (res->m[j]!=NULL) &&
934  ((sPairs)[i].syz!=NULL))
935  {
936  if (pLmDivisibleBy(res->m[j],(sPairs)[i].syz))
937  {
938  (sPairs)[i].syz =
939  ksOldSpolyRed(res->m[j],(sPairs)[i].syz);
940  //sySPolyRed((sPairs)[i].syz,res->m[j]);
941  j = k-1;
942  }
943  else
944  {
945  j--;
946  }
947  }
948  if ((sPairs)[i].syz != NULL)
949  {
950  if (k==IDELEMS(res))
951  {
952  syEnlargeFields(syzstr,index);
953  res=syzstr->res[index];
954  }
955  if (TEST_OPT_DEBUG)
956  {
957  if ((sPairs)[i].isNotMinimal==NULL)
958  {
959  PrintLn();
960  PrintS("minimal generator: ");pWrite((syzstr->resPairs[index-1])[i].syz);
961  PrintS("comes from: ");pWrite((syzstr->resPairs[index-1])[i].p1);
962  PrintS("and: ");pWrite((syzstr->resPairs[index-1])[i].p2);
963  }
964  }
965  //res->m[k] = (sPairs)[i].syz;
966  res->m[k] = syRedtail((sPairs)[i].syz,syzstr,index);
967  (sPairs)[i].syzind = k;
968  syzstr->elemLength[index][k] = pLength((sPairs)[i].syz);
969  pNorm(res->m[k]);
970  // (sPairs)[i].syz = NULL;
971  k++;
972  if (syOrder(res->m[k-1],syzstr,index,k))
974  //euler++;
975  }
976  else
977  (sPairs)[i].syzind = -1;
978  }
979  i++;
980  }

◆ syRedNextPairs()

static void syRedNextPairs ( SSet  nextPairs,
syStrategy  syzstr,
int  howmuch,
int  index 
)
static

Definition at line 768 of file syz1.cc.

771 {
772  int i,j,k=IDELEMS(syzstr->res[index]);
773  int ks=IDELEMS(syzstr->res[index+1]);
774  int * Fin=syzstr->Firstelem[index-1];
775  int * Hin=syzstr->Howmuch[index-1];
776  int * bin=syzstr->backcomponents[index];
777  int * elL=syzstr->elemLength[index];
778  number coefgcd;
779  polyset redset=syzstr->orderedRes[index]->m;
780  poly p=NULL,q;
781  intvec *spl1;
782  SObject tso;
783  long * ShiftedComponents = syzstr->ShiftedComponents[index];
784  int* Components = syzstr->truecomponents[index];
785  assume(Components != NULL && ShiftedComponents != NULL);
786  BOOLEAN need_reset;
787 
788  if ((nextPairs==NULL) || (howmuch==0)) return;
789  while ((k>0) && (syzstr->res[index]->m[k-1]==NULL)) k--;
790  while ((ks>0) && (syzstr->res[index+1]->m[ks-1]==NULL)) ks--;
791  spl1 = syLinStrat(nextPairs,syzstr,howmuch,index);
792  i=0;
793  while ((*spl1)[i]>0)
794  {
795  need_reset = FALSE;
796  tso = nextPairs[(*spl1)[i]-1];
797  if ((tso.p1!=NULL) && (tso.p2!=NULL))
798  {
799  nNormalize(pGetCoeff(tso.p1));
800  nNormalize(pGetCoeff(tso.p2));
801  coefgcd =
802  n_SubringGcd(pGetCoeff(tso.p1),pGetCoeff(tso.p2),currRing->cf);
803  tso.syz = pHead(tso.lcm);
804  p = tso.syz;
805  pSetCoeff(p,nDiv(pGetCoeff(tso.p1),coefgcd));
807  pSetComp(p,tso.ind2+1);
808  p_Setm_Syz(p, currRing, Components, ShiftedComponents); // actueller index
809  pNext(p) = pHead(tso.lcm);
810  pIter(p);
811  pSetComp(p,tso.ind1+1);
812  p_Setm_Syz(p, currRing, Components, ShiftedComponents); // actueller index
813  pSetCoeff(p,nDiv(pGetCoeff(tso.p2),coefgcd));
814  nDelete(&coefgcd);
815  if (tso.p != NULL)
816  {
817  kBucketInit(syzstr->bucket,tso.p,-1);
818  q = kBucketGetLm(syzstr->bucket);
819  j = Fin[pGetComp(q)]-1;
820  int pos = j+Hin[pGetComp(q)];
821  loop
822  {
823  if (j<0) break;
824  if (pLmDivisibleByNoComp(redset[j],q))
825  {
826  pNext(p) = pHead(q);
827  pIter(p);
828  pSetComp(p,bin[j]+1);
829  p_Setm_Syz(p, currRing, Components, ShiftedComponents); // actueller index
830 //if (pLength(redset[j])!=syzstr->elemLength[index][bin[j]])
831 //Print("Halt");
832 //if (pLength(redset[j])!=syzstr->elemLength[index][bin[j]])
833 //Print("Halt");
835  number up = kBucketPolyRed(syzstr->bucket,redset[j],elL[bin[j]],
836  NULL);
837  // Thomas: Check whether you need number here
838  nDelete(&up);
839  q = kBucketGetLm(syzstr->bucket);
840  if (q==NULL) break;
841  j = Fin[pGetComp(q)]-1;
842  pos = j+Hin[pGetComp(q)];
843  }
844  else
845  {
846  j++;
847  if (j==pos) break;
848  }
849  }
850  int lb;
851  kBucketClear(syzstr->bucket,&tso.p,&lb);
852  }
853  if (tso.p != NULL)
854  {
855  if (TEST_OPT_PROT) PrintS("g");
856  if (k==IDELEMS((syzstr->res)[index]))
857  {
858  syEnlargeFields(syzstr,index);
859  bin=syzstr->backcomponents[index];
860  elL=syzstr->elemLength[index];
861  redset=syzstr->orderedRes[index]->m;
862  Components = syzstr->truecomponents[index];
863  ShiftedComponents = syzstr->ShiftedComponents[index];
864  }
865  pNext(p) = pHead(tso.p);
866  pIter(p);
867 
868  assume(p!= NULL);
869  k++;
870  syzstr->res[index]->m[k-1] = tso.p;
871  syzstr->elemLength[index][k-1] = pLength(tso.p);
872  pNorm(syzstr->res[index]->m[k-1]);
873  need_reset = syOrder(syzstr->res[index]->m[k-1],syzstr,index,k);
874  pSetComp(p,k); // actueller index
875  p_Setm_Syz(p, currRing, Components, ShiftedComponents);
877 
878  tso.isNotMinimal = p;
879  tso.p = NULL;
880  }
881  else
882  {
883  if (TEST_OPT_PROT) PrintS(".");
884  //if (index % 2==0)
885  //euler++;
886  //else
887  //euler--;
888  }
889  if (ks==IDELEMS(syzstr->res[index+1]))
890  {
891  syEnlargeFields(syzstr,index+1);
892  }
893  syzstr->res[index+1]->m[ks] = tso.syz;
894  syzstr->elemLength[index+1][ks] = pLength(tso.syz);
895  pNorm(syzstr->res[index+1]->m[ks]);
896  tso.syz =NULL;
897  tso.syzind = ks;
898  if (need_reset)
899  syResetShiftedComponents(syzstr, index+1);
900  if (syOrder(syzstr->res[index+1]->m[ks],syzstr,index+1,ks+1))
901  syResetShiftedComponents(syzstr, index+2);
902  ks++;
903  p = NULL;
904  nextPairs[(*spl1)[i]-1] = tso;
905  }
906  i++;
907  }
908  delete spl1;

◆ syRedtail()

poly syRedtail ( poly  p,
syStrategy  syzstr,
int  index 
)

Definition at line 226 of file syz1.cc.

228 {
229  poly h, hn;
230  int j,pos;
231  ideal redWith=syzstr->orderedRes[index];
232 
233  h = p;
234  hn = pNext(h);
235  while(hn != NULL)
236  {
237  j = syzstr->Firstelem[index-1][pGetComp(hn)]-1;
238  if (j>=0)
239  {
240  pos = j+syzstr->Howmuch[index-1][pGetComp(hn)];
241  while (j < pos)
242  {
243  if (pLmDivisibleByNoComp(redWith->m[j], hn))
244  {
245  //hn = sySPolyRed(hn,redWith->m[j]);
246  hn = ksOldSpolyRed(redWith->m[j],hn);
247  if (hn == NULL)
248  {
249  pNext(h) = NULL;
250  return p;
251  }
252  j = syzstr->Firstelem[index-1][pGetComp(hn)]-1;
253  pos = j+syzstr->Howmuch[index-1][pGetComp(hn)];
254  }
255  else
256  {
257  j++;
258  }
259  }
260  }
261  h = pNext(h) = hn;
262  hn = pNext(h);
263  }
264  return p;

◆ syReorder()

resolvente syReorder ( resolvente  res,
int  length,
syStrategy  syzstr,
BOOLEAN  toCopy,
resolvente  totake 
)

Definition at line 1641 of file syz1.cc.

1644 {
1645  int i,j,l;
1646  poly p,q,tq;
1647  polyset ri1;
1648  resolvente fullres;
1649  ring origR=syzstr->syRing;
1650  fullres = (resolvente)omAlloc0((length+1)*sizeof(ideal));
1651  if (totake==NULL)
1652  totake = res;
1653  for (i=length-1;i>0;i--)
1654  {
1655  if (res[i]!=NULL)
1656  {
1657  if (i>1)
1658  {
1659  j = IDELEMS(res[i-1]);
1660  while ((j>0) && (res[i-1]->m[j-1]==NULL)) j--;
1661  fullres[i-1] = idInit(IDELEMS(res[i]),j);
1662  ri1 = totake[i-1]->m;
1663  for (j=IDELEMS(res[i])-1;j>=0;j--)
1664  {
1665  p = res[i]->m[j];
1666  q = NULL;
1667  while (p!=NULL)
1668  {
1669  if (toCopy)
1670  {
1671  if (origR!=NULL)
1672  tq = prHeadR(p,origR, currRing);
1673  else
1674  tq = pHead(p);
1675  pIter(p);
1676  }
1677  else
1678  {
1679  res[i]->m[j] = NULL;
1680  if (origR!=NULL)
1681  {
1682  poly pp=p;
1683  pIter(p);
1684  pNext(pp)=NULL;
1685  tq = prMoveR(pp, origR, currRing);
1686  }
1687  else
1688  {
1689  tq = p;
1690  pIter(p);
1691  pNext(tq) = NULL;
1692  }
1693  }
1694 // pWrite(tq);
1695  pTest(tq);
1696  for (l=(currRing->N);l>0;l--)
1697  {
1698  if (origR!=NULL)
1699  pSubExp(tq,l, p_GetExp(ri1[pGetComp(tq)-1],l,origR));
1700  else
1701  pSubExp(tq,l, pGetExp(ri1[pGetComp(tq)-1],l));
1702  }
1703  pSetm(tq);
1704  pTest(tq);
1705  q = pAdd(q,tq);
1706  pTest(q);
1707  }
1708  fullres[i-1]->m[j] = q;
1709  }
1710  }
1711  else
1712  {
1713  if (origR!=NULL)
1714  {
1715  fullres[i-1] = idInit(IDELEMS(res[i]),res[i]->rank);
1716  for (j=IDELEMS(res[i])-1;j>=0;j--)
1717  {
1718  if (toCopy)
1719  fullres[i-1]->m[j] = prCopyR(res[i]->m[j], origR, currRing);
1720  else
1721  {
1722  fullres[i-1]->m[j] = prMoveR(res[i]->m[j], origR, currRing);
1723  res[i]->m[j] = NULL;
1724  }
1725  }
1726  }
1727  else
1728  {
1729  if (toCopy)
1730  fullres[i-1] = idCopy(res[i]);
1731  else
1732  {
1733  fullres[i-1] = res[i];
1734  res[i] = NULL;
1735  }
1736  }
1737  for (j=IDELEMS(fullres[i-1])-1;j>=0;j--)
1738  fullres[i-1]->m[j] = pSortCompCorrect(fullres[i-1]->m[j]);
1739  }
1740  if (!toCopy)
1741  {
1742  if (res[i]!=NULL) idDelete(&res[i]);
1743  }
1744  }
1745  }
1746  if (!toCopy)
1747  omFreeSize((ADDRESS)res,(length+1)*sizeof(ideal));
1748  //syzstr->length = length;
1749  return fullres;

◆ syReorderShiftedComponents()

long syReorderShiftedComponents ( long *  sc,
int  n 
)

Definition at line 334 of file syz1.cc.

336 {
337  long holes = 0;
338  int i;
339  long new_comps = 0, new_space, max;
340 
341  // count number of holes
342  for (i=1; i<n; i++)
343  {
344  if (sc[i-1] + 1 < sc[i]) holes++;
345  }
346 
347  if (LONG_MAX - SYZ_SHIFT_BASE <= sc[n-1])
348  {
349  // need new components
350  new_comps = (((long) 1) << SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE) - 1;
351  max = LONG_MAX;
352  }
353  else
354  {
355  max = sc[n-1] + SYZ_SHIFT_BASE;
356  }
357 
358  // no we arrange things such that
359  // (n - holes) + holes*new_space + new_comps*SYZ_SHIFT_BASE= LONG_MAX
360  new_space = (max - n + holes - new_comps*SYZ_SHIFT_BASE) / holes;
361 
362  assume(new_space < SYZ_SHIFT_BASE && new_space >= 4);
363 
364  long* tc = ( long*) omAlloc(n*sizeof(long));
365  tc[0] = sc[0];
366  // rearrange things
367  for (i=1; i<n; i++)
368  {
369  if (sc[i-1] + 1 < sc[i])
370  {
371  tc[i] = tc[i-1] + new_space;
372  }
373  else
374  {
375  tc[i] = tc[i-1] + 1;
376  }
377  assume(tc[i] > tc[i-1]);
378  }
379 
380  assume(LONG_MAX - SYZ_SHIFT_BASE > tc[n-1]);
381 #ifndef SING_NDEBUG
382  for (i=1; i<n; i++)
383  {
384  assume(tc[i] >= 0);
385  assume(tc[i-1] + 1 <= tc[i]);
386  }
387 #endif
388 
389  omMemcpyW(sc, tc, n);
390  omFreeSize(tc, n*sizeof(long));
391  return new_space;

◆ syResetShiftedComponents()

void syResetShiftedComponents ( syStrategy  syzstr,
int  index,
int  hilb 
)

Definition at line 409 of file syz1.cc.

411 {
412  assume(index > 0);
413  int i;
414  if (syzstr->res[index] != NULL)
415  {
416  long * prev_s;
417  int* prev_c;
418  int p_length;
419  rGetSComps(&prev_c, &prev_s, &p_length, currRing);
420  currcomponents = syzstr->truecomponents[index-1];
424  IDELEMS(syzstr->res[index-1]), currRing);
425  if (hilb==0)
426  {
427  ideal id = syzstr->res[index];
428  for (i=0; i<IDELEMS(id); i++)
429  {
430  pResetSetm(id->m[i]);
431  }
432  }
433  else if (hilb==1)
434  {
435  assume (index>1);
436  assume (syzstr->resPairs[index-1]!=NULL);
437  SSet Pairs=syzstr->resPairs[index-1];
438  SSet Pairs1=syzstr->resPairs[index];
439  int till=(*syzstr->Tl)[index-1];
440  for (i=0;i<till;i++)
441  {
442  if (Pairs[i].syz!=NULL)
443  pResetSetm(Pairs[i].syz);
444  }
445  till=(*syzstr->Tl)[index];
446  for (i=0;i<till;i++)
447  {
448  if (Pairs1[i].p!=NULL)
449  pResetSetm(Pairs1[i].p);
450  }
451  }
452  currcomponents = prev_c;
453  currShiftedComponents = prev_s;
454  rChangeSComps(prev_c, prev_s, p_length, currRing);
455  }

◆ sySize()

int sySize ( syStrategy  syzstr)

Definition at line 1829 of file syz1.cc.

1831 {
1832  resolvente r=syzstr->res;
1833  if (r==NULL)
1834  r = syzstr->fullres;
1835  if (r==NULL)
1836  r = syzstr->minres;
1837  if (r==NULL)
1838  {
1839  WerrorS("No resolution found");
1840  return 0;
1841  }
1842  int i=syzstr->length;
1843  while ((i>0) && (r[i-1]==NULL)) i--;
1844  return i;

◆ syStripOutCopy()

static poly syStripOutCopy ( poly  p,
intvec toStrip 
)
static

Definition at line 2066 of file syz1.cc.

2068 {
2069  if (toStrip==NULL) return pCopy(p);
2070  poly result=NULL,pp;
2071 
2072  while (p!=NULL)
2073  {
2074  if ((*toStrip)[pGetComp(p)]==0)
2075  {
2076  if (result==NULL)
2077  {
2078  result = pp = pHead(p);
2079  }
2080  else
2081  {
2082  pNext(pp) = pHead(p);
2083  pIter(pp);
2084  }
2085  }
2086  pIter(p);
2087  }
2088  return result;

◆ syToStrip()

static intvec* syToStrip ( syStrategy  syzstr,
int  index 
)
static

Definition at line 2253 of file syz1.cc.

2255 {
2256  intvec * result=NULL;
2257 
2258  if ((syzstr->resPairs[index-1]!=NULL) && (!idIs0(syzstr->res[index])))
2259  {
2260  result=new intvec(IDELEMS(syzstr->res[index])+1);
2261  for (int i=(*syzstr->Tl)[index-1]-1;i>=0;i--)
2262  {
2263  if (syzstr->resPairs[index-1][i].isNotMinimal!=NULL)
2264  {
2265  (*result)[syzstr->resPairs[index-1][i].syzind+1] = 1;
2266  }
2267  }
2268  }
2269  return result;

Variable Documentation

◆ currcomponents

int* currcomponents =NULL

Definition at line 33 of file syz1.cc.

◆ currShiftedComponents

long* currShiftedComponents =NULL

Definition at line 34 of file syz1.cc.

FALSE
#define FALSE
Definition: auxiliary.h:94
idCopy
ideal idCopy(ideal A)
Definition: ideals.h:59
ssyStrategy::Tl
intvec * Tl
Definition: syz.h:49
SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE
#define SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE
Definition: syz.h:14
idElem
int idElem(const ideal F)
count non-zero elements
Definition: simpleideals.cc:209
pTakeOutComp
void pTakeOutComp(poly *p, long comp, poly *q, int *lq, const ring R=currRing)
Splits *p into two polys: *q which consists of all monoms with component == comp and *p of all other ...
Definition: polys.h:321
syLinStrat
static intvec * syLinStrat(SSet nextPairs, syStrategy syzstr, int howmuch, int index)
Definition: syz1.cc:649
nNormalize
#define nNormalize(n)
Definition: numbers.h:30
syMinimizeResolvente
void syMinimizeResolvente(resolvente res, int length, int first)
Definition: syz.cc:356
syStripOutCopy
static poly syStripOutCopy(poly p, intvec *toStrip)
Definition: syz1.cc:2066
ssyStrategy::sev
unsigned long ** sev
Definition: syz.h:58
pGetComp
#define pGetComp(p)
Component.
Definition: polys.h:36
p_GetExp
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:458
j
int j
Definition: facHensel.cc:105
pNorm
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:345
syLengthInt
static int syLengthInt(int i)
Definition: syz1.cc:1918
ssyStrategy::Howmuch
int ** Howmuch
Definition: syz.h:41
TEST_OPT_PROT
#define TEST_OPT_PROT
Definition: options.h:101
k
int k
Definition: cfEzgcd.cc:92
idDelete
#define idDelete(H)
delete an ideal
Definition: ideals.h:28
rChangeCurrRing
void rChangeCurrRing(ring r)
Definition: polys.cc:15
result
return result
Definition: facAbsBiFact.cc:76
polyset
poly * polyset
Definition: polys.h:243
syStrategy
ssyStrategy * syStrategy
Definition: syz.h:34
pGetExp
#define pGetExp(p, i)
Exponent.
Definition: polys.h:40
pEnlargeSet
void pEnlargeSet(poly **p, int l, int increment)
Definition: p_polys.cc:3644
p_Setm_Syz
void p_Setm_Syz(poly p, ring r, int *Components, long *ShiftedComponents)
Definition: p_polys.cc:522
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
ssyStrategy::fullres
resolvente fullres
Definition: syz.h:56
kBucketPolyRed
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
Definition: kbuckets.cc:1075
syRedGenerOfCurrDeg
static void syRedGenerOfCurrDeg(syStrategy syzstr, int deg, int index)
Definition: syz1.cc:915
syReadOutMinimalRes
static resolvente syReadOutMinimalRes(syStrategy syzstr, BOOLEAN computeStd=FALSE)
Definition: syz1.cc:2313
syBetti
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
Definition: syz.cc:771
syOrdPairs
static intvec * syOrdPairs(SSet sPairs, int length)
Definition: syz1.cc:2275
length
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
ssyStrategy::minres
resolvente minres
Definition: syz.h:57
TEST_OPT_DEBUG
#define TEST_OPT_DEBUG
Definition: options.h:106
ssyStrategy::Firstelem
int ** Firstelem
Definition: syz.h:42
syEnlargeFields
void syEnlargeFields(syStrategy syzstr, int index)
Definition: syz1.cc:734
pResetSetm
static void pResetSetm(poly p)
Definition: syz1.cc:394
idTest
#define idTest(id)
Definition: ideals.h:46
omAlloc0Bin
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:204
kBucketGetLm
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:502
pDelete
#define pDelete(p_ptr)
Definition: polys.h:174
idTestHomModule
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:2100
ssyStrategy::resPairs
SRes resPairs
Definition: syz.h:48
idIs0
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
Definition: simpleideals.cc:767
syChosePairs
SSet syChosePairs(syStrategy syzstr, int *index, int *howmuch, int *actdeg)
Definition: syz1.cc:1288
loop
#define loop
Definition: structs.h:77
pSetComp
#define pSetComp(p, v)
Definition: polys.h:37
syEnterPair
void syEnterPair(SSet sPairs, SObject *so, int *sPlength, int)
Definition: syz1.cc:985
syCompactifyPairSet
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
Definition: syz1.cc:104
ind2
long ind2(long arg)
Definition: kutil.cc:4059
syKillEmptyEntres
void syKillEmptyEntres(resolvente res, int length)
Definition: syz1.cc:2200
pTotaldegree
static long pTotaldegree(poly p)
Definition: polys.h:264
char_ptr_bin
omBin char_ptr_bin
Definition: ring.cc:44
syPrintEmptySpaces
static void syPrintEmptySpaces(int i)
Definition: syz1.cc:1894
rGetSComps
void rGetSComps(int **currComponents, long **currShiftedComponents, int *length, ring r)
Definition: ring.cc:4345
_components
static int * _components
Definition: p_polys.cc:141
prMoveR
poly prMoveR(poly &p, ring src_r, ring dest_r)
Definition: prCopy.cc:90
pLength
static unsigned pLength(poly a)
Definition: p_polys.h:184
currcomponents
int * currcomponents
Definition: syz1.cc:33
syReorderShiftedComponents
long syReorderShiftedComponents(long *sc, int n)
Definition: syz1.cc:334
next
ListNode * next
Definition: janet.h:31
nInpNeg
#define nInpNeg(n)
Definition: numbers.h:21
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
ssyStrategy::references
short references
Definition: syz.h:62
ssyStrategy::bucket
kBucket_pt bucket
Definition: syz.h:53
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
ivCopy
intvec * ivCopy(const intvec *o)
Definition: intvec.h:132
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition: simpleideals.cc:113
res
CanonicalForm res
Definition: facAbsFact.cc:64
kBucketDestroy
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:212
ssyStrategy::orderedRes
resolvente orderedRes
Definition: syz.h:47
id_RankFreeModule
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
Definition: simpleideals.cc:781
ssyStrategy::truecomponents
int ** truecomponents
Definition: syz.h:38
syPrintEmptySpaces1
static void syPrintEmptySpaces1(int i)
Definition: syz1.cc:1906
PrintS
void PrintS(const char *s)
Definition: reporter.cc:283
omMemcpyW
#define omMemcpyW(p1, p2, l)
Definition: omMemOps.h:28
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:258
syInitializePair
void syInitializePair(SObject *so)
Definition: syz1.cc:63
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:85
pTest
#define pTest(p)
Definition: polys.h:396
syCopyPair
void syCopyPair(SObject *argso, SObject *imso)
Definition: syz1.cc:82
kBucketInit
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:489
pLcm
#define pLcm(a, b, m)
Definition: polys.h:277
kBucket_Minus_m_Mult_p
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...
Definition: kbuckets.cc:712
TEST_OPT_NO_SYZ_MINIM
#define TEST_OPT_NO_SYZ_MINIM
Definition: options.h:121
rAssure_dp_S
ring rAssure_dp_S(const ring r)
Definition: ring.cc:4879
idSkipZeroes
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
Definition: simpleideals.cc:171
ssyStrategy::syRing
ring syRing
Definition: syz.h:55
resolvente
ideal * resolvente
Definition: ideals.h:17
sySize
int sySize(syStrategy syzstr)
Definition: syz1.cc:1829
h
static Poly * h
Definition: janet.cc:972
max
static int max(int a, int b)
Definition: fast_mult.cc:264
pSubExp
#define pSubExp(p, i, v)
Definition: polys.h:45
syToStrip
static intvec * syToStrip(syStrategy syzstr, int index)
Definition: syz1.cc:2253
pOne
#define pOne()
Definition: polys.h:297
syReorder
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
Definition: syz1.cc:1641
intvec
Definition: intvec.h:16
pIter
#define pIter(p)
Definition: monomials.h:35
omAlloc
#define omAlloc(size)
Definition: omAllocDecl.h:208
ssyStrategy::length
int length
Definition: syz.h:59
nDiv
#define nDiv(a, b)
Definition: numbers.h:32
pSortCompCorrect
#define pSortCompCorrect(p)
Assume: If considerd only as poly in any component of p (say, monomials of other components of p are ...
Definition: polys.h:213
ssyStrategy::resolution
intvec * resolution
Definition: syz.h:50
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
kBucketClear
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:517
pLmDivisibleByNoComp
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
Definition: polys.h:136
ksOldSpolyRed
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
Definition: kInline.h:1041
pAdd
#define pAdd(p, q)
Definition: polys.h:190
syOrder
static BOOLEAN syOrder(poly p, syStrategy syzstr, int index, int realcomp)
Definition: syz1.cc:461
pDivideM
#define pDivideM(a, b)
Definition: polys.h:276
ssyStrategy::betti
intvec * betti
Definition: syz.h:52
p_Setm_General
void p_Setm_General(poly p, const ring r)
Definition: p_polys.cc:153
ssyStrategy::elemLength
int ** elemLength
Definition: syz.h:43
pSetCoeff
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:30
syChosePairsPutIn
static SSet syChosePairsPutIn(syStrategy syzstr, int *index, int *howmuch, int *actdeg, int an, int en)
Definition: syz1.cc:1181
syInitRes
SRes syInitRes(ideal arg, int *length, intvec *Tl, intvec *cw)
Definition: syz1.cc:293
rDelete
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:436
p_Delete
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
syResetShiftedComponents
void syResetShiftedComponents(syStrategy syzstr, int index, int hilb)
Definition: syz1.cc:409
syRedNextPairs
static void syRedNextPairs(SSet nextPairs, syStrategy syzstr, int howmuch, int index)
Definition: syz1.cc:768
si_max
static int si_max(const int a, const int b)
Definition: auxiliary.h:138
ssyStrategy::cw
intvec * cw
Definition: syz.h:51
kBucket::p
poly p
Definition: kbuckets.h:181
Print
#define Print
Definition: emacs.cc:79
kBucketTakeOutComp
void kBucketTakeOutComp(kBucket_pt bucket, long comp, poly *r_p, int *l)
Definition: kbuckets.cc:1034
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:36
syRedtail
poly syRedtail(poly p, syStrategy syzstr, int index)
Definition: syz1.cc:226
idHomModule
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:95
ro_syzcomp
Definition: ring.h:59
syMinimizeP1
static poly syMinimizeP1(int toMin, syStrategy syzstr, intvec *ordn, int index, intvec *toStrip)
Definition: syz1.cc:2151
_componentsExternal
static int _componentsExternal
Definition: p_polys.cc:143
WerrorS
void WerrorS(const char *s)
Definition: feFopen.cc:24
SSet
SObject * SSet
Definition: syz.h:31
m
int m
Definition: cfEzgcd.cc:121
assume
#define assume(x)
Definition: mod2.h:384
NULL
#define NULL
Definition: omList.c:9
ssyStrategy::backcomponents
int ** backcomponents
Definition: syz.h:40
pSetm
#define pSetm(p)
Definition: polys.h:254
l
int l
Definition: cfEzgcd.cc:93
_componentsShifted
static long * _componentsShifted
Definition: p_polys.cc:142
lcm
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
SRes
SSet * SRes
Definition: syz.h:32
nDelete
#define nDelete(n)
Definition: numbers.h:16
n_SubringGcd
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition: coeffs.h:687
omRealloc0Size
#define omRealloc0Size(addr, o_size, size)
Definition: omAllocDecl.h:219
syChMin
static int syChMin(intvec *iv)
Definition: syz1.cc:270
syCreateNewPairs
static void syCreateNewPairs(syStrategy syzstr, int index, int newEl)
Definition: syz1.cc:1069
pLmDivisibleBy
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
Definition: polys.h:134
prHeadR
poly prHeadR(poly p, ring src_r, ring dest_r, prCopyProc_t prproc)
Definition: prCopy.cc:126
p
int p
Definition: cfModGcd.cc:4019
rChangeSComps
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4336
kBucketCreate
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:205
ssyStrategy::hilb_coeffs
intvec ** hilb_coeffs
Definition: syz.h:45
pCopy
#define pCopy(p)
return a copy of the poly
Definition: polys.h:173
IDELEMS
#define IDELEMS(i)
Definition: simpleideals.h:24
pHead
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition: polys.h:65
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:42
currShiftedComponents
long * currShiftedComponents
Definition: syz1.cc:34
PrintLn
void PrintLn()
Definition: reporter.cc:309
ssyStrategy::res
resolvente res
Definition: syz.h:46
ssyStrategy::ShiftedComponents
long ** ShiftedComponents
Definition: syz.h:39
intvec::length
int length() const
Definition: intvec.h:92
syInitSyzMod
int syInitSyzMod(syStrategy syzstr, int index, int init)
Definition: syz1.cc:1459
syDeletePair
void syDeletePair(SObject *so)
Definition: syz1.cc:44
index
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:585
ssyStrategy::weights
intvec ** weights
Definition: syz.h:44
pNext
#define pNext(p)
Definition: monomials.h:34
idSort
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition: ideals.h:185
omAlloc0
#define omAlloc0(size)
Definition: omAllocDecl.h:209
prCopyR
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:35
if
if(yy_init)
Definition: libparse.cc:1417
SYZ_SHIFT_BASE
#define SYZ_SHIFT_BASE
Definition: syz.h:17
ssyStrategy
Definition: syz.h:36
ksOldCreateSpoly
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
Definition: kInline.h:1061
pWrite
void pWrite(poly p)
Definition: polys.h:290