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++)
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);
538 for (
int i=0;
i<
k;
i++)
563 inJShortcut =
initial(inJShortcut,sShortcut,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 negativeTropicalStartingPoint(leftv res, leftv args)
implementation of the class tropicalStrategy
ring getShortcutRing() const
const CanonicalForm int s
gfan::ZCone getPolyhedralCone() const
Class used for (list of) interpreter objects.
gfan::ZCone groebnerCone(const ideal I, const ring r, const gfan::ZVector &w)
ring getPolynomialRing() const
gfan::ZFan * groebnerFan(const tropicalStrategy currentStrategy)
BOOLEAN positiveTropicalStartingPoint(leftv res, leftv args)
BOOLEAN nonPositiveTropicalStartingPoint(leftv res, leftv args)
static void p_GetExpV(poly p, int *ev, const ring r)
#define omFreeSize(addr, size)
static short rVar(const ring r)
#define rVar(r) (r->N)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
ring getStartingRing() const
returns the polynomial ring over the valuation ring
groebnerCone tropicalStartingCone(const tropicalStrategy ¤tStrategy)
int * ZVectorToIntStar(const gfan::ZVector &v, bool &overflow)
void WerrorS(const char *s)
static gfan::ZCone linealitySpaceOfGroebnerFan(const ideal I, const ring r)
number getUniformizingParameter() const
returns the uniformizing parameter in the valuation ring
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
static number p_SetCoeff(poly p, number n, ring r)
gfan::ZVector tropicalPoint() const
Returns a point in the tropical variety, if the groebnerCone contains one.
std::set< groebnerCone, groebnerCone_compare > groebnerCones
ideal lift(const ideal J, const ring r, const ideal inI, const ring s)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
groebnerCones groebnerNeighbours() const
Returns a complete list of neighboring Groebner cones.
poly initial(const poly p, const ring r, const gfan::ZVector &w)
Returns the initial form of p with respect to w.
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)
bool isValuationTrivial() const
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 createTraversalStartingRing(const ring s, const gfan::ZMatrix &startingPoints, const tropicalStrategy ¤tStrategy)
ideal gfanlib_kStd_wrapper(ideal I, ring r, tHomog h=testHomog)
gfan::ZVector intStar2ZVector(const int d, const int *i)
gfan::ZCone getHomogeneitySpace() const
returns the homogeneity space of the preimage ideal
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
ideal getStartingIdeal() const
returns the input ideal
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
BOOLEAN tropicalVariety(leftv res, leftv args)
bool areIdealsEqual(ideal I, ring r, ideal J, ring s)
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, checking each cone whether it contains a ray in the tropical variety.
poly checkForMonomialViaSuddenSaturation(const ideal I, const ring r)
gfan::ZMatrix tropicalStartingPoints
void tau(int **points, int sizePoints, int k)
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
static void p_Delete(poly *p, const ring r)
ideal idInit(int idsize, int rank)
initialise an ideal / module
const Variable & v
< [in] a sqrfree bivariate poly
BOOLEAN rays(leftv res, leftv args)
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 ...
implementation of the class groebnerCone
void rDelete(ring r)
unconditionally deletes fields in r
gfan::ZVector getInteriorPoint() const
BOOLEAN equations(leftv res, leftv args)
int getExpectedDimension() const
returns the expected Dimension of the polyhedral output
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, checking each cone whether it contains a ray in the tropical variety.
int idElem(const ideal F)
count non-zero elements
groebnerCone groebnerStartingCone(const tropicalStrategy ¤tStrategy)
BOOLEAN nonNegativeTropicalStartingPoint(leftv res, leftv args)
void nKillChar(coeffs r)
undo all initialisations
ideal getPolynomialIdeal() const