Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
tropicalStrategy Class Reference

#include <tropicalStrategy.h>

Public Member Functions

 tropicalStrategy (const ideal I, const ring r, const bool completelyHomogeneous=true, const bool completeSpace=true)
 Constructor for the trivial valuation case. More...
 
 tropicalStrategy (const ideal J, const number p, const ring s)
 Constructor for the non-trivial valuation case p is the uniformizing parameter of the valuation. More...
 
 tropicalStrategy (const tropicalStrategy &currentStrategy)
 copy constructor More...
 
 tropicalStrategy ()
 
 ~tropicalStrategy ()
 destructor More...
 
tropicalStrategyoperator= (const tropicalStrategy &currentStrategy)
 assignment operator More...
 
bool isValuationTrivial () const
 
bool isValuationNonTrivial () const
 
ring getOriginalRing () const
 returns the polynomial ring over the field with valuation More...
 
ideal getOriginalIdeal () const
 returns the input ideal over the field with valuation More...
 
ring getStartingRing () const
 returns the polynomial ring over the valuation ring More...
 
ideal getStartingIdeal () const
 returns the input ideal More...
 
int getExpectedAmbientDimension () const
 
int getExpectedDimension () const
 returns the expected Dimension of the polyhedral output More...
 
number getUniformizingParameter () const
 returns the uniformizing parameter in the valuation ring More...
 
ring getShortcutRing () const
 
gfan::ZCone getHomogeneitySpace () const
 returns the homogeneity space of the preimage ideal More...
 
bool homogeneitySpaceContains (const gfan::ZVector &v) const
 returns true, if v is contained in the homogeneity space; false otherwise More...
 
bool restrictToLowerHalfSpace () const
 returns true, if valuation non-trivial, false otherwise More...
 
gfan::ZVector adjustWeightForHomogeneity (gfan::ZVector w) const
 Given weight w, returns a strictly positive weight u such that an ideal satisfying the valuation-sepcific homogeneity conditions is weighted homogeneous with respect to w if and only if it is homogeneous with respect to u. More...
 
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 ideal that is weighted homogeneous with respect to w the weights u and v coincide. More...
 
gfan::ZVector negateWeight (const gfan::ZVector &w) const
 
ring getShortcutRingPrependingWeight (const ring r, const gfan::ZVector &w) const
 If valuation trivial, returns a copy of r with a positive weight prepended, such that any ideal homogeneous with respect to w is homogeneous with respect to that weight. More...
 
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 be read off. More...
 
void pReduce (ideal I, const ring r) const
 
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 respect to that ordering, checks whether the initial ideal of I with respect to w contains a monomial. More...
 
ideal computeStdOfInitialIdeal (const ideal inI, const ring r) const
 given generators of the initial ideal, computes its standard basis More...
 
ideal computeWitness (const ideal inJ, const ideal inI, const ideal I, const ring r) const
 suppose w a weight in maximal groebner cone of > suppose I (initially) reduced standard basis w.r.t. More...
 
ideal computeLift (const ideal inJs, const ring s, const ideal inIr, const ideal Ir, const ring r) const
 
std::pair< ideal, ring > computeFlip (const ideal Ir, const ring r, const gfan::ZVector &interiorPoint, const gfan::ZVector &facetNormal) const
 given an interior point of a groebner cone computes the groebner cone adjacent to it More...
 

Static Public Member Functions

static tropicalStrategy debugStrategy (const ideal startIdeal, number unifParameter, ring startRing)
 

Private Member Functions

ring copyAndChangeCoefficientRing (const ring r) const
 
ring copyAndChangeOrderingWP (const ring r, const gfan::ZVector &w, const gfan::ZVector &v) const
 
ring copyAndChangeOrderingLS (const ring r, const gfan::ZVector &w, const gfan::ZVector &v) const
 
bool checkForUniformizingBinomial (const ideal I, const ring r) const
 if valuation non-trivial, checks whether the generating system contains p-t otherwise returns true More...
 
bool checkForUniformizingParameter (const ideal inI, const ring r) const
 if valuation non-trivial, checks whether the genearting system contains p otherwise returns true More...
 
int findPositionOfUniformizingBinomial (const ideal I, const ring r) const
 
void putUniformizingBinomialInFront (ideal I, const ring r, const number q) const
 

Private Attributes

ring originalRing
 polynomial ring over a field with valuation More...
 
ideal originalIdeal
 input ideal, assumed to be a homogeneous prime ideal More...
 
int expectedDimension
 the expected Dimension of the polyhedral output, i.e. More...
 
gfan::ZCone linealitySpace
 the homogeneity space of the Grobner fan More...
 
ring startingRing
 polynomial ring over the valuation ring extended by one extra variable t More...
 
ideal startingIdeal
 preimage of the input ideal under the map that sends t to the uniformizing parameter More...
 
number uniformizingParameter
 uniformizing parameter in the valuation ring More...
 
ring shortcutRing
 polynomial ring over the residue field More...
 
bool onlyLowerHalfSpace
 true if valuation non-trivial, false otherwise More...
 
gfan::ZVector(* weightAdjustingAlgorithm1 )(const gfan::ZVector &w)
 A function such that: Given weight w, returns a strictly positive weight u such that an ideal satisfying the valuation-sepcific homogeneity conditions is weighted homogeneous with respect to w if and only if it is homogeneous with respect to u. More...
 
gfan::ZVector(* weightAdjustingAlgorithm2 )(const gfan::ZVector &v, const gfan::ZVector &w)
 A function such that: Given strictly positive weight w and weight v, returns a strictly positive weight u such that on an ideal that is weighted homogeneous with respect to w the weights u and v coincide. More...
 
bool(* extraReductionAlgorithm )(ideal I, ring r, number p)
 A function that reduces the generators of an ideal I so that the inequalities and equations of the Groebner cone can be read off. More...
 

Detailed Description

Definition at line 37 of file tropicalStrategy.h.

Constructor & Destructor Documentation

§ tropicalStrategy() [1/4]

tropicalStrategy::tropicalStrategy ( const ideal  I,
const ring  r,
const bool  completelyHomogeneous = true,
const bool  completeSpace = true 
)

Constructor for the trivial valuation case.

Initializes all relevant structures and information for the trivial valuation case, i.e.

computing a tropical variety without any valuation.

Definition at line 129 of file tropicalStrategy.cc.

131  :
132  originalRing(rCopy(r)),
133  originalIdeal(id_Copy(I,r)),
140  onlyLowerHalfSpace(false),
144 {
146  if (!completelyHomogeneous)
147  {
150  }
151  if (!completeSpace)
152  onlyLowerHalfSpace = true;
153 }
gfan::ZCone homogeneitySpace(ideal I, ring r)
Definition: tropical.cc:19
gfan::ZVector nonvalued_adjustWeightUnderHomogeneity(const gfan::ZVector &e, const gfan::ZVector &)
ideal id_Copy(ideal h1, const ring r)
copy an ideal
bool onlyLowerHalfSpace
true if valuation non-trivial, false otherwise
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
const ring r
Definition: syzextra.cc:208
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
static bool noExtraReduction(ideal I, ring r, number)
ring shortcutRing
polynomial ring over the residue field
#define assume(x)
Definition: mod2.h:403
int dim(ideal I, ring r)
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
gfan::ZVector(* weightAdjustingAlgorithm2)(const gfan::ZVector &v, const gfan::ZVector &w)
A function such that: Given strictly positive weight w and weight v, returns a strictly positive weig...
gfan::ZVector valued_adjustWeightUnderHomogeneity(const gfan::ZVector &e, const gfan::ZVector &w)
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:495
number uniformizingParameter
uniformizing parameter in the valuation ring
ring rCopy(ring r)
Definition: ring.cc:1619
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
#define NULL
Definition: omList.c:10
bool(* extraReductionAlgorithm)(ideal I, ring r, number p)
A function that reduces the generators of an ideal I so that the inequalities and equations of the Gr...
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:474
gfan::ZVector nonvalued_adjustWeightForHomogeneity(const gfan::ZVector &w)
gfan::ZVector valued_adjustWeightForHomogeneity(const gfan::ZVector &w)
ring originalRing
polynomial ring over a field with valuation
gfan::ZCone linealitySpace
the homogeneity space of the Grobner fan
int expectedDimension
the expected Dimension of the polyhedral output, i.e.
gfan::ZVector(* weightAdjustingAlgorithm1)(const gfan::ZVector &w)
A function such that: Given weight w, returns a strictly positive weight u such that an ideal satisfy...

§ tropicalStrategy() [2/4]

tropicalStrategy::tropicalStrategy ( const ideal  J,
const number  p,
const ring  s 
)

Constructor for the non-trivial valuation case p is the uniformizing parameter of the valuation.

Definition at line 268 of file tropicalStrategy.cc.

268  :
269  originalRing(rCopy(s)),
270  originalIdeal(id_Copy(J,s)),
272  linealitySpace(gfan::ZCone()), // to come, see below
273  startingRing(NULL), // to come, see below
274  startingIdeal(NULL), // to come, see below
275  uniformizingParameter(NULL), // to come, see below
276  shortcutRing(NULL), // to come, see below
277  onlyLowerHalfSpace(true),
281 {
282  /* assume that the ground field of the originalRing is Q */
283  assume(rField_is_Q(s));
284 
285  /* replace Q with Z for the startingRing
286  * and add an extra variable for tracking the uniformizing parameter */
288 
289  /* map the uniformizing parameter into the new coefficient domain */
290  nMapFunc nMap = n_SetMap(originalRing->cf,startingRing->cf);
292 
293  /* map the input ideal into the new polynomial ring */
296 
298 
299  /* construct the shorcut ring */
301  nKillChar(shortcutRing->cf);
305 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
gfan::ZCone homogeneitySpace(ideal I, ring r)
Definition: tropical.cc:19
ideal id_Copy(ideal h1, const ring r)
copy an ideal
bool ppreduceInitially(poly *hStar, const poly g, const ring r)
reduces h initially with respect to g, returns false if h was initially reduced in the first place...
{p < 2^31}
Definition: coeffs.h:30
static ideal constructStartingIdeal(ideal originalIdeal, ring originalRing, number uniformizingParameter, ring startingRing)
bool onlyLowerHalfSpace
true if valuation non-trivial, false otherwise
static ring constructStartingRing(ring r)
Given a polynomial ring r over the rational numbers and a weighted ordering, returns a polynomial rin...
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ...
Definition: coeffs.h:551
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...
Definition: ring.cc:3435
ring shortcutRing
polynomial ring over the residue field
#define assume(x)
Definition: mod2.h:403
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1321
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
#define rTest(r)
Definition: ring.h:775
int dim(ideal I, ring r)
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:501
int IsPrime(int p)
Definition: prime.cc:61
gfan::ZVector(* weightAdjustingAlgorithm2)(const gfan::ZVector &v, const gfan::ZVector &w)
A function such that: Given strictly positive weight w and weight v, returns a strictly positive weig...
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
gfan::ZVector valued_adjustWeightUnderHomogeneity(const gfan::ZVector &e, const gfan::ZVector &w)
number uniformizingParameter
uniformizing parameter in the valuation ring
ring rCopy(ring r)
Definition: ring.cc:1619
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
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 ...
#define NULL
Definition: omList.c:10
bool(* extraReductionAlgorithm)(ideal I, ring r, number p)
A function that reduces the generators of an ideal I so that the inequalities and equations of the Gr...
gfan::ZVector valued_adjustWeightForHomogeneity(const gfan::ZVector &w)
ring originalRing
polynomial ring over a field with valuation
gfan::ZCone linealitySpace
the homogeneity space of the Grobner fan
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
int expectedDimension
the expected Dimension of the polyhedral output, i.e.
gfan::ZVector(* weightAdjustingAlgorithm1)(const gfan::ZVector &w)
A function such that: Given weight w, returns a strictly positive weight u such that an ideal satisfy...
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:329

§ tropicalStrategy() [3/4]

tropicalStrategy::tropicalStrategy ( const tropicalStrategy currentStrategy)

copy constructor

Definition at line 307 of file tropicalStrategy.cc.

307  :
308  originalRing(rCopy(currentStrategy.getOriginalRing())),
309  originalIdeal(id_Copy(currentStrategy.getOriginalIdeal(),currentStrategy.getOriginalRing())),
310  expectedDimension(currentStrategy.getExpectedDimension()),
311  linealitySpace(currentStrategy.getHomogeneitySpace()),
312  startingRing(rCopy(currentStrategy.getStartingRing())),
313  startingIdeal(id_Copy(currentStrategy.getStartingIdeal(),currentStrategy.getStartingRing())),
316  onlyLowerHalfSpace(currentStrategy.restrictToLowerHalfSpace()),
320 {
325  if (currentStrategy.getUniformizingParameter())
326  {
329  }
330  if (currentStrategy.getShortcutRing())
331  {
332  shortcutRing = rCopy(currentStrategy.getShortcutRing());
334  }
335 }
ring getShortcutRing() const
ring getOriginalRing() const
returns the polynomial ring over the field with valuation
ideal id_Copy(ideal h1, const ring r)
copy an ideal
#define id_Test(A, lR)
Definition: simpleideals.h:80
ring getStartingRing() const
returns the polynomial ring over the valuation ring
bool onlyLowerHalfSpace
true if valuation non-trivial, false otherwise
number getUniformizingParameter() const
returns the uniformizing parameter in the valuation ring
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
ring shortcutRing
polynomial ring over the residue field
gfan::ZCone getHomogeneitySpace() const
returns the homogeneity space of the preimage ideal
ideal getStartingIdeal() const
returns the input ideal
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:742
#define rTest(r)
Definition: ring.h:775
bool restrictToLowerHalfSpace() const
returns true, if valuation non-trivial, false otherwise
gfan::ZVector(* weightAdjustingAlgorithm2)(const gfan::ZVector &v, const gfan::ZVector &w)
A function such that: Given strictly positive weight w and weight v, returns a strictly positive weig...
number uniformizingParameter
uniformizing parameter in the valuation ring
ring rCopy(ring r)
Definition: ring.cc:1619
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
#define NULL
Definition: omList.c:10
bool(* extraReductionAlgorithm)(ideal I, ring r, number p)
A function that reduces the generators of an ideal I so that the inequalities and equations of the Gr...
ideal getOriginalIdeal() const
returns the input ideal over the field with valuation
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:455
int getExpectedDimension() const
returns the expected Dimension of the polyhedral output
ring originalRing
polynomial ring over a field with valuation
gfan::ZCone linealitySpace
the homogeneity space of the Grobner fan
int expectedDimension
the expected Dimension of the polyhedral output, i.e.
gfan::ZVector(* weightAdjustingAlgorithm1)(const gfan::ZVector &w)
A function such that: Given weight w, returns a strictly positive weight u such that an ideal satisfy...

§ tropicalStrategy() [4/4]

tropicalStrategy::tropicalStrategy ( )

Definition at line 894 of file tropicalStrategy.cc.

894  :
898  linealitySpace(gfan::ZCone()),
903  onlyLowerHalfSpace(false)
904 {
908 }
bool onlyLowerHalfSpace
true if valuation non-trivial, false otherwise
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
ring shortcutRing
polynomial ring over the residue field
gfan::ZVector(* weightAdjustingAlgorithm2)(const gfan::ZVector &v, const gfan::ZVector &w)
A function such that: Given strictly positive weight w and weight v, returns a strictly positive weig...
number uniformizingParameter
uniformizing parameter in the valuation ring
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
#define NULL
Definition: omList.c:10
bool(* extraReductionAlgorithm)(ideal I, ring r, number p)
A function that reduces the generators of an ideal I so that the inequalities and equations of the Gr...
ring originalRing
polynomial ring over a field with valuation
gfan::ZCone linealitySpace
the homogeneity space of the Grobner fan
int expectedDimension
the expected Dimension of the polyhedral output, i.e.
gfan::ZVector(* weightAdjustingAlgorithm1)(const gfan::ZVector &w)
A function such that: Given weight w, returns a strictly positive weight u such that an ideal satisfy...

§ ~tropicalStrategy()

tropicalStrategy::~tropicalStrategy ( )

destructor

Definition at line 337 of file tropicalStrategy.cc.

338 {
345 
352 }
#define id_Test(A, lR)
Definition: simpleideals.h:80
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
ring shortcutRing
polynomial ring over the residue field
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:742
#define rTest(r)
Definition: ring.h:775
number uniformizingParameter
uniformizing parameter in the valuation ring
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
ring originalRing
polynomial ring over a field with valuation

Member Function Documentation

§ adjustWeightForHomogeneity()

gfan::ZVector tropicalStrategy::adjustWeightForHomogeneity ( gfan::ZVector  w) const
inline

Given weight w, returns a strictly positive weight u such that an ideal satisfying the valuation-sepcific homogeneity conditions is weighted homogeneous with respect to w if and only if it is homogeneous with respect to u.

Definition at line 254 of file tropicalStrategy.h.

255  {
256  return this->weightAdjustingAlgorithm1(w);
257  }
const CanonicalForm & w
Definition: facAbsFact.cc:55
gfan::ZVector(* weightAdjustingAlgorithm1)(const gfan::ZVector &w)
A function such that: Given weight w, returns a strictly positive weight u such that an ideal satisfy...

§ adjustWeightUnderHomogeneity()

gfan::ZVector tropicalStrategy::adjustWeightUnderHomogeneity ( gfan::ZVector  v,
gfan::ZVector  w 
) const
inline

Given strictly positive weight w and weight v, returns a strictly positive weight u such that on an ideal that is weighted homogeneous with respect to w the weights u and v coincide.

Definition at line 264 of file tropicalStrategy.h.

265  {
266  return this->weightAdjustingAlgorithm2(v,w);
267  }
gfan::ZVector(* weightAdjustingAlgorithm2)(const gfan::ZVector &v, const gfan::ZVector &w)
A function such that: Given strictly positive weight w and weight v, returns a strictly positive weig...
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
const CanonicalForm & w
Definition: facAbsFact.cc:55

§ checkForUniformizingBinomial()

bool tropicalStrategy::checkForUniformizingBinomial ( const ideal  I,
const ring  r 
) const
private

if valuation non-trivial, checks whether the generating system contains p-t otherwise returns true

Definition at line 814 of file tropicalStrategy.cc.

815 {
816  // if the valuation is trivial,
817  // then there is no special condition the first generator has to fullfill
818  if (isValuationTrivial())
819  return true;
820 
821  // if the valuation is non-trivial then checks if the first generator is p-t
822  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
823  poly p = p_One(r);
824  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
825  poly t = p_One(r);
826  p_SetExp(t,1,1,r);
827  p_Setm(t,r);
828  poly pt = p_Add_q(p,p_Neg(t,r),r);
829 
830  for (int i=0; i<IDELEMS(I); i++)
831  {
832  if (p_EqualPolys(I->m[i],pt,r))
833  {
834  p_Delete(&pt,r);
835  return true;
836  }
837  }
838  p_Delete(&pt,r);
839  return false;
840 }
return P p
Definition: myNF.cc:203
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1313
bool isValuationTrivial() const
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4321
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
number uniformizingParameter
uniformizing parameter in the valuation ring
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:483
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1013
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877

§ checkForUniformizingParameter()

bool tropicalStrategy::checkForUniformizingParameter ( const ideal  inI,
const ring  r 
) const
private

if valuation non-trivial, checks whether the genearting system contains p otherwise returns true

Definition at line 867 of file tropicalStrategy.cc.

868 {
869  // if the valuation is trivial,
870  // then there is no special condition the first generator has to fullfill
871  if (isValuationTrivial())
872  return true;
873 
874  // if the valuation is non-trivial then checks if the first generator is p
875  if (inI->m[0]==NULL)
876  return false;
877  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
878  poly p = p_One(r);
879  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
880 
881  for (int i=0; i<IDELEMS(inI); i++)
882  {
883  if (p_EqualPolys(inI->m[i],p,r))
884  {
885  p_Delete(&p,r);
886  return true;
887  }
888  }
889  p_Delete(&p,r);
890  return false;
891 }
return P p
Definition: myNF.cc:203
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1313
bool isValuationTrivial() const
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4321
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
number uniformizingParameter
uniformizing parameter in the valuation ring
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
#define NULL
Definition: omList.c:10
polyrec * poly
Definition: hilb.h:10

§ checkInitialIdealForMonomial()

std::pair< poly, int > tropicalStrategy::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 respect to that ordering, checks whether the initial ideal of I with respect to w contains a monomial.

If no w is given, assuming that I is already an initial form of some ideal, checks whether I contains a monomial. In both cases returns a monomial, if it contains one, returns NULL otherwise.

Definition at line 485 of file tropicalStrategy.cc.

486 {
487  // quick check whether I already contains an ideal
488  int k = IDELEMS(I);
489  for (int i=0; i<k; i++)
490  {
491  poly g = I->m[i];
492  if (g!=NULL
493  && pNext(g)==NULL
494  && (isValuationTrivial() || n_IsOne(p_GetCoeff(g,r),r->cf)))
495  return std::pair<poly,int>(g,i);
496  }
497 
498  ring rShortcut;
499  ideal inIShortcut;
500  if (w.size()>0)
501  {
502  // if needed, prepend extra weight for homogeneity
503  // switch to residue field if valuation is non trivial
504  rShortcut = getShortcutRingPrependingWeight(r,w);
505 
506  // compute the initial ideal and map it into the constructed ring
507  // if switched to residue field, remove possibly 0 elements
508  ideal inI = initial(I,r,w);
509  inIShortcut = idInit(k);
510  nMapFunc intoShortcut = n_SetMap(r->cf,rShortcut->cf);
511  for (int i=0; i<k; i++)
512  inIShortcut->m[i] = p_PermPoly(inI->m[i],NULL,r,rShortcut,intoShortcut,NULL,0);
513  if (isValuationNonTrivial())
514  idSkipZeroes(inIShortcut);
515  id_Delete(&inI,r);
516  }
517  else
518  {
519  rShortcut = r;
520  inIShortcut = I;
521  }
522 
523  // check initial ideal for monomial and
524  // if it exsists, return a copy of the monomial in the input ring
525  poly p = checkForMonomialViaSuddenSaturation(inIShortcut,rShortcut);
526  poly monomial = NULL;
527  if (p!=NULL)
528  {
529  monomial=p_One(r);
530  for (int i=1; i<=rVar(r); i++)
531  p_SetExp(monomial,i,p_GetExp(p,i,rShortcut),r);
532  p_Setm(monomial,r);
533  p_Delete(&p,rShortcut);
534  }
535 
536 
537  if (w.size()>0)
538  {
539  // if needed, cleanup
540  id_Delete(&inIShortcut,rShortcut);
541  rDelete(rShortcut);
542  }
543  return std::pair<poly,int>(monomial,-1);
544 }
ring getShortcutRingPrependingWeight(const ring r, const gfan::ZVector &w) const
If valuation trivial, returns a copy of r with a positive weight prepended, such that any ideal homog...
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the one element.
Definition: coeffs.h:472
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
g
Definition: cfModGcd.cc:4031
int k
Definition: cfEzgcd.cc:93
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:32
const ring r
Definition: syzextra.cc:208
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)
Definition: p_polys.cc:3939
poly p_One(const ring r)
Definition: p_polys.cc:1313
bool isValuationTrivial() const
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent : the integer VarOffset encodes:
Definition: p_polys.h:464
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
poly checkForMonomialViaSuddenSaturation(const ideal I, const ring r)
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:483
bool isValuationNonTrivial() const
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
const CanonicalForm & w
Definition: facAbsFact.cc:55
#define pNext(p)
Definition: monomials.h:43
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
#define p_GetCoeff(p, r)
Definition: monomials.h:57
polyrec * poly
Definition: hilb.h:10

§ computeFlip()

std::pair< ideal, ring > tropicalStrategy::computeFlip ( const ideal  Ir,
const ring  r,
const gfan::ZVector &  interiorPoint,
const gfan::ZVector &  facetNormal 
) const

given an interior point of a groebner cone computes the groebner cone adjacent to it

Definition at line 767 of file tropicalStrategy.cc.

770 {
771  assume(isValuationTrivial() || interiorPoint[0].sign()<0);
773 
774  // get a generating system of the initial ideal
775  // and compute a standard basis with respect to adjacent ordering
776  ideal inIr = initial(Ir,r,interiorPoint);
777  ring sAdjusted = copyAndChangeOrderingWP(r,interiorPoint,facetNormal);
778  nMapFunc identity = n_SetMap(r->cf,sAdjusted->cf);
779  int k = IDELEMS(Ir);
780  ideal inIsAdjusted = idInit(k);
781  for (int i=0; i<k; i++)
782  inIsAdjusted->m[i] = p_PermPoly(inIr->m[i],NULL,r,sAdjusted,identity,NULL,0);
783  ideal inJsAdjusted = computeStdOfInitialIdeal(inIsAdjusted,sAdjusted);
784 
785  // find witnesses of the new standard basis elements of the initial ideal
786  // with the help of the old standard basis of the ideal
787  k = IDELEMS(inJsAdjusted);
788  ideal inJr = idInit(k);
789  identity = n_SetMap(sAdjusted->cf,r->cf);
790  for (int i=0; i<k; i++)
791  inJr->m[i] = p_PermPoly(inJsAdjusted->m[i],NULL,sAdjusted,r,identity,NULL,0);
792 
793  ideal Jr = computeWitness(inJr,inIr,Ir,r);
794  ring s = copyAndChangeOrderingLS(r,interiorPoint,facetNormal);
795  identity = n_SetMap(r->cf,s->cf);
796  ideal Js = idInit(k);
797  for (int i=0; i<k; i++)
798  Js->m[i] = p_PermPoly(Jr->m[i],NULL,r,s,identity,NULL,0);
799 
800  // this->reduce(Jr,r);
801  // cleanup
802  id_Delete(&inIsAdjusted,sAdjusted);
803  id_Delete(&inJsAdjusted,sAdjusted);
804  rDelete(sAdjusted);
805  id_Delete(&inIr,r);
806  id_Delete(&Jr,r);
807  id_Delete(&inJr,r);
808 
810  return std::make_pair(Js,s);
811 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
bool isOrderingLocalInT(const ring r)
ideal computeWitness(const ideal inJ, const ideal inI, const ideal I, const ring r) const
suppose w a weight in maximal groebner cone of > suppose I (initially) reduced standard basis w...
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int k
Definition: cfEzgcd.cc:93
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:32
const ring r
Definition: syzextra.cc:208
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)
Definition: p_polys.cc:3939
bool isValuationTrivial() const
#define assume(x)
Definition: mod2.h:403
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
ring copyAndChangeOrderingLS(const ring r, const gfan::ZVector &w, const gfan::ZVector &v) const
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
ring copyAndChangeOrderingWP(const ring r, const gfan::ZVector &w, const gfan::ZVector &v) const
bool checkForUniformizingBinomial(const ideal I, const ring r) const
if valuation non-trivial, checks whether the generating system contains p-t otherwise returns true ...
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
static int sign(int x)
Definition: ring.cc:3412
ideal computeStdOfInitialIdeal(const ideal inI, const ring r) const
given generators of the initial ideal, computes its standard basis

§ computeLift()

ideal tropicalStrategy::computeLift ( const ideal  inJs,
const ring  s,
const ideal  inIr,
const ideal  Ir,
const ring  r 
) const

Definition at line 670 of file tropicalStrategy.cc.

671 {
672  int k = IDELEMS(inJs);
673  ideal inJr = idInit(k);
674  nMapFunc identitysr = n_SetMap(s->cf,r->cf);
675  for (int i=0; i<k; i++)
676  inJr->m[i] = p_PermPoly(inJs->m[i],NULL,s,r,identitysr,NULL,0);
677 
678  ideal Jr = computeWitness(inJr,inIr,Ir,r);
679  nMapFunc identityrs = n_SetMap(r->cf,s->cf);
680  ideal Js = idInit(k);
681  for (int i=0; i<k; i++)
682  Js->m[i] = p_PermPoly(Jr->m[i],NULL,r,s,identityrs,NULL,0);
683  return Js;
684 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
ideal computeWitness(const ideal inJ, const ideal inI, const ideal I, const ring r) const
suppose w a weight in maximal groebner cone of > suppose I (initially) reduced standard basis w...
int k
Definition: cfEzgcd.cc:93
const ring r
Definition: syzextra.cc:208
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)
Definition: p_polys.cc:3939
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10

§ computeStdOfInitialIdeal()

ideal tropicalStrategy::computeStdOfInitialIdeal ( const ideal  inI,
const ring  r 
) const

given generators of the initial ideal, computes its standard basis

Definition at line 638 of file tropicalStrategy.cc.

639 {
640  // if valuation trivial, then compute std as usual
641  if (isValuationTrivial())
642  return gfanlib_kStd_wrapper(inI,r);
643 
644  // if valuation non-trivial, then uniformizing parameter is in ideal
645  // so switch to residue field first and compute standard basis over the residue field
646  ring rShortcut = copyAndChangeCoefficientRing(r);
647  nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf);
648  int k = IDELEMS(inI);
649  ideal inIShortcut = idInit(k);
650  for (int i=0; i<k; i++)
651  inIShortcut->m[i] = p_PermPoly(inI->m[i],NULL,r,rShortcut,takingResidues,NULL,0);
652  ideal inJShortcut = gfanlib_kStd_wrapper(inIShortcut,rShortcut);
653 
654  // and lift the result back to the ring with valuation
655  nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf);
656  k = IDELEMS(inJShortcut);
657  ideal inJ = idInit(k+1);
658  inJ->m[0] = p_One(r);
659  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
660  p_SetCoeff(inJ->m[0],identity(uniformizingParameter,startingRing->cf,r->cf),r);
661  for (int i=0; i<k; i++)
662  inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,rShortcut,r,takingRepresentatives,NULL,0);
663 
664  id_Delete(&inJShortcut,rShortcut);
665  id_Delete(&inIShortcut,rShortcut);
666  rDelete(rShortcut);
667  return inJ;
668 }
ring copyAndChangeCoefficientRing(const ring r) const
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
int k
Definition: cfEzgcd.cc:93
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
const ring r
Definition: syzextra.cc:208
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)
Definition: p_polys.cc:3939
poly p_One(const ring r)
Definition: p_polys.cc:1313
bool isValuationTrivial() const
ideal gfanlib_kStd_wrapper(ideal I, ring r, tHomog h=testHomog)
Definition: std_wrapper.cc:5
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
number uniformizingParameter
uniformizing parameter in the valuation ring
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448

§ computeWitness()

ideal tropicalStrategy::computeWitness ( const ideal  inJ,
const ideal  inI,
const ideal  I,
const ring  r 
) const

suppose w a weight in maximal groebner cone of > suppose I (initially) reduced standard basis w.r.t.

and inI initial forms of its elements w.r.t. w

suppose inJ elements of initial ideal that are homogeneous w.r.t w returns J elements of ideal whose initial form w.r.t. w are inI in particular, if w lies also inthe maximal groebner cone of another ordering >' and inJ is a standard basis of the initial ideal w.r.t. >' then the returned J will be a standard baiss of the ideal w.r.t. >'

change ground ring into finite field and map the data into it

Compute a division with remainder over the finite field and map the result back to r

Compute the normal forms

Definition at line 556 of file tropicalStrategy.cc.

557 {
558  // if the valuation is trivial and the ring and ideal have not been extended,
559  // then it is sufficient to return the difference between the elements of inJ
560  // and their normal forms with respect to I and r
561  if (isValuationTrivial())
562  return witness(inJ,I,r);
563  // if the valuation is non-trivial and the ring and ideal have been extended,
564  // then we can make a shortcut through the residue field
565  else
566  {
567  assume(IDELEMS(inI)==IDELEMS(I));
569  assume(uni>=0);
570  /**
571  * change ground ring into finite field
572  * and map the data into it
573  */
574  ring rShortcut = copyAndChangeCoefficientRing(r);
575 
576  int k = IDELEMS(inJ);
577  int l = IDELEMS(I);
578  ideal inJShortcut = idInit(k);
579  ideal inIShortcut = idInit(l);
580  nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf);
581  for (int i=0; i<k; i++)
582  inJShortcut->m[i] = p_PermPoly(inJ->m[i],NULL,r,rShortcut,takingResidues,NULL,0);
583  for (int j=0; j<l; j++)
584  inIShortcut->m[j] = p_PermPoly(inI->m[j],NULL,r,rShortcut,takingResidues,NULL,0);
585  id_Test(inJShortcut,rShortcut);
586  id_Test(inIShortcut,rShortcut);
587 
588  /**
589  * Compute a division with remainder over the finite field
590  * and map the result back to r
591  */
592  matrix QShortcut = divisionDiscardingRemainder(inJShortcut,inIShortcut,rShortcut);
593  matrix Q = mpNew(l,k);
594  nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf);
595  for (int ij=k*l-1; ij>=0; ij--)
596  Q->m[ij] = p_PermPoly(QShortcut->m[ij],NULL,rShortcut,r,takingRepresentatives,NULL,0);
597 
598  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
599  number p = identity(uniformizingParameter,startingRing->cf,r->cf);
600 
601  /**
602  * Compute the normal forms
603  */
604  ideal J = idInit(k);
605  for (int j=0; j<k; j++)
606  {
607  poly q0 = p_Copy(inJ->m[j],r);
608  for (int i=0; i<l; i++)
609  {
610  poly qij = p_Copy(MATELEM(Q,i+1,j+1),r);
611  poly inIi = p_Copy(inI->m[i],r);
612  q0 = p_Add_q(q0,p_Neg(p_Mult_q(qij,inIi,r),r),r);
613  }
614  q0 = p_Div_nn(q0,p,r);
615  poly q0g0 = p_Mult_q(q0,p_Copy(I->m[uni],r),r);
616  // q0 = NULL;
617  poly qigi = NULL;
618  for (int i=0; i<l; i++)
619  {
620  poly qij = p_Copy(MATELEM(Q,i+1,j+1),r);
621  // poly inIi = p_Copy(I->m[i],r);
622  poly Ii = p_Copy(I->m[i],r);
623  qigi = p_Add_q(qigi,p_Mult_q(qij,Ii,r),r);
624  }
625  J->m[j] = p_Add_q(q0g0,qigi,r);
626  }
627 
628  id_Delete(&inIShortcut,rShortcut);
629  id_Delete(&inJShortcut,rShortcut);
630  mp_Delete(&QShortcut,rShortcut);
631  rDelete(rShortcut);
632  mp_Delete(&Q,r);
633  n_Delete(&p,r->cf);
634  return J;
635  }
636 }
matrix divisionDiscardingRemainder(const poly f, const ideal G, const ring r)
Computes a division discarding remainder of f with respect to G.
Definition: witness.cc:9
int findPositionOfUniformizingBinomial(const ideal I, const ring r) const
ring copyAndChangeCoefficientRing(const ring r) const
return P p
Definition: myNF.cc:203
#define id_Test(A, lR)
Definition: simpleideals.h:80
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
poly p_Div_nn(poly p, const number n, const ring r)
Definition: p_polys.cc:1475
int k
Definition: cfEzgcd.cc:93
#define Q
Definition: sirandom.c:25
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:804
poly * m
Definition: matpol.h:19
const ring r
Definition: syzextra.cc:208
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)
Definition: p_polys.cc:3939
bool isValuationTrivial() const
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:403
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:785
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:48
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
number uniformizingParameter
uniformizing parameter in the valuation ring
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
#define NULL
Definition: omList.c:10
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.
Definition: witness.cc:34
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1013
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1020
int l
Definition: cfEzgcd.cc:94
#define MATELEM(mat, i, j)
Definition: matpol.h:29

§ copyAndChangeCoefficientRing()

ring tropicalStrategy::copyAndChangeCoefficientRing ( const ring  r) const
private

Definition at line 546 of file tropicalStrategy.cc.

547 {
548  ring rShortcut = rCopy0(r);
549  nKillChar(rShortcut->cf);
550  rShortcut->cf = nCopyCoeff(shortcutRing->cf);
551  rComplete(rShortcut);
552  rTest(rShortcut);
553  return rShortcut;
554 }
const ring r
Definition: syzextra.cc:208
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...
Definition: ring.cc:3435
ring shortcutRing
polynomial ring over the residue field
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1321
#define rTest(r)
Definition: ring.h:775
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:433
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490

§ copyAndChangeOrderingLS()

ring tropicalStrategy::copyAndChangeOrderingLS ( const ring  r,
const gfan::ZVector &  w,
const gfan::ZVector &  v 
) const
private

Definition at line 738 of file tropicalStrategy.cc.

739 {
740  // copy shortcutRing and change to desired ordering
741  bool ok;
742  ring s = rCopy0(r);
743  int n = rVar(s);
744  deleteOrdering(s);
745  s->order = (int*) omAlloc0(5*sizeof(int));
746  s->block0 = (int*) omAlloc0(5*sizeof(int));
747  s->block1 = (int*) omAlloc0(5*sizeof(int));
748  s->wvhdl = (int**) omAlloc0(5*sizeof(int**));
749  s->order[0] = ringorder_a;
750  s->block0[0] = 1;
751  s->block1[0] = n;
752  s->wvhdl[0] = ZVectorToIntStar(w,ok);
753  s->order[1] = ringorder_a;
754  s->block0[1] = 1;
755  s->block1[1] = n;
756  s->wvhdl[1] = ZVectorToIntStar(v,ok);
757  s->order[2] = ringorder_lp;
758  s->block0[2] = 1;
759  s->block1[2] = n;
760  s->order[3] = ringorder_C;
761  rComplete(s);
762  rTest(s);
763 
764  return s;
765 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
int * ZVectorToIntStar(const gfan::ZVector &v, bool &overflow)
const ring r
Definition: syzextra.cc:208
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...
Definition: ring.cc:3435
static void deleteOrdering(ring r)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1321
#define rTest(r)
Definition: ring.h:775
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
const CanonicalForm & w
Definition: facAbsFact.cc:55
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ copyAndChangeOrderingWP()

ring tropicalStrategy::copyAndChangeOrderingWP ( const ring  r,
const gfan::ZVector &  w,
const gfan::ZVector &  v 
) const
private

Definition at line 707 of file tropicalStrategy.cc.

708 {
709  // copy shortcutRing and change to desired ordering
710  bool ok;
711  ring s = rCopy0(r);
712  int n = rVar(s);
713  deleteOrdering(s);
714  gfan::ZVector wAdjusted = adjustWeightForHomogeneity(w);
715  gfan::ZVector vAdjusted = adjustWeightUnderHomogeneity(v,wAdjusted);
716  s->order = (int*) omAlloc0(5*sizeof(int));
717  s->block0 = (int*) omAlloc0(5*sizeof(int));
718  s->block1 = (int*) omAlloc0(5*sizeof(int));
719  s->wvhdl = (int**) omAlloc0(5*sizeof(int**));
720  s->order[0] = ringorder_a;
721  s->block0[0] = 1;
722  s->block1[0] = n;
723  s->wvhdl[0] = ZVectorToIntStar(wAdjusted,ok);
724  s->order[1] = ringorder_a;
725  s->block0[1] = 1;
726  s->block1[1] = n;
727  s->wvhdl[1] = ZVectorToIntStar(vAdjusted,ok);
728  s->order[2] = ringorder_lp;
729  s->block0[2] = 1;
730  s->block1[2] = n;
731  s->order[3] = ringorder_C;
732  rComplete(s);
733  rTest(s);
734 
735  return s;
736 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
int * ZVectorToIntStar(const gfan::ZVector &v, bool &overflow)
const ring r
Definition: syzextra.cc:208
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...
Definition: ring.cc:3435
static void deleteOrdering(ring r)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1321
#define rTest(r)
Definition: ring.h:775
gfan::ZVector adjustWeightForHomogeneity(gfan::ZVector w) const
Given weight w, returns a strictly positive weight u such that an ideal satisfying the valuation-sepc...
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
const CanonicalForm & w
Definition: facAbsFact.cc:55
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...
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ debugStrategy()

tropicalStrategy tropicalStrategy::debugStrategy ( const ideal  startIdeal,
number  unifParameter,
ring  startRing 
)
static

Definition at line 910 of file tropicalStrategy.cc.

911 {
912  tropicalStrategy debug;
913  debug.originalRing = rCopy(startRing);
914  debug.originalIdeal = id_Copy(startIdeal,startRing);
915  debug.startingRing = rCopy(startRing);
916  debug.startingIdeal = id_Copy(startIdeal,startRing);
917  debug.uniformizingParameter = n_Copy(unifParameter,startRing->cf);
918 
919  debug.shortcutRing = rCopy0(startRing);
920  nKillChar(debug.shortcutRing->cf);
921  debug.shortcutRing->cf = nInitChar(n_Zp,(void*)(long)IsPrime(n_Int(unifParameter,startRing->cf)));
922  rComplete(debug.shortcutRing);
923  rTest(debug.shortcutRing);
924 
925  debug.onlyLowerHalfSpace = true;
929 
930  return debug;
931 }
ideal id_Copy(ideal h1, const ring r)
copy an ideal
bool ppreduceInitially(poly *hStar, const poly g, const ring r)
reduces h initially with respect to g, returns false if h was initially reduced in the first place...
{p < 2^31}
Definition: coeffs.h:30
bool onlyLowerHalfSpace
true if valuation non-trivial, false otherwise
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ...
Definition: coeffs.h:551
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...
Definition: ring.cc:3435
ring shortcutRing
polynomial ring over the residue field
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1321
#define rTest(r)
Definition: ring.h:775
int IsPrime(int p)
Definition: prime.cc:61
gfan::ZVector(* weightAdjustingAlgorithm2)(const gfan::ZVector &v, const gfan::ZVector &w)
A function such that: Given strictly positive weight w and weight v, returns a strictly positive weig...
gfan::ZVector valued_adjustWeightUnderHomogeneity(const gfan::ZVector &e, const gfan::ZVector &w)
number uniformizingParameter
uniformizing parameter in the valuation ring
ring rCopy(ring r)
Definition: ring.cc:1619
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
bool(* extraReductionAlgorithm)(ideal I, ring r, number p)
A function that reduces the generators of an ideal I so that the inequalities and equations of the Gr...
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:455
gfan::ZVector valued_adjustWeightForHomogeneity(const gfan::ZVector &w)
ring originalRing
polynomial ring over a field with valuation
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
gfan::ZVector(* weightAdjustingAlgorithm1)(const gfan::ZVector &w)
A function such that: Given weight w, returns a strictly positive weight u such that an ideal satisfy...
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:329

§ findPositionOfUniformizingBinomial()

int tropicalStrategy::findPositionOfUniformizingBinomial ( const ideal  I,
const ring  r 
) const
private

Definition at line 842 of file tropicalStrategy.cc.

843 {
845 
846  // if the valuation is non-trivial then checks if the first generator is p-t
847  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
848  poly p = p_One(r);
849  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
850  poly t = p_One(r);
851  p_SetExp(t,1,1,r);
852  p_Setm(t,r);
853  poly pt = p_Add_q(p,p_Neg(t,r),r);
854 
855  for (int i=0; i<IDELEMS(I); i++)
856  {
857  if (p_EqualPolys(I->m[i],pt,r))
858  {
859  p_Delete(&pt,r);
860  return i;
861  }
862  }
863  p_Delete(&pt,r);
864  return -1;
865 }
return P p
Definition: myNF.cc:203
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1313
#define assume(x)
Definition: mod2.h:403
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4321
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
number uniformizingParameter
uniformizing parameter in the valuation ring
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:483
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
bool isValuationNonTrivial() const
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1013
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877

§ getExpectedAmbientDimension()

int tropicalStrategy::getExpectedAmbientDimension ( ) const
inline

Definition at line 197 of file tropicalStrategy.h.

198  {
199  return rVar(startingRing);
200  }
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t

§ getExpectedDimension()

int tropicalStrategy::getExpectedDimension ( ) const
inline

returns the expected Dimension of the polyhedral output

Definition at line 205 of file tropicalStrategy.h.

206  {
207  return expectedDimension;
208  }
int expectedDimension
the expected Dimension of the polyhedral output, i.e.

§ getHomogeneitySpace()

gfan::ZCone tropicalStrategy::getHomogeneitySpace ( ) const
inline

returns the homogeneity space of the preimage ideal

Definition at line 228 of file tropicalStrategy.h.

229  {
230  return linealitySpace;
231  }
gfan::ZCone linealitySpace
the homogeneity space of the Grobner fan

§ getOriginalIdeal()

ideal tropicalStrategy::getOriginalIdeal ( ) const
inline

returns the input ideal over the field with valuation

Definition at line 173 of file tropicalStrategy.h.

174  {
176  return originalIdeal;
177  }
#define id_Test(A, lR)
Definition: simpleideals.h:80
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
ring originalRing
polynomial ring over a field with valuation

§ getOriginalRing()

ring tropicalStrategy::getOriginalRing ( ) const
inline

returns the polynomial ring over the field with valuation

Definition at line 164 of file tropicalStrategy.h.

165  {
167  return originalRing;
168  }
#define rTest(r)
Definition: ring.h:775
ring originalRing
polynomial ring over a field with valuation

§ getShortcutRing()

ring tropicalStrategy::getShortcutRing ( ) const
inline

Definition at line 219 of file tropicalStrategy.h.

220  {
222  return shortcutRing;
223  }
ring shortcutRing
polynomial ring over the residue field
#define rTest(r)
Definition: ring.h:775

§ getShortcutRingPrependingWeight()

ring tropicalStrategy::getShortcutRingPrependingWeight ( const ring  r,
const gfan::ZVector &  w 
) const

If valuation trivial, returns a copy of r with a positive weight prepended, such that any ideal homogeneous with respect to w is homogeneous with respect to that weight.

If valuation non-trivial, changes the coefficient ring to the residue field.

Definition at line 437 of file tropicalStrategy.cc.

438 {
439  ring rShortcut = rCopy0(r);
440 
441  // save old ordering
442  int* order = rShortcut->order;
443  int* block0 = rShortcut->block0;
444  int* block1 = rShortcut->block1;
445  int** wvhdl = rShortcut->wvhdl;
446 
447  // adjust weight and create new ordering
448  gfan::ZVector w = adjustWeightForHomogeneity(v);
449  int h = rBlocks(r); int n = rVar(r);
450  rShortcut->order = (int*) omAlloc0((h+1)*sizeof(int));
451  rShortcut->block0 = (int*) omAlloc0((h+1)*sizeof(int));
452  rShortcut->block1 = (int*) omAlloc0((h+1)*sizeof(int));
453  rShortcut->wvhdl = (int**) omAlloc0((h+1)*sizeof(int*));
454  rShortcut->order[0] = ringorder_a;
455  rShortcut->block0[0] = 1;
456  rShortcut->block1[0] = n;
457  bool overflow;
458  rShortcut->wvhdl[0] = ZVectorToIntStar(w,overflow);
459  for (int i=1; i<=h; i++)
460  {
461  rShortcut->order[i] = order[i-1];
462  rShortcut->block0[i] = block0[i-1];
463  rShortcut->block1[i] = block1[i-1];
464  rShortcut->wvhdl[i] = wvhdl[i-1];
465  }
466 
467  // if valuation non-trivial, change coefficient ring to residue field
468  if (isValuationNonTrivial())
469  {
470  nKillChar(rShortcut->cf);
471  rShortcut->cf = nCopyCoeff(shortcutRing->cf);
472  }
473  rComplete(rShortcut);
474  rTest(rShortcut);
475 
476  // delete old ordering
477  omFree(order);
478  omFree(block0);
479  omFree(block1);
480  omFree(wvhdl);
481 
482  return rShortcut;
483 }
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
int * ZVectorToIntStar(const gfan::ZVector &v, bool &overflow)
static int rBlocks(ring r)
Definition: ring.h:556
const ring r
Definition: syzextra.cc:208
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...
Definition: ring.cc:3435
ring shortcutRing
polynomial ring over the residue field
#define omFree(addr)
Definition: omAllocDecl.h:261
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1321
#define rTest(r)
Definition: ring.h:775
gfan::ZVector adjustWeightForHomogeneity(gfan::ZVector w) const
Given weight w, returns a strictly positive weight u such that an ideal satisfying the valuation-sepc...
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:433
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
bool isValuationNonTrivial() const
const CanonicalForm & w
Definition: facAbsFact.cc:55
static Poly * h
Definition: janet.cc:978
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
#define omAlloc0(size)
Definition: omAllocDecl.h:211

§ getStartingIdeal()

ideal tropicalStrategy::getStartingIdeal ( ) const
inline

returns the input ideal

Definition at line 191 of file tropicalStrategy.h.

192  {
194  return startingIdeal;
195  }
#define id_Test(A, lR)
Definition: simpleideals.h:80
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t

§ getStartingRing()

ring tropicalStrategy::getStartingRing ( ) const
inline

returns the polynomial ring over the valuation ring

Definition at line 182 of file tropicalStrategy.h.

183  {
185  return startingRing;
186  }
#define rTest(r)
Definition: ring.h:775
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t

§ getUniformizingParameter()

number tropicalStrategy::getUniformizingParameter ( ) const
inline

returns the uniformizing parameter in the valuation ring

Definition at line 213 of file tropicalStrategy.h.

214  {
216  return uniformizingParameter;
217  }
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:742
number uniformizingParameter
uniformizing parameter in the valuation ring
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t

§ homogeneitySpaceContains()

bool tropicalStrategy::homogeneitySpaceContains ( const gfan::ZVector &  v) const
inline

returns true, if v is contained in the homogeneity space; false otherwise

Definition at line 236 of file tropicalStrategy.h.

237  {
238  return linealitySpace.contains(v);
239  }
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
gfan::ZCone linealitySpace
the homogeneity space of the Grobner fan

§ isValuationNonTrivial()

bool tropicalStrategy::isValuationNonTrivial ( ) const
inline

Definition at line 155 of file tropicalStrategy.h.

156  {
157  bool b = (uniformizingParameter!=NULL);
158  return b;
159  }
number uniformizingParameter
uniformizing parameter in the valuation ring
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213

§ isValuationTrivial()

bool tropicalStrategy::isValuationTrivial ( ) const
inline

Definition at line 150 of file tropicalStrategy.h.

151  {
152  bool b = (uniformizingParameter==NULL);
153  return b;
154  }
number uniformizingParameter
uniformizing parameter in the valuation ring
#define NULL
Definition: omList.c:10
const poly b
Definition: syzextra.cc:213

§ negateWeight()

gfan::ZVector tropicalStrategy::negateWeight ( const gfan::ZVector &  w) const
inline

Definition at line 269 of file tropicalStrategy.h.

270  {
271  gfan::ZVector wNeg(w.size());
272 
273  if (this->isValuationNonTrivial())
274  {
275  wNeg[0]=w[0];
276  for (unsigned i=1; i<w.size(); i++)
277  wNeg[i]=w[i];
278  }
279  else
280  wNeg = -w;
281 
282  return wNeg;
283  }
int i
Definition: cfEzgcd.cc:123
bool isValuationNonTrivial() const
const CanonicalForm & w
Definition: facAbsFact.cc:55

§ operator=()

tropicalStrategy & tropicalStrategy::operator= ( const tropicalStrategy currentStrategy)

assignment operator

Definition at line 354 of file tropicalStrategy.cc.

355 {
356  originalRing = rCopy(currentStrategy.getOriginalRing());
357  originalIdeal = id_Copy(currentStrategy.getOriginalIdeal(),currentStrategy.getOriginalRing());
358  expectedDimension = currentStrategy.getExpectedDimension();
359  startingRing = rCopy(currentStrategy.getStartingRing());
360  startingIdeal = id_Copy(currentStrategy.getStartingIdeal(),currentStrategy.getStartingRing());
362  shortcutRing = rCopy(currentStrategy.getShortcutRing());
363  onlyLowerHalfSpace = currentStrategy.restrictToLowerHalfSpace();
367 
369  if (originalIdeal) id_Test(originalIdeal,originalRing);
371  if (startingIdeal) id_Test(startingIdeal,startingRing);
372  if (uniformizingParameter) n_Test(uniformizingParameter,startingRing->cf);
373  if (shortcutRing) rTest(shortcutRing);
374 
375  return *this;
376 }
ring getShortcutRing() const
ring getOriginalRing() const
returns the polynomial ring over the field with valuation
ideal id_Copy(ideal h1, const ring r)
copy an ideal
#define id_Test(A, lR)
Definition: simpleideals.h:80
ring getStartingRing() const
returns the polynomial ring over the valuation ring
bool onlyLowerHalfSpace
true if valuation non-trivial, false otherwise
number getUniformizingParameter() const
returns the uniformizing parameter in the valuation ring
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
ring shortcutRing
polynomial ring over the residue field
ideal getStartingIdeal() const
returns the input ideal
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:742
#define rTest(r)
Definition: ring.h:775
bool restrictToLowerHalfSpace() const
returns true, if valuation non-trivial, false otherwise
gfan::ZVector(* weightAdjustingAlgorithm2)(const gfan::ZVector &v, const gfan::ZVector &w)
A function such that: Given strictly positive weight w and weight v, returns a strictly positive weig...
number uniformizingParameter
uniformizing parameter in the valuation ring
ring rCopy(ring r)
Definition: ring.cc:1619
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
bool(* extraReductionAlgorithm)(ideal I, ring r, number p)
A function that reduces the generators of an ideal I so that the inequalities and equations of the Gr...
ideal getOriginalIdeal() const
returns the input ideal over the field with valuation
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:455
int getExpectedDimension() const
returns the expected Dimension of the polyhedral output
ring originalRing
polynomial ring over a field with valuation
int expectedDimension
the expected Dimension of the polyhedral output, i.e.
gfan::ZVector(* weightAdjustingAlgorithm1)(const gfan::ZVector &w)
A function such that: Given weight w, returns a strictly positive weight u such that an ideal satisfy...

§ pReduce()

void tropicalStrategy::pReduce ( ideal  I,
const ring  r 
) const

Definition at line 421 of file tropicalStrategy.cc.

422 {
423  rTest(r);
424  id_Test(I,r);
425 
426  if (isValuationTrivial())
427  return;
428 
429  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
430  number p = identity(uniformizingParameter,startingRing->cf,r->cf);
431  ::pReduce(I,p,r);
432  n_Delete(&p,r->cf);
433 
434  return;
435 }
return P p
Definition: myNF.cc:203
#define id_Test(A, lR)
Definition: simpleideals.h:80
const ring r
Definition: syzextra.cc:208
bool isValuationTrivial() const
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
#define rTest(r)
Definition: ring.h:775
void pReduce(ideal I, const ring r) 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
Definition: coeffs.h:725
number uniformizingParameter
uniformizing parameter in the valuation ring
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459

§ putUniformizingBinomialInFront()

void tropicalStrategy::putUniformizingBinomialInFront ( ideal  I,
const ring  r,
const number  q 
) const
private

Definition at line 378 of file tropicalStrategy.cc.

379 {
380  poly p = p_One(r);
381  p_SetCoeff(p,q,r);
382  poly t = p_One(r);
383  p_SetExp(t,1,1,r);
384  p_Setm(t,r);
385  poly pt = p_Add_q(p,p_Neg(t,r),r);
386 
387  int k = IDELEMS(I);
388  int l;
389  for (l=0; l<k; l++)
390  {
391  if (p_EqualPolys(I->m[l],pt,r))
392  break;
393  }
394  p_Delete(&pt,r);
395 
396  if (l>1)
397  {
398  pt = I->m[l];
399  for (int i=l; i>0; i--)
400  I->m[l] = I->m[l-1];
401  I->m[0] = pt;
402  pt = NULL;
403  }
404  return;
405 }
return P p
Definition: myNF.cc:203
int k
Definition: cfEzgcd.cc:93
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1313
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4321
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent : VarOffset encodes the position in p->exp
Definition: p_polys.h:483
#define NULL
Definition: omList.c:10
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:228
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1013
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:877
int l
Definition: cfEzgcd.cc:94

§ reduce()

bool tropicalStrategy::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 be read off.

Definition at line 407 of file tropicalStrategy.cc.

408 {
409  rTest(r);
410  id_Test(I,r);
411 
412  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
413  number p = identity(uniformizingParameter,startingRing->cf,r->cf);
414  bool b = extraReductionAlgorithm(I,r,p);
415  // putUniformizingBinomialInFront(I,r,p);
416  n_Delete(&p,r->cf);
417 
418  return b;
419 }
return P p
Definition: myNF.cc:203
#define id_Test(A, lR)
Definition: simpleideals.h:80
const ring r
Definition: syzextra.cc:208
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
#define rTest(r)
Definition: ring.h:775
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
number uniformizingParameter
uniformizing parameter in the valuation ring
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
bool(* extraReductionAlgorithm)(ideal I, ring r, number p)
A function that reduces the generators of an ideal I so that the inequalities and equations of the Gr...
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
const poly b
Definition: syzextra.cc:213

§ restrictToLowerHalfSpace()

bool tropicalStrategy::restrictToLowerHalfSpace ( ) const
inline

returns true, if valuation non-trivial, false otherwise

Definition at line 244 of file tropicalStrategy.h.

245  {
246  return onlyLowerHalfSpace;
247  }
bool onlyLowerHalfSpace
true if valuation non-trivial, false otherwise

Field Documentation

§ expectedDimension

int tropicalStrategy::expectedDimension
private

the expected Dimension of the polyhedral output, i.e.

the dimension of the ideal if valuation trivial or the dimension of the ideal plus one if valuation non-trivial (as the output is supposed to be intersected with a hyperplane)

Definition at line 54 of file tropicalStrategy.h.

§ extraReductionAlgorithm

bool(* tropicalStrategy::extraReductionAlgorithm) (ideal I, ring r, number p)
private

A function that reduces the generators of an ideal I so that the inequalities and equations of the Groebner cone can be read off.

Definition at line 99 of file tropicalStrategy.h.

§ linealitySpace

gfan::ZCone tropicalStrategy::linealitySpace
private

the homogeneity space of the Grobner fan

Definition at line 58 of file tropicalStrategy.h.

§ onlyLowerHalfSpace

bool tropicalStrategy::onlyLowerHalfSpace
private

true if valuation non-trivial, false otherwise

Definition at line 79 of file tropicalStrategy.h.

§ originalIdeal

ideal tropicalStrategy::originalIdeal
private

input ideal, assumed to be a homogeneous prime ideal

Definition at line 47 of file tropicalStrategy.h.

§ originalRing

ring tropicalStrategy::originalRing
private

polynomial ring over a field with valuation

Definition at line 43 of file tropicalStrategy.h.

§ shortcutRing

ring tropicalStrategy::shortcutRing
private

polynomial ring over the residue field

Definition at line 74 of file tropicalStrategy.h.

§ startingIdeal

ideal tropicalStrategy::startingIdeal
private

preimage of the input ideal under the map that sends t to the uniformizing parameter

Definition at line 66 of file tropicalStrategy.h.

§ startingRing

ring tropicalStrategy::startingRing
private

polynomial ring over the valuation ring extended by one extra variable t

Definition at line 62 of file tropicalStrategy.h.

§ uniformizingParameter

number tropicalStrategy::uniformizingParameter
private

uniformizing parameter in the valuation ring

Definition at line 70 of file tropicalStrategy.h.

§ weightAdjustingAlgorithm1

gfan::ZVector(* tropicalStrategy::weightAdjustingAlgorithm1) (const gfan::ZVector &w)
private

A function such that: Given weight w, returns a strictly positive weight u such that an ideal satisfying the valuation-sepcific homogeneity conditions is weighted homogeneous with respect to w if and only if it is homogeneous with respect to u.

Definition at line 87 of file tropicalStrategy.h.

§ weightAdjustingAlgorithm2

gfan::ZVector(* tropicalStrategy::weightAdjustingAlgorithm2) (const gfan::ZVector &v, const gfan::ZVector &w)
private

A function such that: Given strictly positive weight w and weight v, returns a strictly positive weight u such that on an ideal that is weighted homogeneous with respect to w the weights u and v coincide.

Definition at line 94 of file tropicalStrategy.h.


The documentation for this class was generated from the following files: