Loading...
Searching...
No Matches
groebnerComplex.h File Reference

Go to the source code of this file.

## Functions

BOOLEAN | groebnerComplex (leftv res, leftv args)

## Function Documentation

## groebnerComplex()

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

Definition at line 19 of file groebnerComplex.cc.

{
leftv u = args;
if ((u!=NULL) && (u->Typ()==IDEAL_CMD))
{
ideal I = (ideal) u->Data();
leftv v = u->next;
if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
{
leftv w = v->next;
if (w==NULL)
{
number p = (number) v->Data();
tropicalStrategy currentStrategy(I,p,currRing);
if ((I->m[0]!=NULL) && (idElem(I)==1))
{
try
{
ideal startingIdeal = currentStrategy.getStartingIdeal();
ring startingRing = currentStrategy.getStartingRing();
currentStrategy.pReduce(startingIdeal,startingRing);
poly g = startingIdeal->m[0];
pReduceInhomogeneous(g, currentStrategy.getUniformizingParameter(), startingRing);
gfan::ZFan* zf = groebnerFanOfPolynomial(g,startingRing,true);
res->rtyp = fanID;
res->data = (char*) zf;
return FALSE;
}
catch (const std::exception& ex)
{
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
}
else
{
try
{
gfan::ZFan* zf = groebnerComplex(currentStrategy);
res->rtyp = fanID;
res->data = (char*) zf;
return FALSE;
}
catch (const std::exception& ex)
{
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
}
}
}
}
if ((u!=NULL) && (u->Typ()==POLY_CMD))
{
poly g = (poly) u->Data();
leftv v = u->next;
if ((v!=NULL) && (v->Typ()==NUMBER_CMD))
{
leftv w = v->next;
if (w==NULL)
{
try
{
number p = (number) v->Data();
ideal I = idInit(1);
I->m[0] = p_Copy(g,currRing);
tropicalStrategy currentStrategy(I,p,currRing);
ideal startingIdeal = currentStrategy.getStartingIdeal();
ring startingRing = currentStrategy.getStartingRing();
poly gg = startingIdeal->m[0];
pReduceInhomogeneous(gg, currentStrategy.getUniformizingParameter(), startingRing);
gfan::ZFan* zf = groebnerFanOfPolynomial(gg,startingRing,true);
id_Delete(&I,currRing);
res->rtyp = fanID;
res->data = (char*) zf;
return FALSE;
}
catch (const std::exception& ex)
{
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
}
}
}
WerrorS("groebnerComplex: unexpected parameters");
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
fanID
VAR int fanID
Definition bbfan.cc:19
p
int p
Definition cfModGcd.cc:4086
g
g
Definition cfModGcd.cc:4098
sleftv::Typ
int Typ()
Definition subexpr.cc:1048
sleftv::Data
void * Data()
Definition subexpr.cc:1192
sleftv::next
leftv next
Definition subexpr.h:86
tropicalStrategy
Definition tropicalStrategy.h:37
res
CanonicalForm res
Definition facAbsFact.cc:60
w
const CanonicalForm & w
Definition facAbsFact.cc:51
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
NUMBER_CMD
@ NUMBER_CMD
Definition grammar.cc:289
POLY_CMD
@ POLY_CMD
Definition grammar.cc:290
groebnerComplex
gfan::ZFan * groebnerComplex(const tropicalStrategy currentStrategy)
Definition groebnerComplex.cc:11
groebnerFanOfPolynomial
gfan::ZFan * groebnerFanOfPolynomial(poly g, ring r, bool onlyLowerHalfSpace=false)
Definition groebnerFan.cc:36
NULL
#define NULL
Definition omList.c:12
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition p_polys.h:848
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
pReduceInhomogeneous
void pReduceInhomogeneous(poly &g, const number p, const ring r)
Definition ppinitialReduction.cc:132
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
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