My Project
Loading...
Searching...
No Matches
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:4098
#define pIter(p)
Definition monomials.h:37
#define omFreeSize(addr, size)
#define omAlloc(size)
static void p_GetExpV(poly p, int *ev, const ring r)
Definition p_polys.h:1536
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition ring.h:598
#define IDELEMS(i)

◆ 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","groebnerConeInternal",FALSE,groebnerCone);
444 p->iiAddCproc("tropical.lib","maximalGroebnerConeInternal",FALSE,maximalGroebnerCone);
445 p->iiAddCproc("tropical.lib","homogeneitySpaceInternal",FALSE,homogeneitySpace);
446 // p->iiAddCproc("","lowerHomogeneitySpaceInternal",FALSE,lowerHomogeneitySpace);
447 p->iiAddCproc("tropical.lib","initialInternal",FALSE,initial);
448 p->iiAddCproc("tropical.lib","tropicalVarietyInternal",FALSE,tropicalVariety);
449 p->iiAddCproc("tropical.lib","groebnerFanInternal",FALSE,groebnerFan);
450 p->iiAddCproc("tropical.lib","groebnerComplexInternal",FALSE,groebnerComplex);
451 // p->iiAddCproc("","ppreduceInitiallyInternal",FALSE,ppreduceInitially);
452 // p->iiAddCproc("","ttreduceInitiallyInternal",FALSE,ttreduceInitially);
453}
#define FALSE
Definition auxiliary.h:97
int p
Definition cfModGcd.cc:4086
gfan::ZFan * groebnerComplex(const tropicalStrategy currentStrategy)
gfan::ZFan * groebnerFan(const tropicalStrategy currentStrategy)
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:30
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

Variable Documentation

◆ tropicalVerboseLevel

EXTERN_VAR int tropicalVerboseLevel

Definition at line 7 of file tropical.h.