Loading...
Searching...
No Matches
polymake_wrapper.cc File Reference
`#include "kernel/mod2.h"`
`#include "Singular/dyn_modules/gfanlib/bbcone.h"`
`#include "Singular/dyn_modules/gfanlib/bbfan.h"`
`#include "Singular/dyn_modules/gfanlib/bbpolytope.h"`
`#include "Singular/blackbox.h"`
`#include "Singular/ipshell.h"`
`#include "Singular/subexpr.h"`
`#include "Singular/mod_lib.h"`
`#include <polymake/client.h>`
`#include <polymake_conversion.h>`
`#include <polymake_documentation.h>`
`#include <polymake/Graph.h>`
`#include <omp.h>`

Go to the source code of this file.

## Macros

#define | POLYAMKE_VERSION POLYMAKEVERSION

## Functions

static BOOLEAN | bbpolytope_Op2 (int op, leftv res, leftv i1, leftv i2)
BOOLEAN | PMisLatticePolytope (leftv res, leftv args)
BOOLEAN | PMisBounded (leftv res, leftv args)
BOOLEAN | PMisReflexive (leftv res, leftv args)
BOOLEAN | PMisGorenstein (leftv res, leftv args)
BOOLEAN | PMgorensteinIndex (leftv res, leftv args)
BOOLEAN | PMgorensteinVector (leftv res, leftv args)
BOOLEAN | PMisCanonical (leftv res, leftv args)
BOOLEAN | PMisTerminal (leftv res, leftv args)
BOOLEAN | PMisLatticeEmpty (leftv res, leftv args)
BOOLEAN | PMlatticeVolume (leftv res, leftv args)
BOOLEAN | PMlatticeDegree (leftv res, leftv args)
BOOLEAN | PMlatticeCodegree (leftv res, leftv args)
BOOLEAN | PMehrhartPolynomialCoeff (leftv res, leftv args)
BOOLEAN | PMfVector (leftv res, leftv args)
BOOLEAN | PMhVector (leftv res, leftv args)
BOOLEAN | PMhStarVector (leftv res, leftv args)
BOOLEAN | PMisNormal (leftv res, leftv args)
BOOLEAN | PMfacetWidths (leftv res, leftv args)
BOOLEAN | PMfacetWidth (leftv res, leftv args)
BOOLEAN | PMfacetVertexLatticeDistances (leftv res, leftv args)
BOOLEAN | PMisCompressed (leftv res, leftv args)
BOOLEAN | PMisSmooth (leftv res, leftv args)
BOOLEAN | PMisVeryAmple (leftv res, leftv args)
BOOLEAN | PMlatticePoints (leftv res, leftv args)
BOOLEAN | PMnLatticePoints (leftv res, leftv args)
BOOLEAN | PMinteriorLatticePoints (leftv res, leftv args)
BOOLEAN | PMnInteriorLatticePoints (leftv res, leftv args)
BOOLEAN | PMboundaryLatticePoints (leftv res, leftv args)
BOOLEAN | PMnBoundaryLatticePoints (leftv res, leftv args)
BOOLEAN | PMhilbertBasis (leftv res, leftv args)
BOOLEAN | PMnHilbertBasis (leftv res, leftv args)
BOOLEAN | PMminkowskiSum (leftv res, leftv args)
polymake::Matrix< polymake::Integer > | verticesOf (const polymake::perl::Object *p, const polymake::Set< polymake::Integer > *s)
BOOLEAN | PMmaximalFace (leftv res, leftv args)
BOOLEAN | PMminimalFace (leftv res, leftv args)
BOOLEAN | PMmaximalValue (leftv res, leftv args)
BOOLEAN | PMminimalValue (leftv res, leftv args)
BOOLEAN | visual (leftv res, leftv args)
BOOLEAN | normalFan (leftv res, leftv args)
BOOLEAN | PMconeViaRays (leftv res, leftv args)
BOOLEAN | PMpolytopeViaVertices (leftv res, leftv args)
BOOLEAN | PMvertexAdjacencyGraph (leftv res, leftv args)
BOOLEAN | PMvertexEdgeGraph (leftv res, leftv args)
int SI_MOD_INIT | polymake (SModulFunctions *p)

## Variables

polymake::Main * | init_polymake =NULL

## Macro Definition Documentation

## POLYAMKE_VERSION

#define POLYAMKE_VERSION POLYMAKEVERSION

Definition at line 5 of file polymake_wrapper.cc.

## Function Documentation

## bbpolytope_Op2()

BOOLEAN bbpolytope_Op2 | ( | int | op,
|  | leftv | res,
|  | leftv | i1,
|  | leftv | i2 )

static

Definition at line 24 of file polymake_wrapper.cc.

{
gfan::ZCone* zp = (gfan::ZCone*) i1->Data();
switch(op)
{
case '+':
{
if (i2->Typ()==polytopeID || i2->Typ()==coneID)
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zq = (gfan::ZCone*) i2->Data();
gfan::ZCone* ms;
try
{
polymake::perl::Object* pp = ZPolytope2PmPolytope(zp);
polymake::perl::Object* pq = ZPolytope2PmPolytope(zq);
polymake::perl::Object pms;
#if (POLYMAKE_VERSION >= 305)
polymake::call_function("minkowski_sum", *pp, *pq) >> pms;
#else
CallPolymakeFunction("minkowski_sum", *pp, *pq) >> pms;
#endif
ms = PmPolytope2ZPolytope(&pms);
delete pp;
delete pq;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = polytopeID;
res->data = (void*) ms;
return FALSE;
}
return blackboxDefaultOp2(op,res,i1,i2);
}
case '*':
{
if (i2->Typ()==INT_CMD)
{
gfan::initializeCddlibIfRequired();
int s = (int)(long) i2->Data();
gfan::ZMatrix zm = zp->extremeRays();
for (int i=0; i<zm.getHeight(); i++)
for (int j=1; j<zm.getWidth(); j++)
zm[i][j] *= s;
gfan::ZCone* zs = new gfan::ZCone();
*zs = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
gfan::deinitializeCddlibIfRequired();
res->rtyp = polytopeID;
res->data = (void*) zs;
return FALSE;
}
return blackboxDefaultOp2(op,res,i1,i2);
}
case '&':
{
if (i2->Typ()==polytopeID)
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zq = (gfan::ZCone*) i2->Data();
int d1 = zp->ambientDimension();
int d2 = zq->ambientDimension();
if (d1 != d2)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("mismatching ambient dimensions");
return TRUE;
}
gfan::ZCone* zs = new gfan::ZCone();
*zs = gfan::intersection(*zp, *zq);
zs->canonicalize();
gfan::deinitializeCddlibIfRequired();
res->rtyp = polytopeID;
res->data = (void*) zs;
return FALSE;
}
return blackboxDefaultOp2(op,res,i1,i2);
}
case '|':
{
if(i2->Typ()==polytopeID)
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zq = (gfan::ZCone*) i2->Data();
int d1 = zp->ambientDimension();
int d2 = zq->ambientDimension();
if (d1 != d2)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("mismatching ambient dimensions");
return TRUE;
}
gfan::ZMatrix rays = zp->extremeRays();
rays.append(zq->extremeRays());
gfan::ZMatrix lineality = zp->generatorsOfLinealitySpace();
lineality.append(zq->generatorsOfLinealitySpace());
gfan::ZCone* zs = new gfan::ZCone();
*zs = gfan::ZCone::givenByRays(rays,lineality);
zs->canonicalize();
gfan::deinitializeCddlibIfRequired();
res->rtyp = polytopeID;
res->data = (void*) zs;
return FALSE;
}
return blackboxDefaultOp2(op,res,i1,i2);
}
case EQUAL_EQUAL:
{
if(i2->Typ()==polytopeID)
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zq = (gfan::ZCone*) i2->Data();
zp->canonicalize();
zq->canonicalize();
bool b = !((*zp)!=(*zq));
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
return blackboxDefaultOp2(op,res,i1,i2);
}
default:
return blackboxDefaultOp2(op,res,i1,i2);
}
return blackboxDefaultOp2(op,res,i1,i2);
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
coneID
VAR int coneID
Definition bbcone.cc:25
rays
BOOLEAN rays(leftv res, leftv args)
Definition bbcone.cc:662
polytopeID
VAR int polytopeID
Definition bbpolytope.cc:16
blackboxDefaultOp2
BOOLEAN blackboxDefaultOp2(int, leftv, leftv, leftv)
default procedure blackboxDefaultOp2, to be called as "default:" branch
Definition blackbox.cc:97
pp
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f ).
Definition cf_gcd.cc:676
i
int i
Definition cfEzgcd.cc:132
b
CanonicalForm b
Definition cfModGcd.cc:4111
sleftv::Typ
int Typ()
Definition subexpr.cc:1048
sleftv::Data
void * Data()
Definition subexpr.cc:1192
s
const CanonicalForm int s
Definition facAbsFact.cc:51
res
CanonicalForm res
Definition facAbsFact.cc:60
j
int j
Definition facHensel.cc:110
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
EQUAL_EQUAL
@ EQUAL_EQUAL
Definition grammar.cc:268
PmPolytope2ZPolytope
gfan::ZCone * PmPolytope2ZPolytope(polymake::perl::Object *pp)
Definition polymake_conversion.cc:341
ZPolytope2PmPolytope
polymake::perl::Object * ZPolytope2PmPolytope(gfan::ZCone *zc)
Definition polymake_conversion.cc:448
INT_CMD
@ INT_CMD
Definition tok.h:96

## normalFan()

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

Definition at line 1793 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
gfan::ZFan* zf = new gfan::ZFan(0);
try
{
polymake::perl::Object* p=ZPolytope2PmPolytope(zp);
polymake::perl::Object pf;
#if (POLYMAKE_VERSION >= 305)
polymake::call_function("normal_fan", *p) >> pf;
#else
CallPolymakeFunction("normal_fan",*p) >> pf;
#endif
delete p;
zf = PmFan2ZFan(&pf);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = fanID;
res->data = (char*) zf;
return FALSE;
}
WerrorS("normalFan: unexpected parameters");
return TRUE;
}
fanID
VAR int fanID
Definition bbfan.cc:19
p
int p
Definition cfModGcd.cc:4086
NULL
#define NULL
Definition omList.c:12
PmFan2ZFan
gfan::ZFan * PmFan2ZFan(polymake::perl::Object *pf)
Definition polymake_conversion.cc:399
leftv
sleftv * leftv
Definition structs.h:53

## PMboundaryLatticePoints()

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

Definition at line 1217 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* iv;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Matrix<polymake::Integer> lp = p->give("BOUNDARY_LATTICE_POINTS");
delete p;
iv = PmMatrixInteger2Intvec(&lp,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INTMAT_CMD;
res->data = (char*) iv;
return FALSE;
}
WerrorS("boundaryLatticePoints: unexpected parameters");
return TRUE;
}
intvec
Definition intvec.h:24
INTMAT_CMD
@ INTMAT_CMD
Definition grammar.cc:280
PmMatrixInteger2Intvec
intvec * PmMatrixInteger2Intvec(polymake::Matrix< polymake::Integer > *mi, bool &ok)
Definition polymake_conversion.cc:163

## PMconeViaRays()

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

Definition at line 1828 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == INTMAT_CMD))
{
gfan::initializeCddlibIfRequired();
polymake::perl::Object pc("Cone<Rational>");
intvec* hlines = (intvec*) u->Data(); // these will are half lines in the cone
polymake::Matrix<polymake::Integer> pmhlines = Intvec2PmMatrixInteger(hlines);
pc.take("INPUT_RAYS") << pmhlines;
leftv v = u->next;
if ((v != NULL) && (v->Typ() == INTMAT_CMD))
{
intvec* lines = (intvec*) v->Data(); // these will be lines in the cone
polymake::Matrix<polymake::Integer> pmlines = Intvec2PmMatrixInteger(lines);
pc.take("INPUT_LINEALITY") << pmlines;
// leftv w = v->next;
// if ((w != NULL) && (w->Typ() == INT_CMD))
// {
// int flag = (int) (long) w->Data(); // TODO: this will indicate whether the
// // information provided are exact
// }
}
gfan::ZCone* zc = PmCone2ZCone(&pc);
gfan::deinitializeCddlibIfRequired();
res->rtyp = coneID;
res->data = (char*) zc;
return FALSE;
}
WerrorS("coneViaRays: unexpected parameters");
return TRUE;
}
lines
int lines
Definition checklibs.c:13
sleftv::next
leftv next
Definition subexpr.h:86
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
PmCone2ZCone
gfan::ZCone * PmCone2ZCone(polymake::perl::Object *pc)
Definition polymake_conversion.cc:286
Intvec2PmMatrixInteger
polymake::Matrix< polymake::Integer > Intvec2PmMatrixInteger(const intvec *im)
Definition polymake_conversion.cc:272

## PMehrhartPolynomialCoeff()

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

Definition at line 638 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* ec;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Vector<polymake::Integer> pec = p->give("EHRHART_POLYNOMIAL_COEFF");
delete p;
ec = PmVectorInteger2Intvec(&pec,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("ehrhartPolynomialCoeff: overflow in PmVectorInteger2Intvec");
return TRUE;
}
res->rtyp = INTVEC_CMD;
res->data = (char*) ec;
return FALSE;
}
WerrorS("ehrhartPolynomialCoeff: unexpected parameters");
return TRUE;
}
PmVectorInteger2Intvec
intvec * PmVectorInteger2Intvec(const polymake::Vector< polymake::Integer > *vi, bool &ok)
Definition polymake_conversion.cc:153
INTVEC_CMD
@ INTVEC_CMD
Definition tok.h:101

## PMfacetVertexLatticeDistances()

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

Definition at line 890 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* ld;
bool ok=true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Matrix<polymake::Integer> pld = p->give("FACET_VERTEX_LATTICE_DISTANCES");
delete p;
ld = PmMatrixInteger2Intvec(&pld,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INTMAT_CMD;
res->data = (char*) ld;
return FALSE;
}
WerrorS("facetVertexLatticeDistances: unexpected parameters");
return TRUE;
}

## PMfacetWidth()

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

Definition at line 853 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
int fw;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Integer pfw = p->give("FACET_WIDTH");
delete p;
fw = PmInteger2Int(pfw,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) fw;
return FALSE;
}
WerrorS("facetWidth: unexpected parameters");
return TRUE;
}
PmInteger2Int
int PmInteger2Int(const polymake::Integer &pi, bool &ok)
Definition polymake_conversion.cc:121

## PMfacetWidths()

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

Definition at line 816 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* fw;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Vector<polymake::Integer> pfw = p->give("FACET_WIDTHS");
delete p;
fw = PmVectorInteger2Intvec(&pfw,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("facetWidths: overflow in PmVectorInteger2Intvec");
return TRUE;
}
res->rtyp = INTVEC_CMD;
res->data = (char*) fw;
return FALSE;
}
WerrorS("facetWidths: unexpected parameters");
return TRUE;
}

## PMfVector()

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

Definition at line 675 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* hv;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Vector<polymake::Integer> phv = p->give("F_VECTOR");
delete p;
hv = PmVectorInteger2Intvec(&phv,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("fVectorP: overflow in PmVectorInteger2Intvec");
return TRUE;
}
res->rtyp = INTVEC_CMD;
res->data = (char*) hv;
return FALSE;
}
WerrorS("fVectorP: unexpected parameters");
return TRUE;
}

## PMgorensteinIndex()

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

Definition at line 341 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
int gi;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
bool b = p->give("GORENSTEIN");
if (b)
{
polymake::Integer pgi = p->give("GORENSTEIN_INDEX");
gi = PmInteger2Int(pgi,ok);
delete p;
}
else
{
delete p;
gfan::deinitializeCddlibIfRequired();
WerrorS("gorensteinIndex: input polytope not gorenstein");
return TRUE;
}
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) gi;
return FALSE;
}
WerrorS("gorensteinIndex: unexpected parameters");
return TRUE;
}

## PMgorensteinVector()

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

Definition at line 389 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* gv;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
bool b = p->give("GORENSTEIN");
if (b)
{
polymake::Vector<polymake::Integer> pgv = p->give("GORENSTEIN_VECTOR");
gv = PmVectorInteger2Intvec(&pgv,ok);
delete p;
}
else
{
delete p;
gfan::deinitializeCddlibIfRequired();
WerrorS("gorensteinVector: input polytope not gorenstein");
return TRUE;
}
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("gorensteinVector: overflow in PmVectorInteger2Intvec");
return TRUE;
}
res->rtyp = INTVEC_CMD;
res->data = (char*) gv;
return FALSE;
}
WerrorS("gorensteinVector: unexpected parameters");
return TRUE;
}

## PMhilbertBasis()

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

Definition at line 1291 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* iv;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
#if (POLYMAKEVERSION >=305)
polymake::Matrix<polymake::Integer> lp = p->call_method("HILBERT_BASIS");
#elif (POLYMAKEVERSION >=214)
polymake::Matrix<polymake::Integer> lp = p->CallPolymakeMethod("HILBERT_BASIS");
#elif (POLYMAKEVERSION >=212)
polymake::Matrix<polymake::Integer> lp = p->give("HILBERT_BASIS");
#else
#error polymake version too old
#endif
delete p;
iv = PmMatrixInteger2Intvec(&lp,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INTMAT_CMD;
res->data = (char*) iv;
return FALSE;
}
WerrorS("hilbertBasis: unexpected parameters");
return TRUE;
}

## PMhStarVector()

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

Definition at line 749 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* hv;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Vector<polymake::Integer> phv = p->give("H_STAR_VECTOR");
delete p;
hv = PmVectorInteger2Intvec(&phv,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("hStarVector: overflow in PmVectorInteger2Intvec");
return TRUE;
}
res->rtyp = INTVEC_CMD;
res->data = (char*) hv;
return FALSE;
}
WerrorS("hStarVector: unexpected parameters");
return TRUE;
}

## PMhVector()

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

Definition at line 712 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* hv;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Vector<polymake::Integer> phv = p->give("H_VECTOR");
delete p;
hv = PmVectorInteger2Intvec(&phv,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("hVector: overflow in PmVectorInteger2Intvec");
return TRUE;
}
res->rtyp = INTVEC_CMD;
res->data = (char*) hv;
return FALSE;
}
WerrorS("hVector: unexpected parameters");
return TRUE;
}

## PMinteriorLatticePoints()

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

Definition at line 1143 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* iv;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Matrix<polymake::Integer> lp = p->give("INTERIOR_LATTICE_POINTS");
delete p;
iv = PmMatrixInteger2Intvec(&lp,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INTMAT_CMD;
res->data = (char*) iv;
return FALSE;
}
WerrorS("interiorLatticePoints: unexpected parameters");
return TRUE;
}

## PMisBounded()

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

Definition at line 251 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("BOUNDED");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isBounded: unexpected parameters");
return TRUE;
}

## PMisCanonical()

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

Definition at line 437 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("CANONICAL");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isCanonical: unexpected parameters");
return TRUE;
}

## PMisCompressed()

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

Definition at line 927 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("COMPRESSED");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isCompressed: unexpected parameters");
return TRUE;
}

## PMisGorenstein()

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

Definition at line 311 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("GORENSTEIN");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isGorenstein: unexpected parameters");
return TRUE;
}

## PMisLatticeEmpty()

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

Definition at line 497 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("LATTICE_EMPTY");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isLatticeEmpty: unexpected parameters");
return TRUE;
}

## PMisLatticePolytope()

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

Definition at line 221 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("Lattice");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isLatticePolytope: unexpected parameters");
return TRUE;
}

## PMisNormal()

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

Definition at line 786 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("NORMAL");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isNormal: unexpected parameters");
return TRUE;
}

## PMisReflexive()

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

Definition at line 281 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("REFLEXIVE");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isReflexive: unexpected parameters");
return TRUE;
}

## PMisSmooth()

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

Definition at line 957 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zc = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZCone2PmCone(zc);
b = p->give("SMOOTH_CONE");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("SMOOTH");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
if ((u != NULL) && (u->Typ() == fanID))
{
gfan::initializeCddlibIfRequired();
gfan::ZFan* zf = (gfan::ZFan*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZFan2PmFan(zf);
b = p->give("SMOOTH_FAN");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isSmooth: unexpected parameters");
return TRUE;
}
ZFan2PmFan
polymake::perl::Object * ZFan2PmFan(gfan::ZFan *zf)
Definition polymake_conversion.cc:530
ZCone2PmCone
polymake::perl::Object * ZCone2PmCone(gfan::ZCone *zc)
Definition polymake_conversion.cc:423

## PMisTerminal()

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

Definition at line 467 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("TERMINAL");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isTerminal: unexpected parameters");
return TRUE;
}

## PMisVeryAmple()

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

Definition at line 1031 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
bool b;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
b = p->give("VERY_AMPLE");
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = INT_CMD;
res->data = (char*) (long) b;
return FALSE;
}
WerrorS("isVeryAmple: unexpected parameters");
return TRUE;
}

## PMlatticeCodegree()

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

Definition at line 601 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
int lc;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Integer plc = p->give("LATTICE_CODEGREE");
delete p;
lc = PmInteger2Int(plc,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) lc;
return FALSE;
}
WerrorS("latticeCodegree: unexpected parameters");
return TRUE;
}
lc
CanonicalForm lc(const CanonicalForm &f)
Definition canonicalform.h:304

## PMlatticeDegree()

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

Definition at line 564 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
int ld;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Integer pld = p->give("LATTICE_DEGREE");
delete p;
ld = PmInteger2Int(pld,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) ld;
return FALSE;
}
WerrorS("latticeDegree: unexpected parameters");
return TRUE;
}

## PMlatticePoints()

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

Definition at line 1061 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* iv;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
#if (POLYMAKEVERSION >=305)
polymake::Matrix<polymake::Integer> lp = p->call_method("LATTICE_POINTS");
#elif (POLYMAKEVERSION >=214)
polymake::Matrix<polymake::Integer> lp = p->CallPolymakeMethod("LATTICE_POINTS");
#elif (POLYMAKEVERSION >=212)
polymake::Matrix<polymake::Integer> lp = p->give("LATTICE_POINTS");
#else
#error polymake version too old
#endif
delete p;
iv = PmMatrixInteger2Intvec(&lp,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INTMAT_CMD;
res->data = (char*) iv;
return FALSE;
}
WerrorS("LatticePoints: unexpected parameters");
return TRUE;
}

## PMlatticeVolume()

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

Definition at line 527 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
int lv;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Integer plv = p->give("LATTICE_VOLUME");
delete p;
lv = PmInteger2Int(plv,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) lv;
return FALSE;
}
WerrorS("latticeVolume: unexpected parameters");
return TRUE;
}

## PMmaximalFace()

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

Definition at line 1544 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
leftv v = u->next;
if ((v != NULL) && (v->Typ() == INTVEC_CMD))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* iv = (intvec*) v->Data();
intvec* maxface;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::perl::Object o("LinearProgram<Rational>");
o.take("LINEAR_OBJECTIVE") << Intvec2PmVectorInteger(iv);
p->take("LP") << o;
polymake::Set<polymake::Integer> mf = p->give("LP.MAXIMAL_FACE");
polymake::Matrix<polymake::Integer> vertices = verticesOf(p,&mf);
delete p;
maxface = new intvec(PmMatrixInteger2Intvec(&vertices,ok));
}
catch (const std::exception& ex)
{
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
gfan::deinitializeCddlibIfRequired();
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INTVEC_CMD;
res->data = (char*) maxface;
return FALSE;
}
}
WerrorS("maximalFace: unexpected parameters");
return TRUE;
}
vertices
BOOLEAN vertices(leftv res, leftv args)
Definition bbpolytope.cc:369
Intvec2PmVectorInteger
polymake::Vector< polymake::Integer > Intvec2PmVectorInteger(const intvec *iv)
Definition polymake_conversion.cc:49
verticesOf
polymake::Matrix< polymake::Integer > verticesOf(const polymake::perl::Object *p, const polymake::Set< polymake::Integer > *s)
Definition polymake_wrapper.cc:1519

## PMmaximalValue()

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

Definition at line 1636 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
leftv v = u->next;
if ((v != NULL) && (v->Typ() == INTVEC_CMD))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* iv = (intvec*) v->Data();
if (iv->rows()==zp->ambientDimension())
{
int m;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Vector<polymake::Integer> lo = Intvec2PmVectorInteger(iv);
polymake::perl::Object o("LinearProgram<Rational>");
o.take("LINEAR_OBJECTIVE") << lo;
p->take("LP") << o;
polymake::Integer mv = p->give("LP.MAXIMAL_VALUE");
delete p;
m = PmInteger2Int(mv,ok);
}
catch (const std::exception& ex)
{
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
gfan::deinitializeCddlibIfRequired();
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) m;
return FALSE;
}
}
WerrorS("maximalValue: vector is of wrong size");
return TRUE;
}
WerrorS("maximalValue: unexpected parameters");
return TRUE;
}
m
int m
Definition cfEzgcd.cc:128
intvec::rows
int rows() const
Definition intvec.h:97

## PMminimalFace()

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

Definition at line 1590 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
leftv v = u->next;
if ((v != NULL) && (v->Typ() == INTVEC_CMD))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* iv = (intvec*) v->Data();
intvec* minface;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::perl::Object o("LinearProgram<Rational>");
o.take("LINEAR_OBJECTIVE") << Intvec2PmVectorInteger(iv);
p->take("LP") << o;
polymake::Set<polymake::Integer> mf = p->give("LP.MINIMAL_FACE");
polymake::Matrix<polymake::Integer> vertices = verticesOf(p,&mf);
delete p;
minface = new intvec(PmMatrixInteger2Intvec(&vertices,ok));
}
catch (const std::exception& ex)
{
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
gfan::deinitializeCddlibIfRequired();
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INTVEC_CMD;
res->data = (char*) minface;
return FALSE;
}
}
WerrorS("minimalFace: unexpected parameters");
return TRUE;
}

## PMminimalValue()

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

Definition at line 1686 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
leftv v = u->next;
if ((v != NULL) && (v->Typ() == INTVEC_CMD))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
intvec* iv = (intvec*) v->Data();
if (iv->rows()==zp->ambientDimension())
{
int m;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Vector<polymake::Integer> lo = Intvec2PmVectorInteger(iv);
polymake::perl::Object o("LinearProgram<Rational>");
o.take("LINEAR_OBJECTIVE") << lo;
p->take("LP") << o;
polymake::Integer mv = p->give("LP.MINIMAL_VALUE");
delete p;
m = PmInteger2Int(mv,ok);
}
catch (const std::exception& ex)
{
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
gfan::deinitializeCddlibIfRequired();
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) m;
return FALSE;
}
}
WerrorS("minimalValue: vector is of wrong size");
return TRUE;
}
WerrorS("minimalValue: unexpected parameters");
return TRUE;
}

## PMminkowskiSum()

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

Definition at line 1373 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
leftv v = u->next;
if ((v != NULL) && (v->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
gfan::ZCone* zq = (gfan::ZCone*)v->Data();
gfan::ZCone* ms;
try
{
polymake::perl::Object* pp = ZPolytope2PmPolytope(zp);
polymake::perl::Object* pq = ZPolytope2PmPolytope(zq);
polymake::perl::Object pms;
#if (POLYMAKE_VERSION >= 305)
polymake::call_function("minkowski_sum", *pp, *pq) >> pms;
#else
CallPolymakeFunction("minkowski_sum", *pp, *pq) >> pms;
#endif
delete pp;
delete pq;
ms = PmPolytope2ZPolytope(&pms);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = polytopeID;
res->data = (char*) ms;
return FALSE;
}
if ((v != NULL) && (v->Typ() == coneID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
gfan::ZCone* zc = (gfan::ZCone*)v->Data();
gfan::ZCone* zq = new gfan::ZCone(liftUp(*zc));
gfan::ZCone* ms;
try
{
polymake::perl::Object* pp = ZPolytope2PmPolytope(zp);
polymake::perl::Object* pq = ZPolytope2PmPolytope(zq);
polymake::perl::Object pms;
#if (POLYMAKE_VERSION >= 305)
polymake::call_function("minkowski_sum", *pp, *pq) >> pms;
#else
CallPolymakeFunction("minkowski_sum", *pp, *pq) >> pms;
#endif
delete pp;
delete pq;
ms = PmPolytope2ZPolytope(&pms);
}
catch (const std::exception& ex)
{
delete zq;
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
delete zq;
gfan::deinitializeCddlibIfRequired();
res->rtyp = polytopeID;
res->data = (char*) ms;
return FALSE;
}
}
if ((u != NULL) && (u->Typ() == coneID))
{
leftv v = u->next;
if ((v != NULL) && (v->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zc = (gfan::ZCone*)u->Data();
gfan::ZCone* zp = new gfan::ZCone(liftUp(*zc));
gfan::ZCone* zq = (gfan::ZCone*)v->Data();
gfan::ZCone* ms;
try
{
polymake::perl::Object* pp = ZPolytope2PmPolytope(zp);
polymake::perl::Object* pq = ZPolytope2PmPolytope(zq);
polymake::perl::Object pms;
#if (POLYMAKE_VERSION >= 305)
polymake::call_function("minkowski_sum", *pp, *pq) >> pms;
#else
CallPolymakeFunction("minkowski_sum", *pp, *pq) >> pms;
#endif
delete pp;
delete pq;
ms = PmPolytope2ZPolytope(&pms);
}
catch (const std::exception& ex)
{
delete zp;
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
delete zp;
gfan::deinitializeCddlibIfRequired();
res->rtyp = polytopeID;
res->data = (char*) ms;
return FALSE;
}
if ((v != NULL) && (v->Typ() == coneID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
gfan::ZCone* zq = (gfan::ZCone*)v->Data();
gfan::ZCone* ms;
try
{
polymake::perl::Object* pp = ZPolytope2PmPolytope(zp);
polymake::perl::Object* pq = ZPolytope2PmPolytope(zq);
polymake::perl::Object pms;
#if (POLYMAKE_VERSION >= 305)
polymake::call_function("minkowski_sum", *pp, *pq) >> pms;
#else
CallPolymakeFunction("minkowski_sum", *pp, *pq) >> pms;
#endif
delete pp;
delete pq;
ms = PmPolytope2ZPolytope(&pms);
}
catch (const std::exception& ex)
{
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
gfan::deinitializeCddlibIfRequired();
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = coneID;
res->data = (char*) ms;
return FALSE;
}
}
WerrorS("minkowskiSum: unexpected parameters");
return TRUE;
}
liftUp
gfan::ZMatrix liftUp(const gfan::ZMatrix &zm)
Definition bbcone.cc:1170

## PMnBoundaryLatticePoints()

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

Definition at line 1254 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
int n;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Integer nlp = p->give("N_BOUNDARY_LATTICE_POINTS");
delete p;
n = PmInteger2Int(nlp,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) n;
return FALSE;
}
WerrorS("nBoundaryLatticePoints: unexpected parameters");
return TRUE;
}

## PMnHilbertBasis()

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

Definition at line 1336 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == coneID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
int n;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Integer nlp = p->give("N_HILBERT_BASIS");
delete p;
n = PmInteger2Int(nlp,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) n;
return FALSE;
}
WerrorS("nHilbertBasis: unexpected parameters");
return TRUE;
}

## PMnInteriorLatticePoints()

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

Definition at line 1180 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
int n;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Integer nlp = p->give("N_INTERIOR_LATTICE_POINTS");
delete p;
n = PmInteger2Int(nlp,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) n;
return FALSE;
}
WerrorS("nInteriorLatticePoints: unexpected parameters");
return TRUE;
}

## PMnLatticePoints()

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

Definition at line 1106 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
int n;
bool ok = true;
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Integer nlp = p->give("N_LATTICE_POINTS");
delete p;
n = PmInteger2Int(nlp,ok);
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int");
return TRUE;
}
res->rtyp = INT_CMD;
res->data = (char*) (long) n;
return FALSE;
}
WerrorS("nLatticePoints: unexpected parameters");
return TRUE;
}

## PMpolytopeViaVertices()

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

Definition at line 1864 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == INTMAT_CMD))
{
gfan::initializeCddlibIfRequired();
polymake::perl::Object pp("Polytope<Rational>");
intvec* points = (intvec*) u->Data(); // these will be vertices of or points in the polytope
polymake::Matrix<polymake::Integer> pmpoints = Intvec2PmMatrixInteger(points);
leftv v = u->next;
if ((v != NULL) && (v->Typ() == INT_CMD))
{
int flag = (int) (long) v->Data();
switch(flag)
{
case 0: pp.take("POINTS") << pmpoints; // case means the matrix may contain points inside the polytope
case 1: pp.take("VERTICES") << pmpoints; // case means the matrix only contains vertices of the polytope
default: WerrorS("polytopeViaVertices: invalid flag");
}
}
else
pp.take("POINTS") << pmpoints; // by default, we assume that matrix may contain non-vertices
gfan::ZCone* zp = PmPolytope2ZPolytope(&pp);
gfan::deinitializeCddlibIfRequired();
res->rtyp = polytopeID;
res->data = (char*) zp;
return FALSE;
}
WerrorS("polytopeViaVertices: unexpected parameters");
return TRUE;
}
points
STATIC_VAR coordinates * points
Definition interpolation.cc:96

## PMvertexAdjacencyGraph()

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

Definition at line 1899 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*) u->Data();
lists output=(lists)omAllocBin(slists_bin); output->Init(2);
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Matrix<polymake::Integer> vert0 = p->give("VERTICES");
bigintmat* vert1 = PmMatrixInteger2Bigintmat(&vert0);
output->m[0].rtyp = BIGINTMAT_CMD;
output->m[0].data = (void*) vert1;
polymake::Graph<> gr=p->give("GRAPH.ADJACENCY");
polymake::IncidenceMatrix<polymake::NonSymmetric> adj = adjacency_matrix(gr);
lists listOfEdges = PmIncidenceMatrix2ListOfIntvecs(&adj);
output->m[1].rtyp = LIST_CMD;
output->m[1].data = (void*) listOfEdges;
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = LIST_CMD;
res->data = (void*) output;
return FALSE;
}
WerrorS("vertexEdgeGraph: unexpected parameters");
return TRUE;
}
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
sleftv::rtyp
int rtyp
Definition subexpr.h:91
sleftv::data
void * data
Definition subexpr.h:88
slists::m
sleftv * m
Definition lists.h:46
slists::Init
INLINE_THIS void Init(int l=0)
BIGINTMAT_CMD
@ BIGINTMAT_CMD
Definition grammar.cc:278
slists_bin
VAR omBin slists_bin
Definition lists.cc:23
lists
slists * lists
Definition mpr_numeric.h:146
omAllocBin
#define omAllocBin(bin)
Definition omAllocDecl.h:205
PmIncidenceMatrix2ListOfIntvecs
lists PmIncidenceMatrix2ListOfIntvecs(polymake::IncidenceMatrix< polymake::NonSymmetric > *icmat)
Definition polymake_conversion.cc:203
PmMatrixInteger2Bigintmat
bigintmat * PmMatrixInteger2Bigintmat(polymake::Matrix< polymake::Integer > *mi)
Definition polymake_conversion.cc:182
LIST_CMD
@ LIST_CMD
Definition tok.h:118

## PMvertexEdgeGraph()

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

Definition at line 1938 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*) u->Data();
lists output=(lists)omAllocBin(slists_bin); output->Init(2);
try
{
polymake::perl::Object* p = ZPolytope2PmPolytope(zp);
polymake::Matrix<polymake::Integer> vert0 = p->give("VERTICES");
bigintmat* vert1 = PmMatrixInteger2Bigintmat(&vert0);
output->m[0].rtyp = BIGINTMAT_CMD;
output->m[0].data = (void*) vert1;
polymake::Graph<> gr=p->give("GRAPH.ADJACENCY");
polymake::IncidenceMatrix<polymake::NonSymmetric> adj = adjacency_matrix(gr);
lists listOfEdges = PmAdjacencyMatrix2ListOfEdges(&adj);
output->m[1].rtyp = LIST_CMD;
output->m[1].data = (void*) listOfEdges;
delete p;
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = LIST_CMD;
res->data = (void*) output;
return FALSE;
}
WerrorS("vertexEdgeGraph: unexpected parameters");
return TRUE;
}
PmAdjacencyMatrix2ListOfEdges
lists PmAdjacencyMatrix2ListOfEdges(polymake::IncidenceMatrix< polymake::NonSymmetric > *icmat)
Definition polymake_conversion.cc:226

## polymake()

int SI_MOD_INIT polymake | ( | SModulFunctions * | p | ) |

Definition at line 1979 of file polymake_wrapper.cc.

{
omp_set_num_threads(1); // avoid multiple threads within polymake/libnormaliz
if (init_polymake==NULL)
{init_polymake = new polymake::Main();}
init_polymake->set_application("fan");
// p->iiAddCproc("polymake.so","coneViaPoints",FALSE,PMconeViaRays);
// p->iiAddCproc("polymake.so","polytopeViaPoints",FALSE,PMpolytopeViaVertices);
p->iiAddCproc("polymake.lib","isLatticePolytope",FALSE,PMisLatticePolytope);
p->iiAddCproc("polymake.lib","isBounded",FALSE,PMisBounded);
p->iiAddCproc("polymake.lib","isReflexive",FALSE,PMisReflexive);
p->iiAddCproc("polymake.lib","isGorenstein",FALSE,PMisGorenstein);
p->iiAddCproc("polymake.lib","gorensteinIndex",FALSE,PMgorensteinIndex);
p->iiAddCproc("polymake.lib","gorensteinVector",FALSE,PMgorensteinVector);
p->iiAddCproc("polymake.lib","isCanonical",FALSE,PMisCanonical);
p->iiAddCproc("polymake.lib","isTerminal",FALSE,PMisTerminal);
p->iiAddCproc("polymake.lib","isLatticeEmpty",FALSE,PMisLatticeEmpty);
p->iiAddCproc("polymake.lib","latticeVolume",FALSE,PMlatticeVolume);
p->iiAddCproc("polymake.lib","latticeDegree",FALSE,PMlatticeDegree);
p->iiAddCproc("polymake.lib","latticeCodegree",FALSE,PMlatticeCodegree);
p->iiAddCproc("polymake.lib","ehrhartPolynomialCoeff",FALSE,PMehrhartPolynomialCoeff);
p->iiAddCproc("polymake.lib","fVectorP",FALSE,PMfVector);
p->iiAddCproc("polymake.lib","hVector",FALSE,PMhVector);
p->iiAddCproc("polymake.lib","hStarVector",FALSE,PMhStarVector);
p->iiAddCproc("polymake.lib","isNormal",FALSE,PMisNormal);
p->iiAddCproc("polymake.lib","facetWidths",FALSE,PMfacetWidths);
p->iiAddCproc("polymake.lib","facetWidth",FALSE,PMfacetWidth);
p->iiAddCproc("polymake.lib","facetVertexLatticeDistances",FALSE,PMfacetVertexLatticeDistances);
p->iiAddCproc("polymake.lib","isCompressed",FALSE,PMisCompressed);
p->iiAddCproc("polymake.lib","isSmooth",FALSE,PMisSmooth);
p->iiAddCproc("polymake.lib","isVeryAmple",FALSE,PMisVeryAmple);
p->iiAddCproc("polymake.lib","latticePoints",FALSE,PMlatticePoints);
p->iiAddCproc("polymake.lib","nLatticePoints",FALSE,PMnLatticePoints);
p->iiAddCproc("polymake.lib","interiorLatticePoints",FALSE,PMinteriorLatticePoints);
p->iiAddCproc("polymake.lib","nInteriorLatticePoints",FALSE,PMnInteriorLatticePoints);
p->iiAddCproc("polymake.lib","boundaryLatticePoints",FALSE,PMboundaryLatticePoints);
p->iiAddCproc("polymake.lib","nBoundaryLatticePoints",FALSE,PMnBoundaryLatticePoints);
p->iiAddCproc("polymake.lib","hilbertBasis",FALSE,PMhilbertBasis);
p->iiAddCproc("polymake.lib","nHilbertBasis",FALSE,PMnHilbertBasis);
p->iiAddCproc("polymake.lib","minkowskiSum",FALSE,PMminkowskiSum);
p->iiAddCproc("polymake.lib","maximalFace",FALSE,PMmaximalFace);
p->iiAddCproc("polymake.lib","minimalFace",FALSE,PMminimalFace);
p->iiAddCproc("polymake.lib","maximalValue",FALSE,PMmaximalValue);
p->iiAddCproc("polymake.lib","minimalValue",FALSE,PMminimalValue);
p->iiAddCproc("polymake.lib","visual",FALSE,visual);
p->iiAddCproc("polymake.lib","normalFan",FALSE,normalFan);
p->iiAddCproc("polymake.lib","vertexAdjacencyGraph",FALSE,PMvertexAdjacencyGraph);
p->iiAddCproc("polymake.lib","vertexEdgeGraph",FALSE,PMvertexEdgeGraph);
blackbox* b=getBlackboxStuff(polytopeID);
b->blackbox_Op2=bbpolytope_Op2;
init_polymake_help();
return MAX_TOK;
}
getBlackboxStuff
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition blackbox.cc:17
init_polymake_help
void init_polymake_help()
Definition polymake_documentation.cc:6
PMnInteriorLatticePoints
BOOLEAN PMnInteriorLatticePoints(leftv res, leftv args)
Definition polymake_wrapper.cc:1180
bbpolytope_Op2
static BOOLEAN bbpolytope_Op2(int op, leftv res, leftv i1, leftv i2)
Definition polymake_wrapper.cc:24
PMisLatticePolytope
BOOLEAN PMisLatticePolytope(leftv res, leftv args)
Definition polymake_wrapper.cc:221
PMvertexAdjacencyGraph
BOOLEAN PMvertexAdjacencyGraph(leftv res, leftv args)
Definition polymake_wrapper.cc:1899
PMminkowskiSum
BOOLEAN PMminkowskiSum(leftv res, leftv args)
Definition polymake_wrapper.cc:1373
PMmaximalFace
BOOLEAN PMmaximalFace(leftv res, leftv args)
Definition polymake_wrapper.cc:1544
PMfVector
BOOLEAN PMfVector(leftv res, leftv args)
Definition polymake_wrapper.cc:675
PMisSmooth
BOOLEAN PMisSmooth(leftv res, leftv args)
Definition polymake_wrapper.cc:957
normalFan
BOOLEAN normalFan(leftv res, leftv args)
Definition polymake_wrapper.cc:1793
PMnBoundaryLatticePoints
BOOLEAN PMnBoundaryLatticePoints(leftv res, leftv args)
Definition polymake_wrapper.cc:1254
PMfacetVertexLatticeDistances
BOOLEAN PMfacetVertexLatticeDistances(leftv res, leftv args)
Definition polymake_wrapper.cc:890
PMisLatticeEmpty
BOOLEAN PMisLatticeEmpty(leftv res, leftv args)
Definition polymake_wrapper.cc:497
PMgorensteinIndex
BOOLEAN PMgorensteinIndex(leftv res, leftv args)
Definition polymake_wrapper.cc:341
visual
BOOLEAN visual(leftv res, leftv args)
Definition polymake_wrapper.cc:1737
PMehrhartPolynomialCoeff
BOOLEAN PMehrhartPolynomialCoeff(leftv res, leftv args)
Definition polymake_wrapper.cc:638
PMvertexEdgeGraph
BOOLEAN PMvertexEdgeGraph(leftv res, leftv args)
Definition polymake_wrapper.cc:1938
PMboundaryLatticePoints
BOOLEAN PMboundaryLatticePoints(leftv res, leftv args)
Definition polymake_wrapper.cc:1217
PMisReflexive
BOOLEAN PMisReflexive(leftv res, leftv args)
Definition polymake_wrapper.cc:281
PMisVeryAmple
BOOLEAN PMisVeryAmple(leftv res, leftv args)
Definition polymake_wrapper.cc:1031
PMlatticeVolume
BOOLEAN PMlatticeVolume(leftv res, leftv args)
Definition polymake_wrapper.cc:527
PMnHilbertBasis
BOOLEAN PMnHilbertBasis(leftv res, leftv args)
Definition polymake_wrapper.cc:1336
PMmaximalValue
BOOLEAN PMmaximalValue(leftv res, leftv args)
Definition polymake_wrapper.cc:1636
PMgorensteinVector
BOOLEAN PMgorensteinVector(leftv res, leftv args)
Definition polymake_wrapper.cc:389
init_polymake
polymake::Main * init_polymake
Definition polymake_wrapper.cc:22
PMlatticeDegree
BOOLEAN PMlatticeDegree(leftv res, leftv args)
Definition polymake_wrapper.cc:564
PMhVector
BOOLEAN PMhVector(leftv res, leftv args)
Definition polymake_wrapper.cc:712
PMminimalValue
BOOLEAN PMminimalValue(leftv res, leftv args)
Definition polymake_wrapper.cc:1686
PMisCompressed
BOOLEAN PMisCompressed(leftv res, leftv args)
Definition polymake_wrapper.cc:927
PMlatticePoints
BOOLEAN PMlatticePoints(leftv res, leftv args)
Definition polymake_wrapper.cc:1061
PMisBounded
BOOLEAN PMisBounded(leftv res, leftv args)
Definition polymake_wrapper.cc:251
PMnLatticePoints
BOOLEAN PMnLatticePoints(leftv res, leftv args)
Definition polymake_wrapper.cc:1106
PMinteriorLatticePoints
BOOLEAN PMinteriorLatticePoints(leftv res, leftv args)
Definition polymake_wrapper.cc:1143
PMfacetWidth
BOOLEAN PMfacetWidth(leftv res, leftv args)
Definition polymake_wrapper.cc:853
PMisNormal
BOOLEAN PMisNormal(leftv res, leftv args)
Definition polymake_wrapper.cc:786
PMhStarVector
BOOLEAN PMhStarVector(leftv res, leftv args)
Definition polymake_wrapper.cc:749
PMminimalFace
BOOLEAN PMminimalFace(leftv res, leftv args)
Definition polymake_wrapper.cc:1590
PMlatticeCodegree
BOOLEAN PMlatticeCodegree(leftv res, leftv args)
Definition polymake_wrapper.cc:601
PMisCanonical
BOOLEAN PMisCanonical(leftv res, leftv args)
Definition polymake_wrapper.cc:437
PMfacetWidths
BOOLEAN PMfacetWidths(leftv res, leftv args)
Definition polymake_wrapper.cc:816
PMisTerminal
BOOLEAN PMisTerminal(leftv res, leftv args)
Definition polymake_wrapper.cc:467
PMhilbertBasis
BOOLEAN PMhilbertBasis(leftv res, leftv args)
Definition polymake_wrapper.cc:1291
PMisGorenstein
BOOLEAN PMisGorenstein(leftv res, leftv args)
Definition polymake_wrapper.cc:311
MAX_TOK
@ MAX_TOK
Definition tok.h:220

## verticesOf()

polymake::Matrix< polymake::Integer > verticesOf | ( | const polymake::perl::Object * | p,
|  | const polymake::Set< polymake::Integer > * | s )

Definition at line 1519 of file polymake_wrapper.cc.

{
polymake::Matrix<polymake::Integer> allrays = p->give("VERTICES");
polymake::Matrix<polymake::Integer> wantedrays;
bool ok = true;
#if (POLYMAKE_VERSION >= 305)
for(const auto i : *s)
{
wantedrays = wantedrays / allrays.row(PmInteger2Int(i,ok));
}
#else
for(polymake::Entire<polymake::Set<polymake::Integer> >::const_iterator i=polymake::entire(*s); !i.at_end(); i++)
{
wantedrays = wantedrays / allrays.row(PmInteger2Int(*i,ok));
}
#endif
if (!ok)
{
WerrorS("overflow while converting polymake::Integer to int in raysOf");
}
return wantedrays;
}

## visual()

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

Definition at line 1737 of file polymake_wrapper.cc.

{
leftv u = args;
if ((u != NULL) && (u->Typ() == polytopeID))
{
gfan::initializeCddlibIfRequired();
gfan::ZCone* zp = (gfan::ZCone*)u->Data();
try
{
polymake::perl::Object* pp = ZPolytope2PmPolytope(zp);
#if (POLYMAKE_VERSION >= 305)
polymake::call_function("jreality",pp->call_method("VISUAL"));
#else
VoidCallPolymakeFunction("jreality",pp->CallPolymakeMethod("VISUAL"));
#endif
delete pp;
}
catch (const std::exception& ex)
{
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
gfan::deinitializeCddlibIfRequired();
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = NONE;
res->data = NULL;
return FALSE;
}
if ((u != NULL) && (u->Typ() == fanID))
{
gfan::initializeCddlibIfRequired();
gfan::ZFan* zf = (gfan::ZFan*)u->Data();
try
{
polymake::perl::Object* pf=ZFan2PmFan(zf);
#if (POLYMAKE_VERSION >= 305)
polymake::call_function("jreality",pf->call_method("VISUAL"));
#else
VoidCallPolymakeFunction("jreality",pf->CallPolymakeMethod("VISUAL"));
#endif
}
catch (const std::exception& ex)
{
gfan::deinitializeCddlibIfRequired();
WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n");
return TRUE;
}
gfan::deinitializeCddlibIfRequired();
res->rtyp = NONE;
res->data = NULL;
return FALSE;
}
WerrorS("visual: unexpected parameters");
return TRUE;
}
NONE
#define NONE
Definition tok.h:223

## Variable Documentation

## init_polymake

polymake::Main* init_polymake =NULL

Definition at line 22 of file polymake_wrapper.cc.