10#include "gfanlib/gfanlib.h"
11#include "gfanlib/gfanlib_matrix.h"
28 std::cout <<
"ERROR: interiorPoint is not contained in the Groebner cone!" << std::endl
29 <<
"cone: " << std::endl
31 <<
"interiorPoint:" << std::endl
37 std::cout <<
"ERROR: interiorPoint is contained in the interior of the maximal Groebner cone!" << std::endl
38 <<
"cone: " << std::endl
40 <<
"interiorPoint:" << std::endl
47 std::cout <<
"ERROR: interiorPoint is not contained in the interior of a facet!" << std::endl
48 <<
"cone: " << std::endl
50 <<
"interiorPoint:" << std::endl
56 if(dual.containsRelatively(facetNormal))
58 std::cout <<
"ERROR: facetNormal is not pointing outwards!" << std::endl
59 <<
"cone: " << std::endl
61 <<
"facetNormal:" << std::endl
62 << facetNormal << std::endl;
94 int* leadexpv = (
int*)
omAlloc((n+1)*
sizeof(
int));
95 int* tailexpv = (
int*)
omAlloc((n+1)*
sizeof(
int));
96 gfan::ZVector leadexpw = gfan::ZVector(n);
97 gfan::ZVector tailexpw = gfan::ZVector(n);
147 gfan::ZMatrix
equations = gfan::ZMatrix(0,n);
148 int* expv = (
int*)
omAlloc((n+1)*
sizeof(
int));
206 gfan::ZMatrix
equations = gfan::ZMatrix(0,n);
207 int* expv = (
int*)
omAlloc((n+1)*
sizeof(
int));
258 gfan::ZMatrix
equations = gfan::ZMatrix(0,n);
259 int* expv = (
int*)
omAlloc((n+1)*
sizeof(
int));
294 gfan::ZVector lowerHalfSpaceCondition = gfan::ZVector(n);
295 lowerHalfSpaceCondition[0] = -1;
361 gfan::ZMatrix
R = coneToCheck.extremeRays();
362 for (
int i=0;
i<
R.getHeight();
i++)
376 return gfan::ZVector();
395 id_Delete(&flipped.first,flipped.second);
408 gfan::ZMatrix interiorPoints = facetsData.first;
409 gfan::ZMatrix facetNormals = facetsData.second;
412 for (
int i=0;
i<interiorPoints.getHeight();
i++)
414 gfan::ZVector
w = interiorPoints[
i];
415 gfan::ZVector
v = facetNormals[
i];
431 return (!dual.contains(
w));
442 for (
int i=0;
i<interiorPoints.getHeight();
i++)
444 if (!(
currentStrategy->restrictToLowerHalfSpace() && interiorPoints[
i][0].sign()==0))
448 for (
int j=0;
j<ray.getHeight();
j++)
452 neighbours.insert(neighbour);
463 if (setOfCones.size() > 0)
465 groebnerCones::iterator sigma = setOfCones.begin();
466 gfan::ZFan* zf =
new gfan::ZFan(sigma->getPolyhedralCone().ambientDimension());
467 for (; sigma!=setOfCones.end(); sigma++)
469 gfan::ZCone zc = sigma->getPolyhedralCone();
476 return new gfan::ZFan(gfan::ZFan(
currRing->N));
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)
BOOLEAN equations(leftv res, leftv args)
BOOLEAN inequalities(leftv res, leftv args)
std::string toString(const gfan::ZCone *const c)
gfan::ZVector intStar2ZVector(const int d, const int *i)
gfan::ZVector expvToZVector(const int n, const int *expv)
const tropicalStrategy * currentStrategy
const tropicalStrategy * getTropicalStrategy() const
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.
groebnerCone & operator=(const groebnerCone &sigma)
bool contains(const gfan::ZVector &w) const
Returns true if Groebner cone contains w, false otherwise.
gfan::ZVector interiorPoint
gfan::ZCone getPolyhedralCone() const
bool checkFlipConeInput(const gfan::ZVector interiorPoint, const gfan::ZVector facetNormal) const
Debug tools.
ideal polynomialIdeal
ideal to which this Groebner cone belongs to
bool pointsOutwards(const gfan::ZVector w) const
Return 1 if w points is in the dual of the polyhedral cone, 0 otherwise.
ideal getPolynomialIdeal() const
gfan::ZCone polyhedralCone
ring getPolynomialRing() const
gfan::ZVector getInteriorPoint() 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...
ring polynomialRing
ring in which the ideal exists
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 ...
void pReduce(ideal I, const ring r) const
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
gfan::ZFan * toFanStar(groebnerCones setOfCones)
implementation of the class groebnerCone
std::set< groebnerCone, groebnerCone_compare > groebnerCones
ideal id_Copy(ideal h1, const ring r)
copy an ideal
long wDeg(const poly p, const ring r, const gfan::ZVector &w)
various functions to compute the initial form of polynomials and ideals
poly initial(const poly p, const ring r, const gfan::ZVector &w)
Returns the initial form of p with respect to w.
#define omFreeSize(addr, size)
static void p_Delete(poly *p, const ring r)
static void p_GetExpV(poly p, int *ev, const ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void rDelete(ring r)
unconditionally deletes fields in r
static short rVar(const ring r)
#define rVar(r) (r->N)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
gfan::ZMatrix raysOfTropicalStar(ideal I, const ring r, const gfan::ZVector &u, const tropicalStrategy *currentStrategy)
bool checkWeightVector(const ideal I, const ring r, const gfan::ZVector &weightVector, bool checkBorder)
bool checkPolyhedralInput(const gfan::ZCone zc, const gfan::ZVector p)
bool checkOrderingAndCone(const ring r, const gfan::ZCone zc)
bool checkPolynomialInput(const ideal I, const ring r)
implementation of the class tropicalStrategy