Functions | Variables
syz1.cc File Reference
#include "kernel/mod2.h"
#include "misc/mylimits.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 521 of file p_polys.cc.

522 {
523  _components = Components;
524  _componentsShifted = ShiftedComponents;
526  p_Setm_General(p, r);
528 }
void p_Setm_General(poly p, const ring r)
Definition: p_polys.cc:152
static int _componentsExternal
Definition: p_polys.cc:142
static int * _components
Definition: p_polys.cc:140
static long * _componentsShifted
Definition: p_polys.cc:141
int p
Definition: cfModGcd.cc:4019

◆ pResetSetm()

static void pResetSetm ( poly  p)
static

Definition at line 394 of file syz1.cc.

395 {
396 #ifdef PDEBUG
397  poly q = p;
398 #endif
399  while (p!= NULL)
400  {
401  pSetm(p);
402  pIter(p);
403  }
404 #ifdef PDEBUG
405  pTest(q);
406 #endif
407 }
#define pSetm(p)
Definition: polys.h:266
#define pTest(p)
Definition: polys.h:410
#define pIter(p)
Definition: monomials.h:37
#define NULL
Definition: omList.c:12
int p
Definition: cfModGcd.cc:4019

◆ 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.

1757 {
1758  int dummy;
1759  BOOLEAN std_weights=TRUE;
1760  if ((weights!=NULL)
1761  && (syzstr->betti!=NULL)
1762  && (syzstr->weights!=NULL) && (syzstr->weights[0]!=NULL))
1763  {
1764  int i;
1765  for(i=weights->length()-1; i>=0; i--)
1766  {
1767  //Print("test %d: %d - %d\n",i,(*weights)[i], (*(syzstr->weights[0]))[i]);
1768  if ((*weights)[i]!=(*(syzstr->weights[0]))[i])
1769  {
1770  std_weights=FALSE;
1771  break;
1772  }
1773  }
1774  }
1775  if ((syzstr->betti!=NULL)
1776  && (std_weights))
1777  {
1778  if (minim || (syzstr->resPairs!=NULL))
1779  return ivCopy(syzstr->betti);
1780  }
1781 
1782  resolvente fullres = syzstr->fullres;
1783  resolvente minres = syzstr->minres;
1784  const int length = syzstr->length;
1785 
1786  if ((fullres==NULL) && (minres==NULL))
1787  {
1788  if (syzstr->hilb_coeffs==NULL)
1789  { // LA SCALA
1790  fullres = syReorder(syzstr->res, length, syzstr);
1791  }
1792  else
1793  { // HRES
1794  minres = syReorder(syzstr->orderedRes, length, syzstr);
1795  syKillEmptyEntres(minres, length);
1796  }
1797  }
1798 
1799  intvec *result=NULL;
1800 
1801  if (fullres!=NULL)
1802  result = syBetti(fullres,length,&dummy,weights,minim,row_shift);
1803  else
1804  result = syBetti(minres,length,&dummy,weights,minim,row_shift);
1805 
1806 
1807  return result; /// Don't change the syzstr???
1808 
1809  // TODO: cleanup thses!
1810  if( fullres != NULL && syzstr->fullres == NULL )
1811  syzstr->fullres = fullres;
1812  if( minres != NULL && syzstr->minres == NULL )
1813  syzstr->minres = minres;
1814 
1815  if ((result!=NULL)
1816  && ((minim) || (syzstr->resPairs!=NULL))
1817  && std_weights
1818  && (syzstr->betti==NULL))
1819  {
1820  syzstr->betti = ivCopy(result); // cache the result...
1821  }
1822 
1823  return result;
1824 }
int length
Definition: syz.h:60
intvec ** weights
Definition: syz.h:45
void syKillEmptyEntres(resolvente res, int length)
Definition: syz1.cc:2200
#define FALSE
Definition: auxiliary.h:94
intvec * betti
Definition: syz.h:53
intvec * ivCopy(const intvec *o)
Definition: intvec.h:135
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
Definition: syz1.cc:1641
resolvente res
Definition: syz.h:47
#define TRUE
Definition: auxiliary.h:98
intvec ** hilb_coeffs
Definition: syz.h:46
resolvente orderedRes
Definition: syz.h:48
Definition: intvec.h:19
int i
Definition: cfEzgcd.cc:125
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
int length() const
Definition: intvec.h:94
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
ideal * resolvente
Definition: ideals.h:18
intvec * syBetti(resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
Definition: syz.cc:770
int BOOLEAN
Definition: auxiliary.h:85
return result
Definition: facAbsBiFact.cc:76

◆ syChMin()

static int syChMin ( intvec iv)
static

Definition at line 270 of file syz1.cc.

271 {
272  int i,j=-1,r=-1;
273 
274  for (i=iv->length()-1;i>=0;i--)
275  {
276  if ((*iv)[i]>=0)
277  {
278  if ((j<0) || ((*iv)[i]<j))
279  {
280  j = (*iv)[i];
281  r = i;
282  }
283  }
284  }
285  return r;
286 }
int j
Definition: facHensel.cc:105
int i
Definition: cfEzgcd.cc:125
int length() const
Definition: intvec.h:94

◆ syChosePairs()

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

Definition at line 1288 of file syz1.cc.

1289 {
1290  return syChosePairsPutIn(syzstr,index,howmuch,actdeg,0,syzstr->length);
1291 }
int length
Definition: syz.h:60
static SSet syChosePairsPutIn(syStrategy syzstr, int *index, int *howmuch, int *actdeg, int an, int en)
Definition: syz1.cc:1181
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592

◆ 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.

1183 {
1184  int newdeg=*actdeg,newindex=-1,i,t,sldeg;
1185  SSet result;
1186  SRes resPairs=syzstr->resPairs;
1187 
1188  if (an>syzstr->length) return NULL;
1189  if (en>syzstr->length) en=syzstr->length;
1190  while (*index<en)
1191  {
1192  if (resPairs[*index]!=NULL)
1193  {
1194  sldeg = (*actdeg)+*index;
1195  i = 0;
1196  if (*index!=0)
1197  {
1198  while ((i<(*syzstr->Tl)[*index]))
1199  {
1200  if ((resPairs[*index])[i].lcm!=NULL)
1201  {
1202  if ((resPairs[*index])[i].order == sldeg)
1203  {
1204  result = &(resPairs[*index])[i];
1205  *howmuch =1;
1206  i++;
1207  while ((i<(*syzstr->Tl)[*index]) && ((resPairs[*index])[i].lcm!=NULL)
1208  && ((resPairs[*index])[i].order == sldeg))
1209  {
1210  i++;
1211  (*howmuch)++;
1212  }
1213  return result;
1214  }
1215  }
1216  i++;
1217  }
1218  }
1219  else
1220  {
1221  while ((i<(*syzstr->Tl)[*index]))
1222  {
1223  if ((resPairs[*index])[i].syz!=NULL)
1224  {
1225  if ((resPairs[*index])[i].order == sldeg)
1226  {
1227  result = &(resPairs[*index])[i];
1228  (*howmuch) =1;
1229  i++;
1230  while ((i<(*syzstr->Tl)[*index]) && ((resPairs[*index])[i].syz!=NULL)
1231  && ((resPairs[*index])[i].order == *actdeg))
1232  {
1233  i++;
1234  (*howmuch)++;
1235  }
1236  return result;
1237  }
1238  }
1239  i++;
1240  }
1241  }
1242  }
1243  (*index)++;
1244  }
1245  *index = an;
1246  //if (TEST_OPT_PROT) Print("(Euler:%d)",euler);
1247  while (*index<en)
1248  {
1249  if (resPairs[*index]!=NULL)
1250  {
1251  i = 0;
1252  while ((i<(*syzstr->Tl)[*index]))
1253  {
1254  t = *actdeg+*index;
1255  if (((resPairs[*index])[i].lcm!=NULL) ||
1256  ((resPairs[*index])[i].syz!=NULL))
1257  {
1258  if ((resPairs[*index])[i].order > t)
1259  t = (resPairs[*index])[i].order;
1260  }
1261  if ((t>*actdeg+*index) && ((newdeg==*actdeg) || (t<newdeg+*index)))
1262  {
1263  newdeg = t-*index;
1264  newindex = *index;
1265  break;
1266  }
1267  i++;
1268  }
1269  }
1270  (*index)++;
1271  }
1272  if (newdeg>*actdeg)
1273  {
1274  *actdeg = newdeg;
1275  *index = newindex;
1276  return syChosePairsPutIn(syzstr,index,howmuch,actdeg,an,en);
1277  }
1278  else return NULL;
1279 }
int length
Definition: syz.h:60
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
static SSet syChosePairsPutIn(syStrategy syzstr, int *index, int *howmuch, int *actdeg, int an, int en)
Definition: syz1.cc:1181
intvec * Tl
Definition: syz.h:50
int i
Definition: cfEzgcd.cc:125
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
SObject * SSet
Definition: syz.h:32
SSet * SRes
Definition: syz.h:33
return result
Definition: facAbsBiFact.cc:76

◆ syCompactify1()

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

Definition at line 132 of file syz1.cc.

133 {
134  int k=first,kk=0;
135 
136  while (k+kk<*sPlength)
137  {
138  if (sPairs[k+kk].lcm!=NULL)
139  {
140  if (kk>0) syCopyPair(&sPairs[k+kk],&sPairs[k]);
141  k++;
142  }
143  else
144  {
145  kk++;
146  }
147  }
148  while (k<*sPlength)
149  {
150  syInitializePair(&sPairs[k]);
151  k++;
152  }
153  *sPlength -= kk;
154 }
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
void syInitializePair(SObject *so)
Definition: syz1.cc:63
int k
Definition: cfEzgcd.cc:92
void syCopyPair(SObject *argso, SObject *imso)
Definition: syz1.cc:82
#define NULL
Definition: omList.c:12

◆ syCompactifyPairSet()

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

Definition at line 104 of file syz1.cc.

105 {
106  int k=first,kk=0;
107 
108  while (k+kk<sPlength)
109  {
110  if (sPairs[k+kk].lcm!=NULL)
111  {
112  if (kk>0) syCopyPair(&sPairs[k+kk],&sPairs[k]);
113  k++;
114  }
115  else
116  {
117  kk++;
118  }
119  }
120  while (k<sPlength)
121  {
122  syInitializePair(&sPairs[k]);
123  k++;
124  }
125 }
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
void syInitializePair(SObject *so)
Definition: syz1.cc:63
int k
Definition: cfEzgcd.cc:92
void syCopyPair(SObject *argso, SObject *imso)
Definition: syz1.cc:82
#define NULL
Definition: omList.c:12

◆ syCopy()

syStrategy syCopy ( syStrategy  syzstr)

Definition at line 1884 of file syz1.cc.

1885 {
1886  syStrategy result=syzstr;
1887  (result->references)++;
1888  return result;
1889 }
short references
Definition: syz.h:63
return result
Definition: facAbsBiFact.cc:76

◆ syCopyPair()

void syCopyPair ( SObject *  argso,
SObject *  imso 
)

Definition at line 82 of file syz1.cc.

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

◆ syCreateNewPairs()

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

Definition at line 1069 of file syz1.cc.

1070 {
1071  SSet temp;
1072  SObject tso;
1073  int i,ii,j,k=IDELEMS(syzstr->res[index]),l=(*syzstr->Tl)[index],ll;
1074  int first,pos,jj,j1;
1075  int * bci=syzstr->backcomponents[index];
1076  poly p,q;
1077  polyset rs=syzstr->res[index]->m,nPm;
1078 
1079 
1080  while ((k>0) && (rs[k-1]==NULL)) k--;
1081  if (newEl>=k) return;
1082 
1083  long * ShiftedComponents = syzstr->ShiftedComponents[index];
1084  int* Components = syzstr->truecomponents[index];
1085 
1086  ideal nP=idInit(k,syzstr->res[index]->rank);
1087  nPm=nP->m;
1088  while ((l>0) && ((syzstr->resPairs[index])[l-1].p1==NULL)) l--;
1089  for (j=newEl;j<k;j++)
1090  {
1091  q = rs[j];
1092  first = syzstr->Firstelem[index-1][pGetComp(q)]-1;
1093  pos = first+syzstr->Howmuch[index-1][pGetComp(q)];
1094  for (i=first;i<pos;i++)
1095  {
1096  jj = bci[i];
1097  if (jj>=j) break;
1098  p = pOne();
1099  pLcm(rs[jj],q,p);
1100  pSetComp(p,j+1);
1101  p_Setm_Syz(p, currRing, Components, ShiftedComponents);
1102  ii = first;
1103  loop
1104  {
1105  j1 = bci[ii];
1106  if (nPm[j1]!=NULL)
1107  {
1108  if (pLmDivisibleByNoComp(nPm[j1],p))
1109  {
1110  pDelete(&p);
1111  break;
1112  }
1113  else if (pLmDivisibleByNoComp(p,nPm[j1]))
1114  {
1115  pDelete(&(nPm[j1]));
1116  //break;
1117  }
1118  }
1119  ii++;
1120  if (ii>=pos) break;
1121  }
1122  if (p!=NULL)
1123  {
1124  nPm[jj] = p;
1125  }
1126  }
1127  for (i=first;i<pos;i++)
1128  {
1129  ii = bci[i];
1130  if (nPm[ii]!=NULL)
1131  {
1132  if (l>=(*syzstr->Tl)[index])
1133  {
1134  temp = (SSet)omAlloc0(((*syzstr->Tl)[index]+16)*sizeof(SObject));
1135  for (ll=0;ll<(*syzstr->Tl)[index];ll++)
1136  {
1137  temp[ll].p = (syzstr->resPairs[index])[ll].p;
1138  temp[ll].p1 = (syzstr->resPairs[index])[ll].p1;
1139  temp[ll].p2 = (syzstr->resPairs[index])[ll].p2;
1140  temp[ll].syz = (syzstr->resPairs[index])[ll].syz;
1141  temp[ll].lcm = (syzstr->resPairs[index])[ll].lcm;
1142  temp[ll].ind1 = (syzstr->resPairs[index])[ll].ind1;
1143  temp[ll].ind2 = (syzstr->resPairs[index])[ll].ind2;
1144  temp[ll].syzind = (syzstr->resPairs[index])[ll].syzind;
1145  temp[ll].order = (syzstr->resPairs[index])[ll].order;
1146  temp[ll].isNotMinimal = (syzstr->resPairs[index])[ll].isNotMinimal;
1147  }
1148  if (syzstr->resPairs[index] != NULL) // OB: ????
1149  omFreeSize((ADDRESS)syzstr->resPairs[index],(*syzstr->Tl)[index]*sizeof(SObject));
1150  (*syzstr->Tl)[index] += 16;
1151  syzstr->resPairs[index] = temp;
1152  }
1153  tso.lcm = p = nPm[ii];
1154  nPm[ii] = NULL;
1155  tso.order = pTotaldegree(p);
1156  if ((syzstr->cw!=NULL) && (index>0) && (pGetComp(q)>0))
1157  {
1158  int ii=index-1,jj=pGetComp(q);
1159  while (ii>0)
1160  {
1161  jj = pGetComp(syzstr->res[ii]->m[jj-1]);
1162  ii--;
1163  }
1164  tso.order += (*syzstr->cw)[jj-1];
1165  }
1166  tso.p1 = rs[ii];
1167  tso.p2 = q;
1168  tso.ind1 = ii;
1169  tso.ind2 = j;
1170  tso.syzind = -1;
1171  tso.isNotMinimal = NULL;
1172  tso.p = NULL;
1173  tso.syz = NULL;
1174  syEnterPair(syzstr->resPairs[index],&tso,&l,index);
1175  }
1176  }
1177  }
1178  idDelete(&nP);
1179 }
int j
Definition: facHensel.cc:105
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
resolvente res
Definition: syz.h:47
#define pLcm(a, b, m)
Definition: polys.h:290
void * ADDRESS
Definition: auxiliary.h:133
int k
Definition: cfEzgcd.cc:92
#define loop
Definition: structs.h:80
#define pGetComp(p)
Component.
Definition: polys.h:37
intvec * Tl
Definition: syz.h:50
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
Definition: polys.h:142
static long pTotaldegree(poly p)
Definition: polys.h:277
#define pSetComp(p, v)
Definition: polys.h:38
int ** backcomponents
Definition: syz.h:41
poly * polyset
Definition: polys.h:254
int i
Definition: cfEzgcd.cc:125
int ** Howmuch
Definition: syz.h:42
#define pOne()
Definition: polys.h:310
#define IDELEMS(i)
Definition: simpleideals.h:23
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void p_Setm_Syz(poly p, ring r, int *Components, long *ShiftedComponents)
Definition: p_polys.cc:521
intvec * cw
Definition: syz.h:52
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
void syEnterPair(SSet sPairs, SObject *so, int *sPlength, int)
Definition: syz1.cc:985
#define pDelete(p_ptr)
Definition: polys.h:181
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
SObject * SSet
Definition: syz.h:32
long ind2(long arg)
Definition: kutil.cc:4111
int p
Definition: cfModGcd.cc:4019
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:93

◆ syDeletePair()

void syDeletePair ( SObject *  so)

Definition at line 44 of file syz1.cc.

45 {
46  pDelete(&(*so).p);
47  pDelete(&(*so).lcm);
48  pDelete(&(*so).syz);
49  (*so).p1 = NULL;
50  (*so).p2 = NULL;
51  (*so).ind1 = 0;
52  (*so).ind2 = 0;
53  (*so).syzind = -1;
54  (*so).order = 0;
55  (*so).isNotMinimal = NULL;
56  (*so).length = -1;
57  (*so).reference = -1;
58 }
#define NULL
Definition: omList.c:12
#define pDelete(p_ptr)
Definition: polys.h:181

◆ syDim()

int syDim ( syStrategy  syzstr)

Definition at line 1849 of file syz1.cc.

1850 {
1851  int i,l;
1852  if (syzstr->resPairs!=NULL)
1853  {
1854  SRes rP=syzstr->resPairs;
1855 
1856  l = syzstr->length;
1857  while ((l>0) && (rP[l-1]==NULL)) l--;
1858  if (l==0) return -1;
1859  l--;
1860  while (l>=0)
1861  {
1862  i = 0;
1863  while ((i<(*syzstr->Tl)[l]) &&
1864  ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL)) &&
1865  (rP[l][i].isNotMinimal!=NULL))
1866  {
1867  i++;
1868  }
1869  if ((i<(*syzstr->Tl)[l]) &&
1870  ((rP[l][i].lcm!=NULL) || (rP[l][i].syz!=NULL)) &&
1871  (rP[l][i].isNotMinimal==NULL))
1872  return l;
1873  l--;
1874  }
1875  return l;
1876  }
1877  else
1878  return sySize(syzstr);
1879 }
int length
Definition: syz.h:60
intvec * Tl
Definition: syz.h:50
int sySize(syStrategy syzstr)
Definition: syz1.cc:1829
int i
Definition: cfEzgcd.cc:125
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
SSet * SRes
Definition: syz.h:33
int l
Definition: cfEzgcd.cc:93

◆ syEnlargeFields()

void syEnlargeFields ( syStrategy  syzstr,
int  index 
)

Definition at line 734 of file syz1.cc.

735 {
736  pEnlargeSet(&(syzstr->res[index]->m),IDELEMS(syzstr->res[index]),16);
738  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
739  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
740  syzstr->ShiftedComponents[index]
741  =(long*)omRealloc0Size((ADDRESS)syzstr->ShiftedComponents[index],
742  (IDELEMS(syzstr->res[index])+1)*sizeof(long),
743  (IDELEMS(syzstr->res[index])+17)*sizeof(long));
745  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
746  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
747  syzstr->Howmuch[index]=(int*)omRealloc0Size((ADDRESS)syzstr->Howmuch[index],
748  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
749  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
750  syzstr->Firstelem[index]=(int*)omRealloc0Size((ADDRESS)syzstr->Firstelem[index],
751  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
752  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
753  syzstr->elemLength[index]=(int*)omRealloc0Size((ADDRESS)syzstr->elemLength[index],
754  (IDELEMS(syzstr->res[index])+1)*sizeof(int),
755  (IDELEMS(syzstr->res[index])+17)*sizeof(int));
756  syzstr->sev[index]=(unsigned long*)omRealloc0Size((ADDRESS)syzstr->sev[index],
757  (IDELEMS(syzstr->res[index])+1)*sizeof(unsigned long),
758  (IDELEMS(syzstr->res[index])+17)*sizeof(unsigned long));
759  IDELEMS(syzstr->res[index]) += 16;
760  pEnlargeSet(&(syzstr->orderedRes[index]->m),IDELEMS(syzstr->orderedRes[index]),16);
761  IDELEMS(syzstr->orderedRes[index]) += 16;
762 }
#define omRealloc0Size(addr, o_size, size)
Definition: omAllocDecl.h:221
resolvente res
Definition: syz.h:47
void * ADDRESS
Definition: auxiliary.h:133
resolvente orderedRes
Definition: syz.h:48
int ** backcomponents
Definition: syz.h:41
int ** Howmuch
Definition: syz.h:42
#define IDELEMS(i)
Definition: simpleideals.h:23
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
int ** elemLength
Definition: syz.h:44
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
void pEnlargeSet(poly **p, int l, int increment)
Definition: p_polys.cc:3656
unsigned long ** sev
Definition: syz.h:59

◆ syEnterPair() [1/2]

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

Definition at line 985 of file syz1.cc.

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

◆ syEnterPair() [2/2]

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

Definition at line 1035 of file syz1.cc.

1036 {
1037  int ll;
1038 
1039  if (*sPlength>=(*syzstr->Tl)[index])
1040  {
1041  SSet temp = (SSet)omAlloc0(((*syzstr->Tl)[index]+16)*sizeof(SObject));
1042  for (ll=0;ll<(*syzstr->Tl)[index];ll++)
1043  {
1044  temp[ll].p = (syzstr->resPairs[index])[ll].p;
1045  temp[ll].p1 = (syzstr->resPairs[index])[ll].p1;
1046  temp[ll].p2 = (syzstr->resPairs[index])[ll].p2;
1047  temp[ll].syz = (syzstr->resPairs[index])[ll].syz;
1048  temp[ll].lcm = (syzstr->resPairs[index])[ll].lcm;
1049  temp[ll].ind1 = (syzstr->resPairs[index])[ll].ind1;
1050  temp[ll].ind2 = (syzstr->resPairs[index])[ll].ind2;
1051  temp[ll].syzind = (syzstr->resPairs[index])[ll].syzind;
1052  temp[ll].order = (syzstr->resPairs[index])[ll].order;
1053  temp[ll].isNotMinimal = (syzstr->resPairs[index])[ll].isNotMinimal;
1054  temp[ll].length = (syzstr->resPairs[index])[ll].length;
1055  temp[ll].reference = (syzstr->resPairs[index])[ll].reference;
1056  }
1057  if (syzstr->resPairs[index] != NULL) // OB: ?????
1058  omFreeSize((ADDRESS)syzstr->resPairs[index],(*syzstr->Tl)[index]*sizeof(SObject));
1059  (*syzstr->Tl)[index] += 16;
1060  syzstr->resPairs[index] = temp;
1061  }
1062  syEnterPair(syzstr->resPairs[index],so,sPlength,index);
1063 }
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void * ADDRESS
Definition: auxiliary.h:133
intvec * Tl
Definition: syz.h:50
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
void syEnterPair(SSet sPairs, SObject *so, int *sPlength, int)
Definition: syz1.cc:985
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
SObject * SSet
Definition: syz.h:32
long ind2(long arg)
Definition: kutil.cc:4111
int p
Definition: cfModGcd.cc:4019
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ syInitializePair()

void syInitializePair ( SObject *  so)

Definition at line 63 of file syz1.cc.

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

◆ syInitRes()

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

Definition at line 293 of file syz1.cc.

294 {
295  if (idIs0(arg)) return NULL;
296  SRes resPairs = (SRes)omAlloc0(*length*sizeof(SSet));
297  resPairs[0] = (SSet)omAlloc0(IDELEMS(arg)*sizeof(SObject));
298  intvec * iv=NULL;
299  int i,j;
300 
302  {
303  iv = idSort(arg);
304  for (i=0;i<IDELEMS(arg);i++)
305  {
306  (resPairs[0])[i].syz = /*pCopy*/(arg->m[(*iv)[i]-1]);
307  arg->m[(*iv)[i]-1] = NULL;
308  (resPairs[0])[i].order = pTotaldegree((resPairs[0])[i].syz);
309  }
310  }
311  else
312  {
313  iv = new intvec(IDELEMS(arg),1,-1);
314  for (i=0;i<IDELEMS(arg);i++)
315  {
316  (*iv)[i] = pTotaldegree(arg->m[i])+(*cw)[pGetComp(arg->m[i])-1];
317  }
318  for (i=0;i<IDELEMS(arg);i++)
319  {
320  j = syChMin(iv);
321  if (j<0) break;
322  (resPairs[0])[i].syz = arg->m[j];
323  arg->m[j] = NULL;
324  (resPairs[0])[i].order = (*iv)[j];
325  (*iv)[j] = -1;
326  }
327  }
328  if (iv!=NULL) delete iv;
329  (*Tl)[0] = IDELEMS(arg);
330  return resPairs;
331 }
int j
Definition: facHensel.cc:105
static intvec * idSort(ideal id, BOOLEAN nolex=TRUE)
Definition: ideals.h:186
#define pGetComp(p)
Component.
Definition: polys.h:37
Definition: intvec.h:19
static int syChMin(intvec *iv)
Definition: syz1.cc:270
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
static long pTotaldegree(poly p)
Definition: polys.h:277
int i
Definition: cfEzgcd.cc:125
#define IDELEMS(i)
Definition: simpleideals.h:23
#define NULL
Definition: omList.c:12
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
SObject * SSet
Definition: syz.h:32
SSet * SRes
Definition: syz.h:33
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ syInitSyzMod()

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

Definition at line 1459 of file syz1.cc.

1460 {
1461  int result;
1462 
1463  if (syzstr->res[index]==NULL)
1464  {
1465  syzstr->res[index] = idInit(init-1,1);
1466  syzstr->truecomponents[index] = (int*)omAlloc0(init*sizeof(int));
1467  syzstr->ShiftedComponents[index] = (long*)omAlloc0(init*sizeof(long));
1468  if (index==0)
1469  {
1470  for (int i=0;i<init;i++)
1471  {
1472  syzstr->truecomponents[0][i] = i;
1473  syzstr->ShiftedComponents[0][i] = (i)*SYZ_SHIFT_BASE;
1474  }
1475  }
1476  syzstr->backcomponents[index] = (int*)omAlloc0(init*sizeof(int));
1477  syzstr->Howmuch[index] = (int*)omAlloc0(init*sizeof(int));
1478  syzstr->Firstelem[index] = (int*)omAlloc0(init*sizeof(int));
1479  syzstr->elemLength[index] = (int*)omAlloc0(init*sizeof(int));
1480  syzstr->orderedRes[index] = idInit(init-1,1);
1481  syzstr->sev[index] = (unsigned long*) omAlloc0(init*sizeof(unsigned long));
1482  result = 0;
1483  }
1484  else
1485  {
1486  result = IDELEMS(syzstr->res[index]);
1487  while ((result>0) && (syzstr->res[index]->m[result-1]==NULL)) result--;
1488  }
1489  return result;
1490 }
resolvente res
Definition: syz.h:47
resolvente orderedRes
Definition: syz.h:48
#define SYZ_SHIFT_BASE
Definition: syz.h:18
int ** backcomponents
Definition: syz.h:41
int i
Definition: cfEzgcd.cc:125
int ** Howmuch
Definition: syz.h:42
#define IDELEMS(i)
Definition: simpleideals.h:23
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
int ** elemLength
Definition: syz.h:44
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:12
unsigned long ** sev
Definition: syz.h:59
#define omAlloc0(size)
Definition: omAllocDecl.h:211
return result
Definition: facAbsBiFact.cc:76

◆ syKillComputation()

void syKillComputation ( syStrategy  syzstr,
ring  r 
)

Definition at line 1495 of file syz1.cc.

1496 {
1497  if (syzstr->references>0)
1498  {
1499  (syzstr->references)--;
1500  }
1501  else
1502  {
1503  int i,j;
1504  if (syzstr->minres!=NULL)
1505  {
1506  for (i=0;i<syzstr->length;i++)
1507  {
1508  if (syzstr->minres[i]!=NULL)
1509  {
1510  id_Delete(&(syzstr->minres[i]),r);
1511  }
1512  }
1513  omFreeSize((ADDRESS)syzstr->minres,(syzstr->length+1)*sizeof(ideal));
1514  }
1515  if (syzstr->fullres!=NULL)
1516  {
1517  for (i=0;i<syzstr->length;i++)
1518  {
1519  if (syzstr->fullres[i]!=NULL)
1520  {
1521  id_Delete(&(syzstr->fullres[i]),r);
1522  }
1523  }
1524  omFreeSize((ADDRESS)syzstr->fullres,(syzstr->length+1)*sizeof(ideal));
1525  }
1526  if (syzstr->weights!=NULL)
1527  {
1528  for (i=0;i<syzstr->length;i++)
1529  {
1530  if (syzstr->weights[i]!=NULL)
1531  {
1532  delete syzstr->weights[i];
1533  }
1534  }
1535  omFreeSize((ADDRESS)syzstr->weights,syzstr->length*sizeof(intvec*));
1536  }
1537 
1538  ring sr=syzstr->syRing;
1539  if (sr==NULL) sr=r;
1540 
1541  if (syzstr->resPairs!=NULL)
1542  {
1543  for (i=0;i<syzstr->length;i++)
1544  {
1545  for (j=0;j<(*syzstr->Tl)[i];j++)
1546  {
1547  if ((syzstr->resPairs[i])[j].lcm!=NULL)
1548  p_Delete(&((syzstr->resPairs[i])[j].lcm),sr);
1549  if ((i>0) && ((syzstr->resPairs[i])[j].syz!=NULL))
1550  p_Delete(&((syzstr->resPairs[i])[j].syz),sr);
1551  }
1552  if (syzstr->orderedRes[i]!=NULL)
1553  {
1554  for (j=0;j<IDELEMS(syzstr->orderedRes[i]);j++)
1555  {
1556  syzstr->orderedRes[i]->m[j] = NULL;
1557  }
1558  id_Delete(&(syzstr->orderedRes[i]),sr);
1559  }
1560  if (syzstr->truecomponents[i]!=NULL)
1561  {
1562  omFreeSize((ADDRESS)syzstr->truecomponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1563  syzstr->truecomponents[i]=NULL;
1564  omFreeSize((ADDRESS)syzstr->ShiftedComponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(long));
1565  syzstr->ShiftedComponents[i]=NULL;
1566  }
1567  if (syzstr->backcomponents[i]!=NULL)
1568  {
1569  omFreeSize((ADDRESS)syzstr->backcomponents[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1570  syzstr->backcomponents[i]=NULL;
1571  }
1572  if (syzstr->Howmuch[i]!=NULL)
1573  {
1574  omFreeSize((ADDRESS)syzstr->Howmuch[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1575  syzstr->Howmuch[i]=NULL;
1576  }
1577  if (syzstr->Firstelem[i]!=NULL)
1578  {
1579  omFreeSize((ADDRESS)syzstr->Firstelem[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1580  syzstr->Firstelem[i]=NULL;
1581  }
1582  if (syzstr->elemLength[i]!=NULL)
1583  {
1584  omFreeSize((ADDRESS)syzstr->elemLength[i],(IDELEMS(syzstr->res[i])+1)*sizeof(int));
1585  syzstr->elemLength[i]=NULL;
1586  }
1587  if (syzstr->res[i]!=NULL)
1588  {
1589  for (j=0;j<IDELEMS(syzstr->res[i]);j++)
1590  {
1591  if (syzstr->res[i]->m[j]!=NULL)
1592  p_Delete(&(syzstr->res[i]->m[j]),sr);
1593  }
1594  }
1595  if ((syzstr->hilb_coeffs!=NULL)
1596  && (syzstr->hilb_coeffs[i]!=NULL))
1597  delete syzstr->hilb_coeffs[i];
1598  if (syzstr->sev[i] != NULL)
1599  omFreeSize((ADDRESS)syzstr->sev[i], (IDELEMS(syzstr->res[i])+1)*sizeof(unsigned long));
1600  id_Delete(&(syzstr->res[i]),sr);
1601  if (syzstr->resPairs[i] != NULL) // OB: ????
1602  omFreeSize((ADDRESS)syzstr->resPairs[i],(*syzstr->Tl)[i]*sizeof(SObject));
1603  }
1604  omFreeSize((ADDRESS)syzstr->resPairs,syzstr->length*sizeof(SObject*));
1605  omFreeSize((ADDRESS)syzstr->res,(syzstr->length+1)*sizeof(ideal));
1606  omFreeSize((ADDRESS)syzstr->orderedRes,(syzstr->length+1)*sizeof(ideal));
1607  omFreeSize((ADDRESS)syzstr->elemLength,(syzstr->length+1)*sizeof(int*));
1608  omFreeSize((ADDRESS)syzstr->truecomponents,(syzstr->length+1)*sizeof(int*));
1609  omFreeSize((ADDRESS)syzstr->ShiftedComponents,(syzstr->length+1)*sizeof(long*));
1610  if (syzstr->sev != NULL)
1611  omFreeSize(((ADDRESS)syzstr->sev), (syzstr->length+1)*sizeof(unsigned long*));
1612  omFreeSize((ADDRESS)syzstr->backcomponents,(syzstr->length+1)*sizeof(int*));
1613  omFreeSize((ADDRESS)syzstr->Howmuch,(syzstr->length+1)*sizeof(int*));
1614  omFreeSize((ADDRESS)syzstr->Firstelem,(syzstr->length+1)*sizeof(int*));
1615  if (syzstr->hilb_coeffs!=NULL)
1616  omFreeSize((ADDRESS)syzstr->hilb_coeffs,(syzstr->length+1)*sizeof(intvec*));
1617  }
1618  if (syzstr->cw!=NULL)
1619  delete syzstr->cw;
1620  if (syzstr->betti!=NULL)
1621  delete syzstr->betti;
1622  if (syzstr->resolution!=NULL)
1623  delete syzstr->resolution;
1624  if (syzstr->Tl!=NULL)
1625  delete syzstr->Tl;
1626  if ((syzstr->syRing != NULL) && (syzstr->syRing != r))
1627  {
1628  if(syzstr->syRing->typ[1].ord_typ == ro_syzcomp)
1629  rChangeSComps(NULL, NULL, 0, syzstr->syRing);
1630 
1631  rDelete(syzstr->syRing);
1632  }
1633  omFreeSize((ADDRESS)syzstr, sizeof(ssyStrategy));
1634  }
1635 }
int length
Definition: syz.h:60
intvec ** weights
Definition: syz.h:45
int j
Definition: facHensel.cc:105
short references
Definition: syz.h:63
intvec * betti
Definition: syz.h:53
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
resolvente res
Definition: syz.h:47
void * ADDRESS
Definition: auxiliary.h:133
intvec ** hilb_coeffs
Definition: syz.h:46
intvec * Tl
Definition: syz.h:50
resolvente orderedRes
Definition: syz.h:48
Definition: intvec.h:19
int ** backcomponents
Definition: syz.h:41
int i
Definition: cfEzgcd.cc:125
int ** Howmuch
Definition: syz.h:42
#define IDELEMS(i)
Definition: simpleideals.h:23
resolvente fullres
Definition: syz.h:57
int ** Firstelem
Definition: syz.h:43
resolvente minres
Definition: syz.h:58
int ** elemLength
Definition: syz.h:44
intvec * cw
Definition: syz.h:52
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:856
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:12
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
unsigned long ** sev
Definition: syz.h:59
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4362
intvec * resolution
Definition: syz.h:51

◆ syKillEmptyEntres()

void syKillEmptyEntres ( resolvente  res,
int  length 
)

Definition at line 2200 of file syz1.cc.

2201 {
2202  int i,j,jj,k,rj;
2203  intvec * changes;
2204  poly p;
2205  ideal ri;
2206 
2207  for (i=0;i<length;i++)
2208  {
2209  ri = res[i];
2210  if (ri!=NULL)
2211  {
2212  rj = IDELEMS(ri);
2213  changes = new intvec(rj+1,1,-1);
2214  while ((rj>0) && (ri->m[rj-1]==NULL)) rj--;
2215  j = k = 0;
2216  while (j+k<rj)
2217  {
2218  if (ri->m[j+k]!=NULL)
2219  {
2220  ri->m[j] = ri->m[j+k];
2221  (*changes)[j+k+1] = j+1;
2222  j++;
2223  }
2224  else
2225  {
2226  k++;
2227  }
2228  }
2229  for (jj=j;jj<rj;jj++)
2230  ri->m[jj] = NULL;
2231  if (res[i+1]!=NULL)
2232  {
2233  ri = res[i+1];
2234  for (j=IDELEMS(ri)-1;j>=0;j--)
2235  {
2236  p = ri->m[j];
2237  while (p!=NULL)
2238  {
2239  pSetComp(p,(*changes)[pGetComp(p)]);
2240  pSetm(p);
2241  pIter(p);
2242  }
2243  }
2244  }
2245  delete changes;
2246  }
2247  }
2248 }
int j
Definition: facHensel.cc:105
#define pSetm(p)
Definition: polys.h:266
int k
Definition: cfEzgcd.cc:92
#define pGetComp(p)
Component.
Definition: polys.h:37
#define pIter(p)
Definition: monomials.h:37
if(yy_init)
Definition: libparse.cc:1418
Definition: intvec.h:19
CanonicalForm res
Definition: facAbsFact.cc:64
#define pSetComp(p, v)
Definition: polys.h:38
int i
Definition: cfEzgcd.cc:125
#define IDELEMS(i)
Definition: simpleideals.h:23
#define NULL
Definition: omList.c:12
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
int p
Definition: cfModGcd.cc:4019

◆ syLaScala()

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

Definition at line 2559 of file syz1.cc.

2560 {
2561  int i,j,actdeg=32000,index=0;
2562  int howmuch;
2563  ideal temp;
2564  SSet nextPairs;
2565  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
2566  ring origR = currRing;
2567 
2568  if(weights!= NULL)
2569  syzstr->cw = new intvec(weights);
2570  else
2571  syzstr->cw = NULL;
2572 
2573  if ((idIs0(arg)) ||
2574  ((id_RankFreeModule(arg,currRing)>0) && (!idTestHomModule(arg, NULL, syzstr->cw))))
2575  {
2577  syzstr->length = 1;
2578  syzstr->minres[0] = idInit(1,arg->rank);
2579  return syzstr;
2580  }
2581 
2582 
2583  //crit = 0;
2584  //euler = -1;
2585 
2586  if( maxlength > 0 )
2587  syzstr->length = maxlength; // = (currRing->N)+2;
2588  else
2589  syzstr->length = maxlength = (currRing->N)+2;
2590 
2591  // Creare dp,S ring and change to it
2592  syzstr->syRing = rAssure_dp_S(origR);
2593  assume(syzstr->syRing != origR);
2594  assume(syzstr->syRing->typ[1].ord_typ == ro_syzcomp);
2595  rChangeCurrRing(syzstr->syRing);
2596 
2597  // set initial ShiftedComps
2598  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
2599  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
2600  for (i=0;i<=arg->rank;i++)
2601  {
2603  currcomponents[i] = i;
2604  }
2606 /*--- initializes the data structures---------------*/
2607  syzstr->Tl = new intvec(maxlength);
2608  temp = idInit(IDELEMS(arg),arg->rank);
2609  for (i=0;i<IDELEMS(arg);i++)
2610  {
2611  temp->m[i] = prCopyR( arg->m[i], origR, currRing);
2612  if (temp->m[i]!=NULL)
2613  {
2614  j = pTotaldegree(temp->m[i]);
2615  if (j<actdeg) actdeg = j;
2616  }
2617  }
2618  idTest(temp);
2619  idSkipZeroes(temp);
2620  idTest(temp);
2621  syzstr->resPairs = syInitRes(temp,&maxlength,syzstr->Tl,syzstr->cw);
2622  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
2623  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(long));
2624 
2625  syzstr->res = (resolvente)omAlloc0((maxlength+1)*sizeof(ideal));
2626  syzstr->orderedRes = (resolvente)omAlloc0((maxlength+1)*sizeof(ideal));
2627  syzstr->elemLength = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2628 
2629  syzstr->truecomponents = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2630  syzstr->ShiftedComponents = (long**)omAlloc0((maxlength+1)*sizeof(long*));
2631 
2632  syzstr->backcomponents = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2633  syzstr->Howmuch = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2634  syzstr->Firstelem = (int**)omAlloc0((maxlength+1)*sizeof(int*));
2635  syzstr->sev = (unsigned long **) omAlloc0((maxlength+1)*sizeof(unsigned long *));
2636 
2637  assume( syzstr->length == maxlength );
2638 
2639  syzstr->bucket = kBucketCreate(currRing);
2640  int len0=id_RankFreeModule(temp,currRing)+1;
2641 
2642  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2643  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2644 /*--- computes the resolution ----------------------*/
2645  while (nextPairs!=NULL)
2646  {
2647  if (TEST_OPT_PROT) Print("%d",actdeg);
2648  if (TEST_OPT_PROT) Print("(m%d)",index);
2649  if (index==0)
2650  i = syInitSyzMod(syzstr,index,len0);
2651  else
2652  i = syInitSyzMod(syzstr,index);
2653  currcomponents = syzstr->truecomponents[si_max(index-1,0)];
2654  currShiftedComponents = syzstr->ShiftedComponents[si_max(index-1,0)];
2655  rChangeSComps(currcomponents, currShiftedComponents,
2656  IDELEMS(syzstr->res[si_max(index-1,0)]), currRing);
2657  j = syInitSyzMod(syzstr,index+1);
2658  if (index>0)
2659  {
2660  syRedNextPairs(nextPairs,syzstr,howmuch,index);
2661  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
2662  }
2663  else
2664  syRedGenerOfCurrDeg(syzstr,actdeg,index+1);
2665 /*--- creates new pairs -----------------------------*/
2666  syCreateNewPairs(syzstr,index,i);
2667  if (index<(maxlength-1))
2668  {
2669  syCreateNewPairs(syzstr,index+1,j);
2670  }
2671  index++;
2672  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2673  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2674  }
2675  if (temp!=NULL) idDelete(&temp);
2676  kBucketDestroy(&(syzstr->bucket));
2677  if (origR != syzstr->syRing)
2678  rChangeCurrRing(origR);
2679  if (TEST_OPT_PROT) PrintLn();
2680  return syzstr;
2681 }
int length
Definition: syz.h:60
static void syCreateNewPairs(syStrategy syzstr, int index, int newEl)
Definition: syz1.cc:1069
int j
Definition: facHensel.cc:105
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:80
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:34
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
kBucket_pt bucket
Definition: syz.h:54
#define TEST_OPT_PROT
Definition: options.h:102
int * currcomponents
Definition: syz1.cc:33
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition: ideals.cc:2098
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static void syRedNextPairs(SSet nextPairs, syStrategy syzstr, int howmuch, int index)
Definition: syz1.cc:768
resolvente res
Definition: syz.h:47
void * ADDRESS
Definition: auxiliary.h:133
omBin char_ptr_bin
Definition: ring.cc:44
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
Definition: syz1.cc:104
intvec * Tl
Definition: syz.h:50
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:216
Definition: intvec.h:19
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
static long pTotaldegree(poly p)
Definition: polys.h:277
#define assume(x)
Definition: mod2.h:390
#define SYZ_SHIFT_BASE
Definition: syz.h:18
int syInitSyzMod(syStrategy syzstr, int index, int init)
Definition: syz1.cc:1459
int ** backcomponents
Definition: syz.h:41
static int si_max(const int a, const int b)
Definition: auxiliary.h:138
int i
Definition: cfEzgcd.cc:125
int ** Howmuch
Definition: syz.h:42
SSet syChosePairs(syStrategy syzstr, int *index, int *howmuch, int *actdeg)
Definition: syz1.cc:1288
#define IDELEMS(i)
Definition: simpleideals.h:23
static void syRedGenerOfCurrDeg(syStrategy syzstr, int deg, int index)
Definition: syz1.cc:915
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void rChangeCurrRing(ring r)
Definition: polys.cc:14
resolvente minres
Definition: syz.h:58
int ** elemLength
Definition: syz.h:44
intvec * cw
Definition: syz.h:52
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:12
ring rAssure_dp_S(const ring r)
Definition: ring.cc:4905
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
unsigned long ** sev
Definition: syz.h:59
long * currShiftedComponents
Definition: syz1.cc:34
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
SObject * SSet
Definition: syz.h:32
SRes syInitRes(ideal arg, int *length, intvec *Tl, intvec *cw)
Definition: syz1.cc:293
ideal * resolvente
Definition: ideals.h:18
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:209
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4362
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define idTest(id)
Definition: ideals.h:47
ssyStrategy * syStrategy
Definition: syz.h:35

◆ syLaScala3()

syStrategy syLaScala3 ( ideal  arg,
int *  length 
)

Definition at line 2433 of file syz1.cc.

2434 {
2435  int i,j,actdeg=32000,index=0;
2436  int howmuch;
2437  ideal temp;
2438  SSet nextPairs;
2439  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
2440  ring origR = currRing;
2441 
2442  if ((idIs0(arg)) ||
2443  ((id_RankFreeModule(arg,currRing)>0) && (!idHomModule(arg,NULL,&(syzstr->cw)))))
2444  {
2446  syzstr->length = 1;
2447  syzstr->minres[0] = idInit(1,arg->rank);
2448  return syzstr;
2449  }
2450 
2451  //crit = 0;
2452  //euler = -1;
2453  syzstr->length = *length = (currRing->N)+2;
2454 
2455  // Creare dp,S ring and change to it
2456  syzstr->syRing = rAssure_dp_S(origR);
2457  assume(syzstr->syRing != origR); // why?
2458  rChangeCurrRing(syzstr->syRing);
2459 
2460  // set initial ShiftedComps
2461  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
2462  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
2463  for (i=0;i<=arg->rank;i++)
2464  {
2466  currcomponents[i] = i;
2467  }
2469 /*--- initializes the data structures---------------*/
2470  syzstr->Tl = new intvec(*length);
2471  temp = idInit(IDELEMS(arg),arg->rank);
2472  for (i=0;i<IDELEMS(arg);i++)
2473  {
2474  temp->m[i] = prCopyR( arg->m[i], origR, syzstr->syRing);
2475  if (temp->m[i]!=NULL)
2476  {
2477  j = pTotaldegree(temp->m[i]);
2478  if (j<actdeg) actdeg = j;
2479  }
2480  }
2481  idTest(temp);
2482  idSkipZeroes(temp);
2483  idTest(temp);
2484  syzstr->resPairs = syInitRes(temp,length,syzstr->Tl,syzstr->cw);
2485  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
2486  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(long));
2487  syzstr->res = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
2488  syzstr->orderedRes = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
2489  syzstr->elemLength = (int**)omAlloc0((*length+1)*sizeof(int*));
2490  syzstr->truecomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
2491  syzstr->ShiftedComponents = (long**)omAlloc0((*length+1)*sizeof(long*));
2492  syzstr->backcomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
2493  syzstr->Howmuch = (int**)omAlloc0((*length+1)*sizeof(int*));
2494  syzstr->Firstelem = (int**)omAlloc0((*length+1)*sizeof(int*));
2495  syzstr->sev = (unsigned long **) omAlloc0((*length+1)*sizeof(unsigned long *));
2496  syzstr->bucket = kBucketCreate(currRing);
2497  int len0=id_RankFreeModule(temp,currRing)+1;
2498 
2499  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2500  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2501 /*--- computes the resolution ----------------------*/
2502  while (nextPairs!=NULL)
2503  {
2504  if (TEST_OPT_PROT) Print("%d",actdeg);
2505  if (TEST_OPT_PROT) Print("(m%d)",index);
2506  if (index==0)
2507  i = syInitSyzMod(syzstr,index,len0);
2508  else
2509  i = syInitSyzMod(syzstr,index);
2510  currcomponents = syzstr->truecomponents[si_max(index-1,0)];
2511  currShiftedComponents = syzstr->ShiftedComponents[si_max(index-1,0)];
2512  rChangeSComps(currcomponents, currShiftedComponents,
2513  IDELEMS(syzstr->res[si_max(index-1,0)]), currRing);
2514  j = syInitSyzMod(syzstr,index+1);
2515  if (index>0)
2516  {
2517  syRedNextPairs(nextPairs,syzstr,howmuch,index);
2518  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
2519  }
2520  else
2521  syRedGenerOfCurrDeg(syzstr,actdeg,index+1);
2522 /*--- creates new pairs -----------------------------*/
2523  syCreateNewPairs(syzstr,index,i);
2524  if (index<(*length)-1)
2525  {
2526  syCreateNewPairs(syzstr,index+1,j);
2527  }
2528  index++;
2529  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
2530  //if (TEST_OPT_PROT) Print("(%d,%d)",howmuch,index);
2531  }
2532  if (temp!=NULL) idDelete(&temp);
2533  kBucketDestroy(&(syzstr->bucket));
2534 
2535  if (origR != syzstr->syRing)
2536  rChangeCurrRing(origR);
2537 
2538  if (TEST_OPT_PROT) PrintLn();
2539 
2540  assume(syzstr->minres==NULL); assume(syzstr->fullres ==NULL);
2541  assume(syzstr->resPairs!=NULL); assume(syzstr->hilb_coeffs==NULL);
2542  assume(syzstr->res!=NULL);
2543 
2544  if(! TEST_OPT_NO_SYZ_MINIM )
2545  syzstr->minres = syReadOutMinimalRes(syzstr);
2546  else
2547  syzstr->fullres = syReorder(syzstr->res, syzstr->length, syzstr); // buggy? (betti...?)
2548 
2549  return syzstr;
2550 }
int length
Definition: syz.h:60
static void syCreateNewPairs(syStrategy syzstr, int index, int newEl)
Definition: syz1.cc:1069
int j
Definition: facHensel.cc:105
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:80
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:34
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
kBucket_pt bucket
Definition: syz.h:54
#define TEST_OPT_PROT
Definition: options.h:102
int * currcomponents
Definition: syz1.cc:33
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
static void syRedNextPairs(SSet nextPairs, syStrategy syzstr, int howmuch, int index)
Definition: syz1.cc:768
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
Definition: syz1.cc:1641
resolvente res
Definition: syz.h:47
void * ADDRESS
Definition: auxiliary.h:133
static resolvente syReadOutMinimalRes(syStrategy syzstr, BOOLEAN computeStd=FALSE)
Definition: syz1.cc:2313
omBin char_ptr_bin
Definition: ring.cc:44
intvec ** hilb_coeffs
Definition: syz.h:46
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
Definition: syz1.cc:104
intvec * Tl
Definition: syz.h:50
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition: ideals.h:96
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:216
Definition: intvec.h:19
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define TEST_OPT_NO_SYZ_MINIM
Definition: options.h:122
static long pTotaldegree(poly p)
Definition: polys.h:277
#define assume(x)
Definition: mod2.h:390
#define SYZ_SHIFT_BASE
Definition: syz.h:18
int syInitSyzMod(syStrategy syzstr, int index, int init)
Definition: syz1.cc:1459
int ** backcomponents
Definition: syz.h:41
static int si_max(const int a, const int b)
Definition: auxiliary.h:138
int i
Definition: cfEzgcd.cc:125
int ** Howmuch
Definition: syz.h:42
SSet syChosePairs(syStrategy syzstr, int *index, int *howmuch, int *actdeg)
Definition: syz1.cc:1288
#define IDELEMS(i)
Definition: simpleideals.h:23
static void syRedGenerOfCurrDeg(syStrategy syzstr, int deg, int index)
Definition: syz1.cc:915
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
resolvente fullres
Definition: syz.h:57
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void rChangeCurrRing(ring r)
Definition: polys.cc:14
resolvente minres
Definition: syz.h:58
int ** elemLength
Definition: syz.h:44
intvec * cw
Definition: syz.h:52
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:12
ring rAssure_dp_S(const ring r)
Definition: ring.cc:4905
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
unsigned long ** sev
Definition: syz.h:59
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
long * currShiftedComponents
Definition: syz1.cc:34
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
SObject * SSet
Definition: syz.h:32
SRes syInitRes(ideal arg, int *length, intvec *Tl, intvec *cw)
Definition: syz1.cc:293
ideal * resolvente
Definition: ideals.h:18
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:209
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4362
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define idTest(id)
Definition: ideals.h:47
ssyStrategy * syStrategy
Definition: syz.h:35

◆ syLengthInt()

static int syLengthInt ( int  i)
static

Definition at line 1918 of file syz1.cc.

1919 {
1920  int j=0;
1921 
1922  if (i==0) return 1;
1923  while (i!=0)
1924  {
1925  j++;
1926  i = i/10;
1927  }
1928  return j;
1929 }
int j
Definition: facHensel.cc:105
int i
Definition: cfEzgcd.cc:125

◆ syLinStrat()

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

Definition at line 649 of file syz1.cc.

651 {
652  int i=howmuch-1,i1=0,i2,i3,l,ll;
653  int ** Fin=syzstr->Firstelem;
654  int ** Hin=syzstr->Howmuch;
655  ideal o_r=syzstr->orderedRes[index+1];
656  intvec *result=new intvec(howmuch+1);
657  intvec *spl=new intvec(howmuch,1,-1);
658  BOOLEAN isDivisible;
659  SObject tso;
660 
661  while (i>=0)
662  {
663  tso = nextPairs[i];
664  isDivisible = FALSE;
665  if (syzstr->res[index+1]!=NULL)
666  {
667  l = Fin[index][pGetComp(tso.lcm)]-1;
668  if (l>=0)
669  {
670  ll = l+Hin[index][pGetComp(tso.lcm)];
671  while ((l<ll) && (!isDivisible))
672  {
673  if (o_r->m[l]!=NULL)
674  {
675  isDivisible = isDivisible ||
676  pLmDivisibleByNoComp(o_r->m[l],tso.lcm);
677  }
678  l++;
679  }
680  }
681  }
682  if (isDivisible)
683  {
684  syDeletePair(&nextPairs[i]);
685  //crit++;
686  }
687  else
688  {
689  pTest(tso.p2);
690  pTest(tso.p1);
691  nextPairs[i].p =
692  ksOldCreateSpoly(tso.p2, tso.p1,NULL);
693  (*spl)[i] = pLength(nextPairs[i].p);
694  }
695  i--;
696  }
697  i3 = 0;
698  loop
699  {
700  i2 = -1;
701  for (i1=0;i1<howmuch;i1++)
702  {
703  if (i2==-1)
704  {
705  if ((*spl)[i1]!=-1)
706  {
707  i2 = i1;
708  }
709  }
710  else
711  {
712  if (((*spl)[i1]>=0) && ((*spl)[i1]<(*spl)[i2]))
713  {
714  i2 = i1;
715  }
716  }
717  }
718  if (i2>=0)
719  {
720  (*result)[i3] = i2+1;
721  (*spl)[i2] = -1;
722  i3++;
723  }
724  else
725  {
726  break;
727  }
728  }
729  delete spl;
730  return result;
731 }
#define FALSE
Definition: auxiliary.h:94
#define pTest(p)
Definition: polys.h:410
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
Definition: kInline.h:1140
resolvente res
Definition: syz.h:47
#define loop
Definition: structs.h:80
#define pGetComp(p)
Component.
Definition: polys.h:37
resolvente orderedRes
Definition: syz.h:48
Definition: intvec.h:19
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
Definition: polys.h:142
int i
Definition: cfEzgcd.cc:125
int ** Howmuch
Definition: syz.h:42
static unsigned pLength(poly a)
Definition: p_polys.h:191
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:12
void syDeletePair(SObject *so)
Definition: syz1.cc:44
int p
Definition: cfModGcd.cc:4019
int BOOLEAN
Definition: auxiliary.h:85
return result
Definition: facAbsBiFact.cc:76
int l
Definition: cfEzgcd.cc:93

◆ syMinimize()

syStrategy syMinimize ( syStrategy  syzstr)

Definition at line 2394 of file syz1.cc.

2395 {
2396  if (syzstr->minres==NULL)
2397  {
2398  if (syzstr->resolution!=NULL)
2399  {
2400  // need to clear syzstr->resolution, as we are
2401  // now displaying the minres instead of fullres
2402  delete syzstr->resolution;
2403  syzstr->resolution=NULL;
2404  }
2405  if (syzstr->resPairs!=NULL)
2406  {
2407  if (syzstr->hilb_coeffs==NULL)
2408  {
2409  // La Scala Resolution
2410  syzstr->minres = syReadOutMinimalRes(syzstr);
2411  }
2412  else
2413  { // HRES
2414  syzstr->minres = syReorder(syzstr->orderedRes,syzstr->length,syzstr);
2415  }
2416  }
2417  else if (syzstr->fullres!=NULL)
2418  {
2419  syMinimizeResolvente(syzstr->fullres,syzstr->length,1);
2420  syzstr->minres = syzstr->fullres;
2421  syzstr->fullres = NULL;
2422  }
2423  }
2424  (syzstr->references)++;
2425  return syzstr;
2426 }
int length
Definition: syz.h:60
void syMinimizeResolvente(resolvente res, int length, int first)
Definition: syz.cc:355
short references
Definition: syz.h:63
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
Definition: syz1.cc:1641
static resolvente syReadOutMinimalRes(syStrategy syzstr, BOOLEAN computeStd=FALSE)
Definition: syz1.cc:2313
intvec ** hilb_coeffs
Definition: syz.h:46
resolvente orderedRes
Definition: syz.h:48
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
intvec * resolution
Definition: syz.h:51

◆ syMinimizeP1()

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

Definition at line 2151 of file syz1.cc.

2153 {
2154  int ii=0,i,tc,lp,ltS=-1;
2155  poly p,mp=NULL,pp;
2156  SSet sPairs=syzstr->resPairs[index];
2157  poly tempStripped=NULL;
2158 
2159  pp = syStripOutCopy(syzstr->res[index+1]->m[toMin],toStrip);
2160  kBucketInit(syzstr->bucket,pp,-1);
2161  while ((ii<ordn->length()) && ((*ordn)[ii]!=-1) &&
2162  (sPairs[(*ordn)[ii]].syzind!=toMin))
2163  {
2164  ii++;
2165  }
2166  while (ii>=0)
2167  {
2168  i = (*ordn)[ii];
2169  if (sPairs[i].isNotMinimal!=NULL)
2170  {
2171  tempStripped =
2172  syStripOutCopy(syzstr->res[index+1]->m[sPairs[i].syzind],toStrip);
2173  tc = pGetComp(sPairs[i].isNotMinimal);
2174  //p = pTakeOutComp1(&tempStripped,tc);
2175  int lu;
2176  pTakeOutComp(&tempStripped,tc,&p,&lu);
2177  kBucketTakeOutComp(syzstr->bucket,tc,&mp,&lp);
2178  mp = pDivideM(mp,p);
2179  while (mp!=NULL)
2180  {
2181  p = pNext(mp);
2182  pNext(mp) = NULL;
2183  ltS = -1;
2184  kBucket_Minus_m_Mult_p(syzstr->bucket,mp,tempStripped,&ltS);
2185  pDelete(&mp);
2186  mp = p;
2187  }
2188  pDelete(&mp);
2189  pDelete(&tempStripped);
2190  }
2191  ii--;
2192  }
2193  kBucketClear(syzstr->bucket,&pp,&lp);
2194  return pp;
2195 }
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:521
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:493
kBucket_pt bucket
Definition: syz.h:54
resolvente res
Definition: syz.h:47
#define pGetComp(p)
Component.
Definition: polys.h:37
#define pDivideM(a, b)
Definition: polys.h:289
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
int i
Definition: cfEzgcd.cc:125
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:716
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
static poly syStripOutCopy(poly p, intvec *toStrip)
Definition: syz1.cc:2066
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
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:334
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
#define pDelete(p_ptr)
Definition: polys.h:181
#define pNext(p)
Definition: monomials.h:36
SObject * SSet
Definition: syz.h:32
int p
Definition: cfModGcd.cc:4019
void kBucketTakeOutComp(kBucket_pt bucket, long comp, poly *r_p, int *l)
Definition: kbuckets.cc:1038

◆ syOrder()

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

Definition at line 461 of file syz1.cc.

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

◆ syOrdPairs()

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

Definition at line 2275 of file syz1.cc.

2276 {
2277  intvec * result=new intvec(length,1,-1);
2278  int i,j=0,k=-1,l,ii;
2279 
2280  loop
2281  {
2282  l = -1;
2283  for(i=0;i<length;i++)
2284  {
2285  if (sPairs[i].syzind>k)
2286  {
2287  if (l==-1)
2288  {
2289  l = sPairs[i].syzind;
2290  ii = i;
2291  }
2292  else
2293  {
2294  if (sPairs[i].syzind<l)
2295  {
2296  l = sPairs[i].syzind;
2297  ii = i;
2298  }
2299  }
2300  }
2301  }
2302  if (l==-1) break;
2303  (*result)[j] = ii;
2304  j++;
2305  k = l;
2306  }
2307  return result;
2308 }
int j
Definition: facHensel.cc:105
int k
Definition: cfEzgcd.cc:92
#define loop
Definition: structs.h:80
Definition: intvec.h:19
int i
Definition: cfEzgcd.cc:125
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
int l
Definition: cfEzgcd.cc:93
return result
Definition: facAbsBiFact.cc:76

◆ syPrint()

void syPrint ( syStrategy  syzstr,
const char *  sn 
)

Definition at line 1934 of file syz1.cc.

1935 {
1936  if ( (syzstr->resPairs==NULL) &&
1937  (syzstr->fullres==NULL) &&
1938  (syzstr->minres==NULL) &&
1939  (syzstr->resolution == NULL) )
1940  {
1941  PrintS("No resolution defined\n");
1942  return;
1943  }
1944 
1945  intvec* resolution = syzstr->resolution;
1946 
1947  if (resolution==NULL)
1948  {
1949  if (syzstr->resPairs!=NULL)
1950  {
1951  resolution = new intvec(syzstr->length+1);
1952  SRes rP = syzstr->resPairs;
1953 // assume(idRankFreeModule(syzstr->res[1], (syzstr->syRing != NULL ? syzstr->syRing : currRing))==syzstr->res[1]->rank);
1954  (*resolution)[0] = syzstr->res[1]->rank;
1955  int k=0;
1956  while ((k<syzstr->length) && (rP[k]!=NULL))
1957  {
1958  int j = 0;
1959  while ((j<(*syzstr->Tl)[k]) &&
1960  ((rP[k][j].lcm!=NULL) || (rP[k][j].syz!=NULL)))
1961  {
1962  if (rP[k][j].isNotMinimal==NULL)
1963  ((*resolution)[k+1])++;
1964  j++;
1965  }
1966  k++;
1967  }
1968  }
1969  else
1970  {
1971  resolution = new intvec(syzstr->length+2);
1972  resolvente rr;
1973  if (syzstr->minres!=NULL)
1974  rr = syzstr->minres;
1975  else
1976  rr = syzstr->fullres;
1977  (*resolution)[0]
1978  = si_max(1,(int)id_RankFreeModule(rr[0],
1979  (syzstr->syRing != NULL ? syzstr->syRing : currRing)));
1980  int k=0;
1981  while ((k<syzstr->length) && (rr[k]!=NULL))
1982  {
1983  (*resolution)[k+1] = idElem(rr[k]);
1984  k++;
1985  }
1986  }
1987  }
1988 
1989  int sl=strlen(sn);
1990  syPrintEmptySpaces1(sl);
1991  int k = 0;
1992  loop
1993  {
1994  if ((k>=resolution->length()) || ((*resolution)[k]==0))
1995  break;
1996  Print("%d",(*resolution)[k]);
1997  syPrintEmptySpaces1(sl+5);
1998  k++;
1999  }
2000  PrintLn();
2001  k = 0;
2002  loop
2003  {
2004  if ((k>=resolution->length()) || ((*resolution)[k]==0))
2005  break;
2006  PrintS(sn);
2007  if (((k+1)>=resolution->length()) || ((*resolution)[(k+1)]==0))
2008  break;
2009  PrintS(" <-- ");
2010  syPrintEmptySpaces((*resolution)[k]);
2011  k++;
2012  }
2013  PrintLn();
2014  PrintLn();
2015  k = 0;
2016  loop
2017  {
2018  if ((k>=resolution->length()) || ((*resolution)[k]==0))
2019  break;
2020  Print("%d",k);
2021  syPrintEmptySpaces1(sl+5+syLengthInt((*resolution)[k])-
2022  syLengthInt(k));
2023  k++;
2024  }
2025  PrintLn();
2026  if (syzstr->minres==NULL)
2027  {
2028  PrintS("resolution not minimized yet\n");
2029  }
2030 
2031  if (syzstr->resolution == NULL) syzstr->resolution = resolution;
2032 }
int length
Definition: syz.h:60
int j
Definition: facHensel.cc:105
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:80
resolvente res
Definition: syz.h:47
int k
Definition: cfEzgcd.cc:92
#define loop
Definition: structs.h:80
intvec * Tl
Definition: syz.h:50
Definition: intvec.h:19
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
static int si_max(const int a, const int b)
Definition: auxiliary.h:138
void PrintS(const char *s)
Definition: reporter.cc:284
static void syPrintEmptySpaces(int i)
Definition: syz1.cc:1894
static int syLengthInt(int i)
Definition: syz1.cc:1918
static void syPrintEmptySpaces1(int i)
Definition: syz1.cc:1906
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define NULL
Definition: omList.c:12
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
int length() const
Definition: intvec.h:94
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
SSet * SRes
Definition: syz.h:33
ideal * resolvente
Definition: ideals.h:18
int idElem(const ideal F)
count non-zero elements
intvec * resolution
Definition: syz.h:51

◆ syPrintEmptySpaces()

static void syPrintEmptySpaces ( int  i)
static

Definition at line 1894 of file syz1.cc.

1895 {
1896  if (i!=0)
1897  {
1898  PrintS(" ");
1899  syPrintEmptySpaces(i/10);
1900  }
1901 }
int i
Definition: cfEzgcd.cc:125
void PrintS(const char *s)
Definition: reporter.cc:284
static void syPrintEmptySpaces(int i)
Definition: syz1.cc:1894

◆ syPrintEmptySpaces1()

static void syPrintEmptySpaces1 ( int  i)
static

Definition at line 1906 of file syz1.cc.

1907 {
1908  if (i!=0)
1909  {
1910  PrintS(" ");
1912  }
1913 }
int i
Definition: cfEzgcd.cc:125
void PrintS(const char *s)
Definition: reporter.cc:284
static void syPrintEmptySpaces1(int i)
Definition: syz1.cc:1906

◆ syReadOutMinimalRes()

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

Definition at line 2313 of file syz1.cc.

2315 {
2316  intvec * Strip, * ordn;
2317  resolvente tres=(resolvente)omAlloc0((syzstr->length+1)*sizeof(ideal));
2318  ring origR = currRing;
2319 
2320 //Print("Hier ");
2321  if (computeStd)
2322  {
2323  tres[0] = syzstr->res[1];
2324  syzstr->res[1] = idInit(IDELEMS(tres[0]),tres[0]->rank);
2325  return tres;
2326  }
2327  int i,l,index,i1;
2328  SSet sPairs;
2329 
2330  assume(syzstr->syRing != NULL);
2331  rChangeCurrRing(syzstr->syRing);
2332 //Print("laeufts ");
2333  syzstr->bucket = kBucketCreate(syzstr->syRing);
2334  for (index=syzstr->length-1;index>0;index--)
2335  {
2336  if (syzstr->resPairs[index]!=NULL)
2337  {
2338 //Print("ideal %d: \n",index);
2339  currcomponents = syzstr->truecomponents[index];
2342  IDELEMS(syzstr->res[index]), currRing);
2343  sPairs = syzstr->resPairs[index];
2344  Strip = syToStrip(syzstr,index);
2345  tres[index+1] = idInit(IDELEMS(syzstr->res[index+1]),syzstr->res[index+1]->rank);
2346  i1 = (*syzstr->Tl)[index];
2347 //Print("i1= %d\n",i1);
2348  ordn = syOrdPairs(sPairs,i1);
2349  for (i=0;i<i1;i++)
2350  {
2351  if ((sPairs[i].isNotMinimal==NULL) && (sPairs[i].lcm!=NULL))
2352  {
2353  l = sPairs[i].syzind;
2354 //Print("Minimiere Poly %d: ",l);pWrite(syzstr->res[index+1]->m[l]);
2355  tres[index+1]->m[l] =
2356  syMinimizeP1(l,syzstr,ordn,index,Strip);
2357  }
2358  }
2359  delete Strip;
2360  delete ordn;
2361  Strip = NULL;
2362  }
2363  }
2364  currcomponents = syzstr->truecomponents[0];
2367  IDELEMS(syzstr->res[0]), currRing);
2368  tres[1] = idInit(IDELEMS(syzstr->res[1]),syzstr->res[1]->rank);
2369  sPairs = syzstr->resPairs[0];
2370  for (i=(*syzstr->Tl)[0]-1;i>=0;i--)
2371  {
2372  if (sPairs[i].syzind>=0)
2373  {
2374  tres[1]->m[sPairs[i].syzind] = pCopy(syzstr->res[1]->m[sPairs[i].syzind]);
2375  }
2376  }
2377 /*--- changes to the original ring------------------*/
2378  kBucketDestroy(&syzstr->bucket);
2379  if (syzstr->syRing != NULL)
2380  {
2381  rChangeCurrRing(origR);
2382  // Thomas: now make sure that all data which you need is pFetchCopied
2383  // maybe incoporate it into syReorder ??
2384  }
2385  tres = syReorder(tres,syzstr->length,syzstr,FALSE,syzstr->res);
2386  syKillEmptyEntres(tres,syzstr->length);
2387  idSkipZeroes(tres[0]);
2388  return tres;
2389 }
int length
Definition: syz.h:60
void syKillEmptyEntres(resolvente res, int length)
Definition: syz1.cc:2200
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:709
kBucket_pt bucket
Definition: syz.h:54
#define FALSE
Definition: auxiliary.h:94
int * currcomponents
Definition: syz1.cc:33
resolvente syReorder(resolvente res, int length, syStrategy syzstr, BOOLEAN toCopy, resolvente totake)
Definition: syz1.cc:1641
resolvente res
Definition: syz.h:47
intvec * Tl
Definition: syz.h:50
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:216
Definition: intvec.h:19
#define assume(x)
Definition: mod2.h:390
static poly syMinimizeP1(int toMin, syStrategy syzstr, intvec *ordn, int index, intvec *toStrip)
Definition: syz1.cc:2151
int i
Definition: cfEzgcd.cc:125
#define IDELEMS(i)
Definition: simpleideals.h:23
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void rChangeCurrRing(ring r)
Definition: polys.cc:14
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:12
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
long * currShiftedComponents
Definition: syz1.cc:34
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
SObject * SSet
Definition: syz.h:32
ideal * resolvente
Definition: ideals.h:18
static intvec * syToStrip(syStrategy syzstr, int index)
Definition: syz1.cc:2253
static intvec * syOrdPairs(SSet sPairs, int length)
Definition: syz1.cc:2275
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:209
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4362
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:93
#define pCopy(p)
return a copy of the poly
Definition: polys.h:180

◆ syRedGenerOfCurrDeg()

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

Definition at line 915 of file syz1.cc.

916 {
917  ideal res=syzstr->res[index];
918  int i=0,j,k=IDELEMS(res);
919  SSet sPairs=syzstr->resPairs[index-1];
920 
921  while ((k>0) && (res->m[k-1]==NULL)) k--;
922  while ((i<(*syzstr->Tl)[index-1]) && (((sPairs)[i].syz==NULL) ||
923  ((sPairs)[i].order<deg)))
924  i++;
925  if ((i>=(*syzstr->Tl)[index-1]) || ((sPairs)[i].order>deg)) return;
926  while ((i<(*syzstr->Tl)[index-1]) && (((sPairs)[i].syz==NULL) ||
927  ((sPairs)[i].order==deg)))
928  {
929  if ((sPairs)[i].syz!=NULL)
930  {
931  j = k-1;
932  while ((j>=0) && (res->m[j]!=NULL) &&
933  ((sPairs)[i].syz!=NULL))
934  {
935  if (pLmDivisibleBy(res->m[j],(sPairs)[i].syz))
936  {
937  (sPairs)[i].syz =
938  ksOldSpolyRed(res->m[j],(sPairs)[i].syz);
939  //sySPolyRed((sPairs)[i].syz,res->m[j]);
940  j = k-1;
941  }
942  else
943  {
944  j--;
945  }
946  }
947  if ((sPairs)[i].syz != NULL)
948  {
949  if (k==IDELEMS(res))
950  {
951  syEnlargeFields(syzstr,index);
952  res=syzstr->res[index];
953  }
954  if (TEST_OPT_DEBUG)
955  {
956  if ((sPairs)[i].isNotMinimal==NULL)
957  {
958  PrintLn();
959  PrintS("minimal generator: ");pWrite((syzstr->resPairs[index-1])[i].syz);
960  PrintS("comes from: ");pWrite((syzstr->resPairs[index-1])[i].p1);
961  PrintS("and: ");pWrite((syzstr->resPairs[index-1])[i].p2);
962  }
963  }
964  //res->m[k] = (sPairs)[i].syz;
965  res->m[k] = syRedtail((sPairs)[i].syz,syzstr,index);
966  (sPairs)[i].syzind = k;
967  syzstr->elemLength[index][k] = pLength((sPairs)[i].syz);
968  pNorm(res->m[k]);
969  // (sPairs)[i].syz = NULL;
970  k++;
971  if (syOrder(res->m[k-1],syzstr,index,k))
973  //euler++;
974  }
975  else
976  (sPairs)[i].syzind = -1;
977  }
978  i++;
979  }
980 }
int j
Definition: facHensel.cc:105
void syEnlargeFields(syStrategy syzstr, int index)
Definition: syz1.cc:734
void PrintLn()
Definition: reporter.cc:310
poly syRedtail(poly p, syStrategy syzstr, int index)
Definition: syz1.cc:226
resolvente res
Definition: syz.h:47
void pWrite(poly p)
Definition: polys.h:303
int k
Definition: cfEzgcd.cc:92
#define TEST_OPT_DEBUG
Definition: options.h:107
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
Definition: polys.h:140
intvec * Tl
Definition: syz.h:50
static BOOLEAN syOrder(poly p, syStrategy syzstr, int index, int realcomp)
Definition: syz1.cc:461
CanonicalForm res
Definition: facAbsFact.cc:64
int i
Definition: cfEzgcd.cc:125
void PrintS(const char *s)
Definition: reporter.cc:284
static unsigned pLength(poly a)
Definition: p_polys.h:191
#define IDELEMS(i)
Definition: simpleideals.h:23
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
int ** elemLength
Definition: syz.h:44
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:358
SObject * SSet
Definition: syz.h:32
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
Definition: kInline.h:1120
void syResetShiftedComponents(syStrategy syzstr, int index, int hilb)
Definition: syz1.cc:409

◆ syRedNextPairs()

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

Definition at line 768 of file syz1.cc.

770 {
771  int i,j,k=IDELEMS(syzstr->res[index]);
772  int ks=IDELEMS(syzstr->res[index+1]);
773  int * Fin=syzstr->Firstelem[index-1];
774  int * Hin=syzstr->Howmuch[index-1];
775  int * bin=syzstr->backcomponents[index];
776  int * elL=syzstr->elemLength[index];
777  number coefgcd;
778  polyset redset=syzstr->orderedRes[index]->m;
779  poly p=NULL,q;
780  intvec *spl1;
781  SObject tso;
782  long * ShiftedComponents = syzstr->ShiftedComponents[index];
783  int* Components = syzstr->truecomponents[index];
784  assume(Components != NULL && ShiftedComponents != NULL);
785  BOOLEAN need_reset;
786 
787  if ((nextPairs==NULL) || (howmuch==0)) return;
788  while ((k>0) && (syzstr->res[index]->m[k-1]==NULL)) k--;
789  while ((ks>0) && (syzstr->res[index+1]->m[ks-1]==NULL)) ks--;
790  spl1 = syLinStrat(nextPairs,syzstr,howmuch,index);
791  i=0;
792  while ((*spl1)[i]>0)
793  {
794  need_reset = FALSE;
795  tso = nextPairs[(*spl1)[i]-1];
796  if ((tso.p1!=NULL) && (tso.p2!=NULL))
797  {
798  nNormalize(pGetCoeff(tso.p1));
799  nNormalize(pGetCoeff(tso.p2));
800  coefgcd =
801  n_SubringGcd(pGetCoeff(tso.p1),pGetCoeff(tso.p2),currRing->cf);
802  tso.syz = pHead(tso.lcm);
803  p = tso.syz;
804  pSetCoeff(p,nDiv(pGetCoeff(tso.p1),coefgcd));
805  pGetCoeff(p) = nInpNeg(pGetCoeff(p));
806  pSetComp(p,tso.ind2+1);
807  p_Setm_Syz(p, currRing, Components, ShiftedComponents); // actueller index
808  pNext(p) = pHead(tso.lcm);
809  pIter(p);
810  pSetComp(p,tso.ind1+1);
811  p_Setm_Syz(p, currRing, Components, ShiftedComponents); // actueller index
812  pSetCoeff(p,nDiv(pGetCoeff(tso.p2),coefgcd));
813  nDelete(&coefgcd);
814  if (tso.p != NULL)
815  {
816  kBucketInit(syzstr->bucket,tso.p,-1);
817  q = kBucketGetLm(syzstr->bucket);
818  j = Fin[pGetComp(q)]-1;
819  int pos = j+Hin[pGetComp(q)];
820  loop
821  {
822  if (j<0) break;
823  if (pLmDivisibleByNoComp(redset[j],q))
824  {
825  pNext(p) = pHead(q);
826  pIter(p);
827  pSetComp(p,bin[j]+1);
828  p_Setm_Syz(p, currRing, Components, ShiftedComponents); // actueller index
829 //if (pLength(redset[j])!=syzstr->elemLength[index][bin[j]])
830 //Print("Halt");
831 //if (pLength(redset[j])!=syzstr->elemLength[index][bin[j]])
832 //Print("Halt");
833  pGetCoeff(p) = nInpNeg(pGetCoeff(p));
834  number up = kBucketPolyRed(syzstr->bucket,redset[j],elL[bin[j]],
835  NULL);
836  // Thomas: Check whether you need number here
837  nDelete(&up);
838  q = kBucketGetLm(syzstr->bucket);
839  if (q==NULL) break;
840  j = Fin[pGetComp(q)]-1;
841  pos = j+Hin[pGetComp(q)];
842  }
843  else
844  {
845  j++;
846  if (j==pos) break;
847  }
848  }
849  int lb;
850  kBucketClear(syzstr->bucket,&tso.p,&lb);
851  }
852  if (tso.p != NULL)
853  {
854  if (TEST_OPT_PROT) PrintS("g");
855  if (k==IDELEMS((syzstr->res)[index]))
856  {
857  syEnlargeFields(syzstr,index);
858  bin=syzstr->backcomponents[index];
859  elL=syzstr->elemLength[index];
860  redset=syzstr->orderedRes[index]->m;
861  Components = syzstr->truecomponents[index];
862  ShiftedComponents = syzstr->ShiftedComponents[index];
863  }
864  pNext(p) = pHead(tso.p);
865  pIter(p);
866 
867  assume(p!= NULL);
868  k++;
869  syzstr->res[index]->m[k-1] = tso.p;
870  syzstr->elemLength[index][k-1] = pLength(tso.p);
871  pNorm(syzstr->res[index]->m[k-1]);
872  need_reset = syOrder(syzstr->res[index]->m[k-1],syzstr,index,k);
873  pSetComp(p,k); // actueller index
874  p_Setm_Syz(p, currRing, Components, ShiftedComponents);
875  pGetCoeff(p) = nInpNeg(pGetCoeff(p));
876 
877  tso.isNotMinimal = p;
878  tso.p = NULL;
879  }
880  else
881  {
882  if (TEST_OPT_PROT) PrintS(".");
883  //if (index % 2==0)
884  //euler++;
885  //else
886  //euler--;
887  }
888  if (ks==IDELEMS(syzstr->res[index+1]))
889  {
890  syEnlargeFields(syzstr,index+1);
891  }
892  syzstr->res[index+1]->m[ks] = tso.syz;
893  syzstr->elemLength[index+1][ks] = pLength(tso.syz);
894  pNorm(syzstr->res[index+1]->m[ks]);
895  tso.syz =NULL;
896  tso.syzind = ks;
897  if (need_reset)
898  syResetShiftedComponents(syzstr, index+1);
899  if (syOrder(syzstr->res[index+1]->m[ks],syzstr,index+1,ks+1))
900  syResetShiftedComponents(syzstr, index+2);
901  ks++;
902  p = NULL;
903  nextPairs[(*spl1)[i]-1] = tso;
904  }
905  i++;
906  }
907  delete spl1;
908 }
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:521
static intvec * syLinStrat(SSet nextPairs, syStrategy syzstr, int howmuch, int index)
Definition: syz1.cc:649
int j
Definition: facHensel.cc:105
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:493
void syEnlargeFields(syStrategy syzstr, int index)
Definition: syz1.cc:734
kBucket_pt bucket
Definition: syz.h:54
#define nNormalize(n)
Definition: numbers.h:30
#define TEST_OPT_PROT
Definition: options.h:102
#define FALSE
Definition: auxiliary.h:94
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
Definition: kbuckets.cc:1079
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:506
resolvente res
Definition: syz.h:47
int k
Definition: cfEzgcd.cc:92
#define loop
Definition: structs.h:80
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:44
#define pGetComp(p)
Component.
Definition: polys.h:37
#define pIter(p)
Definition: monomials.h:37
static BOOLEAN syOrder(poly p, syStrategy syzstr, int index, int realcomp)
Definition: syz1.cc:461
resolvente orderedRes
Definition: syz.h:48
Definition: intvec.h:19
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
Definition: polys.h:142
#define assume(x)
Definition: mod2.h:390
#define nInpNeg(n)
Definition: numbers.h:21
#define pSetComp(p, v)
Definition: polys.h:38
int ** backcomponents
Definition: syz.h:41
poly * polyset
Definition: polys.h:254
int i
Definition: cfEzgcd.cc:125
void PrintS(const char *s)
Definition: reporter.cc:284
int ** Howmuch
Definition: syz.h:42
static unsigned pLength(poly a)
Definition: p_polys.h:191
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
#define IDELEMS(i)
Definition: simpleideals.h:23
#define nDelete(n)
Definition: numbers.h:16
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
void p_Setm_Syz(poly p, ring r, int *Components, long *ShiftedComponents)
Definition: p_polys.cc:521
int ** elemLength
Definition: syz.h:44
int ** truecomponents
Definition: syz.h:39
#define nDiv(a, b)
Definition: numbers.h:32
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:12
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:358
#define pNext(p)
Definition: monomials.h:36
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
poly p
Definition: kbuckets.h:182
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition: coeffs.h:688
int p
Definition: cfModGcd.cc:4019
int BOOLEAN
Definition: auxiliary.h:85
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:31
void syResetShiftedComponents(syStrategy syzstr, int index, int hilb)
Definition: syz1.cc:409

◆ syRedtail()

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

Definition at line 226 of file syz1.cc.

227 {
228  poly h, hn;
229  int j,pos;
230  ideal redWith=syzstr->orderedRes[index];
231 
232  h = p;
233  hn = pNext(h);
234  while(hn != NULL)
235  {
236  j = syzstr->Firstelem[index-1][pGetComp(hn)]-1;
237  if (j>=0)
238  {
239  pos = j+syzstr->Howmuch[index-1][pGetComp(hn)];
240  while (j < pos)
241  {
242  if (pLmDivisibleByNoComp(redWith->m[j], hn))
243  {
244  //hn = sySPolyRed(hn,redWith->m[j]);
245  hn = ksOldSpolyRed(redWith->m[j],hn);
246  if (hn == NULL)
247  {
248  pNext(h) = NULL;
249  return p;
250  }
251  j = syzstr->Firstelem[index-1][pGetComp(hn)]-1;
252  pos = j+syzstr->Howmuch[index-1][pGetComp(hn)];
253  }
254  else
255  {
256  j++;
257  }
258  }
259  }
260  h = pNext(h) = hn;
261  hn = pNext(h);
262  }
263  return p;
264 }
int j
Definition: facHensel.cc:105
#define pGetComp(p)
Component.
Definition: polys.h:37
resolvente orderedRes
Definition: syz.h:48
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
Definition: polys.h:142
int ** Howmuch
Definition: syz.h:42
int ** Firstelem
Definition: syz.h:43
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:12
#define pNext(p)
Definition: monomials.h:36
KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether)
Definition: kInline.h:1120
int p
Definition: cfModGcd.cc:4019
static Poly * h
Definition: janet.cc:971

◆ syReorder()

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

Definition at line 1641 of file syz1.cc.

1643 {
1644  int i,j,l;
1645  poly p,q,tq;
1646  polyset ri1;
1647  resolvente fullres;
1648  ring origR=syzstr->syRing;
1649  fullres = (resolvente)omAlloc0((length+1)*sizeof(ideal));
1650  if (totake==NULL)
1651  totake = res;
1652  for (i=length-1;i>0;i--)
1653  {
1654  if (res[i]!=NULL)
1655  {
1656  if (i>1)
1657  {
1658  j = IDELEMS(res[i-1]);
1659  while ((j>0) && (res[i-1]->m[j-1]==NULL)) j--;
1660  fullres[i-1] = idInit(IDELEMS(res[i]),j);
1661  ri1 = totake[i-1]->m;
1662  for (j=IDELEMS(res[i])-1;j>=0;j--)
1663  {
1664  p = res[i]->m[j];
1665  q = NULL;
1666  while (p!=NULL)
1667  {
1668  if (toCopy)
1669  {
1670  if (origR!=NULL)
1671  tq = prHeadR(p,origR, currRing);
1672  else
1673  tq = pHead(p);
1674  pIter(p);
1675  }
1676  else
1677  {
1678  res[i]->m[j] = NULL;
1679  if (origR!=NULL)
1680  {
1681  poly pp=p;
1682  pIter(p);
1683  pNext(pp)=NULL;
1684  tq = prMoveR(pp, origR, currRing);
1685  }
1686  else
1687  {
1688  tq = p;
1689  pIter(p);
1690  pNext(tq) = NULL;
1691  }
1692  }
1693 // pWrite(tq);
1694  pTest(tq);
1695  for (l=(currRing->N);l>0;l--)
1696  {
1697  if (origR!=NULL)
1698  pSubExp(tq,l, p_GetExp(ri1[pGetComp(tq)-1],l,origR));
1699  else
1700  pSubExp(tq,l, pGetExp(ri1[pGetComp(tq)-1],l));
1701  }
1702  pSetm(tq);
1703  pTest(tq);
1704  q = pAdd(q,tq);
1705  pTest(q);
1706  }
1707  fullres[i-1]->m[j] = q;
1708  }
1709  }
1710  else
1711  {
1712  if (origR!=NULL)
1713  {
1714  fullres[i-1] = idInit(IDELEMS(res[i]),res[i]->rank);
1715  for (j=IDELEMS(res[i])-1;j>=0;j--)
1716  {
1717  if (toCopy)
1718  fullres[i-1]->m[j] = prCopyR(res[i]->m[j], origR, currRing);
1719  else
1720  {
1721  fullres[i-1]->m[j] = prMoveR(res[i]->m[j], origR, currRing);
1722  res[i]->m[j] = NULL;
1723  }
1724  }
1725  }
1726  else
1727  {
1728  if (toCopy)
1729  fullres[i-1] = idCopy(res[i]);
1730  else
1731  {
1732  fullres[i-1] = res[i];
1733  res[i] = NULL;
1734  }
1735  }
1736  for (j=IDELEMS(fullres[i-1])-1;j>=0;j--)
1737  fullres[i-1]->m[j] = pSortCompCorrect(fullres[i-1]->m[j]);
1738  }
1739  if (!toCopy)
1740  {
1741  if (res[i]!=NULL) idDelete(&res[i]);
1742  }
1743  }
1744  }
1745  if (!toCopy)
1746  omFreeSize((ADDRESS)res,(length+1)*sizeof(ideal));
1747  //syzstr->length = length;
1748  return fullres;
1749 }
poly prHeadR(poly p, ring src_r, ring dest_r, prCopyProc_t prproc)
Definition: prCopy.cc:125
int j
Definition: facHensel.cc:105
#define pSetm(p)
Definition: polys.h:266
#define pAdd(p, q)
Definition: polys.h:198
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:34
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
poly prMoveR(poly &p, ring src_r, ring dest_r)
Definition: prCopy.cc:89
#define pTest(p)
Definition: polys.h:410
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define pSubExp(p, i, v)
Definition: polys.h:46
void * ADDRESS
Definition: auxiliary.h:133
#define pGetComp(p)
Component.
Definition: polys.h:37
#define pIter(p)
Definition: monomials.h:37
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
#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:222
CanonicalForm res
Definition: facAbsFact.cc:64
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:468
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
int m
Definition: cfEzgcd.cc:121
poly * polyset
Definition: polys.h:254
int i
Definition: cfEzgcd.cc:125
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
#define IDELEMS(i)
Definition: simpleideals.h:23
ideal idCopy(ideal A)
Definition: ideals.h:60
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
#define NULL
Definition: omList.c:12
ring syRing
Definition: syz.h:56
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
#define pNext(p)
Definition: monomials.h:36
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
ideal * resolvente
Definition: ideals.h:18
int p
Definition: cfModGcd.cc:4019
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:93

◆ syReorderShiftedComponents()

long syReorderShiftedComponents ( long *  sc,
int  n 
)

Definition at line 334 of file syz1.cc.

335 {
336  long holes = 0;
337  int i;
338  long new_comps = 0, new_space, max;
339 
340  // count number of holes
341  for (i=1; i<n; i++)
342  {
343  if (sc[i-1] + 1 < sc[i]) holes++;
344  }
345 
346  if (LONG_MAX - SYZ_SHIFT_BASE <= sc[n-1])
347  {
348  // need new components
349  new_comps = (((long) 1) << SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE) - 1;
350  max = LONG_MAX;
351  }
352  else
353  {
354  max = sc[n-1] + SYZ_SHIFT_BASE;
355  }
356 
357  // no we arrange things such that
358  // (n - holes) + holes*new_space + new_comps*SYZ_SHIFT_BASE= LONG_MAX
359  new_space = (max - n + holes - new_comps*SYZ_SHIFT_BASE) / holes;
360 
361  assume(new_space < SYZ_SHIFT_BASE && new_space >= 4);
362 
363  long* tc = ( long*) omAlloc(n*sizeof(long));
364  tc[0] = sc[0];
365  // rearrange things
366  for (i=1; i<n; i++)
367  {
368  if (sc[i-1] + 1 < sc[i])
369  {
370  tc[i] = tc[i-1] + new_space;
371  }
372  else
373  {
374  tc[i] = tc[i-1] + 1;
375  }
376  assume(tc[i] > tc[i-1]);
377  }
378 
379  assume(LONG_MAX - SYZ_SHIFT_BASE > tc[n-1]);
380 #ifndef SING_NDEBUG
381  for (i=1; i<n; i++)
382  {
383  assume(tc[i] >= 0);
384  assume(tc[i-1] + 1 <= tc[i]);
385  }
386 #endif
387 
388  omMemcpyW(sc, tc, n);
389  omFreeSize(tc, n*sizeof(long));
390  return new_space;
391 }
#define omMemcpyW(p1, p2, l)
Definition: omMemOps.h:29
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define SYZ_SHIFT_MAX_NEW_COMP_ESTIMATE
Definition: syz.h:15
#define omAlloc(size)
Definition: omAllocDecl.h:210
static int max(int a, int b)
Definition: fast_mult.cc:264
#define assume(x)
Definition: mod2.h:390
#define SYZ_SHIFT_BASE
Definition: syz.h:18
int i
Definition: cfEzgcd.cc:125

◆ syResetShiftedComponents()

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

Definition at line 409 of file syz1.cc.

410 {
411  assume(index > 0);
412  int i;
413  if (syzstr->res[index] != NULL)
414  {
415  long * prev_s;
416  int* prev_c;
417  int p_length;
418  rGetSComps(&prev_c, &prev_s, &p_length, currRing);
419  currcomponents = syzstr->truecomponents[index-1];
423  IDELEMS(syzstr->res[index-1]), currRing);
424  if (hilb==0)
425  {
426  ideal id = syzstr->res[index];
427  for (i=0; i<IDELEMS(id); i++)
428  {
429  pResetSetm(id->m[i]);
430  }
431  }
432  else if (hilb==1)
433  {
434  assume (index>1);
435  assume (syzstr->resPairs[index-1]!=NULL);
436  SSet Pairs=syzstr->resPairs[index-1];
437  SSet Pairs1=syzstr->resPairs[index];
438  int till=(*syzstr->Tl)[index-1];
439  for (i=0;i<till;i++)
440  {
441  if (Pairs[i].syz!=NULL)
442  pResetSetm(Pairs[i].syz);
443  }
444  till=(*syzstr->Tl)[index];
445  for (i=0;i<till;i++)
446  {
447  if (Pairs1[i].p!=NULL)
448  pResetSetm(Pairs1[i].p);
449  }
450  }
451  currcomponents = prev_c;
452  currShiftedComponents = prev_s;
453  rChangeSComps(prev_c, prev_s, p_length, currRing);
454  }
455 }
int * currcomponents
Definition: syz1.cc:33
resolvente res
Definition: syz.h:47
intvec * Tl
Definition: syz.h:50
void rGetSComps(int **currComponents, long **currShiftedComponents, int *length, ring r)
Definition: ring.cc:4371
#define assume(x)
Definition: mod2.h:390
int i
Definition: cfEzgcd.cc:125
#define IDELEMS(i)
Definition: simpleideals.h:23
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
static void pResetSetm(poly p)
Definition: syz1.cc:394
long * currShiftedComponents
Definition: syz1.cc:34
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
SObject * SSet
Definition: syz.h:32
int p
Definition: cfModGcd.cc:4019
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4362

◆ sySize()

int sySize ( syStrategy  syzstr)

Definition at line 1829 of file syz1.cc.

1830 {
1831  resolvente r=syzstr->res;
1832  if (r==NULL)
1833  r = syzstr->fullres;
1834  if (r==NULL)
1835  r = syzstr->minres;
1836  if (r==NULL)
1837  {
1838  WerrorS("No resolution found");
1839  return 0;
1840  }
1841  int i=syzstr->length;
1842  while ((i>0) && (r[i-1]==NULL)) i--;
1843  return i;
1844 }
int length
Definition: syz.h:60
resolvente res
Definition: syz.h:47
void WerrorS(const char *s)
Definition: feFopen.cc:24
int i
Definition: cfEzgcd.cc:125
resolvente fullres
Definition: syz.h:57
resolvente minres
Definition: syz.h:58
#define NULL
Definition: omList.c:12
ideal * resolvente
Definition: ideals.h:18

◆ syStripOutCopy()

static poly syStripOutCopy ( poly  p,
intvec toStrip 
)
static

Definition at line 2066 of file syz1.cc.

2067 {
2068  if (toStrip==NULL) return pCopy(p);
2069  poly result=NULL,pp;
2070 
2071  while (p!=NULL)
2072  {
2073  if ((*toStrip)[pGetComp(p)]==0)
2074  {
2075  if (result==NULL)
2076  {
2077  result = pp = pHead(p);
2078  }
2079  else
2080  {
2081  pNext(pp) = pHead(p);
2082  pIter(pp);
2083  }
2084  }
2085  pIter(p);
2086  }
2087  return result;
2088 }
#define pGetComp(p)
Component.
Definition: polys.h:37
#define pIter(p)
Definition: monomials.h:37
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
#define NULL
Definition: omList.c:12
#define pNext(p)
Definition: monomials.h:36
int p
Definition: cfModGcd.cc:4019
return result
Definition: facAbsBiFact.cc:76
#define pCopy(p)
return a copy of the poly
Definition: polys.h:180

◆ syToStrip()

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

Definition at line 2253 of file syz1.cc.

2254 {
2255  intvec * result=NULL;
2256 
2257  if ((syzstr->resPairs[index-1]!=NULL) && (!idIs0(syzstr->res[index])))
2258  {
2259  result=new intvec(IDELEMS(syzstr->res[index])+1);
2260  for (int i=(*syzstr->Tl)[index-1]-1;i>=0;i--)
2261  {
2262  if (syzstr->resPairs[index-1][i].isNotMinimal!=NULL)
2263  {
2264  (*result)[syzstr->resPairs[index-1][i].syzind+1] = 1;
2265  }
2266  }
2267  }
2268  return result;
2269 }
resolvente res
Definition: syz.h:47
intvec * Tl
Definition: syz.h:50
Definition: intvec.h:19
int i
Definition: cfEzgcd.cc:125
#define IDELEMS(i)
Definition: simpleideals.h:23
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:12
SRes resPairs
Definition: syz.h:49
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
return result
Definition: facAbsBiFact.cc:76

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.