Data Structures | Macros | Typedefs | Functions
syz2.cc File Reference
#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <misc/mylimits.h>
#include <misc/options.h>
#include <misc/intvec.h>
#include <coeffs/coeffs.h>
#include <coeffs/numbers.h>
#include <polys/monomials/ring.h>
#include <polys/kbuckets.h>
#include <polys/prCopy.h>
#include <kernel/combinatorics/stairc.h>
#include <kernel/combinatorics/hilb.h>
#include <kernel/GBEngine/kstd1.h>
#include <kernel/GBEngine/kutil.h>
#include <kernel/GBEngine/syz.h>
#include <kernel/ideals.h>
#include <kernel/polys.h>

Go to the source code of this file.

Data Structures

struct  open_pairs
 

Macros

#define USE_CHAINCRIT
 
#define poly_write(p)   wrp(p);PrintLn()
 
#define USE_HEURISTIC2
 

Typedefs

typedef open_pairs * crit_pairs
 

Functions

static void syCreateNewPairs_Hilb (syStrategy syzstr, int index, int actdeg)
 
static void syOrder_Hilb (poly p, syStrategy syzstr, int index)
 
static void syHalfPair (poly syz, int newEl, syStrategy syzstr, int index)
 
static intvecsyLinStrat2 (SSet nextPairs, syStrategy syzstr, int howmuch, int index, intvec **secondpairs)
 
void sySPRedSyz (syStrategy syzstr, sSObject redWith, poly q=NULL)
 
static poly syRed_Hilb (poly toRed, syStrategy syzstr, int index)
 
static void syRedNextPairs_Hilb (SSet nextPairs, syStrategy syzstr, int howmuch, int index, int actord, int *toSub, int *maxindex, int *maxdeg)
 
void sySetNewHilb (syStrategy syzstr, int toSub, int index, int actord)
 
static void syRedGenerOfCurrDeg_Hilb (syStrategy syzstr, int deg, int *maxindex, int *maxdeg)
 
static void syReOrdResult_Hilb (syStrategy syzstr, int maxindex, int maxdeg)
 
syStrategy syHilb (ideal arg, int *length)
 

Data Structure Documentation

◆ sopen_pairs

struct sopen_pairs

Definition at line 61 of file syz2.cc.

Data Fields
int first_poly
crit_pairs next
int second_poly

Macro Definition Documentation

◆ poly_write

#define poly_write (   p)    wrp(p);PrintLn()

Definition at line 46 of file syz2.cc.

◆ USE_CHAINCRIT

#define USE_CHAINCRIT

Definition at line 45 of file syz2.cc.

◆ USE_HEURISTIC2

#define USE_HEURISTIC2

Definition at line 50 of file syz2.cc.

Typedef Documentation

◆ crit_pairs

typedef open_pairs* crit_pairs

Definition at line 60 of file syz2.cc.

Function Documentation

◆ syCreateNewPairs_Hilb()

static void syCreateNewPairs_Hilb ( syStrategy  syzstr,
int  index,
int  actdeg 
)
static

Definition at line 71 of file syz2.cc.

73 {
74  SObject tso;
75  poly toHandle,p,pp;
76  int r1,r2=0,rr,l=(*syzstr->Tl)[index];
77  int i,j,r=0,ti;
78  BOOLEAN toComp=FALSE;
79 #ifdef USE_CHAINCRIT
80  crit_pairs cp=NULL,tcp;
81 #endif
82  actdeg += index;
83 
84  while ((l>0) && ((syzstr->resPairs[index])[l-1].lcm==NULL)) l--;
85  rr = l-1;
86  while ((rr>=0) && (((syzstr->resPairs[index])[rr].p==NULL) ||
87  ((syzstr->resPairs[index])[rr].order>actdeg))) rr--;
88  r2 = rr+1;
89  while ((rr>=0) && ((syzstr->resPairs[index])[rr].order==actdeg)
90  && ((syzstr->resPairs[index])[rr].syzind<0))
91  {
92  rr--;
93  r++;
94  }
95  if (r==0) return;
96  ideal nP=idInit(l,syzstr->res[index]->rank);
97 #ifdef INVERT_PAIRS
98  r1 = rr+1;
99 #else
100  r1 = r2-1;
101 #endif
102 /*---------- there are new pairs ------------------------------*/
103  loop
104  {
105 /*--- chose first new elements --------------------------------*/
106  toComp = FALSE;
107  toHandle = (syzstr->resPairs[index])[r1].p;
108  if (toHandle!=NULL)
109  {
110  int tc=pGetComp(toHandle);
111  (syzstr->resPairs[index])[r1].syzind = 0;
112  for (i=0; i<r1;i++)
113  {
114  if (((syzstr->resPairs[index])[i].p!=NULL) &&
115  (pGetComp((syzstr->resPairs[index])[i].p)==tc))
116  {
117 #ifdef USE_CHAINCRIT
118  tcp = cp;
119  if (tcp!=NULL)
120  {
121  while ((tcp!=NULL) &&
122  ((tcp->first_poly!=i)||(tcp->second_poly!=r1))) tcp = tcp->next;
123  }
124  if (tcp==NULL)
125  {
126 #endif
127  p = pOne();
128  pLcm((syzstr->resPairs[index])[i].p,toHandle,p);
129  pSetm(p);
130  j = 0;
131  while (j<i)
132  {
133  if (nP->m[j]!=NULL)
134  {
135  if (pLmDivisibleByNoComp(nP->m[j],p))
136  {
137  pDelete(&p);
138  /* p = NULL;*/
139  break;
140  }
141  else if (pLmDivisibleByNoComp(p,nP->m[j]))
142  {
143  pDelete(&(nP->m[j]));
144  /* nP->m[j] = NULL;*/
145  }
146 #ifdef USE_CHAINCRIT
147  else
148  {
149  poly p1,p2;
150  int ip= currRing->N;
151  p1 = pDivide(p,(syzstr->resPairs[index])[i].p);
152  p2 = pDivide(nP->m[j],(syzstr->resPairs[index])[j].p);
153  while ((ip>0) && (pGetExp(p1,ip)*pGetExp(p2,ip)==0)) ip--;
154  if (ip==0)
155  {
156 #ifdef SHOW_SPRFL
157 Print("Hier: %d, %d\n",j,i);
158 #endif
159  if (i>rr)
160  {
161  tcp=(crit_pairs)omAlloc0(sizeof(sopen_pairs));
162  tcp->next = cp;
163  tcp->first_poly = j;
164  tcp->second_poly = i;
165  cp = tcp;
166  tcp = NULL;
167  }
168  else
169  {
170  ti=0;
171  while ((ti<l) && (((syzstr->resPairs[index])[ti].ind1!=j)||
172  ((syzstr->resPairs[index])[ti].ind2!=i))) ti++;
173  if (ti<l)
174  {
175 #ifdef SHOW_SPRFL
176 Print("gefunden in Mod %d: ",index); poly_write((syzstr->resPairs[index])[ti].lcm);
177 #endif
178  syDeletePair(&(syzstr->resPairs[index])[ti]);
179 #ifdef SHOW_CRIT
180  crit1++;
181 #endif
182  toComp = TRUE;
183  }
184  }
185  }
186  pLmDelete(&p1);
187  pLmDelete(&p2);
188  }
189 #endif
190  }
191  j++;
192  }
193  if (p!=NULL)
194  {
195  nP->m[i] = p;
196  }
197 #ifdef USE_CHAINCRIT
198  }
199  else
200  {
201 #ifdef SHOW_CRIT
202  crit1++;
203 #endif
204  }
205 #endif
206  }
207  }
208  if (toComp) syCompactify1(syzstr->resPairs[index],&l,r1);
209  for (i=0;i<r1;i++)
210  {
211  if (nP->m[i]!=NULL)
212  {
213  tso.lcm = p = nP->m[i];
214  nP->m[i] = NULL;
215  tso.order = pTotaldegree(p);
216  if ((syzstr->cw!=NULL) && (index>0) && (pGetComp(p)>0))
217  {
218  int ii=index-1,jj=pGetComp(p);
219  while (ii>0)
220  {
221  jj = pGetComp(syzstr->res[ii]->m[jj-1]);
222  ii--;
223  }
224  tso.order += (*syzstr->cw)[jj-1];
225  }
226  tso.p1 = (syzstr->resPairs[index])[i].p;
227  tso.p2 = toHandle;
228  tso.ind1 = i;
229  tso.ind2 = r1;
230  tso.syzind = -1;
231  tso.isNotMinimal = (poly)1;
232  tso.p = NULL;
233  tso.length = -1;
234  number coefgcd =
235  n_SubringGcd(pGetCoeff(tso.p1),pGetCoeff(tso.p2),currRing->cf);
236  tso.syz = pCopy((syzstr->resPairs[index])[i].syz);
237  poly tt = pDivide(tso.lcm,tso.p1);
238  pSetCoeff(tt,nDiv(pGetCoeff(tso.p1),coefgcd));
239  tso.syz = pMult_mm(tso.syz,tt);
240  pLmDelete(&tt);
241  coefgcd = nInpNeg(coefgcd);
242  pp = pCopy((syzstr->resPairs[index])[r1].syz);
243  tt = pDivide(tso.lcm,tso.p2);
244  pSetCoeff(tt,nDiv(pGetCoeff(tso.p2),coefgcd));
245  pp = pMult_mm(pp,tt);
246  pLmDelete(&tt);
247  tso.syz = pAdd(pp,tso.syz);
248  nDelete(&coefgcd);
249  pSetComp(tso.lcm,pGetComp((syzstr->resPairs[index])[r1].syz));
250 #ifdef SHOW_PROT
251 Print("erzeuge Paar im Modul %d,%d mit: \n",index,tso.order);
252 PrintS("poly1: ");poly_write(tso.p1);
253 PrintS("poly2: ");poly_write(tso.p2);
254 PrintS("syz: ");poly_write(tso.syz);
255 PrintS("sPoly: ");poly_write(tso.p);
256 PrintLn();
257 #endif
258  syEnterPair(syzstr,&tso,&l,index);
259  }
260  }
261  }
262 #ifdef INVERT_PAIRS
263  r1++;
264  if (r1>=r2) break;
265 #else
266  r1--;
267  if (r1<=rr) break;
268 #endif
269  }
270  idDelete(&nP);
271 #ifdef USE_CHAINCRIT
272  while (cp!=NULL)
273  {
274  tcp = cp;
275  cp = cp->next;
276  omFreeSize((ADDRESS)tcp,sizeof(sopen_pairs));
277  }
278 #endif
279 }
#define pDivide(a, b)
Definition: polys.h:275
#define pSetm(p)
Definition: polys.h:253
int lcm(unsigned long *l, unsigned long *a, unsigned long *b, unsigned long p, int dega, int degb)
Definition: minpoly.cc:711
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
#define pAdd(p, q)
Definition: polys.h:186
#define poly_write(p)
Definition: syz2.cc:46
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
loop
Definition: myNF.cc:98
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
resolvente res
Definition: syz.h:47
#define TRUE
Definition: auxiliary.h:98
#define pLcm(a, b, m)
Definition: polys.h:277
void * ADDRESS
Definition: auxiliary.h:115
#define pMult_mm(p, m)
Definition: polys.h:185
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
#define pGetComp(p)
Component.
Definition: polys.h:37
poly pp
Definition: myNF.cc:296
intvec * Tl
Definition: syz.h:50
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
const ring r
Definition: syzextra.cc:208
void syEnterPair(syStrategy syzstr, SObject *so, int *sPlength, int index)
Definition: syz1.cc:1043
int j
Definition: myNF.cc:70
#define pLmDivisibleByNoComp(a, b)
like pLmDivisibleBy, does not check components
Definition: polys.h:142
static long pTotaldegree(poly p)
Definition: polys.h:264
#define nInpNeg(n)
Definition: numbers.h:21
open_pairs * crit_pairs
Definition: syz2.cc:60
#define pSetComp(p, v)
Definition: polys.h:38
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
#define pOne()
Definition: polys.h:297
#define nDelete(n)
Definition: numbers.h:16
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
intvec * cw
Definition: syz.h:52
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define nDiv(a, b)
Definition: numbers.h:32
void syCompactify1(SSet sPairs, int *sPlength, int first)
Definition: syz1.cc:140
#define NULL
Definition: omList.c:10
SRes resPairs
Definition: syz.h:49
#define pDelete(p_ptr)
Definition: polys.h:169
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
Definition: coeffs.h:692
long ind2(long arg)
Definition: kutil.cc:4190
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:85
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:31
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int l
Definition: cfEzgcd.cc:94
void syDeletePair(SObject *so)
Definition: syz1.cc:52
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168

◆ syHalfPair()

static void syHalfPair ( poly  syz,
int  newEl,
syStrategy  syzstr,
int  index 
)
static

Definition at line 293 of file syz2.cc.

294 {
295  SObject tso;
296  memset(&tso,0,sizeof(tso));
297  int l=(*syzstr->Tl)[index];
298 
299  while ((l>0) && ((syzstr->resPairs[index])[l-1].syz==NULL)) l--;
300  if ((syzstr->cw!=NULL) && (index>0) && (pGetComp(syz)>0))
301  {
302  int ii=index-1,jj=pGetComp(syz);
303  while (ii>0)
304  {
305  jj = pGetComp(syzstr->res[ii]->m[jj-1]);
306  ii--;
307  }
308  tso.order += (*syzstr->cw)[jj-1];
309  }
310  tso.p1 = NULL;
311  tso.p2 = NULL;
312  tso.ind1 = 0;
313  tso.ind2 = 0;
314  tso.syzind = -1;
315  tso.isNotMinimal = NULL;
316  tso.p = syz;
317  tso.order = pTotaldegree(syz);
318  tso.syz = pHead(syz);
319  pSetComp(tso.syz,newEl+1);
320  pSetm(tso.syz);
321  tso.lcm = pHead(tso.syz);
322  tso.length = pLength(syz);
323  syOrder_Hilb(syz,syzstr,index);
324 #ifdef SHOW_PROT
325 Print("erzeuge Halbpaar im Module %d,%d mit: \n",index,tso.order);
326 PrintS("syz: ");poly_write(tso.syz);
327 PrintS("sPoly: ");poly_write(tso.p);
328 PrintLn();
329 #endif
330  syEnterPair(syzstr,&tso,&l,index);
331 }
#define pSetm(p)
Definition: polys.h:253
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
#define poly_write(p)
Definition: syz2.cc:46
static void syOrder_Hilb(poly p, syStrategy syzstr, int index)
Definition: syz2.cc:285
resolvente res
Definition: syz.h:47
#define pGetComp(p)
Component.
Definition: polys.h:37
intvec * Tl
Definition: syz.h:50
void syEnterPair(syStrategy syzstr, SObject *so, int *sPlength, int index)
Definition: syz1.cc:1043
static long pTotaldegree(poly p)
Definition: polys.h:264
#define pSetComp(p, v)
Definition: polys.h:38
void PrintS(const char *s)
Definition: reporter.cc:284
static unsigned pLength(poly a)
Definition: p_polys.h:189
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL ...
Definition: polys.h:67
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
intvec * cw
Definition: syz.h:52
#define NULL
Definition: omList.c:10
SRes resPairs
Definition: syz.h:49
int l
Definition: cfEzgcd.cc:94

◆ syHilb()

syStrategy syHilb ( ideal  arg,
int *  length 
)

Definition at line 956 of file syz2.cc.

957 {
958  int i,j,actdeg=32000,index=0;
959  int howmuch,toSub=0;
960  int maxindex=0,maxdeg=0;
961  ideal temp=NULL;
962  SSet nextPairs;
963  ring origR = currRing;
964  syStrategy syzstr=(syStrategy)omAlloc0(sizeof(ssyStrategy));
965 
966  if ((idIs0(arg)) || (id_RankFreeModule(arg,currRing)>0))
967  {
969  syzstr->length = 1;
970  syzstr->minres[0] = idInit(1,arg->rank);
971  return syzstr;
972  }
973 
974  // Creare dp,S ring and change to it
975  syzstr->syRing = rAssure_dp_C(origR);
976  rChangeCurrRing(syzstr->syRing);
977 
978  // set initial ShiftedComps
979  currcomponents = (int*)omAlloc0((arg->rank+1)*sizeof(int));
980  currShiftedComponents = (long*)omAlloc0((arg->rank+1)*sizeof(long));
981 
982 /*--- initializes the data structures---------------*/
983 #ifdef SHOW_CRIT
984  crit = 0;
985  crit1 = 0;
986  spfl = 0;
987  cons_pairs = 0;
988  crit_fails = 0;
989 #endif
990  syzstr->length = *length = currRing->N+2;
991  syzstr->Tl = new intvec(*length+1);
992  temp = idInit(IDELEMS(arg),arg->rank);
993  for (i=0;i<IDELEMS(arg);i++)
994  {
995  if (origR != syzstr->syRing)
996  temp->m[i] = prCopyR( arg->m[i], origR, syzstr->syRing);
997  else
998  temp->m[i] = pCopy( arg->m[i]);
999  if (temp->m[i]!=NULL)
1000  {
1001  j = pTotaldegree(temp->m[i]);
1002  if (j<actdeg) actdeg = j;
1003  }
1004  }
1005  idTest(temp);
1006  idSkipZeroes(temp);
1007  syzstr->resPairs = syInitRes(temp,length,syzstr->Tl,syzstr->cw);
1008  omFreeSize((ADDRESS)currcomponents,(arg->rank+1)*sizeof(int));
1009  omFreeSize((ADDRESS)currShiftedComponents,(arg->rank+1)*sizeof(int));
1010  syzstr->res = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1011  syzstr->orderedRes = (resolvente)omAlloc0((*length+1)*sizeof(ideal));
1012  syzstr->elemLength = (int**)omAlloc0((*length+1)*sizeof(int*));
1013  syzstr->truecomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
1014  syzstr->backcomponents = (int**)omAlloc0((*length+1)*sizeof(int*));
1015  syzstr->ShiftedComponents = (long**)omAlloc0((*length+1)*sizeof(long*));
1016  syzstr->Howmuch = (int**)omAlloc0((*length+1)*sizeof(int*));
1017  syzstr->Firstelem = (int**)omAlloc0((*length+1)*sizeof(int*));
1018  syzstr->hilb_coeffs = (intvec**)omAlloc0((*length+1)*sizeof(intvec*));
1019  syzstr->sev = (unsigned long **)omAlloc0((*length+1)*sizeof(unsigned long*));
1020  syzstr->bucket = kBucketCreate(currRing);
1021  syzstr->syz_bucket = kBucketCreate(currRing);
1022  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
1023 /*--- computes the resolution ----------------------*/
1024  while (nextPairs!=NULL)
1025  {
1026 #ifdef SHOW_PROT
1027 Print("compute %d Paare im Module %d im Grad %d \n",howmuch,index,actdeg+index);
1028 #endif
1029  if (TEST_OPT_PROT) Print("%d",actdeg);
1030  if (TEST_OPT_PROT) Print("(m%d)",index);
1031  if (index==0)
1032  i = syInitSyzMod(syzstr,index,id_RankFreeModule(arg, origR)+1);
1033  else
1034  i = syInitSyzMod(syzstr,index);
1035  j = syInitSyzMod(syzstr,index+1);
1036  if (index>0)
1037  {
1038  syRedNextPairs_Hilb(nextPairs,syzstr,howmuch,index,actdeg,&toSub,&maxindex,&maxdeg);
1039  syzstr->res[index+1]->rank=id_RankFreeModule(syzstr->res[index+1],currRing);
1040  sySetNewHilb(syzstr,toSub,index,actdeg);
1041  toSub = 0;
1042  syCompactifyPairSet(syzstr->resPairs[index],(*syzstr->Tl)[index],0);
1043  }
1044  else
1045  syRedGenerOfCurrDeg_Hilb(syzstr,actdeg,&maxindex,&maxdeg);
1046 /*--- creates new pairs -----------------------------*/
1047 #ifdef SHOW_PROT
1048 Print("Bilde neue Paare in Modul %d!\n",index);
1049 #endif
1050  syCreateNewPairs_Hilb(syzstr,index,actdeg);
1051  if (index<(*length)-1)
1052  {
1053 #ifdef SHOW_PROT
1054 Print("Bilde neue Paare in Modul %d!\n",index+1);
1055 #endif
1056  syCreateNewPairs_Hilb(syzstr,index+1,actdeg-1);
1057  }
1058  index++;
1059  nextPairs = syChosePairs(syzstr,&index,&howmuch,&actdeg);
1060  }
1061  syReOrdResult_Hilb(syzstr,maxindex,maxdeg);
1062 #ifdef SHOW_RESULT
1063 PrintS("minimal resolution:\n");
1064 for (int ti=1;ti<=*length;ti++)
1065 {
1066  if (!idIs0(syzstr->orderedRes[ti])) idPrint(syzstr->orderedRes[ti]);
1067 }
1068 PrintS("full resolution:\n");
1069 for (int ti=1;ti<=*length;ti++)
1070 {
1071  if (!idIs0(syzstr->res[ti])) idPrint(syzstr->res[ti]);
1072 }
1073 #endif
1074 #ifdef SHOW_CRIT
1075 Print("Criterion %d times applied\n",crit);
1076 Print("Criterion1 %d times applied\n",crit1);
1077 Print("%d superfluous pairs\n",spfl);
1078 Print("%d pairs considered\n",cons_pairs);
1079 Print("Criterion fails %d times\n",crit_fails);
1080 crit = 0;
1081 crit1 = 0;
1082 spfl = 0;
1083 cons_pairs = 0;
1084 crit_fails = 0;
1085 #endif
1086  if (temp!=NULL) idDelete(&temp);
1087  kBucketDestroy(&(syzstr->bucket));
1088  kBucketDestroy(&(syzstr->syz_bucket));
1089  if (origR != syzstr->syRing)
1090  rChangeCurrRing(origR);
1091  else
1092  currRing = origR;
1093  if (TEST_OPT_PROT) PrintLn();
1094  return syzstr;
1095 }
int length
Definition: syz.h:60
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
SRes syInitRes(ideal arg, int *length, intvec *Tl, intvec *cw=NULL)
Definition: syz1.cc:301
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:36
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
kBucket_pt bucket
Definition: syz.h:54
#define TEST_OPT_PROT
Definition: options.h:98
omBin sip_sideal_bin
Definition: simpleideals.cc:30
void syCompactifyPairSet(SSet sPairs, int sPlength, int first)
Definition: syz1.cc:112
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
resolvente res
Definition: syz.h:47
SSet syChosePairs(syStrategy syzstr, int *index, int *howmuch, int *actdeg)
Definition: syz1.cc:1296
static void syReOrdResult_Hilb(syStrategy syzstr, int maxindex, int maxdeg)
Definition: syz2.cc:908
void * ADDRESS
Definition: auxiliary.h:115
long * currShiftedComponents
Definition: syz1.cc:40
intvec ** hilb_coeffs
Definition: syz.h:46
intvec * Tl
Definition: syz.h:50
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static void syRedNextPairs_Hilb(SSet nextPairs, syStrategy syzstr, int howmuch, int index, int actord, int *toSub, int *maxindex, int *maxdeg)
Definition: syz2.cc:497
#define idPrint(id)
Definition: ideals.h:46
resolvente orderedRes
Definition: syz.h:48
void kBucketDestroy(kBucket_pt *bucket_pt)
Definition: kbuckets.cc:200
Definition: intvec.h:14
int syInitSyzMod(syStrategy syzstr, int index, int init=17)
Definition: syz1.cc:1467
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
int j
Definition: myNF.cc:70
static long pTotaldegree(poly p)
Definition: polys.h:264
ring rAssure_dp_C(const ring r)
Definition: ring.cc:4883
int ** backcomponents
Definition: syz.h:41
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
int ** Howmuch
Definition: syz.h:42
static void syCreateNewPairs_Hilb(syStrategy syzstr, int index, int actdeg)
Definition: syz2.cc:71
kBucket_pt syz_bucket
Definition: syz.h:55
#define IDELEMS(i)
Definition: simpleideals.h:24
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:12
resolvente minres
Definition: syz.h:58
int ** elemLength
Definition: syz.h:44
intvec * cw
Definition: syz.h:52
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:10
int * currcomponents
Definition: syz1.cc:39
ring syRing
Definition: syz.h:56
SRes resPairs
Definition: syz.h:49
void sySetNewHilb(syStrategy syzstr, int toSub, int index, int actord)
Definition: syz2.cc:787
unsigned long ** sev
Definition: syz.h:59
SObject * SSet
Definition: syz.h:32
ideal * resolvente
Definition: ideals.h:18
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
Definition: kbuckets.cc:193
static void syRedGenerOfCurrDeg_Hilb(syStrategy syzstr, int deg, int *maxindex, int *maxdeg)
Definition: syz2.cc:847
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define pCopy(p)
return a copy of the poly
Definition: polys.h:168
#define idTest(id)
Definition: ideals.h:47
ssyStrategy * syStrategy
Definition: syz.h:35

◆ syLinStrat2()

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

Definition at line 336 of file syz2.cc.

338 {
339  ideal o_r=syzstr->res[index+1];
340  int i=0,i1=0,i2=0,l,ll=IDELEMS(o_r);
341  intvec *result=new intvec(howmuch+1);
342  BOOLEAN isDivisible;
343  SObject tso;
344 
345 #ifndef USE_HEURISTIC2
346  while (i1<howmuch)
347  {
348  (*result)[i1] = i1+1;
349  i1++;
350  }
351  return result;
352 #else
353  while ((ll>0) && (o_r->m[ll-1]==NULL)) ll--;
354  while (i<howmuch)
355  {
356  tso = nextPairs[i];
357  isDivisible = FALSE;
358  l = 0;
359  while ((l<ll) && (!isDivisible))
360  {
361  if (o_r->m[l]!=NULL)
362  {
363  isDivisible = isDivisible ||
364  pLmDivisibleBy(o_r->m[l],tso.lcm);
365  }
366  l++;
367  }
368  if (isDivisible)
369  {
370 #ifdef SHOW_PROT
371 Print("streiche Paar im Modul %d,%d mit: \n",index,nextPairs[i].order);
372 PrintS("poly1: ");poly_write(nextPairs[i].p1);
373 PrintS("poly2: ");poly_write(nextPairs[i].p2);
374 PrintS("syz: ");poly_write(nextPairs[i].syz);
375 PrintS("sPoly: ");poly_write(nextPairs[i].p);
376 PrintLn();
377 #endif
378  //syDeletePair(&nextPairs[i]);
379  if (*secondpairs==NULL) *secondpairs = new intvec(howmuch);
380  (**secondpairs)[i2] = i+1;
381  i2++;
382 #ifdef SHOW_CRIT
383  crit++;
384 #endif
385  }
386  else
387  {
388 // nextPairs[i].p = sySPoly(tso.p1, tso.p2,tso.lcm);
389  (*result)[i1] = i+1;
390  i1++;
391  }
392  i++;
393  }
394  return result;
395 #endif
396 }
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
#define poly_write(p)
Definition: syz2.cc:46
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
resolvente res
Definition: syz.h:47
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
Definition: polys.h:140
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
#define IDELEMS(i)
Definition: simpleideals.h:24
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:10
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
int BOOLEAN
Definition: auxiliary.h:85
return result
Definition: facAbsBiFact.cc:76
int l
Definition: cfEzgcd.cc:94

◆ syOrder_Hilb()

static void syOrder_Hilb ( poly  p,
syStrategy  syzstr,
int  index 
)
static

Definition at line 285 of file syz2.cc.

286 {
287  int i=IDELEMS(syzstr->orderedRes[index]);
288 
289  while ((i>0) && (syzstr->orderedRes[index]->m[i-1]==NULL)) i--;
290  syzstr->orderedRes[index]->m[i] = p;
291 }
return P p
Definition: myNF.cc:203
resolvente orderedRes
Definition: syz.h:48
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:10

◆ syRed_Hilb()

static poly syRed_Hilb ( poly  toRed,
syStrategy  syzstr,
int  index 
)
static

Definition at line 407 of file syz2.cc.

408 {
409  ideal redWith=syzstr->res[index];
410  if (redWith==NULL) return toRed;
411  int j=IDELEMS(redWith),i;
412  poly q,result=NULL,resultp;
413 
414  while ((j>0) && (redWith->m[j-1]==NULL)) j--;
415  if ((toRed==NULL) || (j==0)) return toRed;
416  kBucketInit(syzstr->bucket,toRed,-1);
417  q = kBucketGetLm(syzstr->bucket);
418  loop
419  {
420  if (q==NULL)
421  {
422  break;
423  }
424  i = 0;
425  loop
426  {
427  if (pLmDivisibleBy(redWith->m[i],q))
428  {
429  number up = kBucketPolyRed(syzstr->bucket,redWith->m[i],
430  pLength(redWith->m[i]), NULL);
431  nDelete(&up);
432  q = kBucketGetLm(syzstr->bucket);
433  if (toRed==NULL) break;
434  i = 0;
435  }
436  else
437  {
438  i++;
439  }
440  if ((i>=j) || (q==NULL)) break;
441  }
442  if (q!=NULL)
443  {
444  if (result==NULL)
445  {
446  resultp = result = kBucketExtractLm(syzstr->bucket);
447  }
448  else
449  {
450  pNext(resultp) = kBucketExtractLm(syzstr->bucket);
451  pIter(resultp);
452  }
453  q = kBucketGetLm(syzstr->bucket);
454  }
455  }
456  kBucketClear(syzstr->bucket,&q,&i);
457  if (q!=NULL) PrintS("Hier ist was schief gelaufen!\n");
458  return result;
459 }
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:495
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:467
kBucket_pt bucket
Definition: syz.h:54
loop
Definition: myNF.cc:98
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
Definition: kbuckets.cc:1053
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:480
resolvente res
Definition: syz.h:47
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
Definition: polys.h:140
poly kBucketExtractLm(kBucket_pt bucket)
Definition: kbuckets.cc:485
#define pIter(p)
Definition: monomials.h:44
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
static unsigned pLength(poly a)
Definition: p_polys.h:189
#define IDELEMS(i)
Definition: simpleideals.h:24
#define nDelete(n)
Definition: numbers.h:16
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:10
#define pNext(p)
Definition: monomials.h:43
polyrec * poly
Definition: hilb.h:10
return result
Definition: facAbsBiFact.cc:76

◆ syRedGenerOfCurrDeg_Hilb()

static void syRedGenerOfCurrDeg_Hilb ( syStrategy  syzstr,
int  deg,
int *  maxindex,
int *  maxdeg 
)
static

Definition at line 847 of file syz2.cc.

848 {
849  ideal res=syzstr->res[1];
850  int i=0,k=IDELEMS(res),k1=IDELEMS(syzstr->orderedRes[1]);
851  SSet sPairs=syzstr->resPairs[0];
852 
853  while ((k>0) && (res->m[k-1]==NULL)) k--;
854  while ((k1>0) && (syzstr->orderedRes[1]->m[k1-1]==NULL)) k1--;
855  while ((i<(*syzstr->Tl)[0]) && (((sPairs)[i].syz==NULL) ||
856  ((sPairs)[i].order<deg)))
857  i++;
858  if ((i>=(*syzstr->Tl)[0]) || ((sPairs)[i].order>deg)) return;
859  while ((i<(*syzstr->Tl)[0]) && (((sPairs)[i].syz==NULL) ||
860  ((sPairs)[i].order==deg)))
861  {
862  if ((sPairs)[i].syz!=NULL)
863  {
864 #ifdef SHOW_PROT
865 PrintS("reduziere Erzeuger: \n");
866 PrintS("syz: ");poly_write((sPairs)[i].syz);
867 #endif
868  (sPairs)[i].syz = syRed_Hilb((sPairs)[i].syz,syzstr,1);
869 #ifdef SHOW_PROT
870 PrintS("erhalte Erzeuger: \n");
871 PrintS("syz: ");poly_write((sPairs)[i].syz);
872 PrintLn();
873 #endif
874  if ((sPairs)[i].syz != NULL)
875  {
876  if (k==IDELEMS(res))
877  {
878  syEnlargeFields(syzstr,1);
879  res=syzstr->res[1];
880  }
881  if (TEST_OPT_DEBUG)
882  {
883  if ((sPairs)[i].isNotMinimal==NULL)
884  {
885  PrintS("\nminimal generator: ");
886  pWrite((syzstr->resPairs[0])[i].syz);
887  PrintS("comes from: ");pWrite((syzstr->resPairs[0])[i].p1);
888  PrintS("and: ");pWrite((syzstr->resPairs[0])[i].p2);
889  }
890  }
891  res->m[k] = (sPairs)[i].syz;
892  pNorm(res->m[k]);
893  syHalfPair(res->m[k],k1,syzstr,1);
894  k1++;
895  k++;
896  if (1>*maxindex) *maxindex = 1;
897  if (deg-1>*maxdeg) *maxdeg = deg-1;
898  }
899  }
900  i++;
901  }
902 }
void PrintLn()
Definition: reporter.cc:310
#define poly_write(p)
Definition: syz2.cc:46
resolvente res
Definition: syz.h:47
void pWrite(poly p)
Definition: polys.h:290
int k
Definition: cfEzgcd.cc:93
#define TEST_OPT_DEBUG
Definition: options.h:103
intvec * Tl
Definition: syz.h:50
poly res
Definition: myNF.cc:322
resolvente orderedRes
Definition: syz.h:48
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
static poly syRed_Hilb(poly toRed, syStrategy syzstr, int index)
Definition: syz2.cc:407
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
SRes resPairs
Definition: syz.h:49
void syEnlargeFields(syStrategy syzstr, int index)
Definition: syz1.cc:742
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:345
SObject * SSet
Definition: syz.h:32
static void syHalfPair(poly syz, int newEl, syStrategy syzstr, int index)
Definition: syz2.cc:293

◆ syRedNextPairs_Hilb()

static void syRedNextPairs_Hilb ( SSet  nextPairs,
syStrategy  syzstr,
int  howmuch,
int  index,
int  actord,
int *  toSub,
int *  maxindex,
int *  maxdeg 
)
static

Definition at line 497 of file syz2.cc.

500 {
501  int i,j,k=IDELEMS(syzstr->res[index]);
502  int ks=IDELEMS(syzstr->res[index+1]),kk;
503  int ks1=IDELEMS(syzstr->orderedRes[index+1]);
504  int kres=(*syzstr->Tl)[index];
505  int toGo=0;
506  int il;
507  SSet redset=syzstr->resPairs[index];
508  poly q;
509  intvec *spl1;
510  SObject tso;
511  intvec *spl3=NULL;
512 #ifdef USE_HEURISTIC1
513  intvec *spl2=new intvec(howmuch+1,howmuch+1,0);
514  int there_are_superfluous=0;
515  int step=1,jj,j1,j2;
516 #endif
517  assume((syzstr->truecomponents[index]) != NULL && (syzstr->ShiftedComponents[index]) != NULL);
518 
519  actord += index;
520  if ((nextPairs==NULL) || (howmuch==0)) return;
521  while ((k>0) && (syzstr->res[index]->m[k-1]==NULL)) k--;
522  while ((ks>0) && (syzstr->res[index+1]->m[ks-1]==NULL)) ks--;
523  while ((ks1>0) && (syzstr->orderedRes[index+1]->m[ks1-1]==NULL)) ks1--;
524  while ((kres>0) &&
525  ((redset[kres-1].p==NULL) || (redset[kres-1].order>actord))) kres--;
526  while ((kres<(*syzstr->Tl)[index]) &&
527  (redset[kres-1].order!=0) && (redset[kres-1].order<=actord)) kres++;
528  spl1 = syLinStrat2(nextPairs,syzstr,howmuch,index,&spl3);
529 #ifdef SHOW_PROT
530 PrintS("spl1 ist hier: ");spl1->show(0,0);
531 #endif
532  i=0;
533  kk = (*spl1)[i]-1;
534  if (index==1)
535  {
536  intvec * temp1_hilb = hHstdSeries(syzstr->res[index],NULL,NULL,NULL);
537  if (actord<temp1_hilb->length())
538  {
539  toGo = (*temp1_hilb)[actord];
540 #ifdef SHOW_HILB
541 Print("\nStze toGo im Modul %d und Grad %d auf: %d\n",1,actord-1,toGo);
542 #endif
543  }
544  delete temp1_hilb;
545  }
546  else
547  {
548  if (actord<=(syzstr->hilb_coeffs[index])->length())
549  {
550  toGo = (*syzstr->hilb_coeffs[index])[actord-1];
551 #ifdef SHOW_HILB
552 Print("\nStze toGo im Modul %d und Grad %d auf: %d\n",index,actord-1,toGo);
553 #endif
554  }
555  }
556  if ((syzstr->hilb_coeffs[index+1]!=NULL) &&
557  (actord<=(syzstr->hilb_coeffs[index+1])->length()))
558  {
559  toGo += (*syzstr->hilb_coeffs[index+1])[actord-1];
560 #ifdef SHOW_HILB
561 Print("\nAddiere zu toGo aus Modul %d und Grad %d: %d\n",index+1,actord-1,(*syzstr->hilb_coeffs[index+1])[actord-1]);
562 #endif
563  }
564 #ifdef SHOW_HILB
565 Print("<H%d>",toGo);
566 #endif
567  while (kk>=0)
568  {
569  if (toGo==0)
570  {
571  while (kk>=0)
572  {
573  pDelete(&nextPairs[kk].p);
574  pDelete(&nextPairs[kk].syz);
575  syDeletePair(&nextPairs[kk]);
576  nextPairs[kk].p = nextPairs[kk].syz = nextPairs[kk].lcm = NULL;
577  i++;
578  kk = (*spl1)[i]-1;
579 #ifdef USE_HEURISTIC2
580  if (kk<0)
581  {
582  i = 0;
583  delete spl1;
584  spl1 = spl3;
585  spl3 = NULL;
586  if (spl1!=NULL)
587  kk = (*spl1)[i]-1;
588  }
589 #endif
590  }
591  if (spl1!=NULL) delete spl1;
592  break;
593  }
594  tso = nextPairs[kk];
595  if ((tso.p1!=NULL) && (tso.p2!=NULL))
596  {
597 #ifdef SHOW_CRIT
598  cons_pairs++;
599 #endif
600  //tso.p = sySPoly(tso.p1, tso.p2,tso.lcm);
601  tso.p = ksOldCreateSpoly(tso.p2, tso.p1);
602 #ifdef SHOW_PROT
603 PrintS("reduziere Paar mit: \n");
604 PrintS("poly1: ");poly_write(tso.p1);
605 PrintS("poly2: ");poly_write(tso.p2);
606 PrintS("syz: ");poly_write(tso.syz);
607 PrintS("sPoly: ");poly_write(tso.p);
608 #endif
609  if (tso.p != NULL)
610  {
611  kBucketInit(syzstr->bucket,tso.p,-1);
612  kBucketInit(syzstr->syz_bucket,tso.syz,-1);
613  q = kBucketGetLm(syzstr->bucket);
614  j = 0;
615  while (j<kres)
616  {
617  if ((redset[j].p!=NULL) && (pLmDivisibleBy(redset[j].p,q))
618  && ((redset[j].ind1!=tso.ind1) || (redset[j].ind2!=tso.ind2)))
619  {
620 #ifdef SHOW_RED
621 kBucketClear(syzstr->bucket,&tso.p,&tso.length);
622 kBucketClear(syzstr->syz_bucket,&tso.syz,&il);
623 PrintS("reduziere: ");poly_write(tso.p);
624 PrintS("syz: ");poly_write(tso.syz);
625 PrintS("mit: ");poly_write(redset[j].p);
626 PrintS("syz: ");poly_write(redset[j].syz);
627 kBucketInit(syzstr->bucket,tso.p,tso.length);
628 kBucketInit(syzstr->syz_bucket,tso.syz,il);
629 #endif
630  sySPRedSyz(syzstr,redset[j],q);
631  number up = kBucketPolyRed(syzstr->bucket,redset[j].p,
632  redset[j].length, NULL);
633  nDelete(&up);
634  q = kBucketGetLm(syzstr->bucket);
635 #ifdef SHOW_RED
636 kBucketClear(syzstr->bucket,&tso.p,&tso.length);
637 kBucketClear(syzstr->syz_bucket,&tso.syz,&il);
638 PrintS("zu: ");poly_write(tso.p);
639 PrintS("syz: ");poly_write(tso.syz);
640 kBucketInit(syzstr->bucket,tso.p,tso.length);
641 kBucketInit(syzstr->syz_bucket,tso.syz,il);
642 PrintLn();
643 #endif
644  if (q==NULL) break;
645  j = 0;
646  }
647  else
648  {
649  j++;
650  }
651  }
652  kBucketClear(syzstr->bucket,&tso.p,&tso.length);
653  kBucketClear(syzstr->syz_bucket,&tso.syz,&il);
654  }
655 #ifdef SHOW_PROT
656 PrintS("erhalte Paar mit: \n");
657 PrintS("syz: ");poly_write(tso.syz);
658 PrintS("sPoly: ");poly_write(tso.p);
659 PrintLn();
660 #endif
661 #ifdef SHOW_SPRFL
662 //PrintLn();
663 wrp(tso.lcm);
664 Print(" mit index %d, %d ",tso.ind1,tso.ind2);
665 #endif
666  if (tso.p != NULL)
667  {
668  if (TEST_OPT_PROT) PrintS("g");
669  (*toSub)++;
670  toGo--;
671  if (!nIsOne(pGetCoeff(tso.p)))
672  {
673  number n=nInvers(pGetCoeff(tso.p));
674  pNorm(tso.p);
675  pMult_nn(tso.syz,n);
676  nDelete(&n);
677  }
678  if (k==IDELEMS((syzstr->res)[index]))
679  syEnlargeFields(syzstr,index);
680  syzstr->res[index]->m[k] = tso.p;
681  k++;
682  }
683  else
684  {
685  if (ks==IDELEMS(syzstr->res[index+1]))
686  syEnlargeFields(syzstr,index+1);
687  syzstr->res[index+1]->m[ks] = syRed_Hilb(tso.syz,syzstr,index+1);
688  if (syzstr->res[index+1]->m[ks]!=NULL)
689  {
690  if (TEST_OPT_PROT) PrintS("s");
691  toGo--;
692  pNorm(syzstr->res[index+1]->m[ks]);
693  syHalfPair(syzstr->res[index+1]->m[ks],ks1,syzstr,index+1);
694  ks++;
695  ks1++;
696  if (index+1>*maxindex) *maxindex = index+1;
697  if (actord-index>*maxdeg) *maxdeg = actord-index;
698  }
699  else
700  {
701  if (TEST_OPT_PROT) PrintS("-");
702 #ifdef SHOW_CRIT
703  spfl++;
704 #endif
705 #ifdef USE_HEURISTIC1
706  if (there_are_superfluous>=0)
707  {
708  j = i+1;
709  jj = (*spl1)[j]-1;
710  j1 = 1;
711  while (jj>=0)
712  {
713  if (tso.ind2==nextPairs[jj].ind2)
714  {
715  IMATELEM(*spl2,j1,step) = jj+1;
716  j1++;
717  for (j2=j;j2<spl1->length()-1;j2++)
718  {
719  (*spl1)[j2] = (*spl1)[j2+1];
720  }
721  }
722  else
723  {
724  j++;
725  }
726  jj = (*spl1)[j]-1;
727  }
728  step++;
729  if (there_are_superfluous==0) there_are_superfluous = 1;
730  }
731 #endif
732 #ifdef SHOW_SPRFL
733 Print("ist ueberfluessig in Mod %d",index);
734 //Print("\n ueberfluessig in Mod %d:",index);
735 //wrp(tso.lcm);
736 //PrintLn();
737 #endif
738  }
739  tso.syz = NULL;
740  syDeletePair(&tso);
741  tso.p = tso.syz = tso.lcm = NULL;
742  }
743  nextPairs[kk] = tso;
744  }
745 #ifdef SHOW_SPRFL
746 PrintLn();
747 #endif
748  i++;
749 #ifdef SHOW_PROT
750 PrintS("spl1 ist hier: ");spl1->show(0,0);
751 Print("naechstes i ist: %d",i);
752 #endif
753  kk = (*spl1)[i]-1;
754 #ifdef USE_HEURISTIC1
755  if ((kk<0) && (there_are_superfluous>0))
756  {
757  i = 0;
758  delete spl1;
759  spl1 = ivStrip(spl2);
760  delete spl2;
761  if (spl1!=NULL)
762  {
763  there_are_superfluous = -1;
764  kk = (*spl1)[i]-1;
765  }
766  }
767 #endif
768 #ifdef USE_HEURISTIC2
769  if ((kk<0) && (toGo>0))
770  {
771 #ifdef SHOW_CRIT
772  crit_fails++;
773 #endif
774  i = 0;
775  delete spl1;
776  spl1 = spl3;
777  spl3 = NULL;
778  if (spl1!=NULL)
779  kk = (*spl1)[i]-1;
780  }
781 #endif
782  }
783  delete spl1;
784  if (spl3!=NULL) delete spl3;
785 }
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
Definition: kbuckets.cc:495
void kBucketInit(kBucket_pt bucket, poly lm, int length)
Definition: kbuckets.cc:467
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
#define poly_write(p)
Definition: syz2.cc:46
kBucket_pt bucket
Definition: syz.h:54
#define TEST_OPT_PROT
Definition: options.h:98
return P p
Definition: myNF.cc:203
number kBucketPolyRed(kBucket_pt bucket, poly p1, int l1, poly spNoether)
Definition: kbuckets.cc:1053
const poly kBucketGetLm(kBucket_pt bucket)
Definition: kbuckets.cc:480
KINLINE poly ksOldCreateSpoly(poly p1, poly p2, poly spNoether, ring r)
Definition: kInline.h:1073
resolvente res
Definition: syz.h:47
#define nIsOne(n)
Definition: numbers.h:25
void sySPRedSyz(syStrategy syzstr, sSObject redWith, poly q=NULL)
Definition: syz2.cc:398
int k
Definition: cfEzgcd.cc:93
#define pLmDivisibleBy(a, b)
like pDivisibleBy, except that it is assumed that a!=NULL, b!=NULL
Definition: polys.h:140
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
intvec * hHstdSeries(ideal S, intvec *modulweight, intvec *wdegree, ideal Q, ring tailRing)
Definition: hilb.cc:1302
intvec ** hilb_coeffs
Definition: syz.h:46
intvec * Tl
Definition: syz.h:50
resolvente orderedRes
Definition: syz.h:48
Definition: intvec.h:14
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:394
#define pMult_nn(p, n)
Definition: polys.h:183
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
static intvec * syLinStrat2(SSet nextPairs, syStrategy syzstr, int howmuch, int index, intvec **secondpairs)
Definition: syz2.cc:336
kBucket_pt syz_bucket
Definition: syz.h:55
static poly syRed_Hilb(poly toRed, syStrategy syzstr, int index)
Definition: syz2.cc:407
#define IDELEMS(i)
Definition: simpleideals.h:24
#define nDelete(n)
Definition: numbers.h:16
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define nInvers(a)
Definition: numbers.h:33
int ** truecomponents
Definition: syz.h:39
long ** ShiftedComponents
Definition: syz.h:40
#define NULL
Definition: omList.c:10
SRes resPairs
Definition: syz.h:49
int length() const
Definition: intvec.h:86
void syEnlargeFields(syStrategy syzstr, int index)
Definition: syz1.cc:742
void pNorm(poly p, const ring R=currRing)
Definition: polys.h:345
void show(int mat=0, int spaces=0) const
Definition: intvec.cc:150
#define pDelete(p_ptr)
Definition: polys.h:169
SObject * SSet
Definition: syz.h:32
poly p
Definition: kbuckets.h:181
void wrp(poly p)
Definition: polys.h:292
polyrec * poly
Definition: hilb.h:10
#define IMATELEM(M, I, J)
Definition: intvec.h:77
void syDeletePair(SObject *so)
Definition: syz1.cc:52
static void syHalfPair(poly syz, int newEl, syStrategy syzstr, int index)
Definition: syz2.cc:293

◆ syReOrdResult_Hilb()

static void syReOrdResult_Hilb ( syStrategy  syzstr,
int  maxindex,
int  maxdeg 
)
static

Definition at line 908 of file syz2.cc.

909 {
910  ideal reor,toreor;
911  int k,l,m,togo;
912  syzstr->betti = new intvec(maxdeg,maxindex+1,0);
913  if (syzstr->betti->length()>0)
914  {
915  (*syzstr->betti)[0] = 1;
916  for (int i=1;i<=syzstr->length;i++)
917  {
918  if ((syzstr->orderedRes[i]!=NULL) && !idIs0(syzstr->orderedRes[i]))
919  {
920  toreor = syzstr->orderedRes[i];
921  k = IDELEMS(toreor);
922  while ((k>0) && (toreor->m[k-1]==NULL)) k--;
923  reor = idInit(k,toreor->rank);
924  togo = IDELEMS(syzstr->res[i]);
925  for (int j=0;j<k;j++)
926  {
927  if (toreor->m[j]!=NULL) (IMATELEM(*syzstr->betti,p_FDeg(toreor->m[j],currRing)-i+1,i+1))++;
928  reor->m[j] = toreor->m[j];
929  toreor->m[j] = NULL;
930  }
931  m = 0;
932  for (int j=0;j<togo;j++)
933  {
934  if (syzstr->res[i]->m[j]!=NULL)
935  {
936  l = 0;
937  while ((l<k) && (syzstr->res[i]->m[j]!=reor->m[l])) l++;
938  if (l<k)
939  {
940  toreor->m[m] = reor->m[l];
941  reor->m[l] = NULL;
942  m++;
943  }
944  }
945  }
946  idDelete(&reor);
947  }
948  }
949  }
950 }
int length
Definition: syz.h:60
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
intvec * betti
Definition: syz.h:53
resolvente res
Definition: syz.h:47
int k
Definition: cfEzgcd.cc:93
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
resolvente orderedRes
Definition: syz.h:48
Definition: intvec.h:14
int j
Definition: myNF.cc:70
static long p_FDeg(const poly p, const ring r)
Definition: p_polys.h:375
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
#define IMATELEM(M, I, J)
Definition: intvec.h:77
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
int l
Definition: cfEzgcd.cc:94

◆ sySetNewHilb()

void sySetNewHilb ( syStrategy  syzstr,
int  toSub,
int  index,
int  actord 
)

Definition at line 787 of file syz2.cc.

788 {
789  int i;
790  actord += index;
791  intvec * temp_hilb = hHstdSeries(syzstr->res[index+1],NULL,NULL,NULL);
792  intvec * cont_hilb = hHstdSeries(syzstr->res[index],NULL,NULL,NULL);
793  if ((index+1<syzstr->length) && (syzstr->hilb_coeffs[index+1]==NULL))
794  {
795  syzstr->hilb_coeffs[index+1] = new intvec(16*((actord/16)+1));
796  }
797  else if (actord>=syzstr->hilb_coeffs[index+1]->length())
798  {
799  intvec * ttt=new intvec(16*((actord/16)+1));
800  for (i=syzstr->hilb_coeffs[index+1]->length()-1;i>=0;i--)
801  {
802  (*ttt)[i] = (*(syzstr->hilb_coeffs[index+1]))[i];
803  }
804  delete syzstr->hilb_coeffs[index+1];
805  syzstr->hilb_coeffs[index+1] = ttt;
806  }
807  if (actord+1<temp_hilb->length())
808  {
809 #ifdef SHOW_HILB
810 Print("\nSetze fuer Modul %d im Grad %d die Wert: \n",index+1,actord);
811 (temp_hilb)->show(0,0);
812 #endif
813  int k=si_min(temp_hilb->length()-1,(syzstr->hilb_coeffs[index+1])->length());
814  for (int j=k;j>actord;j--)
815  (*(syzstr->hilb_coeffs[index+1]))[j-1] = (*temp_hilb)[j];
816  }
817  else
818  {
819  (*(syzstr->hilb_coeffs[index+1]))[actord] = 0;
820  }
821  delete temp_hilb;
822  if ((index>1) && (actord<=syzstr->hilb_coeffs[index]->length()))
823  {
824 #ifdef SHOW_HILB
825 Print("\nSubtrahiere im Modul %d im Grad %d den Wert: %d\n",index,actord-1,toSub);
826 #endif
827  (*syzstr->hilb_coeffs[index])[actord-1]-=toSub;
828  }
829  if (syzstr->hilb_coeffs[index]!=NULL)
830  {
831  if (cont_hilb->length()>syzstr->hilb_coeffs[index]->length())
832  syzstr->hilb_coeffs[index]->resize(cont_hilb->length());
833  for (int j=cont_hilb->length()-1;j>actord;j--)
834  (*(syzstr->hilb_coeffs[index]))[j-1] = (*cont_hilb)[j];
835  }
836  delete cont_hilb;
837 #ifdef SHOW_HILB
838 Print("<h,%d>",(*(syzstr->hilb_coeffs[index+1]))[actord]);
839 #endif
840 }
int length
Definition: syz.h:60
void resize(int new_length)
Definition: intvec.cc:107
#define Print
Definition: emacs.cc:83
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
static int show(unsigned long offset, char *close)
Definition: fehelp.cc:1073
resolvente res
Definition: syz.h:47
int k
Definition: cfEzgcd.cc:93
intvec * hHstdSeries(ideal S, intvec *modulweight, intvec *wdegree, ideal Q, ring tailRing)
Definition: hilb.cc:1302
intvec ** hilb_coeffs
Definition: syz.h:46
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86

◆ sySPRedSyz()

void sySPRedSyz ( syStrategy  syzstr,
sSObject  redWith,
poly  q = NULL 
)
inline

Definition at line 398 of file syz2.cc.

399 {
400  poly p=pDivide(q,redWith.p);
401  pSetCoeff(p,nDiv(pGetCoeff(q),pGetCoeff(redWith.p)));
402  int il=-1;
403  kBucket_Minus_m_Mult_p(syzstr->syz_bucket,p,redWith.syz,&il,NULL);
404  pLmDelete(&p);
405 }
#define pDivide(a, b)
Definition: polys.h:275
poly p
Definition: syz.h:20
return P p
Definition: myNF.cc:203
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition: polys.h:76
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
kBucket_pt syz_bucket
Definition: syz.h:55
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:690
#define nDiv(a, b)
Definition: numbers.h:32
#define NULL
Definition: omList.c:10
poly syz
Definition: syz.h:23
polyrec * poly
Definition: hilb.h:10
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:31