8 const gfan::ZVector &interiorPoint,
const gfan::ZMatrix &normalVectors)
10 int k = normalVectors.getHeight();
11 std::vector<bool> needToFlip(
k,
true);
13 int n = normalVectors.getWidth();
14 gfan::ZMatrix testVectors(
k,n);
15 gfan::ZVector bigInteriorPoint = 1000*interiorPoint;
16 for (
int i=0;
i<
k;
i++)
17 testVectors[
i] = bigInteriorPoint+normalVectors[
i];
21 if (sigma->contains(interiorPoint))
23 for (
int i=0;
i<
k;
i++)
25 if (needToFlip[
i] && sigma->contains(testVectors[
i]))
27 needToFlip[
i] =
false;
34 for (groebnerCones::iterator sigma = workingList.begin(); sigma!=workingList.end(); sigma++)
36 if (sigma->contains(interiorPoint))
38 for (
int i=0;
i<
k;
i++)
40 if (needToFlip[
i] && sigma->contains(testVectors[
i]))
42 needToFlip[
i] =
false;
61 workingList.insert(startingCone);
63 std::set<gfan::ZVector> finishedInteriorPoints;
64 while(!workingList.empty())
72 for (
int i=0;
i<interiorPoints.getHeight();
i++)
77 gfan::ZVector interiorPoint = interiorPoints[
i];
90 for (
int j=0;
j<normalVectors.getHeight();
j++)
95 workingList.insert(neighbour);
99 finishedInteriorPoints.insert(interiorPoint);
103 workingList.erase(sigma);
106 Print(
"cones finished: %lu cones in working list: %lu\n",
107 (
unsigned long)
tropicalVariety.size(), (
unsigned long)workingList.size());
114 const gfan::ZMatrix &interiorPoints)
116 int k = interiorPoints.getHeight();
117 std::vector<bool> needToFlip(
k,
true);
121 for (
int i=0;
i<
k;
i++)
123 if (needToFlip[
i] && sigma->contains(interiorPoints[
i]))
124 needToFlip[
i] =
false;
128 for (groebnerCones::iterator sigma = workingList.begin(); sigma!=workingList.end(); sigma++)
130 for (
int i=0;
i<
k;
i++)
132 if (needToFlip[
i] && sigma->contains(interiorPoints[
i]))
133 needToFlip[
i] =
false;
147 workingList.insert(startingCone);
148 std::set<gfan::ZVector> finishedInteriorPoints;
151 while(!workingList.empty())
158 workingList.erase(workingList.begin());
161 gfan::ZMatrix interiorPoints = interiorPointsAndOuterFacetNormals.first;
162 gfan::ZMatrix outerFacetNormals = interiorPointsAndOuterFacetNormals.second;
165 for (
int i=0;
i<interiorPoints.getHeight();
i++)
167 gfan::ZVector interiorPoint = interiorPoints[
i];
169 if (needToFlip[
i]==
true)
172 workingList.insert(neighbour);
174 finishedInteriorPoints.insert(interiorPoints[
i]);
180 Print(
"cones finished: %lu cones in working list: %lu\n",
181 (
unsigned long)
groebnerFan.size(), (
unsigned long)workingList.size());
std::pair< gfan::ZMatrix, gfan::ZMatrix > interiorPointsAndNormalsOfFacets(const gfan::ZCone zc, const std::set< gfan::ZVector > &exceptThesePoints, const bool onlyLowerHalfSpace)
gfan::ZMatrix interiorPointsOfFacets(const gfan::ZCone &zc, const std::set< gfan::ZVector > &exceptThese)
const tropicalStrategy * getTropicalStrategy() const
gfan::ZCone getPolyhedralCone() const
ideal getPolynomialIdeal() const
ring getPolynomialRing() const
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()
bool isValuationTrivial() const
bool restrictToLowerHalfSpace() const
returns true, if valuation non-trivial, false otherwise
implementation of the class groebnerCone
std::set< groebnerCone, groebnerCone_compare > groebnerCones
gfan::ZFan * groebnerFan(const tropicalStrategy currentStrategy)
poly initial(const poly p, const ring r, const gfan::ZVector &w)
Returns the initial form of p with respect to w.
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
ideal gfanlib_satStd_wrapper(ideal I, ring r, tHomog h=testHomog)
gfan::ZMatrix raysOfTropicalStar(ideal I, const ring r, const gfan::ZVector &u, const tropicalStrategy *currentStrategy)
groebnerCones groebnerTraversal(const groebnerCone startingCone)
std::vector< bool > checkNecessaryTropicalFlips(const groebnerCones &tropicalVariety, const groebnerCones &workingList, const gfan::ZVector &interiorPoint, const gfan::ZMatrix &normalVectors)
groebnerCones tropicalTraversalMinimizingFlips(const groebnerCone startingCone)
std::vector< bool > checkNecessaryGroebnerFlips(const groebnerCones &groebnerFan, const groebnerCones &workingList, const gfan::ZMatrix &interiorPoints)
BOOLEAN tropicalVariety(leftv res, leftv args)