My Project  UNKNOWN_GIT_VERSION
groebnerCone.h
Go to the documentation of this file.
1 #ifndef CALLGFANLIB_GROEBNERCONE_H
2 #define CALLGFANLIB_GROEBNERCONE_H
3 
4 #include "kernel/polys.h"
5 #include "Singular/ipid.h"
6 
7 #include "polys/monomials/ring.h"
8 #include "polys/simpleideals.h"
9 #include "kernel/ideals.h"
10 #include "gfanlib/gfanlib.h"
11 
12 #include "tropicalStrategy.h"
13 
14 /** \file
15  * implementation of the class groebnerCone
16  *
17  * groebnerCone is a class that encapsulates relevant (possibly redundant) information about a groebnerCone.
18  * Moreover, it contains implrementation of several highly non-trivial algorithms, such as computing its neighbours
19  * in the Groebner fan or computing its neighbours in the tropical variety.
20  */
21 
22 class groebnerCone;
24 typedef std::set<groebnerCone,groebnerCone_compare> groebnerCones;
25 
26 
28 {
29 
30 private:
31  /**
32  * ideal to which this Groebner cone belongs to
33  */
35  /**
36  * ring in which the ideal exists
37  */
39  gfan::ZCone polyhedralCone;
40  gfan::ZVector interiorPoint;
42 
43 public:
44  groebnerCone();
45  groebnerCone(const ideal I, const ring r, const tropicalStrategy& currentCase);
46  groebnerCone(const ideal I, const ring r, const gfan::ZVector& w, const tropicalStrategy& currentCase);
47  groebnerCone(const ideal I, const ring r, const gfan::ZVector& u, const gfan::ZVector& w, const tropicalStrategy& currentCase);
48  groebnerCone(const ideal I, const ideal inI, const ring r, const tropicalStrategy& currentCase);
49  groebnerCone(const groebnerCone& sigma);
50  ~groebnerCone();
51  groebnerCone& operator=(const groebnerCone& sigma);
52 
54  {
60  }
61 
62  ideal getPolynomialIdeal() const { return polynomialIdeal; };
63  ring getPolynomialRing() const { return polynomialRing; };
64  gfan::ZCone getPolyhedralCone() const { return polyhedralCone; };
65  gfan::ZVector getInteriorPoint() const { return interiorPoint; };
67  friend struct groebnerCone_compare;
68 
69  bool isTrivial() const
70  {
71  bool b = (polynomialRing==NULL);
72  return b;
73  }
74 
75  /**
76  * Returns true if Groebner cone contains w, false otherwise
77  */
78  bool contains(const gfan::ZVector &w) const;
79 
80  /**
81  * Returns a point in the tropical variety, if the groebnerCone contains one.
82  * Returns an empty vector otherwise.
83  */
84  gfan::ZVector tropicalPoint() const;
85 
86  /**
87  * Given an interior point on the facet and the outer normal factor on the facet,
88  * returns the adjacent groebnerCone sharing that facet
89  */
90  groebnerCone flipCone(const gfan::ZVector &interiorPoint, const gfan::ZVector &facetNormal) const;
91 
92  /**
93  * Returns a complete list of neighboring Groebner cones.
94  */
96 
97  /**
98  * Returns a complete list of neighboring Groebner cones in the tropical variety.
99  */
101 
102  /**
103  * Debug tools.
104  */
105  #ifndef NDEBUG
106  bool checkFlipConeInput(const gfan::ZVector interiorPoint, const gfan::ZVector facetNormal) const;
107  bool pointsOutwards(const gfan::ZVector) const;
108  #endif
109 };
110 
112 {
113  bool operator()(const groebnerCone &sigma, const groebnerCone &theta) const
114  {
115  const gfan::ZVector p1 = sigma.getInteriorPoint();
116  const gfan::ZVector p2 = theta.getInteriorPoint();
117  assume (p1.size() == p2.size());
118  return p1 < p2;
119  }
120 };
121 
122 gfan::ZFan* toFanStar(groebnerCones setOfCones);
123 
124 #endif
CanonicalForm b
Definition: cfModGcd.cc:4044
const tropicalStrategy * currentStrategy
Definition: groebnerCone.h:41
gfan::ZVector tropicalPoint() const
Returns a point in the tropical variety, if the groebnerCone contains one.
groebnerCones tropicalNeighbours() const
Returns a complete list of neighboring Groebner cones in the tropical variety.
groebnerCones groebnerNeighbours() const
Returns a complete list of neighboring Groebner cones.
bool pointsOutwards(const gfan::ZVector) const
groebnerCone & operator=(const groebnerCone &sigma)
bool contains(const gfan::ZVector &w) const
Returns true if Groebner cone contains w, false otherwise.
gfan::ZVector interiorPoint
Definition: groebnerCone.h:40
gfan::ZCone getPolyhedralCone() const
Definition: groebnerCone.h:64
bool checkFlipConeInput(const gfan::ZVector interiorPoint, const gfan::ZVector facetNormal) const
Debug tools.
Definition: groebnerCone.cc:23
bool isTrivial() const
Definition: groebnerCone.h:69
ideal polynomialIdeal
ideal to which this Groebner cone belongs to
Definition: groebnerCone.h:34
ideal getPolynomialIdeal() const
Definition: groebnerCone.h:62
gfan::ZCone polyhedralCone
Definition: groebnerCone.h:39
const tropicalStrategy * getTropicalStrategy() const
Definition: groebnerCone.h:66
ring getPolynomialRing() const
Definition: groebnerCone.h:63
gfan::ZVector getInteriorPoint() const
Definition: groebnerCone.h:65
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...
void deletePolynomialData()
Definition: groebnerCone.h:53
ring polynomialRing
ring in which the ideal exists
Definition: groebnerCone.h:38
const CanonicalForm & w
Definition: facAbsFact.cc:55
gfan::ZFan * toFanStar(groebnerCones setOfCones)
std::set< groebnerCone, groebnerCone_compare > groebnerCones
Definition: groebnerCone.h:23
#define assume(x)
Definition: mod2.h:390
#define NULL
Definition: omList.c:10
Compatiblity layer for legacy polynomial operations (over currRing)
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:437
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
bool operator()(const groebnerCone &sigma, const groebnerCone &theta) const
Definition: groebnerCone.h:113
implementation of the class tropicalStrategy