1#include "gfanlib/gfanlib_matrix.h"
2#include "gfanlib/gfanlib_zcone.h"
27 for (ZConesSortedByDimension::iterator coneOfA=setA.begin(); coneOfA!=setA.end(); coneOfA++)
29 for (ZConesSortedByDimension::iterator coneOfB=setB.begin(); coneOfB!=setB.end(); coneOfB++)
31 gfan::ZCone coneOfIntersection = gfan::intersection(*coneOfA,*coneOfB);
32 if (coneOfIntersection.dimension()>=d)
34 coneOfIntersection.canonicalize();
35 setAB.insert(coneOfIntersection);
53 int h = W.getHeight();
58 s->block0 = (
int*)
omAlloc0((
h+4)*
sizeof(int));
59 s->block1 = (
int*)
omAlloc0((
h+4)*
sizeof(int));
60 s->wvhdl = (
int**)
omAlloc0((
h+4)*
sizeof(
int*));
63 bool overflow =
false;
74 for (
int j=0;
j<
h-1;
j++)
91 WerrorS(
"genericlyWeightedOrdering: overflow in weight vector");
116 int PayneOsserman =
rVar(r)-1;
117 for (
int i=0;
i<
k;
i++)
136 for (std::set<gfan::ZCone>::iterator zc=C.begin(); zc!=C.end();)
138 gfan::ZVector
w = zc->getRelativeInteriorPoint();
139 gfan::ZMatrix W = zc->generatorsOfSpan();
145 for (
int j=0;
j<
k;
j++)
154 if (mons.first!=
NULL)
159 gs = inIsSTD->m[mons.second];
162 gs =
witness(mons.first,inIsSTD,ininIs,
s);
190 if (zc->contains(wNeg))
195 for (
int j=0;
j<
k;
j++)
203 if (mons.first!=
NULL)
208 gs = inIsSTD->m[mons.second];
211 gs =
witness(mons.first,inIsSTD,ininIs,
s);
249 gfan::ZMatrix raysOfC(0,u.size());
252 for (ZConesSortedByDimension::iterator zc=C.begin(); zc!=C.end(); zc++)
254 assume(zc->dimensionOfLinealitySpace()+1 >= zc->dimension());
255 if (zc->dimensionOfLinealitySpace()+1 >= zc->dimension())
256 raysOfC.appendRow(zc->getRelativeInteriorPoint());
259 gfan::ZVector interiorPoint = zc->getRelativeInteriorPoint();
262 raysOfC.appendRow(interiorPoint);
263 raysOfC.appendRow(currentStrategy->
negateWeight(interiorPoint));
267 gfan::ZMatrix zm = zc->generatorsOfLinealitySpace();
268 for (
int i=0;
i<zm.getHeight();
i++)
270 gfan::ZVector point = zm[
i];
273 raysOfC.appendRow(point);
274 raysOfC.appendRow(currentStrategy->
negateWeight(point));
284 for (ZConesSortedByDimension::iterator zc=C.begin(); zc!=C.end(); zc++)
286 assume(zc->dimensionOfLinealitySpace()+2 >= zc->dimension());
287 if (zc->dimensionOfLinealitySpace()+2 == zc->dimension())
288 raysOfC.appendRow(zc->getRelativeInteriorPoint());
291 gfan::ZVector interiorPoint = zc->getRelativeInteriorPoint();
294 raysOfC.appendRow(interiorPoint);
295 raysOfC.appendRow(currentStrategy->
negateWeight(interiorPoint));
299 gfan::ZMatrix zm = zc->generatorsOfLinealitySpace();
300 for (
int i=0;
i<zm.getHeight();
i++)
302 gfan::ZVector point = zm[
i];
305 raysOfC.appendRow(point);
306 raysOfC.appendRow(currentStrategy->
negateWeight(point));
static int si_max(const int a, const int b)
int * ZVectorToIntStar(const gfan::ZVector &v, bool &overflow)
bool homogeneitySpaceContains(const gfan::ZVector &v) const
returns true, if v is contained in the homogeneity space; false otherwise
gfan::ZVector adjustWeightUnderHomogeneity(gfan::ZVector v, gfan::ZVector w) const
Given strictly positive weight w and weight v, returns a strictly positive weight u such that on an i...
int getExpectedDimension() const
returns the expected Dimension of the polyhedral output
gfan::ZVector adjustWeightForHomogeneity(gfan::ZVector w) const
Given weight w, returns a strictly positive weight u such that an ideal satisfying the valuation-sepc...
gfan::ZVector negateWeight(const gfan::ZVector &w) const
bool restrictToLowerHalfSpace() const
returns true, if valuation non-trivial, false otherwise
std::pair< poly, int > checkInitialIdealForMonomial(const ideal I, const ring r, const gfan::ZVector &w=0) const
If given w, assuming w is in the Groebner cone of the ordering on r and I is a standard basis with re...
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
const CanonicalForm int s
void WerrorS(const char *s)
BOOLEAN idInsertPoly(ideal h1, poly h2)
insert h2 into h1 (if h2 is not the zero polynomial) return TRUE iff h2 was indeed inserted
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)
static void p_Delete(poly *p, const ring r)
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
ideal gfanlib_kStd_wrapper(ideal I, ring r, tHomog h=testHomog)
static ZConesSortedByDimension intersect(const ZConesSortedByDimension &setA, const ZConesSortedByDimension &setB, int d=0)
ZConesSortedByDimension tropicalStar(ideal inI, const ring r, const gfan::ZVector &u, const tropicalStrategy *currentStrategy)
static ring genericlyWeightedOrdering(const ring r, const gfan::ZVector &u, const gfan::ZVector &w, const gfan::ZMatrix &W, const tropicalStrategy *currentStrategy)
gfan::ZMatrix raysOfTropicalStar(ideal I, const ring r, const gfan::ZVector &u, const tropicalStrategy *currentStrategy)
implementation of the class tropicalStrategy
ZConesSortedByDimension tropicalVarietySortedByDimension(const poly g, const ring r, const tropicalStrategy *currentCase)
std::set< gfan::ZCone, ZConeCompareDimensionFirst > ZConesSortedByDimension
poly witness(const poly m, const ideal I, const ideal inI, const ring r)
Let w be the uppermost weight vector in the matrix defining the ordering on r.