Loading...
Searching...
No Matches
bbfan.h File Reference
`#include "kernel/mod2.h"`
`#include "Singular/ipid.h"`
`#include "gfanlib/gfanlib.h"`

Go to the source code of this file.

## Functions

void | bbfan_setup (SModulFunctions *p)
bool | isCompatible (const gfan::ZFan *zf, const gfan::ZCone *zc)
int | getAmbientDimension (gfan::ZFan *zf)
int | getCodimension (gfan::ZFan *zf)
int | getDimension (gfan::ZFan *zf)
int | getLinealityDimension (gfan::ZFan *zf)
int | isSimplicial (gfan::ZFan *zf)
gfan::Matrix< gfan::Integer > | rays (const gfan::ZFan *const zf)
gfan::ZFan | commonRefinement (gfan::ZFan zf, gfan::ZFan zg)

## Variables

EXTERN_VAR int | fanID

## Function Documentation

## bbfan_setup()

void bbfan_setup | ( | SModulFunctions * | p | ) |

Definition at line 1082 of file bbfan.cc.

{
blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox));
// all undefined entries will be set to default in setBlackboxStuff
// the default Print is quite usefule,
// all other are simply error messages
b->blackbox_destroy=bbfan_destroy;
b->blackbox_String=bbfan_String;
//b->blackbox_Print=blackbox_default_Print;
b->blackbox_Init=bbfan_Init;
b->blackbox_Copy=bbfan_Copy;
b->blackbox_Assign=bbfan_Assign;
b->blackbox_serialize=bbfan_serialize;
b->blackbox_deserialize=bbfan_deserialize;
p->iiAddCproc("gfan.lib","emptyFanInternal",FALSE,emptyFan);
p->iiAddCproc("gfan.lib","fullFanInternal",FALSE,fullFan);
/* the following functions are implemented in bbcone.cc */
// iiAddCproc("gfan.lib","containsInSupportInternal",FALSE,containsInSupport);
// iiAddCproc("gfan.lib","getAmbientDimensionInternal",FALSE,getAmbientDimension);
// iiAddCproc("gfan.lib","getCodimensionInternal",FALSE,getDimension);
// iiAddCproc("gfan.lib","getDimensionInternal",FALSE,getDimension);
// iiAddCproc("gfan.lib","getLinealityDimensionInternal",FALSE,getLinealityDimension);
// iiAddCproc("gfan.lib","isSimplicialInternal",FALSE,isSimplicial);
/********************************************************/
p->iiAddCproc("gfan.lib","isCompatibleInternal",FALSE,isCompatible);
p->iiAddCproc("gfan.lib","numberOfConesOfDimensionInternal",FALSE,numberOfConesOfDimension);
p->iiAddCproc("gfan.lib","nconesInternal",FALSE,ncones);
p->iiAddCproc("gfan.lib","nmaxconesInternal",FALSE,nmaxcones);
p->iiAddCproc("gfan.lib","insertConeInternal",FALSE,insertCone);
p->iiAddCproc("gfan.lib","removeConeInternal",FALSE,removeCone);
p->iiAddCproc("gfan.lib","getConeInternal",FALSE,getCone);
p->iiAddCproc("gfan.lib","getConesInternal",FALSE,getCones);
p->iiAddCproc("gfan.lib","isPureInternal",FALSE,isPure);
p->iiAddCproc("gfan.lib","fanFromStringInternal",FALSE,fanFromString);
p->iiAddCproc("gfan.lib","fanViaConesInternal",FALSE,fanViaCones);
p->iiAddCproc("gfan.lib","numberOfConesWithVectorInternal",FALSE,numberOfConesWithVector);
// iiAddCproc("gfan.lib","isCompleteInternal",FALSE,isComplete); not working as expected, should leave this to polymake
p->iiAddCproc("gfan.lib","fVectorInternal",FALSE,fVector);
p->iiAddCproc("gfan.lib","containsInCollectionInternal",FALSE,containsInCollection);
// p->iiAddCproc("gfan.lib","tropicalVarietyInternal",FALSE,tropicalVariety);
p->iiAddCproc("gfan.lib","commonRefinementInternal",FALSE,commonRefinement);
// iiAddCproc("gfan.lib","grFanInternal",FALSE,grFan);
fanID=setBlackboxStuff(b,"fan");
//Print("created type %d (fan)\n",fanID);
}
FALSE
#define FALSE
Definition auxiliary.h:97
nmaxcones
BOOLEAN nmaxcones(leftv res, leftv args)
Definition bbfan.cc:331
numberOfConesOfDimension
BOOLEAN numberOfConesOfDimension(leftv res, leftv args)
Definition bbfan.cc:266
emptyFan
BOOLEAN emptyFan(leftv res, leftv args)
Definition bbfan.cc:176
fanViaCones
BOOLEAN fanViaCones(leftv res, leftv args)
Definition bbfan.cc:814
containsInCollection
bool containsInCollection(gfan::ZFan *zf, gfan::ZCone *zc)
Definition bbfan.cc:433
fullFan
BOOLEAN fullFan(leftv res, leftv args)
Definition bbfan.cc:228
getCones
BOOLEAN getCones(leftv res, leftv args)
Definition bbfan.cc:609
bbfan_String
char * bbfan_String(blackbox *, void *d)
Definition bbfan.cc:35
fanFromString
BOOLEAN fanFromString(leftv res, leftv args)
Definition bbfan.cc:796
isPure
BOOLEAN isPure(leftv res, leftv args)
Definition bbfan.cc:688
bbfan_Copy
void * bbfan_Copy(blackbox *, void *d)
Definition bbfan.cc:64
numberOfConesWithVector
int numberOfConesWithVector(gfan::ZFan *zf, gfan::ZVector *v)
Definition bbfan.cc:748
ncones
BOOLEAN ncones(leftv res, leftv args)
Definition bbfan.cc:309
bbfan_deserialize
BOOLEAN bbfan_deserialize(blackbox **b, void **d, si_link f)
Definition bbfan.cc:1063
removeCone
BOOLEAN removeCone(leftv res, leftv args)
Definition bbfan.cc:514
bbfan_destroy
void bbfan_destroy(blackbox *, void *d)
Definition bbfan.cc:26
fanID
VAR int fanID
Definition bbfan.cc:19
commonRefinement
gfan::ZFan commonRefinement(gfan::ZFan zf, gfan::ZFan zg)
Definition bbfan.cc:948
bbfan_Init
void * bbfan_Init(blackbox *)
Definition bbfan.cc:21
getCone
BOOLEAN getCone(leftv res, leftv args)
Definition bbfan.cc:553
bbfan_Assign
BOOLEAN bbfan_Assign(leftv l, leftv r)
Definition bbfan.cc:71
bbfan_serialize
BOOLEAN bbfan_serialize(blackbox *b, void *d, si_link f)
Definition bbfan.cc:1044
isCompatible
bool isCompatible(const gfan::ZFan *zf, const gfan::ZCone *zc)
Definition bbfan.cc:352
insertCone
BOOLEAN insertCone(leftv res, leftv args)
Definition bbfan.cc:393
fVector
BOOLEAN fVector(leftv res, leftv args)
Definition bbfan.cc:720
setBlackboxStuff
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
Definition blackbox.cc:143
p
int p
Definition cfModGcd.cc:4086
b
CanonicalForm b
Definition cfModGcd.cc:4111
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211

## commonRefinement()

gfan::ZFan commonRefinement | ( | gfan::ZFan | zf,
|  | gfan::ZFan | zg )

Definition at line 948 of file bbfan.cc.

{
assume(zf.getAmbientDimension() == zg.getAmbientDimension());
// gather all maximal cones of f and g
std::list<gfan::ZCone> maximalConesOfF;
for (int d=0; d<=zf.getAmbientDimension(); d++)
for (int i=0; i<zf.numberOfConesOfDimension(d,0,1); i++)
maximalConesOfF.push_back(zf.getCone(d,i,0,1));
std::list<gfan::ZCone> maximalConesOfG;
for (int d=0; d<=zg.getAmbientDimension(); d++)
for (int i=0; i<zg.numberOfConesOfDimension(d,0,1); i++)
maximalConesOfG.push_back(zg.getCone(d,i,0,1));
// construct a new fan out of their intersections
gfan::ZFan zr = gfan::ZFan(zf.getAmbientDimension());
for (std::list<gfan::ZCone>::iterator itf=maximalConesOfF.begin();
itf != maximalConesOfF.end(); itf++)
for (std::list<gfan::ZCone>::iterator itg=maximalConesOfG.begin();
itg != maximalConesOfG.end(); itg++)
zr.insert(intersection(*itf,*itg));
return zr;
}
i
int i
Definition cfEzgcd.cc:132
assume
#define assume(x)
Definition mod2.h:389

## getAmbientDimension()

int getAmbientDimension | ( | gfan::ZFan * | zf | ) |

Definition at line 246 of file bbfan.cc.

{
return zf->getAmbientDimension();
}

## getCodimension()

int getCodimension | ( | gfan::ZFan * | zf | ) |

Definition at line 251 of file bbfan.cc.

{
return zf->getCodimension();
}

## getDimension()

int getDimension | ( | gfan::ZFan * | zf | ) |

Definition at line 256 of file bbfan.cc.

{
return zf->getDimension();
}

## getLinealityDimension()

int getLinealityDimension | ( | gfan::ZFan * | zf | ) |

Definition at line 261 of file bbfan.cc.

{
return zf->getLinealityDimension();
}

## isCompatible()

bool isCompatible | ( | const gfan::ZFan * | zf,
|  | const gfan::ZCone * | zc )

Definition at line 352 of file bbfan.cc.

{
bool b = (zf->getAmbientDimension() == zc->ambientDimension());
if(b)
{
for (int d=0; d<=zf->getAmbientDimension(); d++)
{
for (int i=0; i<zf->numberOfConesOfDimension(d,0,1); i++)
{
gfan::ZCone zd = zf->getCone(d,i,0,1);
gfan::ZCone zt = gfan::intersection(*zc,zd);
zt.canonicalize();
b = b && zd.hasFace(zt);
}
}
}
return b;
}

## isSimplicial()

int isSimplicial | ( | gfan::ZFan * | zf | ) |

Definition at line 682 of file bbfan.cc.

{
int i = zf->isSimplicial() ? 1 : 0;
return i;
}

## rays()

gfan::Matrix< gfan::Integer > rays | ( | const gfan::ZFan *const | zf | ) |

Definition at line 737 of file bbfan.cc.

{
gfan::ZMatrix rays(0,zf->getAmbientDimension());
for (int i=0; i<zf->numberOfConesOfDimension(1,0,0); i++)
{
gfan::ZCone zc = zf->getCone(1, i, 0, 0);
rays.append(zc.extremeRays());
}
return rays;
}
rays
BOOLEAN rays(leftv res, leftv args)
Definition bbcone.cc:662
rays
gfan::ZMatrix rays(const gfan::ZFan *const zf)
Definition bbfan.cc:737

## Variable Documentation

## fanID

EXTERN_VAR int fanID

Definition at line 12 of file bbfan.h.