39 if (startingPoint.size() > 0)
40 return std::make_pair(startingPoint,sigma);
46 workingList.insert(sigma);
47 while (!workingList.empty())
51 for (groebnerCones::iterator
tau = neighbours.begin();
tau!=neighbours.end();
tau++)
55 if (workingList.count(*
tau) == 0)
57 startingPoint =
tau->tropicalPoint();
58 if (startingPoint.size() > 0)
59 return std::make_pair(startingPoint,*
tau);
61 workingList.insert(*
tau);
65 workingList.erase(sigma);
69 gfan::ZVector emptyVector = gfan::ZVector(0);
71 return std::pair<gfan::ZVector,groebnerCone>(emptyVector,emptyCone);
86 if (startingPoint.size() > 0)
87 return std::make_pair(startingPoint,sigma);
93 workingList.insert(sigma);
94 while (!workingList.empty())
98 for (groebnerCones::iterator
tau = neighbours.begin();
tau!=neighbours.end();
tau++)
102 if (workingList.count(*
tau) == 0)
104 startingPoint =
tau->tropicalPoint();
105 if (startingPoint.size() > 0)
106 return std::make_pair(startingPoint,*
tau);
108 workingList.insert(*
tau);
112 workingList.erase(sigma);
116 gfan::ZVector emptyVector = gfan::ZVector(0);
118 return std::pair<gfan::ZVector,groebnerCone>(emptyVector,emptyCone);
126 ideal I = (ideal) u->
Data();
132 for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
134 gfan::ZMatrix ray = zc->extremeRays();
135 for (
int i=0;
i<ray.getHeight();
i++)
137 if (ray[
i].toVector().isPositive())
149 WerrorS(
"positiveTropicalStartingPoint: ideal not principal");
152 WerrorS(
"positiveTropicalStartingPoint: unexpected parameters");
161 ideal I = (ideal) u->
Data();
167 for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
169 gfan::ZMatrix ray = zc->extremeRays();
170 for (
int i=0;
i<ray.getHeight();
i++)
172 if (ray[
i].toVector().isNonNegative())
184 WerrorS(
"nonNegativeTropicalStartingPoint: ideal not principal");
187 WerrorS(
"nonNegativeTropicalStartingPoint: unexpected parameters");
196 ideal I = (ideal) u->
Data();
202 for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
204 gfan::ZMatrix ray = zc->extremeRays();
205 for (
int i=0;
i<ray.getHeight();
i++)
207 gfan::ZVector negatedRay = gfan::Integer(-1)*ray[
i].toVector();
208 if (negatedRay.isPositive())
220 WerrorS(
"negativeTropicalStartingPoint: ideal not principal");
223 WerrorS(
"negativeTropicalStartingPoint: unexpected parameters");
232 ideal I = (ideal) u->
Data();
238 for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
240 gfan::ZMatrix ray = zc->extremeRays();
241 for (
int i=0;
i<ray.getHeight();
i++)
243 gfan::ZVector negatedRay = gfan::Integer(-1)*ray[
i].toVector();
244 if (negatedRay.isNonNegative())
256 WerrorS(
"nonPositiveTropicalStartingPoint: ideal not principal");
259 WerrorS(
"nonPositiveTropicalStartingPoint: unexpected parameters");
268 ideal I = (ideal) u->
Data();
280 gfan::ZCone C = *(Tg.begin());
281 gfan::ZMatrix
rays = C.extremeRays();
282 if (
rays.getHeight()==0)
284 gfan::ZMatrix lin = C.generatorsOfLinealitySpace();
296 gfan::ZMatrix lin = C0.generatorsOfLinealitySpace();
302 gfan::ZVector startingPoint = startingData.first;
307 WerrorS(
"tropicalStartingPoint: unexpected parameters");
317 gfan::ZMatrix
equations = gfan::ZMatrix(0,n);
318 int* expv = (
int*)
omAlloc((n+1)*
sizeof(int));
320 for (
int i=0;
i<
k;
i++)
335 return gfan::ZCone(gfan::ZMatrix(0,n),
equations);
347 int h = startingPoints.getHeight();
349 s0->block0 = (
int*)
omAlloc0((
h+3)*
sizeof(int));
350 s0->block1 = (
int*)
omAlloc0((
h+3)*
sizeof(int));
351 s0->wvhdl = (
int**)
omAlloc0((
h+3)*
sizeof(
int**));
352 for (
int i=0;
i<
h;
i++)
378 currentStrategy.
reduce(I,r);
387 for (
int i=0;
i<
k;
i++)
421 gfan::ZVector startingPoint = startingData.first;
443 for (
int i=0;
i<
k;
i++)
449 for (
int i=0;
i<
k;
i++)
475 for (
int i=0;
i<
k;
i++)
505 gfan::ZVector startingPoint = startingData.first;
512 ideal inI =
initial(I,r,startingPoint);
520 ideal J =
lift(I,r,inJ,
s);
530 ring rShortcut =
rCopy0(r);
538 for (
int i=0;
i<
k;
i++)
563 inJShortcut =
initial(inJShortcut,sShortcut,interiorPoint);
564 inI =
initial(inI,r,interiorPoint);
578 for (
int i=0;
i<
k;
i++)
580 if(inJShortcut->m[
i]!=
NULL)
590 for (
int i=0;
i<
k;
i++)
596 for (
int i=0;
i<
k;
i++)
619 ideal I = (ideal) u->
CopyD();
623 number
p = (number)
v->Data();
631 res->data = (
char*) startingCone;
647 WerrorS(
"tropicalStartingCone: unexpected parameters");
BOOLEAN equations(leftv res, leftv args)
BOOLEAN rays(leftv res, leftv args)
int * ZVectorToIntStar(const gfan::ZVector &v, bool &overflow)
gfan::ZVector intStar2ZVector(const int d, const int *i)
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
void tau(int **points, int sizePoints, int k)
gfan::ZVector tropicalPoint() const
Returns a point in the tropical variety, if the groebnerCone contains one.
groebnerCones groebnerNeighbours() const
Returns a complete list of neighboring Groebner cones.
gfan::ZCone getPolyhedralCone() const
ideal getPolynomialIdeal() const
ring getPolynomialRing() const
gfan::ZVector getInteriorPoint() const
Class used for (list of) interpreter objects.
bool isValuationTrivial() const
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 ...
gfan::ZCone getHomogeneitySpace() const
returns the homogeneity space of the preimage ideal
int getExpectedDimension() const
returns the expected Dimension of the polyhedral output
ring getStartingRing() const
returns the polynomial ring over the valuation ring
ideal getStartingIdeal() const
returns the input ideal
number getUniformizingParameter() const
returns the uniformizing parameter in the valuation ring
ring getShortcutRing() const
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
void nKillChar(coeffs r)
undo all initialisations
poly checkForMonomialViaSuddenSaturation(const ideal I, const ring r)
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
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.
ideal lift(const ideal J, const ring r, const ideal inI, const ring s)
#define omFreeSize(addr, size)
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
static number p_SetCoeff(poly p, number n, ring r)
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 ...
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
void rDelete(ring r)
unconditionally deletes fields in r
static short rVar(const ring r)
#define rVar(r) (r->N)
ideal idInit(int idsize, int rank)
initialise an ideal / module
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static int idElem(const ideal F)
number of non-zero polys in F
gfan::ZMatrix tropicalStartingPoints
static gfan::ZCone linealitySpaceOfGroebnerFan(const ideal I, const ring r)
BOOLEAN nonPositiveTropicalStartingPoint(leftv res, leftv args)
ring createTraversalStartingRing(const ring s, const gfan::ZMatrix &startingPoints, const tropicalStrategy ¤tStrategy)
BOOLEAN positiveTropicalStartingPoint(leftv res, leftv args)
std::pair< gfan::ZVector, groebnerCone > tropicalStartingPoint(const ideal I, const ring r, const tropicalStrategy ¤tStrategy)
Computes a starting point outside the lineatliy space by traversing the Groebner fan,...
BOOLEAN nonNegativeTropicalStartingPoint(leftv res, leftv args)
groebnerCone tropicalStartingCone(const tropicalStrategy ¤tStrategy)
std::pair< gfan::ZVector, groebnerCone > tropicalStartingDataViaGroebnerFan(const ideal I, const ring r, const tropicalStrategy ¤tStrategy)
Computes a starting point outside the lineatliy space by traversing the Groebner fan,...
groebnerCone groebnerStartingCone(const tropicalStrategy ¤tStrategy)
BOOLEAN negativeTropicalStartingPoint(leftv res, leftv args)
ideal gfanlib_kStd_wrapper(ideal I, ring r, tHomog h=testHomog)
bool areIdealsEqual(ideal I, ring r, ideal J, ring s)
implementation of the class tropicalStrategy
BOOLEAN tropicalVariety(leftv res, leftv args)