Macros | Functions
walkSupport.h File Reference
#include <misc/intvec.h>
#include <misc/int64vec.h>

Go to the source code of this file.

Macros

#define idealSize(I)   IDELEMS(I)
 

Functions

int tdeg (poly p)
 
int getMaxTdeg (ideal I)
 
int getMaxPosOfNthRow (intvec *v, int n)
 
int64 getInvEps64 (ideal G, intvec *targm, int pertdeg)
 
int invEpsOk64 (ideal I, intvec *targm, int pertdeg, int64 inveps64)
 
intvecgetNthRow (intvec *v, int n)
 
int64vecgetNthRow64 (intvec *v, int n)
 
void gett64 (int64vec *listw, int64vec *currw, int64vec *targw, int64 &t1, int64 &t2)
 
void nextt64 (ideal G, int64vec *currw, int64vec *targw, int64 &t1, int64 &t2)
 
int64vecnextw64 (int64vec *currw, int64vec *targw, int64 nexttvec0, int64 nexttvec1)
 
int DIFFspy (ideal G)
 
intvecDIFF (ideal G)
 
ideal init64 (ideal G, int64vec *currw)
 
BOOLEAN currwOnBorder64 (ideal I, int64vec *currw64)
 
void getTaun64 (ideal G, intvec *targm, int pertdeg, int64vec **v64, int64 &i64)
 
ideal idStd (ideal G)
 
ideal idInterRed (ideal G)
 
matrix matIdLift (ideal Gomega, ideal M)
 
void rCopyAndChangeA (int64vec *w)
 
int64vecrGetGlobalOrderMatrix (ring r)
 
int64vecrGetGlobalOrderWeightVec (ring r)
 
BOOLEAN noPolysWithMoreThanTwoTerms (ideal Gw)
 
int ivSize (intvec *v)
 
int iv64Size (int64vec *v)
 
intvecleadExp (poly p)
 
int64vecleadExp64 (poly p)
 
void setPosOfIM (intvec *im, int i, int j, int val)
 
poly getNthPolyOfId (ideal I, int n)
 
int gcd (int a, int b)
 
int64 gcd64 (int64 a, int64 b)
 
int64 abs64 (int64 i)
 
ideal sortRedSB (ideal G)
 
intvecint64VecToIntVec (int64vec *source)
 

Macro Definition Documentation

#define idealSize (   I)    IDELEMS(I)

Definition at line 35 of file walkSupport.h.

Function Documentation

int64 abs64 ( int64  i)
inline

Definition at line 44 of file walkSupport.h.

44 { return ABS(i); }
int i
Definition: cfEzgcd.cc:123
#define ABS(x)
Definition: auxiliary.h:157
BOOLEAN currwOnBorder64 ( ideal  I,
int64vec currw64 
)

Definition at line 353 of file walkSupport.cc.

354 {
355  ideal J=init64(G,currw64);
356  int length=idealSize(J);
357  BOOLEAN res=FALSE;
358  for(int i=length; i>0; i--)
359  {
360  //if(pLength(getNthPolyOfId(J,i))>1)
361  poly p=getNthPolyOfId(J,i);
362  if ((p!=NULL) && (pNext(p)!=NULL))
363  {
364  res=TRUE;break;
365  }
366  }
367  idDelete(&J);
368  return res;
369 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
static TreeM * G
Definition: janet.cc:38
poly res
Definition: myNF.cc:322
ideal init64(ideal G, int64vec *currw64)
Definition: walkSupport.cc:302
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
#define idealSize(I)
Definition: walkSupport.h:35
#define pNext(p)
Definition: monomials.h:43
poly getNthPolyOfId(ideal I, int n)
Definition: walkSupport.cc:689
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:131
intvec* DIFF ( ideal  G)

Definition at line 438 of file walkSupport.cc.

439 {
440  intvec *v,*w;
441  poly p;
442  int s=idealSize(G);
443  int n=rVar(currRing);
444  int m=DIFFspy(G);
445  intvec* diffm=new intvec(m,n,0);
446  int j,l;
447  int inc=0;
448  for (j=1; j<=s; j++)
449  {
450  p=getNthPolyOfId(G,j);
451  v=leadExp(p);
452  pIter(p);
453  while(p!=NULL)
454  {
455  inc++;
456  intvec *lep=leadExp(p);
457  w=ivSub(v,lep /*leadExp(p)*/);
458  delete lep;
459  pIter(p);
460  for (l=1; l<=n; l++)
461  {
462  // setPosOfIM(diffm,inc,l,(*w)[l-1]);
463  IMATELEM(*diffm,inc,l) =(*w)[l-1] ;
464  }
465  delete w;
466  }
467  delete v;
468  }
469  return(diffm);
470 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
return P p
Definition: myNF.cc:203
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
intvec * leadExp(poly p)
Definition: walkSupport.cc:749
intvec * ivSub(intvec *a, intvec *b)
Definition: intvec.cc:306
static TreeM * G
Definition: janet.cc:38
#define pIter(p)
Definition: monomials.h:44
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:16
int j
Definition: myNF.cc:70
int m
Definition: cfEzgcd.cc:119
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
int DIFFspy(ideal G)
Definition: walkSupport.cc:410
const CanonicalForm & w
Definition: facAbsFact.cc:55
#define idealSize(I)
Definition: walkSupport.h:35
poly getNthPolyOfId(ideal I, int n)
Definition: walkSupport.cc:689
polyrec * poly
Definition: hilb.h:10
#define IMATELEM(M, I, J)
Definition: intvec.h:77
int l
Definition: cfEzgcd.cc:94
int DIFFspy ( ideal  G)

Definition at line 410 of file walkSupport.cc.

411 {
412  int s=idealSize(G);
413  int j;
414  int temp;
415  int sum=0;
416  poly p;
417  for (j=1; j<=s; j++)
418  {
419  p=getNthPolyOfId(G,j);
420  if((temp=pLength(p))>0) {sum += (temp-1);}
421  }
422  return(sum);
423 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
return P p
Definition: myNF.cc:203
static TreeM * G
Definition: janet.cc:38
static int pLength(poly a)
Definition: p_polys.h:189
int j
Definition: myNF.cc:70
#define idealSize(I)
Definition: walkSupport.h:35
poly getNthPolyOfId(ideal I, int n)
Definition: walkSupport.cc:689
polyrec * poly
Definition: hilb.h:10
int gcd ( int  a,
int  b 
)

Definition at line 839 of file walkSupport.cc.

840 {
841  int r, p0 = a, p1 = b;
842  if(p0 < 0)
843  p0 = -p0;
844 
845  if(p1 < 0)
846  p1 = -p1;
847  while(p1 != 0)
848  {
849  r = p0 % p1;
850  p0 = p1;
851  p1 = r;
852  }
853  return p0;
854 }
const poly a
Definition: syzextra.cc:212
const ring r
Definition: syzextra.cc:208
const poly b
Definition: syzextra.cc:213
int64 gcd64 ( int64  a,
int64  b 
)

Definition at line 867 of file walkSupport.cc.

868 {
869  int64 r, p0 = a, p1 = b;
870  if(p0 < 0)
871  p0 = -p0;
872 
873  if(p1 < 0)
874  p1 = -p1;
875 
876  while(p1 != ((int64)0) )
877  {
878  r = p0 % p1;
879  p0 = p1;
880  p1 = r;
881  }
882 
883  return p0;
884 }
const poly a
Definition: syzextra.cc:212
long int64
Definition: auxiliary.h:112
const ring r
Definition: syzextra.cc:208
const poly b
Definition: syzextra.cc:213
int64 getInvEps64 ( ideal  G,
intvec targm,
int  pertdeg 
)

Definition at line 112 of file walkSupport.cc.

113 {
114  int n;
115  int64 temp64;
116  int64 sum64=0;
117 //think n=2 is enough (instead of n=1)
118  for (n=pertdeg; n>1; n--)
119  {
120  temp64=getMaxPosOfNthRow(targm,n);
121  sum64 += temp64;
122  }
123  int64 inveps64=getMaxTdeg(G)*sum64+1;
124 
125  //overflow test
126  if( sum64!=0 && (((inveps64-1)/sum64)!=getMaxTdeg(G)) )
127  overflow_error=11;
128 
129  return(inveps64);
130 }
long int64
Definition: auxiliary.h:112
static TreeM * G
Definition: janet.cc:38
BOOLEAN overflow_error
Definition: walkMain.cc:37
int getMaxTdeg(ideal I)
Definition: walkSupport.cc:57
int getMaxPosOfNthRow(intvec *v, int n)
Definition: walkSupport.cc:83
int getMaxPosOfNthRow ( intvec v,
int  n 
)

Definition at line 83 of file walkSupport.cc.

84 {
85  int res=0;
86  assume( (0<n) && (n<=(v->rows())) );
87  {
88  int c=v->cols();
89  int cc=(n-1)*c;
90  res=abs((*v)[0+cc /*(n-1)*c*/]);
91  for (int i=c-1;i>=0;i--)
92  {
93  int temp=abs((*v)[i+cc /*(n-1)*c*/]);
94  if(temp>res){res=temp;}
95  }
96  }
97  return(res);
98 }
Rational abs(const Rational &a)
Definition: GMPrat.cc:443
poly res
Definition: myNF.cc:322
#define assume(x)
Definition: mod2.h:405
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: intvec.h:87
int rows() const
Definition: intvec.h:88
int getMaxTdeg ( ideal  I)

Definition at line 57 of file walkSupport.cc.

58 {
59  int res=-1;
60  int length=(int)I->ncols;
61  for(int j=length-1;j>=0;j--)
62  {
63  if ((I->m)[j]!=NULL)
64  {
65  int temp=pTotaldegree((I->m)[j]);
66  if(temp>res) {res=temp;}
67  }
68  }
69  return(res);
70 }
poly res
Definition: myNF.cc:322
int j
Definition: myNF.cc:70
static long pTotaldegree(poly p)
Definition: polys.h:253
#define NULL
Definition: omList.c:10
poly getNthPolyOfId ( ideal  I,
int  n 
)

Definition at line 689 of file walkSupport.cc.

690 {
691  if(0<n && n<=((int)I->ncols))
692  {
693  return (I->m)[n-1];
694  }
695  else
696  {
697  return(NULL);
698  }
699 }
#define NULL
Definition: omList.c:10
intvec* getNthRow ( intvec v,
int  n 
)

Definition at line 168 of file walkSupport.cc.

169 {
170  int r=v->rows();
171  int c=v->cols();
172  intvec *res=new intvec(c);
173  if((0<n) && (n<=r))
174  {
175  int cc=(n-1)*c;
176  for (int i=0; i<c; i++)
177  {
178  (*res)[i]=(*v)[i+cc /*(n-1)*c*/ ];
179  }
180  }
181  return(res);
182 }
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:16
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: intvec.h:87
int rows() const
Definition: intvec.h:88
int64vec* getNthRow64 ( intvec v,
int  n 
)

Definition at line 184 of file walkSupport.cc.

185 {
186  int r=v->rows();
187  int c=v->cols();
188  int64vec *res=new int64vec(c);
189  if((0<n) && (n<=r))
190  {
191  int cc=(n-1)*c;
192  for (int i=0; i<c; i++)
193  {
194  (*res)[i]=(int64)(*v)[i+cc /*(n-1)*c*/ ];
195  }
196  }
197  return(res);
198 }
long int64
Definition: auxiliary.h:112
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: intvec.h:87
int rows() const
Definition: intvec.h:88
void gett64 ( int64vec listw,
int64vec currw,
int64vec targw,
int64 t1,
int64 t2 
)
void getTaun64 ( ideal  G,
intvec targm,
int  pertdeg,
int64vec **  v64,
int64 i64 
)

Definition at line 212 of file walkSupport.cc.

213 {
214  int64vec* taun64=getNthRow64(targm,1);
215  int64vec *temp64,*add64;
216  int64 inveps64=1;
217  if (pertdeg>1) inveps64=getInvEps64(G,targm,pertdeg);
218 
219  int n;
220  //temp64 is used to check for overflow:
221  for (n=2; n<=pertdeg; n++)
222  {
223  if (inveps64!=1)
224  {
225  temp64=iv64Copy(taun64);
226  (*taun64)*=inveps64;
227  for(int i=0; i<rVar(currRing);i++)
228  {
229  if((*temp64)[i]!=0 && (((*taun64)[i])/((*temp64)[i]))!=inveps64)
230  overflow_error=12;
231  }
232  delete temp64;
233  }
234  temp64=iv64Copy(taun64);
235  add64=getNthRow64(targm,n);
236  taun64=iv64Add(add64,taun64);
237  for(int i=0; i<rVar(currRing);i++)
238  {
239  if( ( ((*temp64)[i]) > 0 ) && ( ((*add64)[i]) > 0 ) )
240  {
241  if( ((*taun64)[i]) < ((*temp64)[i]) )
242  overflow_error=13;
243  }
244  if( ( ((*temp64)[i]) < 0 ) && ( ((*add64)[i]) < 0 ) )
245  {
246  if( ((*taun64)[i]) > ((*temp64)[i]) )
247  overflow_error=13;
248  }
249  }
250  delete temp64;
251  }
252 
253  //lists taunlist64=makeTaunList64(taun64,inveps64);
254  //return(taunlist64);
255  *v64=taun64;
256  i64=inveps64;
257 }
int64vec * iv64Copy(int64vec *o)
Definition: int64vec.h:75
int64vec * iv64Add(int64vec *a, int64vec *b)
Definition: int64vec.cc:173
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
long int64
Definition: auxiliary.h:112
int64vec * getNthRow64(intvec *v, int n)
Definition: walkSupport.cc:184
static TreeM * G
Definition: janet.cc:38
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
BOOLEAN overflow_error
Definition: walkMain.cc:37
int i
Definition: cfEzgcd.cc:123
int64 getInvEps64(ideal G, intvec *targm, int pertdeg)
Definition: walkSupport.cc:112
ideal idInterRed ( ideal  G)

Definition at line 961 of file walkSupport.cc.

962 {
963  assume(G != NULL);
964 
965  ideal GG = kInterRedOld(G, NULL);
966  idDelete(&G);
967  return GG;
968 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
static TreeM * G
Definition: janet.cc:38
const CanonicalForm & GG
Definition: cfModGcd.cc:4017
#define assume(x)
Definition: mod2.h:405
ideal kInterRedOld(ideal F, ideal Q)
Definition: kstd1.cc:2928
#define NULL
Definition: omList.c:10
ideal idStd ( ideal  G)

Definition at line 941 of file walkSupport.cc.

942 {
943  ideal GG = kStd(G, NULL, testHomog, NULL);
944  idSkipZeroes(GG);
945  return GG;
946 }
ideal kStd(ideal F, ideal Q, tHomog h, intvec **w, intvec *hilb, int syzComp, int newIdeal, intvec *vw, s_poly_proc_t sp)
Definition: kstd1.cc:2221
static TreeM * G
Definition: janet.cc:38
const CanonicalForm & GG
Definition: cfModGcd.cc:4017
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
#define NULL
Definition: omList.c:10
ideal init64 ( ideal  G,
int64vec currw 
)

Definition at line 302 of file walkSupport.cc.

303 {
304  int length=IDELEMS(G);
305  ideal I=idInit(length,G->rank);
306  int j;
307  int64 leadingweight,templeadingweight;
308  poly p=NULL;
309  poly leadp=NULL;
310  for (j=1; j<=length; j++)
311  {
312  p=getNthPolyOfId(G,j);
313  int64vec *tt=leadExp64(p);
314  leadingweight=scalarProduct64(currw64,tt /*leadExp64(p)*/);
315  delete tt;
316  while (p!=NULL)
317  {
318  tt=leadExp64(p);
319  templeadingweight=scalarProduct64(currw64,tt /*leadExp64(p)*/);
320  delete tt;
321  if(templeadingweight==leadingweight)
322  {
323  leadp=pAdd(leadp,pHead(p));
324  }
325  if(templeadingweight>leadingweight)
326  {
327  pDelete(&leadp);
328  leadp=pHead(p);
329  leadingweight=templeadingweight;
330  }
331  pIter(p);
332  }
333  (I->m)[j-1]=leadp;
334  p=NULL;
335  leadp=NULL;
336  }
337  return(I);
338 }
#define pAdd(p, q)
Definition: polys.h:174
return P p
Definition: myNF.cc:203
long int64
Definition: auxiliary.h:112
int64vec * leadExp64(poly p)
Definition: walkSupport.cc:772
static TreeM * G
Definition: janet.cc:38
#define pIter(p)
Definition: monomials.h:44
int j
Definition: myNF.cc:70
#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:24
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
#define pDelete(p_ptr)
Definition: polys.h:157
static int64 scalarProduct64(int64vec *a, int64vec *b)
Definition: walkSupport.cc:269
poly getNthPolyOfId(ideal I, int n)
Definition: walkSupport.cc:689
polyrec * poly
Definition: hilb.h:10
intvec* int64VecToIntVec ( int64vec source)

Definition at line 1186 of file walkSupport.cc.

1187 {
1188  int r=source->rows();
1189  int c=source->cols();
1190  intvec* res=new intvec(r,c,0);
1191  for(int i=0;i<r;i++){
1192  for(int j=0;j<c;j++){
1193  (*res)[i*c+j]=(int)(*source)[i*c+j];
1194  }
1195  }
1196  delete source;
1197  return(res);
1198 }
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:16
int j
Definition: myNF.cc:70
int rows() const
Definition: int64vec.h:57
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: int64vec.h:56
int invEpsOk64 ( ideal  I,
intvec targm,
int  pertdeg,
int64  inveps64 
)

Definition at line 144 of file walkSupport.cc.

145 {
146  int64 temp64=getInvEps64(I,targm,pertdeg);
147  if (inveps64>=temp64)
148  {
149  return(1);
150  }
151  else
152  {
153  return(0);
154  }
155 }
long int64
Definition: auxiliary.h:112
int64 getInvEps64(ideal G, intvec *targm, int pertdeg)
Definition: walkSupport.cc:112
int iv64Size ( int64vec v)
inline

Definition at line 37 of file walkSupport.h.

37 { return((v->rows())*(v->cols())); }
int rows() const
Definition: int64vec.h:57
int cols() const
Definition: int64vec.h:56
int ivSize ( intvec v)
inline

Definition at line 36 of file walkSupport.h.

36 { return((v->rows())*(v->cols())); }
int cols() const
Definition: intvec.h:87
int rows() const
Definition: intvec.h:88
intvec* leadExp ( poly  p)

Definition at line 749 of file walkSupport.cc.

750 {
751  int N=rVar(currRing);
752  int *e=(int*)omAlloc((N+1)*sizeof(int));
753  pGetExpV(p,e);
754  intvec* iv=new intvec(N);
755  for(int i=N;i>0;i--) { (*iv)[i-1]=e[i];}
756  omFree(e);
757  return(iv);
758 }
return P p
Definition: myNF.cc:203
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
#define omAlloc(size)
Definition: omAllocDecl.h:210
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: intvec.h:16
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
#define omFree(addr)
Definition: omAllocDecl.h:261
int i
Definition: cfEzgcd.cc:123
#define pGetExpV(p, e)
Gets a copy of (resp. set) the exponent vector, where e is assumed to point to (r->N +1)*sizeof(long)...
Definition: polys.h:96
int64vec* leadExp64 ( poly  p)

Definition at line 772 of file walkSupport.cc.

773 {
774  int N=rVar(currRing);
775  int *e=(int*)omAlloc((N+1)*sizeof(int));
776  pGetExpV(p,e);
777  int64vec* iv64=new int64vec(N);
778  for(int i=N;i>0;i--) { (*iv64)[i-1]=(int64)e[i];}
779  omFree(e);
780  return(iv64);
781 }
return P p
Definition: myNF.cc:203
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
long int64
Definition: auxiliary.h:112
#define omAlloc(size)
Definition: omAllocDecl.h:210
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
#define omFree(addr)
Definition: omAllocDecl.h:261
int i
Definition: cfEzgcd.cc:123
#define pGetExpV(p, e)
Gets a copy of (resp. set) the exponent vector, where e is assumed to point to (r->N +1)*sizeof(long)...
Definition: polys.h:96
matrix matIdLift ( ideal  Gomega,
ideal  M 
)

Definition at line 981 of file walkSupport.cc.

982 {
983  ideal Mtmp = idLift(Gomega, M, NULL, FALSE, FALSE, TRUE, NULL);
984  int rows=IDELEMS(Gomega);
985  int cols=IDELEMS(Mtmp);
987  return res;
988 }
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
poly res
Definition: myNF.cc:322
#define M
Definition: sirandom.c:24
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define IDELEMS(i)
Definition: simpleideals.h:24
#define NULL
Definition: omList.c:10
matrix id_Module2formatedMatrix(ideal mod, int rows, int cols, const ring R)
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit)
Definition: ideals.cc:935
void nextt64 ( ideal  G,
int64vec currw,
int64vec targw,
int64 t1,
int64 t2 
)

Definition at line 563 of file walkSupport.cc.

564 {
565  intvec* diffm=DIFF(G);
566  int s=diffm->rows();
567  tvec0=(int64)2;
568  tvec1=(int64)0;
569  intvec *tt;
570  for(int j=1; j<=s; j++)
571  {
572  tt=getNthRow(diffm,j);
573  int64 temptvec0, temptvec1;
574  gett64(tt,currw64,targw64,temptvec0, temptvec1);
575  delete tt;
576 
577  //if tempt>0 both parts will be>0
578  if ( (temptvec1!=0) //that tempt is defined
579  &&
580  (temptvec0>0) && (temptvec1>0) //that tempt>0
581  )
582  {
583  if( ( (temptvec0) <= (temptvec1) ) //that tempt<=1
584  &&
585  ( ( (temptvec0) * (tvec1) ) <
586  ( (temptvec1) * (tvec0) ) )
587  )
588  { //that tempt<t
589  tvec0=temptvec0;
590  tvec1=temptvec1;
591  }
592  }
593  }
594  delete diffm;
595  return;
596 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
long int64
Definition: auxiliary.h:112
static TreeM * G
Definition: janet.cc:38
Definition: intvec.h:16
int j
Definition: myNF.cc:70
intvec * DIFF(ideal G)
Definition: walkSupport.cc:438
intvec * getNthRow(intvec *v, int n)
Definition: walkSupport.cc:168
int rows() const
Definition: intvec.h:88
void gett64(intvec *listw, int64vec *currw64, int64vec *targw64, int64 &tvec0, int64 &tvec1)
Definition: walkSupport.cc:484
int64vec* nextw64 ( int64vec currw,
int64vec targw,
int64  nexttvec0,
int64  nexttvec1 
)

Definition at line 607 of file walkSupport.cc.

609 {
610  //to do (targw-currw)*tvec[0]+currw*tvec[1]
611  int64vec* tempv;
612  int64vec* nextweight;
613  int64vec* a=iv64Sub(targw,currw);
614  //no overflow can occur since both are>=0
615 
616  //to test overflow
617  tempv=iv64Copy(a);
618  *a *= (nexttvec0);
619  for(int i=0; i<rVar(currRing); i++)
620  {
621  if( (nexttvec0) !=0 &&
622  (((*a)[i])/(nexttvec0))!=((*tempv)[i]) )
623  {
624  overflow_error=7;
625  break;
626  }
627  }
628  delete tempv;
629  int64vec* b=currw;
630  tempv=iv64Copy(b);
631  *b *= (nexttvec1);
632  for(int i=0; i<rVar(currRing); i++)
633  {
634  if( (nexttvec1) !=0 &&
635  (((*b)[i])/(nexttvec1))!=((*tempv)[i]) )
636  {
637  overflow_error=8;
638  break;
639  }
640  }
641  delete tempv;
642  nextweight=iv64Add(a,b);
643 
644  for(int i=0; i<rVar(currRing); i++)
645  {
646  if( (((*a)[i])>=0 && ((*b)[i])>=0) ||
647  (((*a)[i])<0 && ((*b)[i])<0) )
648  {
649  if( (abs64((*a)[i]))>abs64((*nextweight)[i]) ||
650  (abs64((*b)[i]))>abs64((*nextweight)[i])
651  )
652  {
653  overflow_error=9;
654  break;
655  }
656  }
657  }
658 
659  //to reduce common factors of nextweight
660  int s=iv64Size(nextweight);
661  int64 g,temp;
662  g=(*nextweight)[0];
663  for (int i=1; i<s; i++)
664  {
665  temp=(*nextweight)[i];
666  g=gcd64(g,temp);
667  if (g==1) break;
668  }
669 
670  if (g!=1) *nextweight /= g;
671 
672  return(nextweight);
673 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const poly a
Definition: syzextra.cc:212
int64vec * iv64Copy(int64vec *o)
Definition: int64vec.h:75
int64vec * iv64Add(int64vec *a, int64vec *b)
Definition: int64vec.cc:173
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
long int64
Definition: auxiliary.h:112
g
Definition: cfModGcd.cc:4031
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
int64 abs64(int64 i)
Definition: walkSupport.h:44
BOOLEAN overflow_error
Definition: walkMain.cc:37
int64vec * iv64Sub(int64vec *a, int64vec *b)
Definition: int64vec.cc:203
int i
Definition: cfEzgcd.cc:123
int iv64Size(int64vec *v)
Definition: walkSupport.h:37
int64 gcd64(int64 a, int64 b)
Definition: walkSupport.cc:867
const poly b
Definition: syzextra.cc:213
BOOLEAN noPolysWithMoreThanTwoTerms ( ideal  Gw)

Definition at line 383 of file walkSupport.cc.

384 {
385  int length=idealSize(Gw);
386  for(int i=length; i>0; i--)
387  {
388  //if(pLength(getNthPolyOfId(Gw,i))>2)
389  poly p=getNthPolyOfId(Gw,i);
390  if ((p!=NULL) && (pNext(p)!=NULL) && (pNext(pNext(p))!=NULL))
391  {
392  return FALSE;
393  }
394  }
395  return TRUE;
396 }
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:144
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
#define idealSize(I)
Definition: walkSupport.h:35
#define pNext(p)
Definition: monomials.h:43
poly getNthPolyOfId(ideal I, int n)
Definition: walkSupport.cc:689
polyrec * poly
Definition: hilb.h:10
void rCopyAndChangeA ( int64vec w)

Definition at line 1003 of file walkSupport.cc.

1004 {
1005  ring rnew=rCopy0(currRing);
1006  rComplete(rnew);
1007  rSetWeightVec(rnew,w->iv64GetVec());
1008  rChangeCurrRing(rnew);
1009 }
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
Definition: ring.cc:3436
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1318
void rChangeCurrRing(ring r)
Definition: polys.cc:14
void rSetWeightVec(ring r, int64 *wv)
Definition: ring.cc:5143
int64 * iv64GetVec()
Definition: int64vec.h:61
int64vec* rGetGlobalOrderMatrix ( ring  r)

Definition at line 1022 of file walkSupport.cc.

1023 {
1024  int n=rVar(r);
1025  int64vec* res=new int64vec(n,n,(int64)0);
1026  if (rHasLocalOrMixedOrdering(r)) return res;
1027  int pos1=0;
1028  int pos2=0;
1029  int temp;
1030  int i=0;
1031  while(r->order[i]!=0 && pos2<n)
1032  {
1033  pos2=pos2+r->block1[i] - r->block0[i];
1034 
1035  if(r->order[i]==ringorder_lp)
1036  {
1037  temp=pos1;
1038  for(int j=pos1; j<=pos2; j++)
1039  (*res)[j*n+j]=(int64)1;
1040  }
1041  else if(r->order[i]==ringorder_dp)
1042  {
1043  for(int j=pos1;j<=pos2;j++)
1044  (*res)[pos1*n+j]=(int64)1;
1045  for(int j=1;j<=(pos2-pos1);j++)
1046  (*res)[(pos1+j)*n+(pos2+1-j)]=(int64)-1;
1047  }
1048  else if(r->order[i]==ringorder_Dp)
1049  {
1050  for(int j=pos1;j<=pos2;j++)
1051  (*res)[pos1*n+j]=(int64)1;
1052  for(int j=1;j<=(pos2-pos1);j++)
1053  (*res)[(pos1+j)*n+(pos1+j-1)]=(int64)1;
1054  }
1055  else if(r->order[i]==ringorder_wp)
1056  {
1057  int* weights=r->wvhdl[i];
1058  for(int j=pos1;j<=pos2;j++)
1059  (*res)[pos1*n+j]=(int64)weights[j-pos1];
1060  for(int j=1;j<=(pos2-pos1);j++)
1061  (*res)[(pos1+j)*n+(pos2+1-j)]=(int64)-1;
1062  }
1063  else if(r->order[i]==ringorder_Wp)
1064  {
1065  int* weights=r->wvhdl[i];
1066  for(int j=pos1;j<=pos2;j++)
1067  (*res)[pos1*n+j]=(int64)weights[j-pos1];
1068  for(int j=1;j<=(pos2-pos1);j++)
1069  (*res)[(pos1+j)*n+(pos1+j-1)]=(int64)1;
1070  }
1071 
1072  else if(r->order[0]==ringorder_M)
1073  {
1074  int* weights=r->wvhdl[0];
1075  for(int j=pos1;j<((pos2+1)*(pos2+1));j++)
1076  (*res)[j]=(int64)weights[j];
1077  }
1078 
1079  pos1=pos2+1;
1080  pos2=pos2+1;
1081  i++;
1082  }
1083 
1084  return(res);
1085 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
long int64
Definition: auxiliary.h:112
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
int i
Definition: cfEzgcd.cc:123
int64vec* rGetGlobalOrderWeightVec ( ring  r)

Definition at line 1099 of file walkSupport.cc.

1100 {
1101  int n=rVar(r);
1102  int64vec* res=new int64vec(n);
1103 
1104  if (rHasLocalOrMixedOrdering(r)) return res;
1105 
1106  int length;
1107 
1108  if(r->order[0]==ringorder_lp)
1109  {
1110  (*res)[0]=(int64)1;
1111  }
1112  else if( (r->order[0]==ringorder_dp) || (r->order[0]==ringorder_Dp) )
1113  {
1114  length=r->block1[0] - r->block0[0];
1115  for (int j=0;j<=length;j++)
1116  (*res)[j]=(int64)1;
1117  }
1118  else if( (r->order[0]==ringorder_wp) || (r->order[0]==ringorder_Wp) ||
1119  (r->order[0]==ringorder_a) || (r->order[0]==ringorder_M) )
1120  {
1121  int* weights=r->wvhdl[0];
1122  length=r->block1[0] - r->block0[0];
1123  for (int j=0;j<=length;j++)
1124  (*res)[j]=(int64)weights[j];
1125  }
1126  else if( /*(*/ r->order[0]==ringorder_a64 /*)*/ )
1127  {
1128  int64* weights=(int64*)r->wvhdl[0];
1129  length=r->block1[0] - r->block0[0];
1130  for (int j=0;j<=length;j++)
1131  (*res)[j]=weights[j];
1132  }
1133 
1134  return(res);
1135 }
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:753
for int64 weights
Definition: ring.h:673
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
long int64
Definition: auxiliary.h:112
poly res
Definition: myNF.cc:322
const ring r
Definition: syzextra.cc:208
for(int i=0;i< R->ExpL_Size;i++) Print("%09lx "
Definition: cfEzgcd.cc:66
int j
Definition: myNF.cc:70
void setPosOfIM ( intvec im,
int  i,
int  j,
int  val 
)
ideal sortRedSB ( ideal  G)

Definition at line 1151 of file walkSupport.cc.

1152 {
1153  int s=idealSize(G);
1154  poly* m=G->m;
1155  poly p,q;
1156  for (int i=0; i<(s-1); i++)
1157  {
1158  for (int j=0; j<((s-1)-i); j++)
1159  {
1160  p=m[j];
1161  q=m[j+1];
1162  if (pLmCmp(p,q)==1)
1163  {
1164  m[j+1]=p;
1165  m[j]=q;
1166  }
1167  }
1168  }
1169  return(G);
1170 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
return P p
Definition: myNF.cc:203
#define pLmCmp(p, q)
returns 0|1|-1 if p=q|p>q|p<q w.r.t monomial ordering
Definition: polys.h:105
static TreeM * G
Definition: janet.cc:38
int j
Definition: myNF.cc:70
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define idealSize(I)
Definition: walkSupport.h:35
polyrec * poly
Definition: hilb.h:10
int tdeg ( poly  p)

Definition at line 38 of file walkSupport.cc.

39 {
40  int res=0;
41  if(p!=NULL) res=pTotaldegree(p);
42  return(res);
43 }
return P p
Definition: myNF.cc:203
poly res
Definition: myNF.cc:322
static long pTotaldegree(poly p)
Definition: polys.h:253
#define NULL
Definition: omList.c:10