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::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 124 of file tropicalStrategy.cc.

126  :
127  originalRing(rCopy(r)),
128  originalIdeal(id_Copy(I,r)),
135  onlyLowerHalfSpace(false),
139 {
141  if (!completelyHomogeneous)
142  {
145  }
146  if (!completeSpace)
147  onlyLowerHalfSpace = true;
148 }
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:405
int dim(ideal I, ring r)
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:461
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:455
number uniformizingParameter
uniformizing parameter in the valuation ring
ring rCopy(ring r)
Definition: ring.cc:1618
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:434
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::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 258 of file tropicalStrategy.cc.

258  :
259  originalRing(rCopy(s)),
260  originalIdeal(id_Copy(J,s)),
262  linealitySpace(gfan::ZCone()), // to come, see below
263  startingRing(NULL), // to come, see below
264  startingIdeal(NULL), // to come, see below
265  uniformizingParameter(NULL), // to come, see below
266  shortcutRing(NULL), // to come, see below
267  onlyLowerHalfSpace(true),
271 {
272  /* assume that the ground field of the originalRing is Q */
273  assume(rField_is_Q(s));
274 
275  /* replace Q with Z for the startingRing
276  * and add an extra variable for tracking the uniformizing parameter */
278 
279  /* map the uniformizing parameter into the new coefficient domain */
280  nMapFunc nMap = n_SetMap(originalRing->cf,startingRing->cf);
282 
283  /* map the input ideal into the new polynomial ring */
286 
288 
289  /* construct the shorcut ring */
291  nKillChar(shortcutRing->cf);
295 }
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
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 ...
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:548
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:3436
ring shortcutRing
polynomial ring over the residue field
#define assume(x)
Definition: mod2.h:405
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1318
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
#define rTest(r)
Definition: ring.h:781
int dim(ideal I, ring r)
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:461
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:720
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:1618
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...
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:488
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:327
tropicalStrategy::tropicalStrategy ( const tropicalStrategy currentStrategy)

copy constructor

Definition at line 297 of file tropicalStrategy.cc.

297  :
298  originalRing(rCopy(currentStrategy.getOriginalRing())),
299  originalIdeal(id_Copy(currentStrategy.getOriginalIdeal(),currentStrategy.getOriginalRing())),
300  expectedDimension(currentStrategy.getExpectedDimension()),
301  linealitySpace(currentStrategy.getHomogeneitySpace()),
302  startingRing(rCopy(currentStrategy.getStartingRing())),
303  startingIdeal(id_Copy(currentStrategy.getStartingIdeal(),currentStrategy.getStartingRing())),
306  onlyLowerHalfSpace(currentStrategy.restrictToLowerHalfSpace()),
310 {
315  if (currentStrategy.getUniformizingParameter())
316  {
319  }
320  if (currentStrategy.getShortcutRing())
321  {
322  shortcutRing = rCopy(currentStrategy.getShortcutRing());
324  }
325 }
ring getOriginalRing() const
returns the polynomial ring over the field with valuation
ideal getOriginalIdeal() const
returns the input ideal 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
bool onlyLowerHalfSpace
true if valuation non-trivial, false otherwise
ring getStartingRing() const
returns the polynomial ring over the valuation ring
int getExpectedDimension() const
returns the expected Dimension of the polyhedral output
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
number getUniformizingParameter() const
returns the uniformizing parameter in the valuation ring
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
ring getShortcutRing() const
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:923
#define rTest(r)
Definition: ring.h:781
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::ZCone getHomogeneitySpace() const
returns the homogeneity space of the preimage ideal
bool restrictToLowerHalfSpace() const
returns true, if valuation non-trivial, false otherwise
number uniformizingParameter
uniformizing parameter in the valuation ring
ring rCopy(ring r)
Definition: ring.cc:1618
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 FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:452
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 ( )

Definition at line 882 of file tropicalStrategy.cc.

882  :
886  linealitySpace(gfan::ZCone()),
891  onlyLowerHalfSpace(false)
892 {
896 }
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 ( )

destructor

Definition at line 327 of file tropicalStrategy.cc.

328 {
335 
342 }
#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:923
#define rTest(r)
Definition: ring.h:781
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:456
ring originalRing
polynomial ring over a field with valuation

Member Function Documentation

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...
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
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 802 of file tropicalStrategy.cc.

803 {
804  // if the valuation is trivial,
805  // then there is no special condition the first generator has to fullfill
806  if (isValuationTrivial())
807  return true;
808 
809  // if the valuation is non-trivial then checks if the first generator is p-t
810  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
811  poly p = p_One(r);
812  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
813  poly t = p_One(r);
814  p_SetExp(t,1,1,r);
815  p_Setm(t,r);
816  poly pt = p_Add_q(p,p_Neg(t,r),r);
817 
818  for (int i=0; i<idSize(I); i++)
819  {
820  if (p_EqualPolys(I->m[i],pt,r))
821  {
822  p_Delete(&pt,r);
823  return true;
824  }
825  }
826  p_Delete(&pt,r);
827  return false;
828 }
return P p
Definition: myNF.cc:203
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1318
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
int i
Definition: cfEzgcd.cc:123
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:720
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4289
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
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:484
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:436
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
bool isValuationTrivial() const
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 855 of file tropicalStrategy.cc.

856 {
857  // if the valuation is trivial,
858  // then there is no special condition the first generator has to fullfill
859  if (isValuationTrivial())
860  return true;
861 
862  // if the valuation is non-trivial then checks if the first generator is p
863  if (inI->m[0]==NULL)
864  return false;
865  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
866  poly p = p_One(r);
867  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
868 
869  for (int i=0; i<idSize(inI); i++)
870  {
871  if (p_EqualPolys(inI->m[i],p,r))
872  {
873  p_Delete(&p,r);
874  return true;
875  }
876  }
877  p_Delete(&p,r);
878  return false;
879 }
return P p
Definition: myNF.cc:203
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1318
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
int i
Definition: cfEzgcd.cc:123
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:720
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4289
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
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
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
polyrec * poly
Definition: hilb.h:10
bool isValuationTrivial() const
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 475 of file tropicalStrategy.cc.

476 {
477  // quick check whether I already contains an ideal
478  int k = idSize(I);
479  for (int i=0; i<k; i++)
480  {
481  poly g = I->m[i];
482  if (pNext(g)==NULL && (isValuationTrivial() || n_IsOne(p_GetCoeff(g,r),r->cf)))
483  return std::pair<poly,int>(g,i);
484  }
485 
486  ring rShortcut;
487  ideal inIShortcut;
488  if (w.size()>0)
489  {
490  // if needed, prepend extra weight for homogeneity
491  // switch to residue field if valuation is non trivial
492  rShortcut = getShortcutRingPrependingWeight(r,w);
493 
494  // compute the initial ideal and map it into the constructed ring
495  // if switched to residue field, remove possibly 0 elements
496  ideal inI = initial(I,r,w);
497  inIShortcut = idInit(k);
498  nMapFunc intoShortcut = n_SetMap(r->cf,rShortcut->cf);
499  for (int i=0; i<k; i++)
500  inIShortcut->m[i] = p_PermPoly(inI->m[i],NULL,r,rShortcut,intoShortcut,NULL,0);
501  if (isValuationNonTrivial())
502  idSkipZeroes(inIShortcut);
503  id_Delete(&inI,r);
504  }
505  else
506  {
507  rShortcut = r;
508  inIShortcut = I;
509  }
510 
511  // check initial ideal for monomial and
512  // if it exsists, return a copy of the monomial in the input ring
513  poly p = checkForMonomialViaSuddenSaturation(inIShortcut,rShortcut);
514  poly monomial = NULL;
515  if (p!=NULL)
516  {
517  monomial=p_One(r);
518  for (int i=1; i<=rVar(r); i++)
519  p_SetExp(monomial,i,p_GetExp(p,i,rShortcut),r);
520  p_Setm(monomial,r);
521  p_Delete(&p,rShortcut);
522  }
523 
524 
525  if (w.size()>0)
526  {
527  // if needed, cleanup
528  id_Delete(&inIShortcut,rShortcut);
529  rDelete(rShortcut);
530  }
531  return std::pair<poly,int>(monomial,-1);
532 }
bool isValuationNonTrivial() const
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:469
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
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_One(const ring r)
Definition: p_polys.cc:1318
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:465
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
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...
poly checkForMonomialViaSuddenSaturation(const ideal I, const ring r)
int i
Definition: cfEzgcd.cc:123
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:720
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:850
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar)
Definition: p_polys.cc:3926
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:484
#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:436
#define p_GetCoeff(p, r)
Definition: monomials.h:57
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
polyrec * poly
Definition: hilb.h:10
bool isValuationTrivial() const
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 755 of file tropicalStrategy.cc.

758 {
759  assume(isValuationTrivial() || interiorPoint[0].sign()<0);
761 
762  // get a generating system of the initial ideal
763  // and compute a standard basis with respect to adjacent ordering
764  ideal inIr = initial(Ir,r,interiorPoint);
765  ring sAdjusted = copyAndChangeOrderingWP(r,interiorPoint,facetNormal);
766  nMapFunc identity = n_SetMap(r->cf,sAdjusted->cf);
767  int k = idSize(Ir);
768  ideal inIsAdjusted = idInit(k);
769  for (int i=0; i<k; i++)
770  inIsAdjusted->m[i] = p_PermPoly(inIr->m[i],NULL,r,sAdjusted,identity,NULL,0);
771  ideal inJsAdjusted = computeStdOfInitialIdeal(inIsAdjusted,sAdjusted);
772 
773  // find witnesses of the new standard basis elements of the initial ideal
774  // with the help of the old standard basis of the ideal
775  k = idSize(inJsAdjusted);
776  ideal inJr = idInit(k);
777  identity = n_SetMap(sAdjusted->cf,r->cf);
778  for (int i=0; i<k; i++)
779  inJr->m[i] = p_PermPoly(inJsAdjusted->m[i],NULL,sAdjusted,r,identity,NULL,0);
780 
781  ideal Jr = computeWitness(inJr,inIr,Ir,r);
782  ring s = copyAndChangeOrderingLS(r,interiorPoint,facetNormal);
783  identity = n_SetMap(r->cf,s->cf);
784  ideal Js = idInit(k);
785  for (int i=0; i<k; i++)
786  Js->m[i] = p_PermPoly(Jr->m[i],NULL,r,s,identity,NULL,0);
787 
788  // this->reduce(Jr,r);
789  // cleanup
790  id_Delete(&inIsAdjusted,sAdjusted);
791  id_Delete(&inJsAdjusted,sAdjusted);
792  rDelete(sAdjusted);
793  id_Delete(&inIr,r);
794  id_Delete(&Jr,r);
795  id_Delete(&inJr,r);
796 
798  return std::make_pair(Js,s);
799 }
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...
bool isOrderingLocalInT(const ring r)
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
ideal computeStdOfInitialIdeal(const ideal inI, const ring r) const
given generators of the initial ideal, computes its standard basis
#define assume(x)
Definition: mod2.h:405
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
ring copyAndChangeOrderingWP(const ring r, const gfan::ZVector &w, const gfan::ZVector &v) const
int i
Definition: cfEzgcd.cc:123
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:720
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar)
Definition: p_polys.cc:3926
#define NULL
Definition: omList.c:10
ring copyAndChangeOrderingLS(const ring r, const gfan::ZVector &w, const gfan::ZVector &v) const
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
bool checkForUniformizingBinomial(const ideal I, const ring r) const
if valuation non-trivial, checks whether the generating system contains p-t otherwise returns true ...
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
int sign(const CanonicalForm &a)
bool isValuationTrivial() const
ideal tropicalStrategy::computeLift ( const ideal  inJs,
const ring  s,
const ideal  inIr,
const ideal  Ir,
const ring  r 
) const

Definition at line 658 of file tropicalStrategy.cc.

659 {
660  int k = idSize(inJs);
661  ideal inJr = idInit(k);
662  nMapFunc identitysr = n_SetMap(s->cf,r->cf);
663  for (int i=0; i<k; i++)
664  inJr->m[i] = p_PermPoly(inJs->m[i],NULL,s,r,identitysr,NULL,0);
665 
666  ideal Jr = computeWitness(inJr,inIr,Ir,r);
667  nMapFunc identityrs = n_SetMap(r->cf,s->cf);
668  ideal Js = idInit(k);
669  for (int i=0; i<k; i++)
670  Js->m[i] = p_PermPoly(Jr->m[i],NULL,r,s,identityrs,NULL,0);
671  return Js;
672 }
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
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
int i
Definition: cfEzgcd.cc:123
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:720
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar)
Definition: p_polys.cc:3926
#define NULL
Definition: omList.c:10
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
ideal tropicalStrategy::computeStdOfInitialIdeal ( const ideal  inI,
const ring  r 
) const

given generators of the initial ideal, computes its standard basis

Definition at line 626 of file tropicalStrategy.cc.

627 {
628  // if valuation trivial, then compute std as usual
629  if (isValuationTrivial())
630  return gfanlib_kStd_wrapper(inI,r);
631 
632  // if valuation non-trivial, then uniformizing parameter is in ideal
633  // so switch to residue field first and compute standard basis over the residue field
634  ring rShortcut = copyAndChangeCoefficientRing(r);
635  nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf);
636  int k = idSize(inI);
637  ideal inIShortcut = idInit(k);
638  for (int i=0; i<k; i++)
639  inIShortcut->m[i] = p_PermPoly(inI->m[i],NULL,r,rShortcut,takingResidues,NULL,0);
640  ideal inJShortcut = gfanlib_kStd_wrapper(inIShortcut,rShortcut);
641 
642  // and lift the result back to the ring with valuation
643  nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf);
644  k = idSize(inJShortcut);
645  ideal inJ = idInit(k+1);
646  inJ->m[0] = p_One(r);
647  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
648  p_SetCoeff(inJ->m[0],identity(uniformizingParameter,startingRing->cf,r->cf),r);
649  for (int i=0; i<k; i++)
650  inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,rShortcut,r,takingRepresentatives,NULL,0);
651 
652  id_Delete(&inJShortcut,rShortcut);
653  id_Delete(&inIShortcut,rShortcut);
654  rDelete(rShortcut);
655  return inJ;
656 }
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:401
ring copyAndChangeCoefficientRing(const ring r) const
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1318
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:72
int i
Definition: cfEzgcd.cc:123
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:720
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar)
Definition: p_polys.cc:3926
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
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
bool isValuationTrivial() const
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 544 of file tropicalStrategy.cc.

545 {
546  // if the valuation is trivial and the ring and ideal have not been extended,
547  // then it is sufficient to return the difference between the elements of inJ
548  // and their normal forms with respect to I and r
549  if (isValuationTrivial())
550  return witness(inJ,I,r);
551  // if the valuation is non-trivial and the ring and ideal have been extended,
552  // then we can make a shortcut through the residue field
553  else
554  {
555  assume(idSize(inI)==idSize(I));
557  assume(uni>=0);
558  /**
559  * change ground ring into finite field
560  * and map the data into it
561  */
562  ring rShortcut = copyAndChangeCoefficientRing(r);
563 
564  int k = idSize(inJ);
565  int l = idSize(I);
566  ideal inJShortcut = idInit(k);
567  ideal inIShortcut = idInit(l);
568  nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf);
569  for (int i=0; i<k; i++)
570  inJShortcut->m[i] = p_PermPoly(inJ->m[i],NULL,r,rShortcut,takingResidues,NULL,0);
571  for (int j=0; j<l; j++)
572  inIShortcut->m[j] = p_PermPoly(inI->m[j],NULL,r,rShortcut,takingResidues,NULL,0);
573  id_Test(inJShortcut,rShortcut);
574  id_Test(inIShortcut,rShortcut);
575 
576  /**
577  * Compute a division with remainder over the finite field
578  * and map the result back to r
579  */
580  matrix QShortcut = divisionDiscardingRemainder(inJShortcut,inIShortcut,rShortcut);
581  matrix Q = mpNew(l,k);
582  nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf);
583  for (int ij=k*l-1; ij>=0; ij--)
584  Q->m[ij] = p_PermPoly(QShortcut->m[ij],NULL,rShortcut,r,takingRepresentatives,NULL,0);
585 
586  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
587  number p = identity(uniformizingParameter,startingRing->cf,r->cf);
588 
589  /**
590  * Compute the normal forms
591  */
592  ideal J = idInit(k);
593  for (int j=0; j<k; j++)
594  {
595  poly q0 = p_Copy(inJ->m[j],r);
596  for (int i=0; i<l; i++)
597  {
598  poly qij = p_Copy(MATELEM(Q,i+1,j+1),r);
599  poly inIi = p_Copy(inI->m[i],r);
600  q0 = p_Add_q(q0,p_Neg(p_Mult_q(qij,inIi,r),r),r);
601  }
602  q0 = p_Div_nn(q0,p,r);
603  poly q0g0 = p_Mult_q(q0,p_Copy(I->m[uni],r),r);
604  // q0 = NULL;
605  poly qigi = NULL;
606  for (int i=0; i<l; i++)
607  {
608  poly qij = p_Copy(MATELEM(Q,i+1,j+1),r);
609  // poly inIi = p_Copy(I->m[i],r);
610  poly Ii = p_Copy(I->m[i],r);
611  qigi = p_Add_q(qigi,p_Mult_q(qij,Ii,r),r);
612  }
613  J->m[j] = p_Add_q(q0g0,qigi,r);
614  }
615 
616  id_Delete(&inIShortcut,rShortcut);
617  id_Delete(&inJShortcut,rShortcut);
618  mp_Delete(&QShortcut,rShortcut);
619  rDelete(rShortcut);
620  mp_Delete(&Q,r);
621  n_Delete(&p,r->cf);
622  return J;
623  }
624 }
int findPositionOfUniformizingBinomial(const ideal I, const ring r) const
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
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:1480
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:811
ring copyAndChangeCoefficientRing(const ring r) const
poly * m
Definition: matpol.h:19
const ring r
Definition: syzextra.cc:208
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:405
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
int i
Definition: cfEzgcd.cc:123
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:720
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
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar)
Definition: p_polys.cc:3926
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 int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
static poly p_Mult_q(poly p, poly q, const ring r)
Definition: p_polys.h:1025
int l
Definition: cfEzgcd.cc:94
#define MATELEM(mat, i, j)
Definition: matpol.h:29
bool isValuationTrivial() const
ring tropicalStrategy::copyAndChangeCoefficientRing ( const ring  r) const
private

Definition at line 534 of file tropicalStrategy.cc.

535 {
536  ring rShortcut = rCopy0(r);
537  nKillChar(rShortcut->cf);
538  rShortcut->cf = nCopyCoeff(shortcutRing->cf);
539  rComplete(rShortcut);
540  rTest(rShortcut);
541  return rShortcut;
542 }
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:3436
ring shortcutRing
polynomial ring over the residue field
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1318
#define rTest(r)
Definition: ring.h:781
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:430
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:488
ring tropicalStrategy::copyAndChangeOrderingLS ( const ring  r,
const gfan::ZVector &  w,
const gfan::ZVector &  v 
) const
private

Definition at line 726 of file tropicalStrategy.cc.

727 {
728  // copy shortcutRing and change to desired ordering
729  bool ok;
730  ring s = rCopy0(r);
731  int n = rVar(s);
732  deleteOrdering(s);
733  s->order = (int*) omAlloc0(5*sizeof(int));
734  s->block0 = (int*) omAlloc0(5*sizeof(int));
735  s->block1 = (int*) omAlloc0(5*sizeof(int));
736  s->wvhdl = (int**) omAlloc0(5*sizeof(int**));
737  s->order[0] = ringorder_a;
738  s->block0[0] = 1;
739  s->block1[0] = n;
740  s->wvhdl[0] = ZVectorToIntStar(w,ok);
741  s->order[1] = ringorder_a;
742  s->block0[1] = 1;
743  s->block1[1] = n;
744  s->wvhdl[1] = ZVectorToIntStar(v,ok);
745  s->order[2] = ringorder_lp;
746  s->block0[2] = 1;
747  s->block1[2] = n;
748  s->order[3] = ringorder_C;
749  rComplete(s);
750  rTest(s);
751 
752  return s;
753 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
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:3436
static void deleteOrdering(ring r)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1318
#define rTest(r)
Definition: ring.h:781
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
ring tropicalStrategy::copyAndChangeOrderingWP ( const ring  r,
const gfan::ZVector &  w,
const gfan::ZVector &  v 
) const
private

Definition at line 695 of file tropicalStrategy.cc.

696 {
697  // copy shortcutRing and change to desired ordering
698  bool ok;
699  ring s = rCopy0(r);
700  int n = rVar(s);
701  deleteOrdering(s);
702  gfan::ZVector wAdjusted = adjustWeightForHomogeneity(w);
703  gfan::ZVector vAdjusted = adjustWeightUnderHomogeneity(v,wAdjusted);
704  s->order = (int*) omAlloc0(5*sizeof(int));
705  s->block0 = (int*) omAlloc0(5*sizeof(int));
706  s->block1 = (int*) omAlloc0(5*sizeof(int));
707  s->wvhdl = (int**) omAlloc0(5*sizeof(int**));
708  s->order[0] = ringorder_a;
709  s->block0[0] = 1;
710  s->block1[0] = n;
711  s->wvhdl[0] = ZVectorToIntStar(wAdjusted,ok);
712  s->order[1] = ringorder_a;
713  s->block0[1] = 1;
714  s->block1[1] = n;
715  s->wvhdl[1] = ZVectorToIntStar(vAdjusted,ok);
716  s->order[2] = ringorder_lp;
717  s->block0[2] = 1;
718  s->block1[2] = n;
719  s->order[3] = ringorder_C;
720  rComplete(s);
721  rTest(s);
722 
723  return s;
724 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
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:3436
static void deleteOrdering(ring r)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1318
#define rTest(r)
Definition: ring.h:781
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...
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
#define omAlloc0(size)
Definition: omAllocDecl.h:211
tropicalStrategy tropicalStrategy::debugStrategy ( const ideal  startIdeal,
number  unifParameter,
ring  startRing 
)
static

Definition at line 898 of file tropicalStrategy.cc.

899 {
900  tropicalStrategy debug;
901  debug.originalRing = rCopy(startRing);
902  debug.originalIdeal = id_Copy(startIdeal,startRing);
903  debug.startingRing = rCopy(startRing);
904  debug.startingIdeal = id_Copy(startIdeal,startRing);
905  debug.uniformizingParameter = n_Copy(unifParameter,startRing->cf);
906 
907  debug.shortcutRing = rCopy0(startRing);
908  nKillChar(debug.shortcutRing->cf);
909  debug.shortcutRing->cf = nInitChar(n_Zp,(void*)(long)IsPrime(n_Int(unifParameter,startRing->cf)));
910  rComplete(debug.shortcutRing);
911  rTest(debug.shortcutRing);
912 
913  debug.onlyLowerHalfSpace = true;
917 
918  return debug;
919 }
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:548
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:3436
ring shortcutRing
polynomial ring over the residue field
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1318
#define rTest(r)
Definition: ring.h:781
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:1618
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:452
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:488
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:327
int tropicalStrategy::findPositionOfUniformizingBinomial ( const ideal  I,
const ring  r 
) const
private

Definition at line 830 of file tropicalStrategy.cc.

831 {
833 
834  // if the valuation is non-trivial then checks if the first generator is p-t
835  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
836  poly p = p_One(r);
837  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
838  poly t = p_One(r);
839  p_SetExp(t,1,1,r);
840  p_Setm(t,r);
841  poly pt = p_Add_q(p,p_Neg(t,r),r);
842 
843  for (int i=0; i<idSize(I); i++)
844  {
845  if (p_EqualPolys(I->m[i],pt,r))
846  {
847  p_Delete(&pt,r);
848  return i;
849  }
850  }
851  p_Delete(&pt,r);
852  return -1;
853 }
bool isValuationNonTrivial() const
return P p
Definition: myNF.cc:203
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:401
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1318
#define assume(x)
Definition: mod2.h:405
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
int i
Definition: cfEzgcd.cc:123
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:720
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4289
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
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:484
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:436
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
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:540
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
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.
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
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
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:781
ring originalRing
polynomial ring over a field with valuation
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:781
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 427 of file tropicalStrategy.cc.

428 {
429  ring rShortcut = rCopy0(r);
430 
431  // save old ordering
432  int* order = rShortcut->order;
433  int* block0 = rShortcut->block0;
434  int* block1 = rShortcut->block1;
435  int** wvhdl = rShortcut->wvhdl;
436 
437  // adjust weight and create new ordering
438  gfan::ZVector w = adjustWeightForHomogeneity(v);
439  int h = rBlocks(r); int n = rVar(r);
440  rShortcut->order = (int*) omAlloc0((h+1)*sizeof(int));
441  rShortcut->block0 = (int*) omAlloc0((h+1)*sizeof(int));
442  rShortcut->block1 = (int*) omAlloc0((h+1)*sizeof(int));
443  rShortcut->wvhdl = (int**) omAlloc0((h+1)*sizeof(int*));
444  rShortcut->order[0] = ringorder_a;
445  rShortcut->block0[0] = 1;
446  rShortcut->block1[0] = n;
447  bool overflow;
448  rShortcut->wvhdl[0] = ZVectorToIntStar(w,overflow);
449  for (int i=1; i<=h; i++)
450  {
451  rShortcut->order[i] = order[i-1];
452  rShortcut->block0[i] = block0[i-1];
453  rShortcut->block1[i] = block1[i-1];
454  rShortcut->wvhdl[i] = wvhdl[i-1];
455  }
456 
457  // if valuation non-trivial, change coefficient ring to residue field
458  if (isValuationNonTrivial())
459  {
460  nKillChar(rShortcut->cf);
461  rShortcut->cf = nCopyCoeff(shortcutRing->cf);
462  }
463  rComplete(rShortcut);
464  rTest(rShortcut);
465 
466  // delete old ordering
467  omFree(order);
468  omFree(block0);
469  omFree(block1);
470  omFree(wvhdl);
471 
472  return rShortcut;
473 }
bool isValuationNonTrivial() const
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:540
int * ZVectorToIntStar(const gfan::ZVector &v, bool &overflow)
static int rBlocks(ring r)
Definition: ring.h:516
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:3436
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:1318
#define rTest(r)
Definition: ring.h:781
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:430
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
static Poly * h
Definition: janet.cc:978
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:488
#define omAlloc0(size)
Definition: omAllocDecl.h:211
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
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:781
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
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:923
number uniformizingParameter
uniformizing parameter in the valuation ring
ring startingRing
polynomial ring over the valuation ring extended by one extra variable t
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
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
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
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  }
bool isValuationNonTrivial() const
int i
Definition: cfEzgcd.cc:123
const CanonicalForm & w
Definition: facAbsFact.cc:55
tropicalStrategy & tropicalStrategy::operator= ( const tropicalStrategy currentStrategy)

assignment operator

Definition at line 344 of file tropicalStrategy.cc.

345 {
346  originalRing = rCopy(currentStrategy.getOriginalRing());
347  originalIdeal = id_Copy(currentStrategy.getOriginalIdeal(),currentStrategy.getOriginalRing());
348  expectedDimension = currentStrategy.getExpectedDimension();
349  startingRing = rCopy(currentStrategy.getStartingRing());
350  startingIdeal = id_Copy(currentStrategy.getStartingIdeal(),currentStrategy.getStartingRing());
352  shortcutRing = rCopy(currentStrategy.getShortcutRing());
353  onlyLowerHalfSpace = currentStrategy.restrictToLowerHalfSpace();
357 
359  if (originalIdeal) id_Test(originalIdeal,originalRing);
361  if (startingIdeal) id_Test(startingIdeal,startingRing);
362  if (uniformizingParameter) n_Test(uniformizingParameter,startingRing->cf);
363  if (shortcutRing) rTest(shortcutRing);
364 
365  return *this;
366 }
ring getOriginalRing() const
returns the polynomial ring over the field with valuation
ideal getOriginalIdeal() const
returns the input ideal 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
bool onlyLowerHalfSpace
true if valuation non-trivial, false otherwise
ring getStartingRing() const
returns the polynomial ring over the valuation ring
int getExpectedDimension() const
returns the expected Dimension of the polyhedral output
ideal startingIdeal
preimage of the input ideal under the map that sends t to the uniformizing parameter ...
number getUniformizingParameter() const
returns the uniformizing parameter in the valuation ring
ideal originalIdeal
input ideal, assumed to be a homogeneous prime ideal
ring getShortcutRing() const
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:923
#define rTest(r)
Definition: ring.h:781
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...
bool restrictToLowerHalfSpace() const
returns true, if valuation non-trivial, false otherwise
number uniformizingParameter
uniformizing parameter in the valuation ring
ring rCopy(ring r)
Definition: ring.cc:1618
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:452
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...
void tropicalStrategy::pReduce ( ideal  I,
const ring  r 
) const

Definition at line 411 of file tropicalStrategy.cc.

412 {
413  rTest(r);
414  id_Test(I,r);
415 
416  if (isValuationTrivial())
417  return;
418 
419  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
420  number p = identity(uniformizingParameter,startingRing->cf,r->cf);
421  ::pReduce(I,p,r);
422  n_Delete(&p,r->cf);
423 
424  return;
425 }
return P p
Definition: myNF.cc:203
#define id_Test(A, lR)
Definition: simpleideals.h:80
void pReduce(ideal I, const ring r) const
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:72
#define rTest(r)
Definition: ring.h:781
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:720
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:456
bool isValuationTrivial() const
void tropicalStrategy::putUniformizingBinomialInFront ( ideal  I,
const ring  r,
const number  q 
) const
private

Definition at line 368 of file tropicalStrategy.cc.

369 {
370  poly p = p_One(r);
371  p_SetCoeff(p,q,r);
372  poly t = p_One(r);
373  p_SetExp(t,1,1,r);
374  p_Setm(t,r);
375  poly pt = p_Add_q(p,p_Neg(t,r),r);
376 
377  int k = idSize(I);
378  int l;
379  for (l=0; l<k; l++)
380  {
381  if (p_EqualPolys(I->m[l],pt,r))
382  break;
383  }
384  p_Delete(&pt,r);
385 
386  if (l>1)
387  {
388  pt = I->m[l];
389  for (int i=l; i>0; i--)
390  I->m[l] = I->m[l-1];
391  I->m[0] = pt;
392  pt = NULL;
393  }
394  return;
395 }
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:401
const ring r
Definition: syzextra.cc:208
poly p_One(const ring r)
Definition: p_polys.cc:1318
int i
Definition: cfEzgcd.cc:123
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4289
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
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:484
#define NULL
Definition: omList.c:10
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:436
static int idSize(const ideal id)
Count the effective size of an ideal (without the trailing allocated zero-elements) ...
Definition: ideals.h:43
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
polyrec * poly
Definition: hilb.h:10
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
int l
Definition: cfEzgcd.cc:94
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 397 of file tropicalStrategy.cc.

398 {
399  rTest(r);
400  id_Test(I,r);
401 
402  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
403  number p = identity(uniformizingParameter,startingRing->cf,r->cf);
404  bool b = extraReductionAlgorithm(I,r,p);
405  // putUniformizingBinomialInFront(I,r,p);
406  n_Delete(&p,r->cf);
407 
408  return b;
409 }
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:72
#define rTest(r)
Definition: ring.h:781
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:720
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:456
const poly b
Definition: syzextra.cc:213
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

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.

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.

gfan::ZCone tropicalStrategy::linealitySpace
private

the homogeneity space of the Grobner fan

Definition at line 58 of file tropicalStrategy.h.

bool tropicalStrategy::onlyLowerHalfSpace
private

true if valuation non-trivial, false otherwise

Definition at line 79 of file tropicalStrategy.h.

ideal tropicalStrategy::originalIdeal
private

input ideal, assumed to be a homogeneous prime ideal

Definition at line 47 of file tropicalStrategy.h.

ring tropicalStrategy::originalRing
private

polynomial ring over a field with valuation

Definition at line 43 of file tropicalStrategy.h.

ring tropicalStrategy::shortcutRing
private

polynomial ring over the residue field

Definition at line 74 of file tropicalStrategy.h.

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.

ring tropicalStrategy::startingRing
private

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

Definition at line 62 of file tropicalStrategy.h.

number tropicalStrategy::uniformizingParameter
private

uniformizing parameter in the valuation ring

Definition at line 70 of file tropicalStrategy.h.

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.

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: