Functions
startingCone.h File Reference
#include <groebnerCone.h>
#include <tropicalStrategy.h>

Go to the source code of this file.

Functions

groebnerCone groebnerStartingCone (const tropicalStrategy &currentStrategy)
 
groebnerCone tropicalStartingCone (const tropicalStrategy &currentCase)
 
BOOLEAN tropicalStartingPoint (leftv res, leftv args)
 
BOOLEAN positiveTropicalStartingPoint (leftv res, leftv args)
 
BOOLEAN nonNegativeTropicalStartingPoint (leftv res, leftv args)
 
BOOLEAN negativeTropicalStartingPoint (leftv res, leftv args)
 
BOOLEAN nonPositiveTropicalStartingPoint (leftv res, leftv args)
 
BOOLEAN tropicalStartingCone (leftv res, leftv args)
 

Function Documentation

§ groebnerStartingCone()

groebnerCone groebnerStartingCone ( const tropicalStrategy currentStrategy)

Definition at line 15 of file startingCone.cc.

16 {
17  groebnerCone sigma(currentStrategy.getStartingIdeal(), currentStrategy.getStartingRing(), currentStrategy);
18  return sigma;
19 }
ring getStartingRing() const
returns the polynomial ring over the valuation ring
ideal getStartingIdeal() const
returns the input ideal

§ negativeTropicalStartingPoint()

BOOLEAN negativeTropicalStartingPoint ( leftv  res,
leftv  args 
)

Definition at line 185 of file startingCone.cc.

186 {
187  leftv u = args;
188  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
189  {
190  ideal I = (ideal) u->Data();
191  if ((I->m[0]!=NULL) && (idElem(I)==1))
192  {
193  tropicalStrategy currentStrategy(I,currRing);
194  poly g = I->m[0];
195  std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
196  for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
197  {
198  gfan::ZMatrix ray = zc->extremeRays();
199  for (int i=0; i<ray.getHeight(); i++)
200  {
201  gfan::ZVector negatedRay = gfan::Integer(-1)*ray[i].toVector();
202  if (negatedRay.isPositive())
203  {
204  res->rtyp = BIGINTMAT_CMD;
205  res->data = (void*) zVectorToBigintmat(ray[i].toVector());
206  return FALSE;
207  }
208  }
209  }
210  res->rtyp = BIGINTMAT_CMD;
211  res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
212  return FALSE;
213  }
214  WerrorS("negativeTropicalStartingPoint: ideal not principal");
215  return TRUE;
216  }
217  WerrorS("negativeTropicalStartingPoint: unexpected parameters");
218  return TRUE;
219 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
g
Definition: cfModGcd.cc:4031
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN tropicalVariety(leftv res, leftv args)
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
int idElem(const ideal F)
count non-zero elements
polyrec * poly
Definition: hilb.h:10

§ nonNegativeTropicalStartingPoint()

BOOLEAN nonNegativeTropicalStartingPoint ( leftv  res,
leftv  args 
)

Definition at line 150 of file startingCone.cc.

151 {
152  leftv u = args;
153  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
154  {
155  ideal I = (ideal) u->Data();
156  if ((I->m[0]!=NULL) && (idElem(I)==1))
157  {
158  tropicalStrategy currentStrategy(I,currRing);
159  poly g = I->m[0];
160  std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
161  for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
162  {
163  gfan::ZMatrix ray = zc->extremeRays();
164  for (int i=0; i<ray.getHeight(); i++)
165  {
166  if (ray[i].toVector().isNonNegative())
167  {
168  res->rtyp = BIGINTMAT_CMD;
169  res->data = (void*) zVectorToBigintmat(ray[i].toVector());
170  return FALSE;
171  }
172  }
173  }
174  res->rtyp = BIGINTMAT_CMD;
175  res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
176  return FALSE;
177  }
178  WerrorS("nonNegativeTropicalStartingPoint: ideal not principal");
179  return TRUE;
180  }
181  WerrorS("nonNegativeTropicalStartingPoint: unexpected parameters");
182  return TRUE;
183 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
g
Definition: cfModGcd.cc:4031
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN tropicalVariety(leftv res, leftv args)
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
int idElem(const ideal F)
count non-zero elements
polyrec * poly
Definition: hilb.h:10

§ nonPositiveTropicalStartingPoint()

BOOLEAN nonPositiveTropicalStartingPoint ( leftv  res,
leftv  args 
)

Definition at line 221 of file startingCone.cc.

222 {
223  leftv u = args;
224  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
225  {
226  ideal I = (ideal) u->Data();
227  if ((I->m[0]!=NULL) && (idElem(I)==1))
228  {
229  tropicalStrategy currentStrategy(I,currRing);
230  poly g = I->m[0];
231  std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
232  for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
233  {
234  gfan::ZMatrix ray = zc->extremeRays();
235  for (int i=0; i<ray.getHeight(); i++)
236  {
237  gfan::ZVector negatedRay = gfan::Integer(-1)*ray[i].toVector();
238  if (negatedRay.isNonNegative())
239  {
240  res->rtyp = BIGINTMAT_CMD;
241  res->data = (void*) zVectorToBigintmat(ray[i]);
242  return FALSE;
243  }
244  }
245  }
246  res->rtyp = BIGINTMAT_CMD;
247  res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
248  return FALSE;
249  }
250  WerrorS("nonPositiveTropicalStartingPoint: ideal not principal");
251  return TRUE;
252  }
253  WerrorS("nonPositiveTropicalStartingPoint: unexpected parameters");
254  return TRUE;
255 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
g
Definition: cfModGcd.cc:4031
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN tropicalVariety(leftv res, leftv args)
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
int idElem(const ideal F)
count non-zero elements
polyrec * poly
Definition: hilb.h:10

§ positiveTropicalStartingPoint()

BOOLEAN positiveTropicalStartingPoint ( leftv  res,
leftv  args 
)

Definition at line 115 of file startingCone.cc.

116 {
117  leftv u = args;
118  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
119  {
120  ideal I = (ideal) u->Data();
121  if ((I->m[0]!=NULL) && (idElem(I)==1))
122  {
123  tropicalStrategy currentStrategy(I,currRing);
124  poly g = I->m[0];
125  std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
126  for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
127  {
128  gfan::ZMatrix ray = zc->extremeRays();
129  for (int i=0; i<ray.getHeight(); i++)
130  {
131  if (ray[i].toVector().isPositive())
132  {
133  res->rtyp = BIGINTMAT_CMD;
134  res->data = (void*) zVectorToBigintmat(ray[i].toVector());
135  return FALSE;
136  }
137  }
138  }
139  res->rtyp = BIGINTMAT_CMD;
140  res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
141  return FALSE;
142  }
143  WerrorS("positiveTropicalStartingPoint: ideal not principal");
144  return TRUE;
145  }
146  WerrorS("positiveTropicalStartingPoint: unexpected parameters");
147  return TRUE;
148 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
g
Definition: cfModGcd.cc:4031
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN tropicalVariety(leftv res, leftv args)
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
int idElem(const ideal F)
count non-zero elements
polyrec * poly
Definition: hilb.h:10

§ tropicalStartingCone() [1/2]

groebnerCone tropicalStartingCone ( const tropicalStrategy currentCase)

Definition at line 335 of file startingCone.cc.

336 {
337  ring r = currentStrategy.getStartingRing();
338  ideal I = currentStrategy.getStartingIdeal();
339  currentStrategy.reduce(I,r);
340  if (currentStrategy.isValuationTrivial())
341  {
342  // copy the data, so that it be deleted when passed to the loop
343  // s <- r
344  // inI <- I
345  ring s = rCopy(r);
346  int k = IDELEMS(I); ideal inI = idInit(k);
347  nMapFunc identityMap = n_SetMap(r->cf,s->cf);
348  for (int i=0; i<k; i++)
349  {
350  if(I->m[i]!=NULL)
351  {
352  inI->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0);
353  }
354  }
355 
356  // repeatedly computes a point in the tropical variety outside the lineality space,
357  // take the initial ideal with respect to it
358  // and check whether the dimension of its homogeneity space
359  // equals the dimension of the tropical variety
360  gfan::ZCone zc = linealitySpaceOfGroebnerFan(inI,s);
361  gfan::ZVector startingPoint; groebnerCone ambientMaximalCone;
362  if (zc.dimension()>=currentStrategy.getExpectedDimension())
363  {
364  // check whether the lineality space is contained in the tropical variety
365  // i.e. whether the ideal does not contain a monomial
367  if (mon)
368  {
369  groebnerCone emptyCone = groebnerCone();
370  p_Delete(&mon,r);
371  id_Delete(&inI,s);
372  return emptyCone;
373  }
374  groebnerCone startingCone(inI,inI,s,currentStrategy);
375  id_Delete(&inI,s);
376  return startingCone;
377  }
378  while (zc.dimension()<currentStrategy.getExpectedDimension())
379  {
380  // compute a point in the tropical variety outside the lineality space
381  std::pair<gfan::ZVector,groebnerCone> startingData = tropicalStartingDataViaGroebnerFan(inI,s,currentStrategy);
382  startingPoint = startingData.first;
383  ambientMaximalCone = groebnerCone(startingData.second);
384 
385  id_Delete(&inI,s); rDelete(s);
386  inI = ambientMaximalCone.getPolynomialIdeal();
387  s = ambientMaximalCone.getPolynomialRing();
388 
389  // compute the initial ideal with respect to the weight
390  inI = initial(inI,s,startingPoint);
391  zc = linealitySpaceOfGroebnerFan(inI,s);
392  }
393 
394  // once the dimension of the homogeneity space equals that of the tropical variety
395  // we know that we have an initial ideal with respect to a weight
396  // in the relative interior of a maximal cone in the tropical variety
397  // from this we can read of the inequalities and equations
398 
399  // but before doing so, we must lift the generating set of inI
400  // to a generating set of I
401  ideal J = lift(I,r,inI,s); // todo: use computeLift from tropicalStrategy
402  groebnerCone startingCone(J,inI,s,currentStrategy);
403  id_Delete(&inI,s);
404  id_Delete(&J,s);
405 
406  // assume(checkContainmentInTropicalVariety(startingCone));
407  return startingCone;
408  }
409  else
410  {
411  // copy the data, so that it be deleted when passed to the loop
412  // s <- r
413  // inJ <- I
414  ring s = rCopy(r);
415  int k = IDELEMS(I); ideal inJ = idInit(k);
416  nMapFunc identityMap = n_SetMap(r->cf,s->cf);
417  for (int i=0; i<k; i++)
418  {
419  if(I->m[i]!=NULL)
420  {
421  inJ->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0);
422  }
423  }
424 
425  // and check whether the dimension of its homogeneity space
426  // equals the dimension of the tropical variety
427  gfan::ZCone zc = linealitySpaceOfGroebnerFan(inJ,s);
428  if (zc.dimension()>=currentStrategy.getExpectedDimension())
429  { // this shouldn't happen as trivial cases should be caught beforehand
430  // this is the case that the tropical variety consists soely out of the lineality space
432  if (mon)
433  {
434  groebnerCone emptyCone = groebnerCone();
435  p_Delete(&mon,r);
436  return emptyCone;
437  }
438  groebnerCone startingCone(I,inJ,s,currentStrategy);
439  id_Delete(&inJ,s);
440  rDelete(s);
441  return startingCone;
442  }
443 
444  // compute a point in the tropical variety outside the lineality space
445  // compute the initial ideal with respect to the weight
446  std::pair<gfan::ZVector,groebnerCone> startingData = tropicalStartingDataViaGroebnerFan(inJ,s,currentStrategy);
447  gfan::ZVector startingPoint = startingData.first;
448  groebnerCone ambientMaximalCone = groebnerCone(startingData.second);
449  id_Delete(&inJ,s); rDelete(s);
450  inJ = ambientMaximalCone.getPolynomialIdeal();
451  s = ambientMaximalCone.getPolynomialRing();
452  inJ = initial(inJ,s,startingPoint);
453  ideal inI = initial(I,r,startingPoint);
454  zc = linealitySpaceOfGroebnerFan(inJ,s);
455 
456  // and check whether the dimension of its homogeneity space
457  // equals the dimension of the tropical variety
458  if (zc.dimension()==currentStrategy.getExpectedDimension())
459  { // this case shouldn't happen as trivial cases should be caught beforehand
460  // this is the case that the tropical variety has a one-codimensional lineality space
461  ideal J = lift(I,r,inJ,s); // todo: use computeLift from tropicalStrategy
462  groebnerCone startingCone(J,inJ,s,currentStrategy);
463  id_Delete(&inJ,s);
464  id_Delete(&J,s);
465  return startingCone;
466  }
467 
468  // from this point on, inJ contains the uniformizing parameter,
469  // hence it contains a monomial if and only if its residue over the residue field does.
470  // so we will switch to the residue field
471  ring rShortcut = rCopy0(r);
472  nKillChar(rShortcut->cf);
473  rShortcut->cf = nCopyCoeff((currentStrategy.getShortcutRing())->cf);
474  rComplete(rShortcut);
475  rTest(rShortcut);
476  k = IDELEMS(inJ);
477  ideal inJShortcut = idInit(k);
478  nMapFunc takingResidues = n_SetMap(s->cf,rShortcut->cf);
479  for (int i=0; i<k; i++)
480  {
481  if(inJ->m[i]!=NULL)
482  {
483  inJShortcut->m[i] = p_PermPoly(inJ->m[i],NULL,s,rShortcut,takingResidues,NULL,0);
484  }
485  }
486  idSkipZeroes(inJShortcut);
487  id_Delete(&inJ,s);
488 
489  // we are interested in a maximal cone of the tropical variety of inJShortcut
490  // this basically equivalent to the case without valuation (or constant coefficient case)
491  // except that our ideal is still only homogeneous in the later variables,
492  // hence we set the optional parameter completelyHomogeneous as 'false'
493  tropicalStrategy shortcutStrategy(inJShortcut,rShortcut,false);
494  groebnerCone startingConeShortcut = tropicalStartingCone(shortcutStrategy);
495  id_Delete(&inJShortcut,rShortcut); rDelete(rShortcut);
496 
497  // now we need to obtain the initial of the residue of inJ
498  // with respect to a weight in the tropical cone,
499  // and obtain the initial of inJ with respect to the same weight
500  ring sShortcut = startingConeShortcut.getPolynomialRing();
501  inJShortcut = startingConeShortcut.getPolynomialIdeal();
502  gfan::ZCone zd = startingConeShortcut.getPolyhedralCone();
503  gfan::ZVector interiorPoint = startingConeShortcut.getInteriorPoint();
504  inJShortcut = initial(inJShortcut,sShortcut,interiorPoint);
505  inI = initial(inI,r,interiorPoint);
506 
507  s = rCopy0(sShortcut); // s will be a ring over the valuation ring
508  nKillChar(s->cf); // with the same ordering as sShortcut
509  s->cf = nCopyCoeff(r->cf);
510  rComplete(s);
511  rTest(s);
512 
513  k = IDELEMS(inJShortcut); // inJ will be overwritten with initial of inJ
514  inJ = idInit(k+1);
515  inJ->m[0] = p_One(s); // with respect to that weight
516  identityMap = n_SetMap(r->cf,s->cf); // first element will obviously be p
517  p_SetCoeff(inJ->m[0],identityMap(currentStrategy.getUniformizingParameter(),r->cf,s->cf),s);
518  nMapFunc findingRepresentatives = n_SetMap(sShortcut->cf,s->cf);
519  for (int i=0; i<k; i++) // and then come the rest
520  {
521  if(inJShortcut->m[i]!=NULL)
522  {
523  inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,sShortcut,s,findingRepresentatives,NULL,0);
524  }
525  }
526 
527  ideal J = currentStrategy.computeLift(inJ,s,inI,I,r);
528  // currentStrategy.reduce(J,s);
529  groebnerCone startingCone(J,inJ,s,currentStrategy);
530  id_Delete(&inJ,s);
531  id_Delete(&J,s);
532  rDelete(s);
533  id_Delete(&inI,r);
534 
535  // assume(checkContainmentInTropicalVariety(startingCone));
536  return startingCone;
537  }
538 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
gfan::ZCone getPolyhedralCone() const
Definition: groebnerCone.h:65
gfan::ZCone groebnerCone(const ideal I, const ring r, const gfan::ZVector &w)
Definition: tropical.cc:156
ring getPolynomialRing() const
Definition: groebnerCone.h:64
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
groebnerCone tropicalStartingCone(const tropicalStrategy &currentStrategy)
int k
Definition: cfEzgcd.cc:93
static gfan::ZCone linealitySpaceOfGroebnerFan(const ideal I, const ring r)
static number p_SetCoeff(poly p, number n, ring r)
Definition: p_polys.h:407
ideal lift(const ideal J, const ring r, const ideal inI, const ring s)
Definition: lift.cc:24
poly initial(const poly p, const ring r, const gfan::ZVector w)
Returns the initial form of p with respect to w.
Definition: initial.cc:32
const ring r
Definition: syzextra.cc:208
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
Definition: p_polys.cc:3939
poly p_One(const ring r)
Definition: p_polys.cc:1313
BOOLEAN rComplete(ring r, int force)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
Definition: ring.cc:3435
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition: ring.cc:1321
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
#define rTest(r)
Definition: ring.h:775
poly checkForMonomialViaSuddenSaturation(const ideal I, const ring r)
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition: coeffs.h:433
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
ring rCopy(ring r)
Definition: ring.cc:1619
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
gfan::ZVector getInteriorPoint() const
Definition: groebnerCone.h:66
std::pair< gfan::ZVector, groebnerCone > tropicalStartingDataViaGroebnerFan(const ideal I, const ring r, const tropicalStrategy &currentStrategy)
Computes a starting point outside the lineatliy space by traversing the Groebner fan, checking each cone whether it contains a ray in the tropical variety.
Definition: startingCone.cc:74
polyrec * poly
Definition: hilb.h:10
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
ideal getPolynomialIdeal() const
Definition: groebnerCone.h:63

§ tropicalStartingCone() [2/2]

BOOLEAN tropicalStartingCone ( leftv  res,
leftv  args 
)

Definition at line 540 of file startingCone.cc.

541 {
542  leftv u = args;
543  if ((u != NULL) && (u->Typ() == IDEAL_CMD))
544  {
545  ideal I = (ideal) u->CopyD();
546  leftv v = u->next;
547  if ((v != NULL) && (v->Typ() == NUMBER_CMD))
548  {
549  number p = (number) v->Data();
550  leftv w = v->next;
551  if (w==NULL)
552  {
553  tropicalStrategy currentStrategy(I,p,currRing);
554  groebnerCone sigma = tropicalStartingCone(currentStrategy);
555  gfan::ZCone* startingCone = new gfan::ZCone(sigma.getPolyhedralCone());
556  res->rtyp = coneID;
557  res->data = (char*) startingCone;
558  return FALSE;
559  }
560  }
561  else
562  {
563  if (v==NULL)
564  {
565  tropicalStrategy currentStrategy(I,currRing);
566  groebnerCone sigma = tropicalStartingCone(currentStrategy);
567  res->rtyp = coneID;
568  res->data = (char*) new gfan::ZCone(sigma.getPolyhedralCone());
569  return FALSE;
570  }
571  }
572  }
573  WerrorS("tropicalStartingCone: unexpected parameters");
574  return TRUE;
575 }
gfan::ZCone getPolyhedralCone() const
Definition: groebnerCone.h:65
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
groebnerCone tropicalStartingCone(const tropicalStrategy &currentStrategy)
void WerrorS(const char *s)
Definition: feFopen.cc:24
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int coneID
Definition: bbcone.cc:26
leftv next
Definition: subexpr.h:88
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
#define NULL
Definition: omList.c:10
const CanonicalForm & w
Definition: facAbsFact.cc:55
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
void * CopyD(int t)
Definition: subexpr.cc:679

§ tropicalStartingPoint()

BOOLEAN tropicalStartingPoint ( leftv  res,
leftv  args 
)

Definition at line 257 of file startingCone.cc.

258 {
259  leftv u = args;
260  if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
261  {
262  ideal I = (ideal) u->Data();
263  tropicalStrategy currentStrategy(I,currRing);
264  if ((I->m[0]!=NULL) && (idElem(I)==1))
265  {
266  poly g = I->m[0];
267  std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
268  if (Tg.empty())
269  {
270  res->rtyp = BIGINTMAT_CMD;
271  res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
272  return FALSE;
273  }
274  gfan::ZCone C = *(Tg.begin());
275  gfan::ZMatrix rays = C.extremeRays();
276  if (rays.getHeight()==0)
277  {
278  gfan::ZMatrix lin = C.generatorsOfLinealitySpace();
279  res->rtyp = BIGINTMAT_CMD;
280  res->data = (void*) zVectorToBigintmat(lin[0]);
281  return FALSE;
282  }
283  res->rtyp = BIGINTMAT_CMD;
284  res->data = (void*) zVectorToBigintmat(rays[0]);
285  return FALSE;
286  }
287  gfan::ZCone C0 = currentStrategy.getHomogeneitySpace();
288  if (C0.dimension()==currentStrategy.getExpectedDimension())
289  {
290  gfan::ZMatrix lin = C0.generatorsOfLinealitySpace();
291  res->rtyp = BIGINTMAT_CMD;
292  res->data = (void*) zVectorToBigintmat(lin[0]);
293  return FALSE;
294  }
295  std::pair<gfan::ZVector,groebnerCone> startingData = tropicalStartingDataViaGroebnerFan(I,currRing,currentStrategy);
296  gfan::ZVector startingPoint = startingData.first;
297  res->rtyp = BIGINTMAT_CMD;
298  res->data = (void*) zVectorToBigintmat(startingPoint);
299  return FALSE;
300  }
301  WerrorS("tropicalStartingPoint: unexpected parameters");
302  return TRUE;
303 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
g
Definition: cfModGcd.cc:4031
void WerrorS(const char *s)
Definition: feFopen.cc:24
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
BOOLEAN tropicalVariety(leftv res, leftv args)
BOOLEAN rays(leftv res, leftv args)
Definition: bbcone.cc:628
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
std::pair< gfan::ZVector, groebnerCone > tropicalStartingDataViaGroebnerFan(const ideal I, const ring r, const tropicalStrategy &currentStrategy)
Computes a starting point outside the lineatliy space by traversing the Groebner fan, checking each cone whether it contains a ray in the tropical variety.
Definition: startingCone.cc:74
void * Data()
Definition: subexpr.cc:1121
int idElem(const ideal F)
count non-zero elements
polyrec * poly
Definition: hilb.h:10