My Project
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

EXTERN_VAR 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}
BOOLEAN equations(leftv res, leftv args)
Definition: bbcone.cc:577
gfan::ZVector intStar2ZVector(const int d, const int *i)
int i
Definition: cfEzgcd.cc:132
g
Definition: cfModGcd.cc:4090
if(!FE_OPT_NO_SHELL_FLAG)(void) system(sys)
#define pIter(p)
Definition: monomials.h:37
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260
#define omAlloc(size)
Definition: omAllocDecl.h:210
static void p_GetExpV(poly p, int *ev, const ring r)
Definition: p_polys.h:1518
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:592
#define IDELEMS(i)
Definition: simpleideals.h:23

◆ 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}
BOOLEAN inequalities(leftv res, leftv args)
Definition: bbcone.cc:560
#define pNext(p)
Definition: monomials.h:36
#define NULL
Definition: omList.c:12

◆ 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}
#define FALSE
Definition: auxiliary.h:96
int p
Definition: cfModGcd.cc:4078
gfan::ZFan * groebnerComplex(const tropicalStrategy currentStrategy)
gfan::ZFan * groebnerFan(const tropicalStrategy currentStrategy)
Definition: groebnerFan.cc:28
BOOLEAN tropicalVariety(leftv res, leftv args)
gfan::ZCone homogeneitySpace(ideal I, ring r)
Definition: tropical.cc:19
gfan::ZCone maximalGroebnerCone(const ideal &I, const ring &r)
Definition: tropical.cc:291
BOOLEAN initial(leftv res, leftv args)
Definition: tropical.cc:373

Variable Documentation

◆ tropicalVerboseLevel

EXTERN_VAR int tropicalVerboseLevel

Definition at line 7 of file tropical.h.