Loading...
Searching...
No Matches
tropicalTraversal.h File Reference
`#include "groebnerCone.h"`

Go to the source code of this file.

## Functions

groebnerCones | tropicalTraversalMinimizingFlips (const groebnerCone startingCone)
groebnerCones | tropicalTraversal (const groebnerCone startingCone)
groebnerCones | groebnerTraversal (const groebnerCone startingCone)

## Function Documentation

## groebnerTraversal()

groebnerCones groebnerTraversal | ( | const groebnerCone | startingCone | ) |

Pick a maximal Groebner cone from the working list and compute interior points on its facets as well as outer facet normals

Definition at line 141 of file tropicalTraversal.cc.

{
const tropicalStrategy* currentStrategy = startingCone.getTropicalStrategy();
groebnerCones groebnerFan;
groebnerCones workingList;
workingList.insert(startingCone);
std::set<gfan::ZVector> finishedInteriorPoints;
bool onlyLowerHalfSpace = !currentStrategy->isValuationTrivial();
while(!workingList.empty())
{
/**
* Pick a maximal Groebner cone from the working list
* and compute interior points on its facets as well as outer facet normals
*/
groebnerCone sigma=*(workingList.begin());
workingList.erase(workingList.begin());
std::pair<gfan::ZMatrix,gfan::ZMatrix> interiorPointsAndOuterFacetNormals = interiorPointsAndNormalsOfFacets(sigma.getPolyhedralCone(), finishedInteriorPoints, onlyLowerHalfSpace);
gfan::ZMatrix interiorPoints = interiorPointsAndOuterFacetNormals.first;
gfan::ZMatrix outerFacetNormals = interiorPointsAndOuterFacetNormals.second;
std::vector<bool> needToFlip = checkNecessaryGroebnerFlips(groebnerFan,workingList, interiorPoints);
for (int i=0; i<interiorPoints.getHeight(); i++)
{
gfan::ZVector interiorPoint = interiorPoints[i];
if (needToFlip[i]==true)
{
groebnerCone neighbour = sigma.flipCone(interiorPoint,outerFacetNormals[i]);
workingList.insert(neighbour);
}
finishedInteriorPoints.insert(interiorPoints[i]);
}
sigma.deletePolynomialData();
groebnerFan.insert(sigma);
if (printlevel > 0)
Print("cones finished: %lu cones in working list: %lu\n",
(unsigned long)groebnerFan.size(), (unsigned long)workingList.size());
}
return groebnerFan;
}
interiorPointsAndNormalsOfFacets
std::pair< gfan::ZMatrix, gfan::ZMatrix > interiorPointsAndNormalsOfFacets(const gfan::ZCone zc, const std::set< gfan::ZVector > &exceptThesePoints, const bool onlyLowerHalfSpace)
Definition bbcone.cc:1853
i
int i
Definition cfEzgcd.cc:132
groebnerCone
Definition groebnerCone.h:28
groebnerCone::getTropicalStrategy
const tropicalStrategy * getTropicalStrategy() const
Definition groebnerCone.h:66
groebnerCone::getPolyhedralCone
gfan::ZCone getPolyhedralCone() const
Definition groebnerCone.h:64
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::deletePolynomialData
void deletePolynomialData()
Definition groebnerCone.h:53
tropicalStrategy
Definition tropicalStrategy.h:37
tropicalStrategy::isValuationTrivial
bool isValuationTrivial() const
Definition tropicalStrategy.h:144
Print
#define Print
Definition emacs.cc:80
printlevel
VAR int printlevel
Definition febase.cc:36
groebnerCones
std::set< groebnerCone, groebnerCone_compare > groebnerCones
Definition groebnerCone.h:24
groebnerFan
gfan::ZFan * groebnerFan(const tropicalStrategy currentStrategy)
Definition groebnerFan.cc:28
checkNecessaryGroebnerFlips
std::vector< bool > checkNecessaryGroebnerFlips(const groebnerCones &groebnerFan, const groebnerCones &workingList, const gfan::ZMatrix &interiorPoints)
Definition tropicalTraversal.cc:113

## tropicalTraversal()

groebnerCones tropicalTraversal | ( | const groebnerCone | startingCone | ) |

## tropicalTraversalMinimizingFlips()

groebnerCones tropicalTraversalMinimizingFlips | ( | const groebnerCone | startingCone | ) |

Pick an element the working list and compute interior points on its facets

For each interior point, compute the rays of the tropical star in that point

Definition at line 52 of file tropicalTraversal.cc.

{
groebnerCones tropicalVariety;
if (startingCone.isTrivial())
{
return tropicalVariety;
}
groebnerCones workingList;
workingList.insert(startingCone);
const tropicalStrategy* currentStrategy=startingCone.getTropicalStrategy();
std::set<gfan::ZVector> finishedInteriorPoints;
while(!workingList.empty())
{
/**
* Pick an element the working list and compute interior points on its facets
*/
groebnerCone sigma=*(workingList.begin());
gfan::ZMatrix interiorPoints = interiorPointsOfFacets(sigma.getPolyhedralCone(),finishedInteriorPoints);
for (int i=0; i<interiorPoints.getHeight(); i++)
{
/**
* For each interior point, compute the rays of the tropical star in that point
*/
gfan::ZVector interiorPoint = interiorPoints[i];
if (!(currentStrategy->restrictToLowerHalfSpace() && interiorPoint[0].sign()==0))
{
ideal inI = initial(sigma.getPolynomialIdeal(),sigma.getPolynomialRing(),interiorPoint);
ideal inISTD = gfanlib_satStd_wrapper(inI,sigma.getPolynomialRing());
id_Delete(&inI,sigma.getPolynomialRing());
gfan::ZMatrix normalVectors = raysOfTropicalStar(inISTD,
sigma.getPolynomialRing(),
interiorPoint,
sigma.getTropicalStrategy());
id_Delete(&inISTD,sigma.getPolynomialRing());
std::vector<bool> needToFlip = checkNecessaryTropicalFlips(tropicalVariety,workingList,interiorPoint,normalVectors);
for (int j=0; j<normalVectors.getHeight(); j++)
{
if (needToFlip[j])
{
groebnerCone neighbour = sigma.flipCone(interiorPoint,normalVectors[j]);
workingList.insert(neighbour);
}
}
}
finishedInteriorPoints.insert(interiorPoint);
}
sigma.deletePolynomialData();
workingList.erase(sigma);
tropicalVariety.insert(sigma);
if (printlevel > 0)
Print("cones finished: %lu cones in working list: %lu\n",
(unsigned long)tropicalVariety.size(), (unsigned long)workingList.size());
}
return tropicalVariety;
}
interiorPointsOfFacets
gfan::ZMatrix interiorPointsOfFacets(const gfan::ZCone &zc, const std::set< gfan::ZVector > &exceptThese)
Definition bbcone.cc:1799
groebnerCone::isTrivial
bool isTrivial() const
Definition groebnerCone.h:69
groebnerCone::getPolynomialIdeal
ideal getPolynomialIdeal() const
Definition groebnerCone.h:62
groebnerCone::getPolynomialRing
ring getPolynomialRing() const
Definition groebnerCone.h:63
tropicalStrategy::restrictToLowerHalfSpace
bool restrictToLowerHalfSpace() const
returns true, if valuation non-trivial, false otherwise
Definition tropicalStrategy.h:238
j
int j
Definition facHensel.cc:110
initial
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:30
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
gfanlib_satStd_wrapper
ideal gfanlib_satStd_wrapper(ideal I, ring r, tHomog h=testHomog)
Definition std_wrapper.cc:124
raysOfTropicalStar
gfan::ZMatrix raysOfTropicalStar(ideal I, const ring r, const gfan::ZVector &u, const tropicalStrategy *currentStrategy)
Definition tropicalCurves.cc:243
checkNecessaryTropicalFlips
std::vector< bool > checkNecessaryTropicalFlips(const groebnerCones &tropicalVariety, const groebnerCones &workingList, const gfan::ZVector &interiorPoint, const gfan::ZMatrix &normalVectors)
Definition tropicalTraversal.cc:7
tropicalVariety
BOOLEAN tropicalVariety(leftv res, leftv args)
Definition tropicalVariety.cc:43