Loading...
Searching...
No Matches
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)

## Variables

gfan::ZMatrix | tropicalStartingPoints

## Function Documentation

## groebnerStartingCone()

groebnerCone groebnerStartingCone | ( | const tropicalStrategy & | currentStrategy | ) |

Definition at line 21 of file startingCone.cc.

{
groebnerCone sigma(currentStrategy.getStartingIdeal(), currentStrategy.getStartingRing(), currentStrategy);
return sigma;
}
groebnerCone
Definition groebnerCone.h:28
tropicalStrategy::getStartingRing
ring getStartingRing() const
returns the polynomial ring over the valuation ring
Definition tropicalStrategy.h:176
tropicalStrategy::getStartingIdeal
ideal getStartingIdeal() const
returns the input ideal
Definition tropicalStrategy.h:185

## negativeTropicalStartingPoint()

BOOLEAN negativeTropicalStartingPoint | ( | leftv | res,
|  | leftv | args )

Definition at line 191 of file startingCone.cc.

{
leftv u = args;
if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
{
ideal I = (ideal) u->Data();
if ((I->m[0]!=NULL) && (idElem(I)==1))
{
tropicalStrategy currentStrategy(I,currRing);
poly g = I->m[0];
std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
{
gfan::ZMatrix ray = zc->extremeRays();
for (int i=0; i<ray.getHeight(); i++)
{
gfan::ZVector negatedRay = gfan::Integer(-1)*ray[i].toVector();
if (negatedRay.isPositive())
{
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(ray[i].toVector());
return FALSE;
}
}
}
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
return FALSE;
}
WerrorS("negativeTropicalStartingPoint: ideal not principal");
return TRUE;
}
WerrorS("negativeTropicalStartingPoint: unexpected parameters");
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
zVectorToBigintmat
bigintmat * zVectorToBigintmat(const gfan::ZVector &zv)
Definition callgfanlib_conversion.cc:21
i
int i
Definition cfEzgcd.cc:132
g
g
Definition cfModGcd.cc:4098
sleftv::Typ
int Typ()
Definition subexpr.cc:1048
sleftv::Data
void * Data()
Definition subexpr.cc:1192
tropicalStrategy
Definition tropicalStrategy.h:37
res
CanonicalForm res
Definition facAbsFact.cc:60
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
BIGINTMAT_CMD
@ BIGINTMAT_CMD
Definition grammar.cc:278
NULL
#define NULL
Definition omList.c:12
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
idElem
static int idElem(const ideal F)
number of non-zero polys in F
Definition simpleideals.h:69
leftv
sleftv * leftv
Definition structs.h:53
tropicalVariety
BOOLEAN tropicalVariety(leftv res, leftv args)
Definition tropicalVariety.cc:43

## nonNegativeTropicalStartingPoint()

BOOLEAN nonNegativeTropicalStartingPoint | ( | leftv | res,
|  | leftv | args )

Definition at line 156 of file startingCone.cc.

{
leftv u = args;
if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
{
ideal I = (ideal) u->Data();
if ((I->m[0]!=NULL) && (idElem(I)==1))
{
tropicalStrategy currentStrategy(I,currRing);
poly g = I->m[0];
std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
{
gfan::ZMatrix ray = zc->extremeRays();
for (int i=0; i<ray.getHeight(); i++)
{
if (ray[i].toVector().isNonNegative())
{
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(ray[i].toVector());
return FALSE;
}
}
}
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
return FALSE;
}
WerrorS("nonNegativeTropicalStartingPoint: ideal not principal");
return TRUE;
}
WerrorS("nonNegativeTropicalStartingPoint: unexpected parameters");
return TRUE;
}

## nonPositiveTropicalStartingPoint()

BOOLEAN nonPositiveTropicalStartingPoint | ( | leftv | res,
|  | leftv | args )

Definition at line 227 of file startingCone.cc.

{
leftv u = args;
if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
{
ideal I = (ideal) u->Data();
if ((I->m[0]!=NULL) && (idElem(I)==1))
{
tropicalStrategy currentStrategy(I,currRing);
poly g = I->m[0];
std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
{
gfan::ZMatrix ray = zc->extremeRays();
for (int i=0; i<ray.getHeight(); i++)
{
gfan::ZVector negatedRay = gfan::Integer(-1)*ray[i].toVector();
if (negatedRay.isNonNegative())
{
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(ray[i]);
return FALSE;
}
}
}
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
return FALSE;
}
WerrorS("nonPositiveTropicalStartingPoint: ideal not principal");
return TRUE;
}
WerrorS("nonPositiveTropicalStartingPoint: unexpected parameters");
return TRUE;
}

## positiveTropicalStartingPoint()

BOOLEAN positiveTropicalStartingPoint | ( | leftv | res,
|  | leftv | args )

Definition at line 121 of file startingCone.cc.

{
leftv u = args;
if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
{
ideal I = (ideal) u->Data();
if ((I->m[0]!=NULL) && (idElem(I)==1))
{
tropicalStrategy currentStrategy(I,currRing);
poly g = I->m[0];
std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
for (std::set<gfan::ZCone>::iterator zc=Tg.begin(); zc!=Tg.end(); zc++)
{
gfan::ZMatrix ray = zc->extremeRays();
for (int i=0; i<ray.getHeight(); i++)
{
if (ray[i].toVector().isPositive())
{
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(ray[i].toVector());
return FALSE;
}
}
}
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
return FALSE;
}
WerrorS("positiveTropicalStartingPoint: ideal not principal");
return TRUE;
}
WerrorS("positiveTropicalStartingPoint: unexpected parameters");
return TRUE;
}

## tropicalStartingCone() [1/2]

groebnerCone tropicalStartingCone | ( | const tropicalStrategy & | currentCase | ) |

Definition at line 374 of file startingCone.cc.

{
ring r = currentStrategy.getStartingRing();
ideal I = currentStrategy.getStartingIdeal();
currentStrategy.reduce(I,r);
if (currentStrategy.isValuationTrivial())
{
// copy the data, so that it be deleted when passed to the loop
// s <- r
// inI <- I
ring s = rCopy(r);
int k = IDELEMS(I); ideal inI = idInit(k);
nMapFunc identityMap = n_SetMap(r->cf,s->cf);
for (int i=0; i<k; i++)
{
if(I->m[i]!=NULL)
{
inI->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0);
}
}
// repeatedly computes a point in the tropical variety outside the lineality space,
// take the initial ideal with respect to it
// and check whether the dimension of its homogeneity space
// equals the dimension of the tropical variety
gfan::ZCone zc = linealitySpaceOfGroebnerFan(inI,s);
groebnerCone ambientMaximalCone;
if (zc.dimension()>=currentStrategy.getExpectedDimension())
{
// check whether the lineality space is contained in the tropical variety
// i.e. whether the ideal does not contain a monomial
poly mon = checkForMonomialViaSuddenSaturation(I,r);
if (mon)
{
groebnerCone emptyCone = groebnerCone();
p_Delete(&mon,r);
id_Delete(&inI,s);
return emptyCone;
}
groebnerCone startingCone(inI,inI,s,currentStrategy);
id_Delete(&inI,s);
return startingCone;
}
while (zc.dimension()<currentStrategy.getExpectedDimension())
{
// compute a point in the tropical variety outside the lineality space
std::pair<gfan::ZVector,groebnerCone> startingData = tropicalStartingDataViaGroebnerFan(inI,s,currentStrategy);
gfan::ZVector startingPoint = startingData.first;
tropicalStartingPoints.appendRow(startingPoint);
ambientMaximalCone = groebnerCone(startingData.second);
id_Delete(&inI,s); rDelete(s);
inI = ambientMaximalCone.getPolynomialIdeal();
s = ambientMaximalCone.getPolynomialRing();
// compute the initial ideal with respect to the weight
inI = initial(inI,s,startingPoint);
zc = linealitySpaceOfGroebnerFan(inI,s);
}
// once the dimension of the homogeneity space equals that of the tropical variety
// we know that we have an initial ideal with respect to a weight
// in the relative interior of a maximal cone in the tropical variety
// from this we can read of the inequalities and equations
ring s0 = createTraversalStartingRing(s,tropicalStartingPoints,currentStrategy);
nMapFunc identity = n_SetMap(s->cf,s0->cf);
k = IDELEMS(inI);
ideal inI0 = idInit(k);
for (int i=0; i<k; i++)
inI0->m[i] = p_PermPoly(inI->m[i],NULL,s,s0,identity,NULL,0);
identity = n_SetMap(r->cf,s0->cf);
k = IDELEMS(I);
ideal I0 = idInit(k);
for (int i=0; i<k; i++)
I0->m[i] = p_PermPoly(I->m[i],NULL,r,s0,identity,NULL,0);
// but before doing so, we must lift the generating set of inI
// to a generating set of I
// ideal J0 = lift(I,r,inI0,s0); // todo: use computeLift from tropicalStrategy
ideal J0 = gfanlib_kStd_wrapper(I0,s0);
assume(areIdealsEqual(J0,s0,I,r));
id_Delete(&I0,s0);
groebnerCone startingCone(J0,inI0,s0,currentStrategy);
id_Delete(&J0,s0);
id_Delete(&inI0,s0);
rDelete(s0);
// assume(checkContainmentInTropicalVariety(startingCone));
return startingCone;
}
else
{
// copy the data, so that it be deleted when passed to the loop
// s <- r
// inJ <- I
ring s = rCopy(r);
int k = IDELEMS(I); ideal inJ = idInit(k);
nMapFunc identityMap = n_SetMap(r->cf,s->cf);
for (int i=0; i<k; i++)
{
if(I->m[i]!=NULL)
{
inJ->m[i] = p_PermPoly(I->m[i],NULL,r,s,identityMap,NULL,0);
}
}
// and check whether the dimension of its homogeneity space
// equals the dimension of the tropical variety
gfan::ZCone zc = linealitySpaceOfGroebnerFan(inJ,s);
if (zc.dimension()>=currentStrategy.getExpectedDimension())
{ // this shouldn't happen as trivial cases should be caught beforehand
// this is the case that the tropical variety consists soely out of the lineality space
poly mon = checkForMonomialViaSuddenSaturation(I,r);
if (mon)
{
groebnerCone emptyCone = groebnerCone();
p_Delete(&mon,r);
return emptyCone;
}
groebnerCone startingCone(I,inJ,s,currentStrategy);
id_Delete(&inJ,s);
rDelete(s);
return startingCone;
}
// compute a point in the tropical variety outside the lineality space
// compute the initial ideal with respect to the weight
std::pair<gfan::ZVector,groebnerCone> startingData = tropicalStartingDataViaGroebnerFan(inJ,s,currentStrategy);
gfan::ZVector startingPoint = startingData.first;
tropicalStartingPoints.appendRow(startingPoint);
groebnerCone ambientMaximalCone = groebnerCone(startingData.second);
id_Delete(&inJ,s); rDelete(s);
inJ = ambientMaximalCone.getPolynomialIdeal();
s = ambientMaximalCone.getPolynomialRing();
inJ = initial(inJ,s,startingPoint);
ideal inI = initial(I,r,startingPoint);
zc = linealitySpaceOfGroebnerFan(inJ,s);
// and check whether the dimension of its homogeneity space
// equals the dimension of the tropical variety
if (zc.dimension()==currentStrategy.getExpectedDimension())
{ // this case shouldn't happen as trivial cases should be caught beforehand
// this is the case that the tropical variety has a one-codimensional lineality space
ideal J = lift(I,r,inJ,s); // todo: use computeLift from tropicalStrategy
groebnerCone startingCone(J,inJ,s,currentStrategy);
id_Delete(&inJ,s);
id_Delete(&J,s);
return startingCone;
}
// from this point on, inJ contains the uniformizing parameter,
// hence it contains a monomial if and only if its residue over the residue field does.
// so we will switch to the residue field
ring rShortcut = rCopy0(r);
nKillChar(rShortcut->cf);
rShortcut->cf = nCopyCoeff((currentStrategy.getShortcutRing())->cf);
rComplete(rShortcut);
rTest(rShortcut);
k = IDELEMS(inJ);
ideal inJShortcut = idInit(k);
nMapFunc takingResidues = n_SetMap(s->cf,rShortcut->cf);
for (int i=0; i<k; i++)
{
if(inJ->m[i]!=NULL)
{
inJShortcut->m[i] = p_PermPoly(inJ->m[i],NULL,s,rShortcut,takingResidues,NULL,0);
}
}
idSkipZeroes(inJShortcut);
id_Delete(&inJ,s);
// we are interested in a maximal cone of the tropical variety of inJShortcut
// this basically equivalent to the case without valuation (or constant coefficient case)
// except that our ideal is still only homogeneous in the later variables,
// hence we set the optional parameter completelyHomogeneous as 'false'
tropicalStrategy shortcutStrategy(inJShortcut,rShortcut,false);
groebnerCone startingConeShortcut = tropicalStartingCone(shortcutStrategy);
id_Delete(&inJShortcut,rShortcut); rDelete(rShortcut);
// now we need to obtain the initial of the residue of inJ
// with respect to a weight in the tropical cone,
// and obtain the initial of inJ with respect to the same weight
ring sShortcut = startingConeShortcut.getPolynomialRing();
inJShortcut = startingConeShortcut.getPolynomialIdeal();
gfan::ZCone zd = startingConeShortcut.getPolyhedralCone();
gfan::ZVector interiorPoint = startingConeShortcut.getInteriorPoint();
inJShortcut = initial(inJShortcut,sShortcut,interiorPoint);
inI = initial(inI,r,interiorPoint);
s = rCopy0(sShortcut); // s will be a ring over the valuation ring
nKillChar(s->cf); // with the same ordering as sShortcut
s->cf = nCopyCoeff(r->cf);
rComplete(s);
rTest(s);
k = IDELEMS(inJShortcut); // inJ will be overwritten with initial of inJ
inJ = idInit(k+1);
inJ->m[0] = p_One(s); // with respect to that weight
identityMap = n_SetMap(r->cf,s->cf); // first element will obviously be p
p_SetCoeff(inJ->m[0],identityMap(currentStrategy.getUniformizingParameter(),r->cf,s->cf),s);
nMapFunc findingRepresentatives = n_SetMap(sShortcut->cf,s->cf);
for (int i=0; i<k; i++) // and then come the rest
{
if(inJShortcut->m[i]!=NULL)
{
inJ->m[i+1] = p_PermPoly(inJShortcut->m[i],NULL,sShortcut,s,findingRepresentatives,NULL,0);
}
}
ring s0 = createTraversalStartingRing(s,tropicalStartingPoints,currentStrategy);
nMapFunc identity = n_SetMap(s->cf,s0->cf);
k = IDELEMS(inJ);
ideal inI0 = idInit(k);
for (int i=0; i<k; i++)
inI0->m[i] = p_PermPoly(inJ->m[i],NULL,s,s0,identity,NULL,0);
identity = n_SetMap(r->cf,s0->cf);
k = IDELEMS(I);
ideal I0 = idInit(k);
for (int i=0; i<k; i++)
I0->m[i] = p_PermPoly(I->m[i],NULL,r,s0,identity,NULL,0);
ideal J0 = gfanlib_kStd_wrapper(I0,s0);
groebnerCone startingCone(J0,inI0,s0,currentStrategy);
// ideal J = currentStrategy.computeLift(inJ,s,inI,I,r);
// currentStrategy.reduce(J,s);
// groebnerCone startingCone(J,inJ,s,currentStrategy);
id_Delete(&inJ,s);
// id_Delete(&J,s);
rDelete(s);
id_Delete(&inI,r);
// assume(checkContainmentInTropicalVariety(startingCone));
return startingCone;
}
}
k
int k
Definition cfEzgcd.cc:99
groebnerCone::getPolyhedralCone
gfan::ZCone getPolyhedralCone() const
Definition groebnerCone.h:64
groebnerCone::getPolynomialIdeal
ideal getPolynomialIdeal() const
Definition groebnerCone.h:62
groebnerCone::getPolynomialRing
ring getPolynomialRing() const
Definition groebnerCone.h:63
groebnerCone::getInteriorPoint
gfan::ZVector getInteriorPoint() const
Definition groebnerCone.h:65
n_SetMap
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:703
nCopyCoeff
static FORCE_INLINE coeffs nCopyCoeff(const coeffs r)
"copy" coeffs, i.e. increment ref
Definition coeffs.h:439
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition coeffs.h:80
nKillChar
void nKillChar(coeffs r)
undo all initialisations
Definition numbers.cc:563
checkForMonomialViaSuddenSaturation
poly checkForMonomialViaSuddenSaturation(const ideal I, const ring r)
Definition containsMonomial.cc:9
s
const CanonicalForm int s
Definition facAbsFact.cc:51
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
lift
ideal lift(const ideal J, const ring r, const ideal inI, const ring s)
Definition lift.cc:26
assume
#define assume(x)
Definition mod2.h:389
p_PermPoly
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:4256
p_One
poly p_One(const ring r)
Definition p_polys.cc:1314
p_SetCoeff
static number p_SetCoeff(poly p, number n, ring r)
Definition p_polys.h:414
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
rComplete
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:3527
rCopy0
ring rCopy0(const ring r, BOOLEAN copy_qideal, BOOLEAN copy_ordering)
Definition ring.cc:1427
rDelete
void rDelete(ring r)
unconditionally deletes fields in r
Definition ring.cc:454
rCopy
ring rCopy(ring r)
Definition ring.cc:1737
rTest
#define rTest(r)
Definition ring.h:794
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition simpleideals.cc:35
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
idSkipZeroes
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
Definition simpleideals.cc:201
IDELEMS
#define IDELEMS(i)
Definition simpleideals.h:23
tropicalStartingPoints
gfan::ZMatrix tropicalStartingPoints
Definition startingCone.cc:18
linealitySpaceOfGroebnerFan
static gfan::ZCone linealitySpaceOfGroebnerFan(const ideal I, const ring r)
Definition startingCone.cc:314
createTraversalStartingRing
ring createTraversalStartingRing(const ring s, const gfan::ZMatrix &startingPoints, const tropicalStrategy &currentStrategy)
Definition startingCone.cc:339
tropicalStartingCone
groebnerCone tropicalStartingCone(const tropicalStrategy &currentStrategy)
Definition startingCone.cc:374
tropicalStartingDataViaGroebnerFan
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,...
Definition startingCone.cc:80
gfanlib_kStd_wrapper
ideal gfanlib_kStd_wrapper(ideal I, ring r, tHomog h=testHomog)
Definition std_wrapper.cc:6
areIdealsEqual
bool areIdealsEqual(ideal I, ring r, ideal J, ring s)
Definition tropicalDebug.cc:41
groebnerCone
gfan::ZCone groebnerCone(const ideal I, const ring r, const gfan::ZVector &w)
Definition tropical.cc:156

## tropicalStartingCone() [2/2]

BOOLEAN tropicalStartingCone | ( | leftv | res,
|  | leftv | args )

Definition at line 614 of file startingCone.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == IDEAL_CMD))
{
ideal I = (ideal) u->CopyD();
leftv v = u->next;
if ((v != NULL) && (v->Typ() == NUMBER_CMD))
{
number p = (number) v->Data();
leftv w = v->next;
if (w==NULL)
{
tropicalStrategy currentStrategy(I,p,currRing);
groebnerCone sigma = tropicalStartingCone(currentStrategy);
gfan::ZCone* startingCone = new gfan::ZCone(sigma.getPolyhedralCone());
res->rtyp = coneID;
res->data = (char*) startingCone;
return FALSE;
}
}
else
{
if (v==NULL)
{
tropicalStrategy currentStrategy(I,currRing);
groebnerCone sigma = tropicalStartingCone(currentStrategy);
res->rtyp = coneID;
res->data = (char*) new gfan::ZCone(sigma.getPolyhedralCone());
return FALSE;
}
}
}
WerrorS("tropicalStartingCone: unexpected parameters");
return TRUE;
}
coneID
VAR int coneID
Definition bbcone.cc:25
p
int p
Definition cfModGcd.cc:4086
sleftv::CopyD
void * CopyD(int t)
Definition subexpr.cc:714
sleftv::next
leftv next
Definition subexpr.h:86
w
const CanonicalForm & w
Definition facAbsFact.cc:51
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
NUMBER_CMD
@ NUMBER_CMD
Definition grammar.cc:289

## tropicalStartingPoint()

BOOLEAN tropicalStartingPoint | ( | leftv | res,
|  | leftv | args )

Definition at line 263 of file startingCone.cc.

{
leftv u = args;
if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
{
ideal I = (ideal) u->Data();
tropicalStrategy currentStrategy(I,currRing);
if ((I->m[0]!=NULL) && (idElem(I)==1))
{
poly g = I->m[0];
std::set<gfan::ZCone> Tg = tropicalVariety(g,currRing,&currentStrategy);
if (Tg.empty())
{
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(gfan::ZVector(0));
return FALSE;
}
gfan::ZCone C = *(Tg.begin());
gfan::ZMatrix rays = C.extremeRays();
if (rays.getHeight()==0)
{
gfan::ZMatrix lin = C.generatorsOfLinealitySpace();
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(lin[0]);
return FALSE;
}
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(rays[0]);
return FALSE;
}
gfan::ZCone C0 = currentStrategy.getHomogeneitySpace();
if (C0.dimension()==currentStrategy.getExpectedDimension())
{
gfan::ZMatrix lin = C0.generatorsOfLinealitySpace();
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(lin[0]);
return FALSE;
}
std::pair<gfan::ZVector,groebnerCone> startingData = tropicalStartingDataViaGroebnerFan(I,currRing,currentStrategy);
gfan::ZVector startingPoint = startingData.first;
res->rtyp = BIGINTMAT_CMD;
res->data = (void*) zVectorToBigintmat(startingPoint);
return FALSE;
}
WerrorS("tropicalStartingPoint: unexpected parameters");
return TRUE;
}
rays
BOOLEAN rays(leftv res, leftv args)
Definition bbcone.cc:662

## Variable Documentation

## tropicalStartingPoints

gfan::ZMatrix tropicalStartingPoints

extern

Definition at line 18 of file startingCone.cc.