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
groebnerCone::tropicalNeighbours
groebnerCones tropicalNeighbours() const
Returns a complete list of neighboring Groebner cones in the tropical variety.
Definition: groebnerCone.cc:438
groebnerCone::polynomialRing
ring polynomialRing
ring in which the ideal exists
Definition: groebnerCone.h:38
groebnerCone::groebnerCone
groebnerCone()
Definition: groebnerCone.cc:69
groebnerCones
std::set< groebnerCone, groebnerCone_compare > groebnerCones
Definition: groebnerCone.h:23
groebnerCone::contains
bool contains(const gfan::ZVector &w) const
Returns true if Groebner cone contains w, false otherwise.
Definition: groebnerCone.cc:344
polys.h
simpleideals.h
groebnerCone::interiorPoint
gfan::ZVector interiorPoint
Definition: groebnerCone.h:40
groebnerCone::pointsOutwards
bool pointsOutwards(const gfan::ZVector) const
Definition: groebnerCone.cc:428
groebnerCone_compare::operator()
bool operator()(const groebnerCone &sigma, const groebnerCone &theta) const
Definition: groebnerCone.h:113
w
const CanonicalForm & w
Definition: facAbsFact.cc:55
b
CanonicalForm b
Definition: cfModGcd.cc:4044
groebnerCone_compare
Definition: groebnerCone.h:111
groebnerCone::deletePolynomialData
void deletePolynomialData()
Definition: groebnerCone.h:53
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition: simpleideals.cc:114
groebnerCone::getPolynomialIdeal
ideal getPolynomialIdeal() const
Definition: groebnerCone.h:62
tropicalStrategy.h
groebnerCone::currentStrategy
const tropicalStrategy * currentStrategy
Definition: groebnerCone.h:41
toFanStar
gfan::ZFan * toFanStar(groebnerCones setOfCones)
Definition: groebnerCone.cc:461
groebnerCone::getPolynomialRing
ring getPolynomialRing() const
Definition: groebnerCone.h:63
groebnerCone::polyhedralCone
gfan::ZCone polyhedralCone
Definition: groebnerCone.h:39
rDelete
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:437
groebnerCone
Definition: groebnerCone.h:27
groebnerCone::checkFlipConeInput
bool checkFlipConeInput(const gfan::ZVector interiorPoint, const gfan::ZVector facetNormal) const
Debug tools.
Definition: groebnerCone.cc:23
ring.h
groebnerCone::~groebnerCone
~groebnerCone()
Definition: groebnerCone.cc:319
groebnerCone::operator=
groebnerCone & operator=(const groebnerCone &sigma)
Definition: groebnerCone.cc:328
assume
#define assume(x)
Definition: mod2.h:390
groebnerCone::tropicalPoint
gfan::ZVector tropicalPoint() const
Returns a point in the tropical variety, if the groebnerCone contains one.
Definition: groebnerCone.cc:354
NULL
#define NULL
Definition: omList.c:10
ideals.h
groebnerCone::getTropicalStrategy
const tropicalStrategy * getTropicalStrategy() const
Definition: groebnerCone.h:66
groebnerCone::flipCone
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...
Definition: groebnerCone.cc:383
groebnerCone::getInteriorPoint
gfan::ZVector getInteriorPoint() const
Definition: groebnerCone.h:65
groebnerCone::polynomialIdeal
ideal polynomialIdeal
ideal to which this Groebner cone belongs to
Definition: groebnerCone.h:34
groebnerCone::getPolyhedralCone
gfan::ZCone getPolyhedralCone() const
Definition: groebnerCone.h:64
ipid.h
groebnerCone::isTrivial
bool isTrivial() const
Definition: groebnerCone.h:69
tropicalStrategy
Definition: tropicalStrategy.h:36
groebnerCone::groebnerNeighbours
groebnerCones groebnerNeighbours() const
Returns a complete list of neighboring Groebner cones.
Definition: groebnerCone.cc:404