My Project  UNKNOWN_GIT_VERSION
Functions | Variables
tropical.h File Reference
#include "Singular/ipid.h"

Go to the source code of this file.

Functions

gfan::ZCone maximalGroebnerCone (const ideal &I, const ring &r)
 
gfan::ZCone homogeneitySpace (ideal I, ring r)
 
void tropical_setup (SModulFunctions *p)
 

Variables

int tropicalVerboseLevel
 

Function Documentation

◆ homogeneitySpace()

gfan::ZCone homogeneitySpace ( ideal  I,
ring  r 
)

Definition at line 19 of file tropical.cc.

20 {
21  int n = rVar(r);
22  poly g;
23  int* leadexpv = (int*) omAlloc((n+1)*sizeof(int));
24  int* tailexpv = (int*) omAlloc((n+1)*sizeof(int));
25  gfan::ZVector leadexpw = gfan::ZVector(n);
26  gfan::ZVector tailexpw = gfan::ZVector(n);
27  gfan::ZMatrix equations = gfan::ZMatrix(0,n);
28  for (int i=0; i<IDELEMS(I); i++)
29  {
30  g = (poly) I->m[i];
31  if (g)
32  {
33  p_GetExpV(g,leadexpv,r);
34  leadexpw = intStar2ZVector(n,leadexpv);
35  pIter(g);
36  while (g)
37  {
38  p_GetExpV(g,tailexpv,r);
39  tailexpw = intStar2ZVector(n,tailexpv);
40  equations.appendRow(leadexpw-tailexpw);
41  pIter(g);
42  }
43  }
44  }
45  omFreeSize(leadexpv,(n+1)*sizeof(int));
46  omFreeSize(tailexpv,(n+1)*sizeof(int));
47  return gfan::ZCone(gfan::ZMatrix(0, equations.getWidth()),equations);
48 }

◆ maximalGroebnerCone()

gfan::ZCone maximalGroebnerCone ( const ideal &  I,
const ring &  r 
)

Definition at line 291 of file tropical.cc.

292 {
293  int n = rVar(r);
294  poly g = NULL;
295  int* leadexpv = (int*) omAlloc((n+1)*sizeof(int));
296  int* tailexpv = (int*) omAlloc((n+1)*sizeof(int));
297  gfan::ZVector leadexpw = gfan::ZVector(n);
298  gfan::ZVector tailexpw = gfan::ZVector(n);
299  gfan::ZMatrix inequalities = gfan::ZMatrix(0,n);
300  for (int i=0; i<IDELEMS(I); i++)
301  {
302  g = (poly) I->m[i];
303  if (g != NULL && pNext(g) != NULL)
304  {
305  p_GetExpV(g,leadexpv,r);
306  leadexpw = intStar2ZVector(n, leadexpv);
307  pIter(g);
308  while (g != NULL)
309  {
310  p_GetExpV(g,tailexpv,r);
311  tailexpw = intStar2ZVector(n, tailexpv);
312  inequalities.appendRow(leadexpw-tailexpw);
313  pIter(g);
314  }
315  }
316  }
317  omFreeSize(leadexpv,(n+1)*sizeof(int));
318  omFreeSize(tailexpv,(n+1)*sizeof(int));
319  return gfan::ZCone(inequalities,gfan::ZMatrix(0, inequalities.getWidth()));
320 }

◆ tropical_setup()

void tropical_setup ( SModulFunctions p)

Definition at line 441 of file tropical.cc.

442 {
443  p->iiAddCproc("tropical.lib","groebnerCone",FALSE,groebnerCone);
444  p->iiAddCproc("tropical.lib","maximalGroebnerCone",FALSE,maximalGroebnerCone);
445  p->iiAddCproc("tropical.lib","homogeneitySpace",FALSE,homogeneitySpace);
446  // p->iiAddCproc("","lowerHomogeneitySpace",FALSE,lowerHomogeneitySpace);
447  p->iiAddCproc("tropical.lib","initial",FALSE,initial);
448  p->iiAddCproc("tropical.lib","tropicalVariety",FALSE,tropicalVariety);
449  p->iiAddCproc("tropical.lib","groebnerFan",FALSE,groebnerFan);
450  p->iiAddCproc("tropical.lib","groebnerComplex",FALSE,groebnerComplex);
451  // p->iiAddCproc("","ppreduceInitially",FALSE,ppreduceInitially);
452  // p->iiAddCproc("","ttreduceInitially",FALSE,ttreduceInitially);
453 }

Variable Documentation

◆ tropicalVerboseLevel

int tropicalVerboseLevel

Definition at line 17 of file tropical.cc.

FALSE
#define FALSE
Definition: auxiliary.h:94
g
g
Definition: cfModGcd.cc:4031
groebnerComplex
gfan::ZFan * groebnerComplex(const tropicalStrategy currentStrategy)
Definition: groebnerComplex.cc:11
intStar2ZVector
gfan::ZVector intStar2ZVector(const int d, const int *i)
Definition: callgfanlib_conversion.cc:86
rVar
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:582
i
int i
Definition: cfEzgcd.cc:125
omFreeSize
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
pIter
#define pIter(p)
Definition: monomials.h:38
omAlloc
#define omAlloc(size)
Definition: omAllocDecl.h:210
homogeneitySpace
gfan::ZCone homogeneitySpace(ideal I, ring r)
Definition: tropical.cc:19
p_GetExpV
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1457
inequalities
BOOLEAN inequalities(leftv res, leftv args)
Definition: bbcone.cc:560
initial
BOOLEAN initial(leftv res, leftv args)
Definition: tropical.cc:373
groebnerFan
gfan::ZFan * groebnerFan(const tropicalStrategy currentStrategy)
Definition: groebnerFan.cc:28
groebnerCone
Definition: groebnerCone.h:28
maximalGroebnerCone
gfan::ZCone maximalGroebnerCone(const ideal &I, const ring &r)
Definition: tropical.cc:291
NULL
#define NULL
Definition: omList.c:10
equations
BOOLEAN equations(leftv res, leftv args)
Definition: bbcone.cc:577
p
int p
Definition: cfModGcd.cc:4019
tropicalVariety
BOOLEAN tropicalVariety(leftv res, leftv args)
Definition: tropicalVariety.cc:43
IDELEMS
#define IDELEMS(i)
Definition: simpleideals.h:26
pNext
#define pNext(p)
Definition: monomials.h:37
if
if(yy_init)
Definition: libparse.cc:1418