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.

{
int n = rVar(r);
poly g;
int* leadexpv = (int*) omAlloc((n+1)*sizeof(int));
int* tailexpv = (int*) omAlloc((n+1)*sizeof(int));
gfan::ZVector leadexpw = gfan::ZVector(n);
gfan::ZVector tailexpw = gfan::ZVector(n);
gfan::ZMatrix equations = gfan::ZMatrix(0,n);
for (int i=0; i<IDELEMS(I); i++)
{
g = (poly) I->m[i];
if (g)
{
p_GetExpV(g,leadexpv,r);
leadexpw = intStar2ZVector(n,leadexpv);
pIter(g);
while (g)
{
p_GetExpV(g,tailexpv,r);
tailexpw = intStar2ZVector(n,tailexpv);
equations.appendRow(leadexpw-tailexpw);
pIter(g);
}
}
}
omFreeSize(leadexpv,(n+1)*sizeof(int));
omFreeSize(tailexpv,(n+1)*sizeof(int));
return gfan::ZCone(gfan::ZMatrix(0, equations.getWidth()),equations);
}
equations
BOOLEAN equations(leftv res, leftv args)
Definition bbcone.cc:577
intStar2ZVector
gfan::ZVector intStar2ZVector(const int d, const int *i)
Definition callgfanlib_conversion.cc:86
i
int i
Definition cfEzgcd.cc:132
g
g
Definition cfModGcd.cc:4098
pIter
#define pIter(p)
Definition monomials.h:37
omFreeSize
#define omFreeSize(addr, size)
Definition omAllocDecl.h:260
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
p_GetExpV
static void p_GetExpV(poly p, int *ev, const ring r)
Definition p_polys.h:1541
rVar
static short rVar(const ring r)
define rVar(r) (r->N)
Definition ring.h:598
IDELEMS
#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.

{
int n = rVar(r);
poly g = NULL;
int* leadexpv = (int*) omAlloc((n+1)*sizeof(int));
int* tailexpv = (int*) omAlloc((n+1)*sizeof(int));
gfan::ZVector leadexpw = gfan::ZVector(n);
gfan::ZVector tailexpw = gfan::ZVector(n);
gfan::ZMatrix inequalities = gfan::ZMatrix(0,n);
for (int i=0; i<IDELEMS(I); i++)
{
g = (poly) I->m[i];
if (g != NULL && pNext(g) != NULL)
{
p_GetExpV(g,leadexpv,r);
leadexpw = intStar2ZVector(n, leadexpv);
pIter(g);
while (g != NULL)
{
p_GetExpV(g,tailexpv,r);
tailexpw = intStar2ZVector(n, tailexpv);
inequalities.appendRow(leadexpw-tailexpw);
pIter(g);
}
}
}
omFreeSize(leadexpv,(n+1)*sizeof(int));
omFreeSize(tailexpv,(n+1)*sizeof(int));
return gfan::ZCone(inequalities,gfan::ZMatrix(0, inequalities.getWidth()));
}
inequalities
BOOLEAN inequalities(leftv res, leftv args)
Definition bbcone.cc:560
pNext
#define pNext(p)
Definition monomials.h:36
NULL
#define NULL
Definition omList.c:12

## tropical_setup()

void tropical_setup | ( | SModulFunctions * | p | ) |

Definition at line 441 of file tropical.cc.

{
p->iiAddCproc("tropical.lib","groebnerConeInternal",FALSE,groebnerCone);
p->iiAddCproc("tropical.lib","maximalGroebnerConeInternal",FALSE,maximalGroebnerCone);
p->iiAddCproc("tropical.lib","homogeneitySpaceInternal",FALSE,homogeneitySpace);
// p->iiAddCproc("","lowerHomogeneitySpaceInternal",FALSE,lowerHomogeneitySpace);
p->iiAddCproc("tropical.lib","initialInternal",FALSE,initial);
p->iiAddCproc("tropical.lib","tropicalVarietyInternal",FALSE,tropicalVariety);
p->iiAddCproc("tropical.lib","groebnerFanInternal",FALSE,groebnerFan);
p->iiAddCproc("tropical.lib","groebnerComplexInternal",FALSE,groebnerComplex);
// p->iiAddCproc("","ppreduceInitiallyInternal",FALSE,ppreduceInitially);
// p->iiAddCproc("","ttreduceInitiallyInternal",FALSE,ttreduceInitially);
}
FALSE
#define FALSE
Definition auxiliary.h:97
p
int p
Definition cfModGcd.cc:4086
groebnerCone
Definition groebnerCone.h:28
groebnerComplex
gfan::ZFan * groebnerComplex(const tropicalStrategy currentStrategy)
Definition groebnerComplex.cc:11
groebnerFan
gfan::ZFan * groebnerFan(const tropicalStrategy currentStrategy)
Definition groebnerFan.cc:28
initial
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
tropicalVariety
BOOLEAN tropicalVariety(leftv res, leftv args)
Definition tropicalVariety.cc:43
homogeneitySpace
gfan::ZCone homogeneitySpace(ideal I, ring r)
Definition tropical.cc:19
maximalGroebnerCone
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.