groebnerCone.cc
Go to the documentation of this file.
1 #include <utility>
2 
4 #include <kernel/ideals.h>
5 #include <Singular/ipid.h>
6 
8 #include <polys/monomials/ring.h>
9 #include <polys/prCopy.h>
10 
11 #include <gfanlib/gfanlib.h>
12 #include <gfanlib/gfanlib_matrix.h>
13 
14 #include <initial.h>
15 #include <tropicalStrategy.h>
16 #include <groebnerCone.h>
17 #include <callgfanlib_conversion.h>
18 #include <containsMonomial.h>
19 #include <initial.h>
20 // #include <flip.h>
21 #include <tropicalCurves.h>
22 #include <bbcone.h>
23 
24 #ifndef NDEBUG
25 static bool checkPolynomialInput(const ideal I, const ring r)
26 {
27  if (r) rTest(r);
28  if (I && r) id_Test(I,r);
29  return ((!I) || (I && r));
30 }
31 
32 static bool checkOrderingAndCone(const ring r, const gfan::ZCone zc)
33 {
34  return true;
35  if (r)
36  {
37  int n = rVar(r); int* w = r->wvhdl[0];
38  gfan::ZVector v = wvhdlEntryToZVector(n,w);
39  if (r->order[0]==ringorder_ws)
40  v = gfan::Integer((long)-1)*v;
41  if (!zc.contains(v))
42  {
43  std::cout << "ERROR: weight of ordering not inside Groebner cone!" << std::endl
44  << "cone: " << std::endl
45  << toString(&zc)
46  << "weight: " << std::endl
47  << v << std::endl;
48  return false;
49  }
50  return true;
51  }
52  return (zc.dimension()==0);
53 }
54 
55 static bool checkPolyhedralInput(const gfan::ZCone zc, const gfan::ZVector p)
56 {
57  return zc.containsRelatively(p);
58 }
59 
60 #if 0 /*unused*/
61 static bool checkOrderingAndWeight(const ideal I, const ring r, const gfan::ZVector w, const tropicalStrategy& currentCase)
62 {
63  groebnerCone sigma(I,r,currentCase);
64  gfan::ZCone zc = sigma.getPolyhedralCone();
65  return zc.contains(w);
66 }
67 #endif
68 
69 bool groebnerCone::checkFlipConeInput(const gfan::ZVector interiorPoint, const gfan::ZVector facetNormal) const
70 {
71  /* check first whether interiorPoint lies on the boundary of the cone */
72  if (!polyhedralCone.contains(interiorPoint))
73  {
74  std::cout << "ERROR: interiorPoint is not contained in the Groebner cone!" << std::endl
75  << "cone: " << std::endl
77  << "interiorPoint:" << std::endl
78  << interiorPoint << std::endl;
79  return false;
80  }
81  if (polyhedralCone.containsRelatively(interiorPoint))
82  {
83  std::cout << "ERROR: interiorPoint is contained in the interior of the maximal Groebner cone!" << std::endl
84  << "cone: " << std::endl
86  << "interiorPoint:" << std::endl
87  << interiorPoint << std::endl;
88  return false;
89  }
90  gfan::ZCone hopefullyAFacet = polyhedralCone.faceContaining(interiorPoint);
91  if (hopefullyAFacet.dimension()!=(polyhedralCone.dimension()-1))
92  {
93  std::cout << "ERROR: interiorPoint is not contained in the interior of a facet!" << std::endl
94  << "cone: " << std::endl
96  << "interiorPoint:" << std::endl
97  << interiorPoint << std::endl;
98  return false;
99  }
100  /* check whether facet normal points outwards */
101  gfan::ZCone dual = polyhedralCone.dualCone();
102  if(dual.containsRelatively(facetNormal))
103  {
104  std::cout << "ERROR: facetNormal is not pointing outwards!" << std::endl
105  << "cone: " << std::endl
107  << "facetNormal:" << std::endl
108  << facetNormal << std::endl;
109  return false;
110  }
111  return true;
112 }
113 #endif //NDEBUG
114 
116  polynomialIdeal(NULL),
117  polynomialRing(NULL),
118  polyhedralCone(gfan::ZCone(0)),
119  interiorPoint(gfan::ZVector(0)),
120  currentStrategy(NULL)
121 {
122 }
123 
124 groebnerCone::groebnerCone(const ideal I, const ring r, const tropicalStrategy& currentCase):
125  polynomialIdeal(NULL),
126  polynomialRing(NULL),
127  currentStrategy(&currentCase)
128 {
130  if (r) polynomialRing = rCopy(r);
131  if (I)
132  {
133  polynomialIdeal = id_Copy(I,r);
136  }
137 
138  int n = rVar(polynomialRing);
139  poly g = NULL;
140  int* leadexpv = (int*) omAlloc((n+1)*sizeof(int));
141  int* tailexpv = (int*) omAlloc((n+1)*sizeof(int));
142  gfan::ZVector leadexpw = gfan::ZVector(n);
143  gfan::ZVector tailexpw = gfan::ZVector(n);
144  gfan::ZMatrix inequalities = gfan::ZMatrix(0,n);
145  for (int i=0; i<idSize(polynomialIdeal); i++)
146  {
147  g = polynomialIdeal->m[i];
148  if (g)
149  {
150  p_GetExpV(g,leadexpv,r);
151  leadexpw = expvToZVector(n, leadexpv);
152  pIter(g);
153  while (g)
154  {
155  p_GetExpV(g,tailexpv,r);
156  tailexpw = expvToZVector(n, tailexpv);
157  inequalities.appendRow(leadexpw-tailexpw);
158  pIter(g);
159  }
160  }
161  }
162  omFreeSize(leadexpv,(n+1)*sizeof(int));
163  omFreeSize(tailexpv,(n+1)*sizeof(int));
164  // if (currentStrategy->restrictToLowerHalfSpace())
165  // {
166  // gfan::ZVector lowerHalfSpaceCondition = gfan::ZVector(n);
167  // lowerHalfSpaceCondition[0] = -1;
168  // inequalities.appendRow(lowerHalfSpaceCondition);
169  // }
170 
171  polyhedralCone = gfan::ZCone(inequalities,gfan::ZMatrix(0, inequalities.getWidth()));
172  polyhedralCone.canonicalize();
173  interiorPoint = polyhedralCone.getRelativeInteriorPoint();
175 }
176 
177 groebnerCone::groebnerCone(const ideal I, const ring r, const gfan::ZVector& w, const tropicalStrategy& currentCase):
178  polynomialIdeal(NULL),
179  polynomialRing(NULL),
180  currentStrategy(&currentCase)
181 {
183  if (r) polynomialRing = rCopy(r);
184  if (I)
185  {
186  polynomialIdeal = id_Copy(I,r);
189  }
190 
191  int n = rVar(polynomialRing);
192  gfan::ZMatrix inequalities = gfan::ZMatrix(0,n);
193  gfan::ZMatrix equations = gfan::ZMatrix(0,n);
194  int* expv = (int*) omAlloc((n+1)*sizeof(int));
195  for (int i=0; i<idSize(polynomialIdeal); i++)
196  {
197  poly g = polynomialIdeal->m[i];
198  if (g)
199  {
200  p_GetExpV(g,expv,polynomialRing);
201  gfan::ZVector leadexpv = intStar2ZVector(n,expv);
202  long d = wDeg(g,polynomialRing,w);
203  for (pIter(g); g; pIter(g))
204  {
205  p_GetExpV(g,expv,polynomialRing);
206  gfan::ZVector tailexpv = intStar2ZVector(n,expv);
207  if (wDeg(g,polynomialRing,w)==d)
208  equations.appendRow(leadexpv-tailexpv);
209  else
210  {
211  assume(wDeg(g,polynomialRing,w)<d);
212  inequalities.appendRow(leadexpv-tailexpv);
213  }
214  }
215  }
216  }
217  omFreeSize(expv,(n+1)*sizeof(int));
218  // if (currentStrategy->restrictToLowerHalfSpace())
219  // {
220  // gfan::ZVector lowerHalfSpaceCondition = gfan::ZVector(n);
221  // lowerHalfSpaceCondition[0] = -1;
222  // inequalities.appendRow(lowerHalfSpaceCondition);
223  // }
224 
225  polyhedralCone = gfan::ZCone(inequalities,equations);
226  polyhedralCone.canonicalize();
227  interiorPoint = polyhedralCone.getRelativeInteriorPoint();
229 }
230 
231 /***
232  * Computes the groebner cone of I around u+e*w for e>0 sufficiently small.
233  * Assumes that this cone is a face of the maximal Groenbner cone given by the ordering of r.
234  **/
235 groebnerCone::groebnerCone(const ideal I, const ring r, const gfan::ZVector& u, const gfan::ZVector& w, const tropicalStrategy& currentCase):
236  polynomialIdeal(NULL),
237  polynomialRing(NULL),
238  currentStrategy(&currentCase)
239 {
241  if (r) polynomialRing = rCopy(r);
242  if (I)
243  {
244  polynomialIdeal = id_Copy(I,r);
247  }
248 
249  int n = rVar(polynomialRing);
250  gfan::ZMatrix inequalities = gfan::ZMatrix(0,n);
251  gfan::ZMatrix equations = gfan::ZMatrix(0,n);
252  int* expv = (int*) omAlloc((n+1)*sizeof(int));
253  for (int i=0; i<idSize(polynomialIdeal); i++)
254  {
255  poly g = polynomialIdeal->m[i];
256  if (g)
257  {
258  p_GetExpV(g,expv,polynomialRing);
259  gfan::ZVector leadexpv = intStar2ZVector(n,expv);
260  long d1 = wDeg(g,polynomialRing,u);
261  long d2 = wDeg(g,polynomialRing,w);
262  for (pIter(g); g; pIter(g))
263  {
264  p_GetExpV(g,expv,polynomialRing);
265  gfan::ZVector tailexpv = intStar2ZVector(n,expv);
266  if (wDeg(g,polynomialRing,u)==d1 && wDeg(g,polynomialRing,w)==d2)
267  equations.appendRow(leadexpv-tailexpv);
268  else
269  {
270  assume(wDeg(g,polynomialRing,u)<d1 || wDeg(g,polynomialRing,w)<d2);
271  inequalities.appendRow(leadexpv-tailexpv);
272  }
273  }
274  }
275  }
276  omFreeSize(expv,(n+1)*sizeof(int));
277  // if (currentStrategy->restrictToLowerHalfSpace())
278  // {
279  // gfan::ZVector lowerHalfSpaceCondition = gfan::ZVector(n);
280  // lowerHalfSpaceCondition[0] = -1;
281  // inequalities.appendRow(lowerHalfSpaceCondition);
282  // }
283 
284  polyhedralCone = gfan::ZCone(inequalities,equations);
285  polyhedralCone.canonicalize();
286  interiorPoint = polyhedralCone.getRelativeInteriorPoint();
288 }
289 
290 
291 groebnerCone::groebnerCone(const ideal I, const ideal inI, const ring r, const tropicalStrategy& currentCase):
292  polynomialIdeal(id_Copy(I,r)),
293  polynomialRing(rCopy(r)),
294  currentStrategy(&currentCase)
295 {
298 
301 
302  int n = rVar(r);
303  gfan::ZMatrix equations = gfan::ZMatrix(0,n);
304  int* expv = (int*) omAlloc((n+1)*sizeof(int));
305  for (int i=0; i<idSize(inI); i++)
306  {
307  poly g = inI->m[i];
308  if (g)
309  {
310  p_GetExpV(g,expv,r);
311  gfan::ZVector leadexpv = intStar2ZVector(n,expv);
312  for (pIter(g); g; pIter(g))
313  {
314  p_GetExpV(g,expv,r);
315  gfan::ZVector tailexpv = intStar2ZVector(n,expv);
316  equations.appendRow(leadexpv-tailexpv);
317  }
318  }
319  }
320  gfan::ZMatrix inequalities = gfan::ZMatrix(0,n);
321  for (int i=0; i<idSize(polynomialIdeal); i++)
322  {
323  poly g = polynomialIdeal->m[i];
324  if (g)
325  {
326  p_GetExpV(g,expv,r);
327  gfan::ZVector leadexpv = intStar2ZVector(n,expv);
328  for (pIter(g); g; pIter(g))
329  {
330  p_GetExpV(g,expv,r);
331  gfan::ZVector tailexpv = intStar2ZVector(n,expv);
332  inequalities.appendRow(leadexpv-tailexpv);
333  }
334  }
335  }
336  omFreeSize(expv,(n+1)*sizeof(int));
338  {
339  gfan::ZVector lowerHalfSpaceCondition = gfan::ZVector(n);
340  lowerHalfSpaceCondition[0] = -1;
341  inequalities.appendRow(lowerHalfSpaceCondition);
342  }
343 
344  polyhedralCone = gfan::ZCone(inequalities,equations);
345  polyhedralCone.canonicalize();
346  interiorPoint = polyhedralCone.getRelativeInteriorPoint();
348 }
349 
351  polynomialIdeal(NULL),
352  polynomialRing(NULL),
353  polyhedralCone(gfan::ZCone(sigma.getPolyhedralCone())),
354  interiorPoint(gfan::ZVector(sigma.getInteriorPoint())),
355  currentStrategy(sigma.getTropicalStrategy())
356 {
362 }
363 
365 {
371 }
372 
374 {
383  return *this;
384 }
385 
386 /**
387  * Returns true if Groebner cone contains w, false otherwise
388  */
389 bool groebnerCone::contains(const gfan::ZVector &w) const
390 {
391  return polyhedralCone.contains(w);
392 }
393 
394 
395 /***
396  * Returns a point in the tropical variety, if the groebnerCone contains one.
397  * Returns an empty vector otherwise.
398  **/
399 gfan::ZVector groebnerCone::tropicalPoint() const
400 {
402  ideal I = polynomialIdeal;
403  ring r = polynomialRing;
404 
405  gfan::ZCone coneToCheck = polyhedralCone;
406  gfan::ZMatrix R = coneToCheck.extremeRays();
407  for (int i=0; i<R.getHeight(); i++)
408  {
409  assume(!currentStrategy->restrictToLowerHalfSpace() || R[i][0].sign()<=0);
410  if (currentStrategy->restrictToLowerHalfSpace() && R[i][0].sign()==0)
411  continue;
412  std::pair<poly,int> s = currentStrategy->checkInitialIdealForMonomial(I,r,R[i]);
413  if (s.first==NULL)
414  {
415  if (s.second<0)
416  // if monomial was initialized, delete it
417  p_Delete(&s.first,r);
418  return R[i];
419  }
420  }
421  return gfan::ZVector();
422 }
423 
424 /**
425  * Given an interior point on the facet and the outer normal factor on the facet,
426  * returns the adjacent groebnerCone sharing that facet
427  */
428 groebnerCone groebnerCone::flipCone(const gfan::ZVector &interiorPoint, const gfan::ZVector &facetNormal) const
429 {
430  assume(this->checkFlipConeInput(interiorPoint,facetNormal));
431  /* Note: the polynomial ring created will have a weighted ordering with respect to interiorPoint
432  * and with a weighted ordering with respect to facetNormal as tiebreaker.
433  * Hence it is sufficient to compute the initial form with respect to facetNormal,
434  * to obtain an initial form with respect to interiorPoint+e*facetNormal,
435  * for e>0 sufficiently small */
436  std::pair<ideal,ring> flipped = currentStrategy->computeFlip(polynomialIdeal,polynomialRing,interiorPoint,facetNormal);
437  assume(checkPolynomialInput(flipped.first,flipped.second));
438  groebnerCone flippedCone(flipped.first, flipped.second, interiorPoint, facetNormal, *currentStrategy);
439  id_Delete(&flipped.first,flipped.second);
440  rDelete(flipped.second);
441  return flippedCone;
442 }
443 
444 
445 /***
446  * Returns a complete list of neighboring Groebner cones.
447  **/
449 {
450  std::pair<gfan::ZMatrix, gfan::ZMatrix> facetsData = interiorPointsAndNormalsOfFacets(polyhedralCone);
451 
452  gfan::ZMatrix interiorPoints = facetsData.first;
453  gfan::ZMatrix facetNormals = facetsData.second;
454 
455  groebnerCones neighbours;
456  for (int i=0; i<interiorPoints.getHeight(); i++)
457  {
458  gfan::ZVector w = interiorPoints[i];
459  gfan::ZVector v = facetNormals[i];
461  {
462  assume(w[0].sign()<=0);
463  if (w[0].sign()==0 && v[0].sign()>0)
464  continue;
465  }
466  neighbours.insert(flipCone(interiorPoints[i],facetNormals[i]));
467  }
468  return neighbours;
469 }
470 
471 
472 bool groebnerCone::pointsOutwards(const gfan::ZVector w) const
473 {
474  gfan::ZCone dual = polyhedralCone.dualCone();
475  return (!dual.contains(w));
476 }
477 
478 
479 /***
480  * Returns a complete list of neighboring Groebner cones in the tropical variety.
481  **/
483 {
484  gfan::ZMatrix interiorPoints = interiorPointsOfFacets(polyhedralCone);
485  groebnerCones neighbours;
486  for (int i=0; i<interiorPoints.getHeight(); i++)
487  {
488  if (!(currentStrategy->restrictToLowerHalfSpace() && interiorPoints[i][0].sign()==0))
489  {
490  ideal initialIdeal = initial(polynomialIdeal,polynomialRing,interiorPoints[i]);
491  gfan::ZMatrix ray = raysOfTropicalStar(initialIdeal,polynomialRing,interiorPoints[i],currentStrategy);
492  for (int j=0; j<ray.getHeight(); j++)
493  if (pointsOutwards(ray[j]))
494  {
495  groebnerCone neighbour = flipCone(interiorPoints[i],ray[j]);
496  neighbours.insert(neighbour);
497  }
498  id_Delete(&initialIdeal,polynomialRing);
499  }
500  }
501  return neighbours;
502 }
503 
504 
505 gfan::ZFan* toFanStar(groebnerCones setOfCones)
506 {
507  if (setOfCones.size() > 0)
508  {
509  groebnerCones::iterator sigma = setOfCones.begin();
510  gfan::ZFan* zf = new gfan::ZFan(sigma->getPolyhedralCone().ambientDimension());
511  for (; sigma!=setOfCones.end(); sigma++)
512  {
513  gfan::ZCone zc = sigma->getPolyhedralCone();
514  // assume(isCompatible(zf,&zc));
515  zf->insert(zc);
516  }
517  return zf;
518  }
519  else
520  return new gfan::ZFan(gfan::ZFan(currRing->N));
521 }
522 
523 
524 #ifndef NDEBUG
525 
527 {
528  leftv u = args;
529  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
530  {
531  leftv v = u->next;
532  if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
533  {
534  leftv w = v->next;
535  if ((w!=NULL) && (w->Typ()==BIGINTMAT_CMD))
536  {
537  leftv x = w->next;
538  if ((x!=NULL) && (x->Typ()==BIGINTMAT_CMD))
539  {
540  omUpdateInfo();
541  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
542 
543  ideal I = (ideal) u->CopyD();
544  number p = (number) v->CopyD();
545  bigintmat* interiorPoint0 = (bigintmat*) w->CopyD();
546  bigintmat* facetNormal0 = (bigintmat*) x->CopyD();
548 
549  gfan::ZVector* interiorPoint = bigintmatToZVector(interiorPoint0);
550  gfan::ZVector* facetNormal = bigintmatToZVector(facetNormal0);
551 
552  groebnerCone sigma(I,currRing,debug);
553  groebnerCone theta = sigma.flipCone(*interiorPoint,*facetNormal);
554 
555  id_Delete(&I,currRing);
556  n_Delete(&p,currRing->cf);
557  delete interiorPoint0;
558  delete facetNormal0;
559  delete interiorPoint;
560  delete facetNormal;
561 
562  res->rtyp = NONE;
563  res->data = NULL;
564  return FALSE;
565  }
566  }
567  }
568  }
569  WerrorS("computeFlipDebug: unexpected parameters");
570  return TRUE;
571 }
572 
574 {
575  leftv u = args;
576  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
577  {
578  leftv v = u->next;
579  if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
580  {
581  omUpdateInfo();
582  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
583 
584  ideal I = (ideal) u->CopyD();
585  number p = (number) v->CopyD();
586 
588  groebnerCone sigma(I,currRing,debug);
589  groebnerCones neighbours = sigma.groebnerNeighbours();
590 
591  id_Delete(&I,currRing);
592  n_Delete(&p,currRing->cf);
593  res->rtyp = NONE;
594  res->data = NULL;
595  return FALSE;
596  }
597  }
598  WerrorS("computeFlipDebug: unexpected parameters");
599  return TRUE;
600 }
601 
603 {
604  leftv u = args;
605  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
606  {
607  leftv v = u->next;
608  if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
609  {
610  omUpdateInfo();
611  Print("usedBytesBefore=%ld\n",om_Info.UsedBytes);
612 
613  ideal I = (ideal) u->CopyD();
614  number p = (number) v->CopyD();
615 
617  groebnerCone sigma(I,currRing,debug);
618  groebnerCones neighbours = sigma.groebnerNeighbours();
619 
620  id_Delete(&I,currRing);
621  n_Delete(&p,currRing->cf);
622  res->rtyp = NONE;
623  res->data = NULL;
624  return FALSE;
625  }
626  }
627  WerrorS("computeFlipDebug: unexpected parameters");
628  return TRUE;
629 }
630 #endif
implementation of the class tropicalStrategy
const CanonicalForm int s
Definition: facAbsFact.cc:55
BOOLEAN flipConeDebug(leftv res, leftv args)
gfan::ZVector getInteriorPoint() const
Definition: groebnerCone.h:66
const tropicalStrategy * currentStrategy
Definition: groebnerCone.h:42
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
const tropicalStrategy * getTropicalStrategy() const
Definition: groebnerCone.h:67
#define Print
Definition: emacs.cc:83
groebnerCone flipCone(const gfan::ZVector &interiorPoint, const gfan::ZVector &facetNormal) const
Given an interior point on the facet and the outer normal factor on the facet, returns the adjacent g...
gfan::ZCone polyhedralCone
Definition: groebnerCone.h:40
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
ideal id_Copy(ideal h1, const ring r)
copy an ideal
Matrices of numbers.
Definition: bigintmat.h:32
#define id_Test(A, lR)
Definition: simpleideals.h:80
long wDeg(const poly p, const ring r, const gfan::ZVector w)
various functions to compute the initial form of polynomials and ideals
Definition: initial.cc:8
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1448
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
gfan::ZVector wvhdlEntryToZVector(const int n, const int *wvhdl0)
void pReduce(ideal I, const ring r) const
gfan::ZCone getPolyhedralCone() const
Definition: groebnerCone.h:65
BOOLEAN groebnerNeighboursDebug(leftv res, leftv args)
bool reduce(ideal I, const ring r) const
reduces the generators of an ideal I so that the inequalities and equations of the Groebner cone can ...
#define TRUE
Definition: auxiliary.h:144
static bool checkPolynomialInput(const ideal I, const ring r)
Definition: groebnerCone.cc:25
g
Definition: cfModGcd.cc:4031
void WerrorS(const char *s)
Definition: feFopen.cc:23
static tropicalStrategy debugStrategy(const ideal startIdeal, number unifParameter, ring startRing)
std::pair< gfan::ZMatrix, gfan::ZMatrix > interiorPointsAndNormalsOfFacets(const gfan::ZCone zc, const std::set< gfan::ZVector > &exceptThesePoints, const bool onlyLowerHalfSpace)
Definition: bbcone.cc:1674
int Typ()
Definition: subexpr.cc:955
#define omAlloc(size)
Definition: omAllocDecl.h:210
groebnerCones tropicalNeighbours() const
Returns a complete list of neighboring Groebner cones in the tropical variety.
static bool checkPolyhedralInput(const gfan::ZCone zc, const gfan::ZVector p)
Definition: groebnerCone.cc:55
bool checkFlipConeInput(const gfan::ZVector interiorPoint, const gfan::ZVector facetNormal) const
Debug tools.
Definition: groebnerCone.cc:69
std::set< groebnerCone, groebnerCone_compare > groebnerCones
Definition: groebnerCone.h:24
void * data
Definition: subexpr.h:89
#define pIter(p)
Definition: monomials.h:44
poly res
Definition: myNF.cc:322
poly initial(const poly p, const ring r, const gfan::ZVector w)
Returns the initial form of p with respect to w.
Definition: initial.cc:32
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
ideal polynomialIdeal
ideal to which this Groebner cone belongs to
Definition: groebnerCone.h:35
gfan::ZFan * toFanStar(groebnerCones setOfCones)
BOOLEAN inequalities(leftv res, leftv args)
Definition: bbcone.cc:527
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
groebnerCones groebnerNeighbours() const
Returns a complete list of neighboring Groebner cones.
omInfo_t om_Info
Definition: omStats.c:13
#define assume(x)
Definition: mod2.h:405
gfan::ZVector intStar2ZVector(const int d, const int *i)
std::pair< ideal, ring > computeFlip(const ideal Ir, const ring r, const gfan::ZVector &interiorPoint, const gfan::ZVector &facetNormal) const
given an interior point of a groebner cone computes the groebner cone adjacent to it ...
#define rTest(r)
Definition: ring.h:781
ideal getPolynomialIdeal() const
Definition: groebnerCone.h:63
ring polynomialRing
ring in which the ideal exists
Definition: groebnerCone.h:39
bool pointsOutwards(const gfan::ZVector) const
int i
Definition: cfEzgcd.cc:123
gfan::ZVector expvToZVector(const int n, const int *expv)
leftv next
Definition: subexpr.h:87
bool restrictToLowerHalfSpace() const
returns true, if valuation non-trivial, false otherwise
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
BOOLEAN tropicalNeighboursDebug(leftv res, leftv args)
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
gfan::ZVector interiorPoint
Definition: groebnerCone.h:41
ring rCopy(ring r)
Definition: ring.cc:1618
static bool checkOrderingAndCone(const ring r, const gfan::ZCone zc)
Definition: groebnerCone.cc:32
#define NULL
Definition: omList.c:10
bool contains(const gfan::ZVector &w) const
Returns true if Groebner cone contains w, false otherwise.
implementation of the class groebnerCone
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
ring getPolynomialRing() const
Definition: groebnerCone.h:64
void omUpdateInfo()
Definition: omStats.c:24
#define R
Definition: sirandom.c:26
BOOLEAN equations(leftv res, leftv args)
Definition: bbcone.cc:543
std::pair< poly, int > checkInitialIdealForMonomial(const ideal I, const ring r, const gfan::ZVector &w=0) const
If given w, assuming w is in the Groebner cone of the ordering on r and I is a standard basis with re...
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:92
Variable x
Definition: cfModGcd.cc:4023
std::string toString(const gfan::ZCone *const c)
Definition: bbcone.cc:26
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:46
groebnerCone & operator=(const groebnerCone &sigma)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
int BOOLEAN
Definition: auxiliary.h:131
#define NONE
Definition: tok.h:170
gfan::ZMatrix raysOfTropicalStar(ideal I, const ring r, const gfan::ZVector &u, const tropicalStrategy *currentStrategy)
void * CopyD(int t)
Definition: subexpr.cc:662
gfan::ZMatrix interiorPointsOfFacets(const gfan::ZCone &zc, const std::set< gfan::ZVector > &exceptThese)
Definition: bbcone.cc:1620
gfan::ZVector * bigintmatToZVector(const bigintmat &bim)
gfan::ZVector tropicalPoint() const
Returns a point in the tropical variety, if the groebnerCone contains one.
int sign(const CanonicalForm &a)