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 isConstantCoefficientCase () const
 
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 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, intcheckInitialIdealForMonomial (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 120 of file tropicalStrategy.cc.

122  :
123  originalRing(rCopy(r)),
124  originalIdeal(id_Copy(I,r)),
131  onlyLowerHalfSpace(false),
135 {
137  if (!completelyHomogeneous)
138  {
141  }
142  if (!completeSpace)
143  onlyLowerHalfSpace = true;
144 }
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)
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:452
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:446
number uniformizingParameter
uniformizing parameter in the valuation ring
ring rCopy(ring r)
Definition: ring.cc:1579
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:425
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 246 of file tropicalStrategy.cc.

246  :
247  originalRing(rCopy(s)),
248  originalIdeal(id_Copy(J,s)),
250  linealitySpace(gfan::ZCone()), // to come, see below
251  startingRing(NULL), // to come, see below
252  startingIdeal(NULL), // to come, see below
253  uniformizingParameter(NULL), // to come, see below
254  shortcutRing(NULL), // to come, see below
255  onlyLowerHalfSpace(true),
259 {
260  /* assume that the ground field of the originalRing is Q */
261  assume(rField_is_Q(s));
262 
263  /* replace Q with Z for the startingRing
264  * and add an extra variable for tracking the uniformizing parameter */
266 
267  /* map the uniformizing parameter into the new coefficient domain */
268  nMapFunc nMap = n_SetMap(originalRing->cf,startingRing->cf);
270 
271  /* map the input ideal into the new polynomial ring */
274 
276 
277  /* construct the shorcut ring */
279  nKillChar(shortcutRing->cf);
283 }
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)
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:29
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:546
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:3371
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:1281
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:71
#define rTest(r)
Definition: ring.h:769
int dim(ideal I, ring r)
int IsPrime(int p)
Definition: ipshell.cc:633
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:452
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:718
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:1579
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:477
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:316
tropicalStrategy::tropicalStrategy ( const tropicalStrategy currentStrategy)

copy constructor

Definition at line 285 of file tropicalStrategy.cc.

285  :
286  originalRing(rCopy(currentStrategy.getOriginalRing())),
287  originalIdeal(id_Copy(currentStrategy.getOriginalIdeal(),currentStrategy.getOriginalRing())),
288  expectedDimension(currentStrategy.getExpectedDimension()),
289  linealitySpace(currentStrategy.getHomogeneitySpace()),
290  startingRing(rCopy(currentStrategy.getStartingRing())),
291  startingIdeal(id_Copy(currentStrategy.getStartingIdeal(),currentStrategy.getStartingRing())),
294  onlyLowerHalfSpace(currentStrategy.restrictToLowerHalfSpace()),
298 {
303  if (currentStrategy.getUniformizingParameter())
304  {
307  }
308  if (currentStrategy.getShortcutRing())
309  {
310  shortcutRing = rCopy(currentStrategy.getShortcutRing());
312  }
313 }
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)
#define id_Test(A, lR)
Definition: simpleideals.h:67
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:918
#define rTest(r)
Definition: ring.h:769
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:1579
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 'n'
Definition: coeffs.h:451
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 870 of file tropicalStrategy.cc.

870  :
874  linealitySpace(gfan::ZCone()),
879  onlyLowerHalfSpace(false)
880 {
884 }
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 315 of file tropicalStrategy.cc.

316 {
323 
330 }
#define id_Test(A, lR)
Definition: simpleideals.h:67
void id_Delete(ideal *h, ring r)
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:918
#define rTest(r)
Definition: ring.h:769
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 'p'
Definition: coeffs.h:455
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 790 of file tropicalStrategy.cc.

791 {
792  // if the valuation is trivial,
793  // then there is no special condition the first generator has to fullfill
794  if (isValuationTrivial())
795  return true;
796 
797  // if the valuation is non-trivial then checks if the first generator is p-t
798  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
799  poly p = p_One(r);
800  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
801  poly t = p_One(r);
802  p_SetExp(t,1,1,r);
803  p_Setm(t,r);
804  poly pt = p_Add_q(p,p_Neg(t,r),r);
805 
806  for (int i=0; i<idSize(I); i++)
807  {
808  if (p_EqualPolys(I->m[i],pt,r))
809  {
810  p_Delete(&pt,r);
811  return true;
812  }
813  }
814  p_Delete(&pt,r);
815  return false;
816 }
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
polyrec * poly
Definition: hilb.h:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:71
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:718
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4288
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:46
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
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 843 of file tropicalStrategy.cc.

844 {
845  // if the valuation is trivial,
846  // then there is no special condition the first generator has to fullfill
847  if (isValuationTrivial())
848  return true;
849 
850  // if the valuation is non-trivial then checks if the first generator is p
851  if (inI->m[0]==NULL)
852  return false;
853  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
854  poly p = p_One(r);
855  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
856 
857  for (int i=0; i<idSize(inI); i++)
858  {
859  if (p_EqualPolys(inI->m[i],p,r))
860  {
861  p_Delete(&p,r);
862  return true;
863  }
864  }
865  p_Delete(&p,r);
866  return false;
867 }
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
polyrec * poly
Definition: hilb.h:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:71
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:718
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4288
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:46
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 463 of file tropicalStrategy.cc.

464 {
465  // quick check whether I already contains an ideal
466  int k = idSize(I);
467  for (int i=0; i<k; i++)
468  {
469  poly g = I->m[i];
470  if (pNext(g)==NULL && (isValuationTrivial() || n_IsOne(p_GetCoeff(g,r),r->cf)))
471  return std::pair<poly,int>(g,i);
472  }
473 
474  ring rShortcut;
475  ideal inIShortcut;
476  if (w.size()>0)
477  {
478  // if needed, prepend extra weight for homogeneity
479  // switch to residue field if valuation is non trivial
480  rShortcut = getShortcutRingPrependingWeight(r,w);
481 
482  // compute the initial ideal and map it into the constructed ring
483  // if switched to residue field, remove possibly 0 elements
484  ideal inI = initial(I,r,w);
485  inIShortcut = idInit(k);
486  nMapFunc intoShortcut = n_SetMap(r->cf,rShortcut->cf);
487  for (int i=0; i<k; i++)
488  inIShortcut->m[i] = p_PermPoly(inI->m[i],NULL,r,rShortcut,intoShortcut,NULL,0);
489  if (isValuationNonTrivial())
490  idSkipZeroes(inIShortcut);
491  id_Delete(&inI,r);
492  }
493  else
494  {
495  rShortcut = r;
496  inIShortcut = I;
497  }
498 
499  // check initial ideal for monomial and
500  // if it exsists, return a copy of the monomial in the input ring
501  poly p = checkForMonomialViaSuddenSaturation(inIShortcut,rShortcut);
502  poly monomial = NULL;
503  if (p!=NULL)
504  {
505  monomial=p_One(r);
506  for (int i=1; i<=rVar(r); i++)
507  p_SetExp(monomial,i,p_GetExp(p,i,rShortcut),r);
508  p_Setm(monomial,r);
509  p_Delete(&p,rShortcut);
510  }
511 
512 
513  if (w.size()>0)
514  {
515  // if needed, cleanup
516  id_Delete(&inIShortcut,rShortcut);
517  rDelete(rShortcut);
518  }
519  return std::pair<poly,int>(monomial,-1);
520 }
bool isValuationNonTrivial() const
return P p
Definition: myNF.cc:203
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:468
const ideal
Definition: gb_hack.h:42
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:531
void id_Delete(ideal *h, ring r)
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
polyrec * poly
Definition: hilb.h:10
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:71
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:718
void idSkipZeroes(ideal ide)
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
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:3892
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:46
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 743 of file tropicalStrategy.cc.

746 {
747  assume(isValuationTrivial() || interiorPoint[0].sign()<0);
749 
750  // get a generating system of the initial ideal
751  // and compute a standard basis with respect to adjacent ordering
752  ideal inIr = initial(Ir,r,interiorPoint);
753  ring sAdjusted = copyAndChangeOrderingWP(r,interiorPoint,facetNormal);
754  nMapFunc identity = n_SetMap(r->cf,sAdjusted->cf);
755  int k = idSize(Ir);
756  ideal inIsAdjusted = idInit(k);
757  for (int i=0; i<k; i++)
758  inIsAdjusted->m[i] = p_PermPoly(inIr->m[i],NULL,r,sAdjusted,identity,NULL,0);
759  ideal inJsAdjusted = computeStdOfInitialIdeal(inIsAdjusted,sAdjusted);
760 
761  // find witnesses of the new standard basis elements of the initial ideal
762  // with the help of the old standard basis of the ideal
763  k = idSize(inJsAdjusted);
764  ideal inJr = idInit(k);
765  identity = n_SetMap(sAdjusted->cf,r->cf);
766  for (int i=0; i<k; i++)
767  inJr->m[i] = p_PermPoly(inJsAdjusted->m[i],NULL,sAdjusted,r,identity,NULL,0);
768 
769  ideal Jr = computeWitness(inJr,inIr,Ir,r);
770  ring s = copyAndChangeOrderingLS(r,interiorPoint,facetNormal);
771  identity = n_SetMap(r->cf,s->cf);
772  ideal Js = idInit(k);
773  for (int i=0; i<k; i++)
774  Js->m[i] = p_PermPoly(Jr->m[i],NULL,r,s,identity,NULL,0);
775 
776  // this->reduce(Jr,r);
777  // cleanup
778  id_Delete(&inIsAdjusted,sAdjusted);
779  id_Delete(&inJsAdjusted,sAdjusted);
780  rDelete(sAdjusted);
781  id_Delete(&inIr,r);
782  id_Delete(&Jr,r);
783  id_Delete(&inJr,r);
784 
786  return std::make_pair(Js,s);
787 }
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)
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
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:71
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:718
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
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:3892
#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:46
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 646 of file tropicalStrategy.cc.

647 {
648  int k = idSize(inJs);
649  ideal inJr = idInit(k);
650  nMapFunc identitysr = n_SetMap(s->cf,r->cf);
651  for (int i=0; i<k; i++)
652  inJr->m[i] = p_PermPoly(inJs->m[i],NULL,s,r,identitysr,NULL,0);
653 
654  ideal Jr = computeWitness(inJr,inIr,Ir,r);
655  nMapFunc identityrs = n_SetMap(r->cf,s->cf);
656  ideal Js = idInit(k);
657  for (int i=0; i<k; i++)
658  Js->m[i] = p_PermPoly(Jr->m[i],NULL,r,s,identityrs,NULL,0);
659  return Js;
660 }
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...
const ideal
Definition: gb_hack.h:42
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:71
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:718
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
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:3892
#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:46
ideal tropicalStrategy::computeStdOfInitialIdeal ( const ideal  inI,
const ring  r 
) const

given generators of the initial ideal, computes its standard basis

Definition at line 614 of file tropicalStrategy.cc.

615 {
616  // if valuation trivial, then compute std as usual
617  if (isValuationTrivial())
618  return gfanlib_kStd_wrapper(inI,r);
619 
620  // if valuation non-trivial, then uniformizing parameter is in ideal
621  // so switch to residue field first and compute standard basis over the residue field
622  ring rShortcut = copyAndChangeCoefficientRing(r);
623  nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf);
624  int k = idSize(inI);
625  ideal inIShortcut = idInit(k);
626  for (int i=0; i<k; i++)
627  inIShortcut->m[i] = p_PermPoly(inI->m[i],NULL,r,rShortcut,takingResidues,NULL,0);
628  ideal inJShortcut = gfanlib_kStd_wrapper(inIShortcut,rShortcut);
629 
630  // and lift the result back to the ring with valuation
631  nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf);
632  k = idSize(inJShortcut);
633  ideal inJ = idInit(k+1);
634  inJ->m[0] = p_One(r);
635  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
636  p_SetCoeff(inJ->m[0],identity(uniformizingParameter,startingRing->cf,r->cf),r);
637  for (int i=0; i<k; i++)
638  inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,rShortcut,r,takingRepresentatives,NULL,0);
639 
640  id_Delete(&inJShortcut,rShortcut);
641  id_Delete(&inIShortcut,rShortcut);
642  rDelete(rShortcut);
643  return inJ;
644 }
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
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:71
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:718
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
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:3892
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:46
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 532 of file tropicalStrategy.cc.

533 {
534  // if the valuation is trivial and the ring and ideal have not been extended,
535  // then it is sufficient to return the difference between the elements of inJ
536  // and their normal forms with respect to I and r
537  if (isValuationTrivial())
538  return witness(inJ,I,r);
539  // if the valuation is non-trivial and the ring and ideal have been extended,
540  // then we can make a shortcut through the residue field
541  else
542  {
543  assume(idSize(inI)==idSize(I));
545  assume(uni>=0);
546  /**
547  * change ground ring into finite field
548  * and map the data into it
549  */
550  ring rShortcut = copyAndChangeCoefficientRing(r);
551 
552  int k = idSize(inJ);
553  int l = idSize(I);
554  ideal inJShortcut = idInit(k);
555  ideal inIShortcut = idInit(l);
556  nMapFunc takingResidues = n_SetMap(r->cf,rShortcut->cf);
557  for (int i=0; i<k; i++)
558  inJShortcut->m[i] = p_PermPoly(inJ->m[i],NULL,r,rShortcut,takingResidues,NULL,0);
559  for (int j=0; j<l; j++)
560  inIShortcut->m[j] = p_PermPoly(inI->m[j],NULL,r,rShortcut,takingResidues,NULL,0);
561  id_Test(inJShortcut,rShortcut);
562  id_Test(inIShortcut,rShortcut);
563 
564  /**
565  * Compute a division with remainder over the finite field
566  * and map the result back to r
567  */
568  matrix QShortcut = divisionDiscardingRemainder(inJShortcut,inIShortcut,rShortcut);
569  matrix Q = mpNew(l,k);
570  nMapFunc takingRepresentatives = n_SetMap(rShortcut->cf,r->cf);
571  for (int ij=k*l-1; ij>=0; ij--)
572  Q->m[ij] = p_PermPoly(QShortcut->m[ij],NULL,rShortcut,r,takingRepresentatives,NULL,0);
573 
574  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
575  number p = identity(uniformizingParameter,startingRing->cf,r->cf);
576 
577  /**
578  * Compute the normal forms
579  */
580  ideal J = idInit(k);
581  for (int j=0; j<k; j++)
582  {
583  poly q0 = p_Copy(inJ->m[j],r);
584  for (int i=0; i<l; i++)
585  {
586  poly qij = p_Copy(MATELEM(Q,i+1,j+1),r);
587  poly inIi = p_Copy(inI->m[i],r);
588  q0 = p_Add_q(q0,p_Neg(p_Mult_q(qij,inIi,r),r),r);
589  }
590  q0 = p_Div_nn(q0,p,r);
591  poly q0g0 = p_Mult_q(q0,p_Copy(I->m[uni],r),r);
592  // q0 = NULL;
593  poly qigi = NULL;
594  for (int i=0; i<l; i++)
595  {
596  poly qij = p_Copy(MATELEM(Q,i+1,j+1),r);
597  // poly inIi = p_Copy(I->m[i],r);
598  poly Ii = p_Copy(I->m[i],r);
599  qigi = p_Add_q(qigi,p_Mult_q(qij,Ii,r),r);
600  }
601  J->m[j] = p_Add_q(q0g0,qigi,r);
602  }
603 
604  id_Delete(&inIShortcut,rShortcut);
605  id_Delete(&inJShortcut,rShortcut);
606  mp_Delete(&QShortcut,rShortcut);
607  rDelete(rShortcut);
608  mp_Delete(&Q,r);
609  n_Delete(&p,r->cf);
610  return J;
611  }
612 }
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:67
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
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
polyrec * poly
Definition: hilb.h:10
#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:71
int i
Definition: cfEzgcd.cc:123
void mp_Delete(matrix *a, const ring r)
Definition: matpol.cc:784
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:718
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:48
ideal idInit(int idsize, int rank)
Definition: simpleideals.cc:40
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:3892
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:46
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 'p'
Definition: coeffs.h:455
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 522 of file tropicalStrategy.cc.

523 {
524  ring rShortcut = rCopy0(r);
525  nKillChar(rShortcut->cf);
526  rShortcut->cf = nCopyCoeff(shortcutRing->cf);
527  rComplete(rShortcut);
528  rTest(rShortcut);
529  return rShortcut;
530 }
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:3371
ring shortcutRing
polynomial ring over the residue field
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1281
#define rTest(r)
Definition: ring.h:769
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:429
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:477
ring tropicalStrategy::copyAndChangeOrderingLS ( const ring  r,
const gfan::ZVector &  w,
const gfan::ZVector &  v 
) const
private

Definition at line 714 of file tropicalStrategy.cc.

715 {
716  // copy shortcutRing and change to desired ordering
717  bool ok;
718  ring s = rCopy0(r);
719  int n = rVar(s);
720  deleteOrdering(s);
721  s->order = (int*) omAlloc0(5*sizeof(int));
722  s->block0 = (int*) omAlloc0(5*sizeof(int));
723  s->block1 = (int*) omAlloc0(5*sizeof(int));
724  s->wvhdl = (int**) omAlloc0(5*sizeof(int**));
725  s->order[0] = ringorder_a;
726  s->block0[0] = 1;
727  s->block1[0] = n;
728  s->wvhdl[0] = ZVectorToIntStar(w,ok);
729  s->order[1] = ringorder_a;
730  s->block0[1] = 1;
731  s->block1[1] = n;
732  s->wvhdl[1] = ZVectorToIntStar(v,ok);
733  s->order[2] = ringorder_lp;
734  s->block0[2] = 1;
735  s->block1[2] = n;
736  s->order[3] = ringorder_C;
737  rComplete(s);
738  rTest(s);
739 
740  return s;
741 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:531
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:3371
static void deleteOrdering(ring r)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1281
#define rTest(r)
Definition: ring.h:769
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 683 of file tropicalStrategy.cc.

684 {
685  // copy shortcutRing and change to desired ordering
686  bool ok;
687  ring s = rCopy0(r);
688  int n = rVar(s);
689  deleteOrdering(s);
690  gfan::ZVector wAdjusted = adjustWeightForHomogeneity(w);
691  gfan::ZVector vAdjusted = adjustWeightUnderHomogeneity(v,wAdjusted);
692  s->order = (int*) omAlloc0(5*sizeof(int));
693  s->block0 = (int*) omAlloc0(5*sizeof(int));
694  s->block1 = (int*) omAlloc0(5*sizeof(int));
695  s->wvhdl = (int**) omAlloc0(5*sizeof(int**));
696  s->order[0] = ringorder_a;
697  s->block0[0] = 1;
698  s->block1[0] = n;
699  s->wvhdl[0] = ZVectorToIntStar(wAdjusted,ok);
700  s->order[1] = ringorder_a;
701  s->block0[1] = 1;
702  s->block1[1] = n;
703  s->wvhdl[1] = ZVectorToIntStar(vAdjusted,ok);
704  s->order[2] = ringorder_lp;
705  s->block0[2] = 1;
706  s->block1[2] = n;
707  s->order[3] = ringorder_C;
708  rComplete(s);
709  rTest(s);
710 
711  return s;
712 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:531
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:3371
static void deleteOrdering(ring r)
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1281
#define rTest(r)
Definition: ring.h:769
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 886 of file tropicalStrategy.cc.

887 {
888  tropicalStrategy debug;
889  debug.originalRing = rCopy(startRing);
890  debug.originalIdeal = id_Copy(startIdeal,startRing);
891  debug.startingRing = rCopy(startRing);
892  debug.startingIdeal = id_Copy(startIdeal,startRing);
893  debug.uniformizingParameter = n_Copy(unifParameter,startRing->cf);
894 
895  debug.shortcutRing = rCopy0(startRing);
896  nKillChar(debug.shortcutRing->cf);
897  debug.shortcutRing->cf = nInitChar(n_Zp,(void*)(long)IsPrime(n_Int(unifParameter,startRing->cf)));
898  rComplete(debug.shortcutRing);
899  rTest(debug.shortcutRing);
900 
901  debug.onlyLowerHalfSpace = true;
905 
906  return debug;
907 }
ideal id_Copy(ideal h1, const ring r)
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:29
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:546
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:3371
ring shortcutRing
polynomial ring over the residue field
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1281
#define rTest(r)
Definition: ring.h:769
int IsPrime(int p)
Definition: ipshell.cc:633
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:1579
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 'n'
Definition: coeffs.h:451
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:477
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:316
int tropicalStrategy::findPositionOfUniformizingBinomial ( const ideal  I,
const ring  r 
) const
private

Definition at line 818 of file tropicalStrategy.cc.

819 {
821 
822  // if the valuation is non-trivial then checks if the first generator is p-t
823  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
824  poly p = p_One(r);
825  p_SetCoeff(p,identity(uniformizingParameter,startingRing->cf,r->cf),r);
826  poly t = p_One(r);
827  p_SetExp(t,1,1,r);
828  p_Setm(t,r);
829  poly pt = p_Add_q(p,p_Neg(t,r),r);
830 
831  for (int i=0; i<idSize(I); i++)
832  {
833  if (p_EqualPolys(I->m[i],pt,r))
834  {
835  p_Delete(&pt,r);
836  return i;
837  }
838  }
839  p_Delete(&pt,r);
840  return -1;
841 }
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
polyrec * poly
Definition: hilb.h:10
#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:71
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:718
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4288
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:46
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:884
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 178 of file tropicalStrategy.h.

179  {
181  return originalIdeal;
182  }
#define id_Test(A, lR)
Definition: simpleideals.h:67
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 169 of file tropicalStrategy.h.

170  {
172  return originalRing;
173  }
#define rTest(r)
Definition: ring.h:769
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:769
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 415 of file tropicalStrategy.cc.

416 {
417  ring rShortcut = rCopy0(r);
418 
419  // save old ordering
420  int* order = rShortcut->order;
421  int* block0 = rShortcut->block0;
422  int* block1 = rShortcut->block1;
423  int** wvhdl = rShortcut->wvhdl;
424 
425  // adjust weight and create new ordering
426  gfan::ZVector w = adjustWeightForHomogeneity(v);
427  int h = rBlocks(r); int n = rVar(r);
428  rShortcut->order = (int*) omAlloc0((h+1)*sizeof(int));
429  rShortcut->block0 = (int*) omAlloc0((h+1)*sizeof(int));
430  rShortcut->block1 = (int*) omAlloc0((h+1)*sizeof(int));
431  rShortcut->wvhdl = (int**) omAlloc0((h+1)*sizeof(int*));
432  rShortcut->order[0] = ringorder_a;
433  rShortcut->block0[0] = 1;
434  rShortcut->block1[0] = n;
435  bool overflow;
436  rShortcut->wvhdl[0] = ZVectorToIntStar(w,overflow);
437  for (int i=1; i<=h; i++)
438  {
439  rShortcut->order[i] = order[i-1];
440  rShortcut->block0[i] = block0[i-1];
441  rShortcut->block1[i] = block1[i-1];
442  rShortcut->wvhdl[i] = wvhdl[i-1];
443  }
444 
445  // if valuation non-trivial, change coefficient ring to residue field
446  if (isValuationNonTrivial())
447  {
448  nKillChar(rShortcut->cf);
449  rShortcut->cf = nCopyCoeff(shortcutRing->cf);
450  }
451  rComplete(rShortcut);
452  rTest(rShortcut);
453 
454  // delete old ordering
455  omFree(order);
456  omFree(block0);
457  omFree(block1);
458  omFree(wvhdl);
459 
460  return rShortcut;
461 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
bool isValuationNonTrivial() const
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:531
int * ZVectorToIntStar(const gfan::ZVector &v, bool &overflow)
static int rBlocks(ring r)
Definition: ring.h:507
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:3371
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:1281
#define rTest(r)
Definition: ring.h:769
int i
Definition: cfEzgcd.cc:123
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:429
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:477
#define omAlloc0(size)
Definition: omAllocDecl.h:211
ideal tropicalStrategy::getStartingIdeal ( ) const
inline

returns the input ideal

Definition at line 196 of file tropicalStrategy.h.

197  {
199  return startingIdeal;
200  }
#define id_Test(A, lR)
Definition: simpleideals.h:67
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 187 of file tropicalStrategy.h.

188  {
190  return startingRing;
191  }
#define rTest(r)
Definition: ring.h:769
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:918
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::isConstantCoefficientCase ( ) 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
bool tropicalStrategy::isValuationNonTrivial ( ) const
inline

Definition at line 160 of file tropicalStrategy.h.

161  {
162  bool b = (uniformizingParameter!=NULL);
163  return b;
164  }
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 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
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 332 of file tropicalStrategy.cc.

333 {
334  originalRing = rCopy(currentStrategy.getOriginalRing());
335  originalIdeal = id_Copy(currentStrategy.getOriginalIdeal(),currentStrategy.getOriginalRing());
336  expectedDimension = currentStrategy.getExpectedDimension();
337  startingRing = rCopy(currentStrategy.getStartingRing());
338  startingIdeal = id_Copy(currentStrategy.getStartingIdeal(),currentStrategy.getStartingRing());
340  shortcutRing = rCopy(currentStrategy.getShortcutRing());
341  onlyLowerHalfSpace = currentStrategy.restrictToLowerHalfSpace();
345 
347  if (originalIdeal) id_Test(originalIdeal,originalRing);
349  if (startingIdeal) id_Test(startingIdeal,startingRing);
350  if (uniformizingParameter) n_Test(uniformizingParameter,startingRing->cf);
351  if (shortcutRing) rTest(shortcutRing);
352 
353  return *this;
354 }
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)
#define id_Test(A, lR)
Definition: simpleideals.h:67
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:918
#define rTest(r)
Definition: ring.h:769
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:1579
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 'n'
Definition: coeffs.h:451
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 399 of file tropicalStrategy.cc.

400 {
401  rTest(r);
402  id_Test(I,r);
403 
404  if (isValuationTrivial())
405  return;
406 
407  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
408  number p = identity(uniformizingParameter,startingRing->cf,r->cf);
409  ::pReduce(I,p,r);
410  n_Delete(&p,r->cf);
411 
412  return;
413 }
return P p
Definition: myNF.cc:203
#define id_Test(A, lR)
Definition: simpleideals.h:67
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:71
#define rTest(r)
Definition: ring.h:769
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:718
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 'p'
Definition: coeffs.h:455
bool isValuationTrivial() const
void tropicalStrategy::putUniformizingBinomialInFront ( ideal  I,
const ring  r,
const number  q 
) const
private

Definition at line 356 of file tropicalStrategy.cc.

357 {
358  poly p = p_One(r);
359  p_SetCoeff(p,q,r);
360  poly t = p_One(r);
361  p_SetExp(t,1,1,r);
362  p_Setm(t,r);
363  poly pt = p_Add_q(p,p_Neg(t,r),r);
364 
365  int k = idSize(I);
366  int l;
367  for (l=0; l<k; l++)
368  {
369  if (p_EqualPolys(I->m[l],pt,r))
370  break;
371  }
372  p_Delete(&pt,r);
373 
374  if (l>1)
375  {
376  pt = I->m[l];
377  for (int i=l; i>0; i--)
378  I->m[l] = I->m[l-1];
379  I->m[0] = pt;
380  pt = NULL;
381  }
382  return;
383 }
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
polyrec * poly
Definition: hilb.h:10
int i
Definition: cfEzgcd.cc:123
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
Definition: p_polys.cc:4288
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:46
static poly p_Neg(poly p, const ring r)
Definition: p_polys.h:1018
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 385 of file tropicalStrategy.cc.

386 {
387  rTest(r);
388  id_Test(I,r);
389 
390  nMapFunc identity = n_SetMap(startingRing->cf,r->cf);
391  number p = identity(uniformizingParameter,startingRing->cf,r->cf);
392  bool b = extraReductionAlgorithm(I,r,p);
393  // putUniformizingBinomialInFront(I,r,p);
394  n_Delete(&p,r->cf);
395 
396  return b;
397 }
return P p
Definition: myNF.cc:203
#define id_Test(A, lR)
Definition: simpleideals.h:67
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:71
#define rTest(r)
Definition: ring.h:769
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:718
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 'p'
Definition: coeffs.h:455
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: