4#ifndef POLYMAKE_VERSION
5#define POLYAMKE_VERSION POLYMAKEVERSION
17#include <polymake/client.h>
20#include <polymake/Graph.h>
26 gfan::ZCone* zp = (gfan::ZCone*) i1->
Data();
33 gfan::initializeCddlibIfRequired();
34 gfan::ZCone* zq = (gfan::ZCone*) i2->
Data();
40 polymake::perl::Object pms;
41 #if (POLYMAKE_VERSION >= 305)
42 polymake::call_function(
"minkowski_sum", *
pp, *pq) >> pms;
44 CallPolymakeFunction(
"minkowski_sum", *
pp, *pq) >> pms;
50 catch (
const std::exception& ex)
52 gfan::deinitializeCddlibIfRequired();
56 gfan::deinitializeCddlibIfRequired();
58 res->data = (
void*) ms;
67 gfan::initializeCddlibIfRequired();
68 int s = (int)(
long) i2->
Data();
69 gfan::ZMatrix zm = zp->extremeRays();
70 for (
int i=0;
i<zm.getHeight();
i++)
71 for (
int j=1;
j<zm.getWidth();
j++)
73 gfan::ZCone* zs =
new gfan::ZCone();
74 *zs = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
75 gfan::deinitializeCddlibIfRequired();
77 res->data = (
void*) zs;
86 gfan::initializeCddlibIfRequired();
87 gfan::ZCone* zq = (gfan::ZCone*) i2->
Data();
88 int d1 = zp->ambientDimension();
89 int d2 = zq->ambientDimension();
92 gfan::deinitializeCddlibIfRequired();
93 WerrorS(
"mismatching ambient dimensions");
96 gfan::ZCone* zs =
new gfan::ZCone();
97 *zs = gfan::intersection(*zp, *zq);
99 gfan::deinitializeCddlibIfRequired();
101 res->data = (
void*) zs;
110 gfan::initializeCddlibIfRequired();
111 gfan::ZCone* zq = (gfan::ZCone*) i2->
Data();
112 int d1 = zp->ambientDimension();
113 int d2 = zq->ambientDimension();
116 gfan::deinitializeCddlibIfRequired();
117 WerrorS(
"mismatching ambient dimensions");
120 gfan::ZMatrix
rays = zp->extremeRays();
121 rays.append(zq->extremeRays());
122 gfan::ZMatrix lineality = zp->generatorsOfLinealitySpace();
123 lineality.append(zq->generatorsOfLinealitySpace());
124 gfan::ZCone* zs =
new gfan::ZCone();
125 *zs = gfan::ZCone::givenByRays(
rays,lineality);
127 gfan::deinitializeCddlibIfRequired();
129 res->data = (
void*) zs;
138 gfan::initializeCddlibIfRequired();
139 gfan::ZCone* zq = (gfan::ZCone*) i2->
Data();
142 bool b = !((*zp)!=(*zq));
143 gfan::deinitializeCddlibIfRequired();
145 res->data = (
char*) (
long)
b;
226 gfan::initializeCddlibIfRequired();
227 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
232 b =
p->give(
"Lattice");
235 catch (
const std::exception& ex)
237 gfan::deinitializeCddlibIfRequired();
241 gfan::deinitializeCddlibIfRequired();
243 res->data = (
char*) (
long)
b;
246 WerrorS(
"isLatticePolytope: unexpected parameters");
256 gfan::initializeCddlibIfRequired();
257 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
262 b =
p->give(
"BOUNDED");
265 catch (
const std::exception& ex)
267 gfan::deinitializeCddlibIfRequired();
271 gfan::deinitializeCddlibIfRequired();
273 res->data = (
char*) (
long)
b;
276 WerrorS(
"isBounded: unexpected parameters");
286 gfan::initializeCddlibIfRequired();
287 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
292 b =
p->give(
"REFLEXIVE");
295 catch (
const std::exception& ex)
297 gfan::deinitializeCddlibIfRequired();
301 gfan::deinitializeCddlibIfRequired();
303 res->data = (
char*) (
long)
b;
306 WerrorS(
"isReflexive: unexpected parameters");
316 gfan::initializeCddlibIfRequired();
317 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
322 b =
p->give(
"GORENSTEIN");
325 catch (
const std::exception& ex)
327 gfan::deinitializeCddlibIfRequired();
331 gfan::deinitializeCddlibIfRequired();
333 res->data = (
char*) (
long)
b;
336 WerrorS(
"isGorenstein: unexpected parameters");
346 gfan::initializeCddlibIfRequired();
347 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
353 bool b =
p->give(
"GORENSTEIN");
356 polymake::Integer pgi =
p->give(
"GORENSTEIN_INDEX");
363 gfan::deinitializeCddlibIfRequired();
364 WerrorS(
"gorensteinIndex: input polytope not gorenstein");
368 catch (
const std::exception& ex)
370 gfan::deinitializeCddlibIfRequired();
374 gfan::deinitializeCddlibIfRequired();
377 WerrorS(
"overflow while converting polymake::Integer to int");
381 res->data = (
char*) (
long) gi;
384 WerrorS(
"gorensteinIndex: unexpected parameters");
394 gfan::initializeCddlibIfRequired();
395 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
401 bool b =
p->give(
"GORENSTEIN");
404 polymake::Vector<polymake::Integer> pgv =
p->give(
"GORENSTEIN_VECTOR");
411 gfan::deinitializeCddlibIfRequired();
412 WerrorS(
"gorensteinVector: input polytope not gorenstein");
416 catch (
const std::exception& ex)
418 gfan::deinitializeCddlibIfRequired();
422 gfan::deinitializeCddlibIfRequired();
425 WerrorS(
"gorensteinVector: overflow in PmVectorInteger2Intvec");
429 res->data = (
char*) gv;
432 WerrorS(
"gorensteinVector: unexpected parameters");
442 gfan::initializeCddlibIfRequired();
443 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
448 b =
p->give(
"CANONICAL");
451 catch (
const std::exception& ex)
453 gfan::deinitializeCddlibIfRequired();
457 gfan::deinitializeCddlibIfRequired();
459 res->data = (
char*) (
long)
b;
462 WerrorS(
"isCanonical: unexpected parameters");
472 gfan::initializeCddlibIfRequired();
473 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
478 b =
p->give(
"TERMINAL");
481 catch (
const std::exception& ex)
483 gfan::deinitializeCddlibIfRequired();
487 gfan::deinitializeCddlibIfRequired();
489 res->data = (
char*) (
long)
b;
492 WerrorS(
"isTerminal: unexpected parameters");
502 gfan::initializeCddlibIfRequired();
503 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
508 b =
p->give(
"LATTICE_EMPTY");
511 catch (
const std::exception& ex)
513 gfan::deinitializeCddlibIfRequired();
517 gfan::deinitializeCddlibIfRequired();
519 res->data = (
char*) (
long)
b;
522 WerrorS(
"isLatticeEmpty: unexpected parameters");
532 gfan::initializeCddlibIfRequired();
533 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
539 polymake::Integer plv =
p->give(
"LATTICE_VOLUME");
543 catch (
const std::exception& ex)
545 gfan::deinitializeCddlibIfRequired();
549 gfan::deinitializeCddlibIfRequired();
552 WerrorS(
"overflow while converting polymake::Integer to int");
556 res->data = (
char*) (
long) lv;
559 WerrorS(
"latticeVolume: unexpected parameters");
569 gfan::initializeCddlibIfRequired();
570 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
576 polymake::Integer pld =
p->give(
"LATTICE_DEGREE");
580 catch (
const std::exception& ex)
582 gfan::deinitializeCddlibIfRequired();
586 gfan::deinitializeCddlibIfRequired();
589 WerrorS(
"overflow while converting polymake::Integer to int");
593 res->data = (
char*) (
long) ld;
596 WerrorS(
"latticeDegree: unexpected parameters");
606 gfan::initializeCddlibIfRequired();
607 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
613 polymake::Integer plc =
p->give(
"LATTICE_CODEGREE");
617 catch (
const std::exception& ex)
619 gfan::deinitializeCddlibIfRequired();
623 gfan::deinitializeCddlibIfRequired();
626 WerrorS(
"overflow while converting polymake::Integer to int");
630 res->data = (
char*) (
long)
lc;
633 WerrorS(
"latticeCodegree: unexpected parameters");
643 gfan::initializeCddlibIfRequired();
644 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
650 polymake::Vector<polymake::Integer> pec =
p->give(
"EHRHART_POLYNOMIAL_COEFF");
654 catch (
const std::exception& ex)
656 gfan::deinitializeCddlibIfRequired();
660 gfan::deinitializeCddlibIfRequired();
663 WerrorS(
"ehrhartPolynomialCoeff: overflow in PmVectorInteger2Intvec");
667 res->data = (
char*) ec;
670 WerrorS(
"ehrhartPolynomialCoeff: unexpected parameters");
680 gfan::initializeCddlibIfRequired();
681 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
687 polymake::Vector<polymake::Integer> phv =
p->give(
"F_VECTOR");
691 catch (
const std::exception& ex)
693 gfan::deinitializeCddlibIfRequired();
697 gfan::deinitializeCddlibIfRequired();
700 WerrorS(
"fVectorP: overflow in PmVectorInteger2Intvec");
704 res->data = (
char*) hv;
707 WerrorS(
"fVectorP: unexpected parameters");
717 gfan::initializeCddlibIfRequired();
718 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
724 polymake::Vector<polymake::Integer> phv =
p->give(
"H_VECTOR");
728 catch (
const std::exception& ex)
730 gfan::deinitializeCddlibIfRequired();
734 gfan::deinitializeCddlibIfRequired();
737 WerrorS(
"hVector: overflow in PmVectorInteger2Intvec");
741 res->data = (
char*) hv;
744 WerrorS(
"hVector: unexpected parameters");
754 gfan::initializeCddlibIfRequired();
755 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
761 polymake::Vector<polymake::Integer> phv =
p->give(
"H_STAR_VECTOR");
765 catch (
const std::exception& ex)
767 gfan::deinitializeCddlibIfRequired();
771 gfan::deinitializeCddlibIfRequired();
774 WerrorS(
"hStarVector: overflow in PmVectorInteger2Intvec");
778 res->data = (
char*) hv;
781 WerrorS(
"hStarVector: unexpected parameters");
791 gfan::initializeCddlibIfRequired();
792 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
797 b =
p->give(
"NORMAL");
800 catch (
const std::exception& ex)
802 gfan::deinitializeCddlibIfRequired();
806 gfan::deinitializeCddlibIfRequired();
808 res->data = (
char*) (
long)
b;
811 WerrorS(
"isNormal: unexpected parameters");
821 gfan::initializeCddlibIfRequired();
822 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
828 polymake::Vector<polymake::Integer> pfw =
p->give(
"FACET_WIDTHS");
832 catch (
const std::exception& ex)
834 gfan::deinitializeCddlibIfRequired();
838 gfan::deinitializeCddlibIfRequired();
841 WerrorS(
"facetWidths: overflow in PmVectorInteger2Intvec");
845 res->data = (
char*) fw;
848 WerrorS(
"facetWidths: unexpected parameters");
858 gfan::initializeCddlibIfRequired();
859 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
865 polymake::Integer pfw =
p->give(
"FACET_WIDTH");
869 catch (
const std::exception& ex)
871 gfan::deinitializeCddlibIfRequired();
875 gfan::deinitializeCddlibIfRequired();
878 WerrorS(
"overflow while converting polymake::Integer to int");
882 res->data = (
char*) (
long) fw;
885 WerrorS(
"facetWidth: unexpected parameters");
895 gfan::initializeCddlibIfRequired();
896 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
902 polymake::Matrix<polymake::Integer> pld =
p->give(
"FACET_VERTEX_LATTICE_DISTANCES");
906 catch (
const std::exception& ex)
908 gfan::deinitializeCddlibIfRequired();
912 gfan::deinitializeCddlibIfRequired();
915 WerrorS(
"overflow while converting polymake::Integer to int");
919 res->data = (
char*) ld;
922 WerrorS(
"facetVertexLatticeDistances: unexpected parameters");
932 gfan::initializeCddlibIfRequired();
933 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
938 b =
p->give(
"COMPRESSED");
941 catch (
const std::exception& ex)
943 gfan::deinitializeCddlibIfRequired();
947 gfan::deinitializeCddlibIfRequired();
949 res->data = (
char*) (
long)
b;
952 WerrorS(
"isCompressed: unexpected parameters");
962 gfan::initializeCddlibIfRequired();
963 gfan::ZCone* zc = (gfan::ZCone*)u->
Data();
968 b =
p->give(
"SMOOTH_CONE");
971 catch (
const std::exception& ex)
973 gfan::deinitializeCddlibIfRequired();
977 gfan::deinitializeCddlibIfRequired();
979 res->data = (
char*) (
long)
b;
984 gfan::initializeCddlibIfRequired();
985 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
990 b =
p->give(
"SMOOTH");
993 catch (
const std::exception& ex)
995 gfan::deinitializeCddlibIfRequired();
999 gfan::deinitializeCddlibIfRequired();
1001 res->data = (
char*) (
long)
b;
1006 gfan::initializeCddlibIfRequired();
1007 gfan::ZFan* zf = (gfan::ZFan*)u->
Data();
1012 b =
p->give(
"SMOOTH_FAN");
1015 catch (
const std::exception& ex)
1017 gfan::deinitializeCddlibIfRequired();
1021 gfan::deinitializeCddlibIfRequired();
1023 res->data = (
char*) (
long)
b;
1026 WerrorS(
"isSmooth: unexpected parameters");
1036 gfan::initializeCddlibIfRequired();
1037 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1042 b =
p->give(
"VERY_AMPLE");
1045 catch (
const std::exception& ex)
1047 gfan::deinitializeCddlibIfRequired();
1051 gfan::deinitializeCddlibIfRequired();
1053 res->data = (
char*) (
long)
b;
1056 WerrorS(
"isVeryAmple: unexpected parameters");
1066 gfan::initializeCddlibIfRequired();
1067 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1073 #if (POLYMAKEVERSION >=305)
1074 polymake::Matrix<polymake::Integer> lp =
p->call_method(
"LATTICE_POINTS");
1075 #elif (POLYMAKEVERSION >=214)
1076 polymake::Matrix<polymake::Integer> lp =
p->CallPolymakeMethod(
"LATTICE_POINTS");
1077 #elif (POLYMAKEVERSION >=212)
1078 polymake::Matrix<polymake::Integer> lp =
p->give(
"LATTICE_POINTS");
1080 #error polymake version too old
1085 catch (
const std::exception& ex)
1087 gfan::deinitializeCddlibIfRequired();
1091 gfan::deinitializeCddlibIfRequired();
1094 WerrorS(
"overflow while converting polymake::Integer to int");
1098 res->data = (
char*) iv;
1101 WerrorS(
"LatticePoints: unexpected parameters");
1111 gfan::initializeCddlibIfRequired();
1112 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1118 polymake::Integer nlp =
p->give(
"N_LATTICE_POINTS");
1122 catch (
const std::exception& ex)
1124 gfan::deinitializeCddlibIfRequired();
1128 gfan::deinitializeCddlibIfRequired();
1131 WerrorS(
"overflow while converting polymake::Integer to int");
1135 res->data = (
char*) (
long) n;
1138 WerrorS(
"nLatticePoints: unexpected parameters");
1148 gfan::initializeCddlibIfRequired();
1149 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1155 polymake::Matrix<polymake::Integer> lp =
p->give(
"INTERIOR_LATTICE_POINTS");
1159 catch (
const std::exception& ex)
1161 gfan::deinitializeCddlibIfRequired();
1165 gfan::deinitializeCddlibIfRequired();
1168 WerrorS(
"overflow while converting polymake::Integer to int");
1172 res->data = (
char*) iv;
1175 WerrorS(
"interiorLatticePoints: unexpected parameters");
1185 gfan::initializeCddlibIfRequired();
1186 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1192 polymake::Integer nlp =
p->give(
"N_INTERIOR_LATTICE_POINTS");
1196 catch (
const std::exception& ex)
1198 gfan::deinitializeCddlibIfRequired();
1202 gfan::deinitializeCddlibIfRequired();
1205 WerrorS(
"overflow while converting polymake::Integer to int");
1209 res->data = (
char*) (
long) n;
1212 WerrorS(
"nInteriorLatticePoints: unexpected parameters");
1222 gfan::initializeCddlibIfRequired();
1223 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1229 polymake::Matrix<polymake::Integer> lp =
p->give(
"BOUNDARY_LATTICE_POINTS");
1233 catch (
const std::exception& ex)
1235 gfan::deinitializeCddlibIfRequired();
1239 gfan::deinitializeCddlibIfRequired();
1242 WerrorS(
"overflow while converting polymake::Integer to int");
1246 res->data = (
char*) iv;
1249 WerrorS(
"boundaryLatticePoints: unexpected parameters");
1259 gfan::initializeCddlibIfRequired();
1260 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1266 polymake::Integer nlp =
p->give(
"N_BOUNDARY_LATTICE_POINTS");
1270 catch (
const std::exception& ex)
1272 gfan::deinitializeCddlibIfRequired();
1276 gfan::deinitializeCddlibIfRequired();
1279 WerrorS(
"overflow while converting polymake::Integer to int");
1283 res->data = (
char*) (
long) n;
1286 WerrorS(
"nBoundaryLatticePoints: unexpected parameters");
1296 gfan::initializeCddlibIfRequired();
1297 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1303 #if (POLYMAKEVERSION >=305)
1304 polymake::Matrix<polymake::Integer> lp =
p->call_method(
"HILBERT_BASIS");
1305 #elif (POLYMAKEVERSION >=214)
1306 polymake::Matrix<polymake::Integer> lp =
p->CallPolymakeMethod(
"HILBERT_BASIS");
1307 #elif (POLYMAKEVERSION >=212)
1308 polymake::Matrix<polymake::Integer> lp =
p->give(
"HILBERT_BASIS");
1310 #error polymake version too old
1315 catch (
const std::exception& ex)
1317 gfan::deinitializeCddlibIfRequired();
1321 gfan::deinitializeCddlibIfRequired();
1324 WerrorS(
"overflow while converting polymake::Integer to int");
1328 res->data = (
char*) iv;
1331 WerrorS(
"hilbertBasis: unexpected parameters");
1341 gfan::initializeCddlibIfRequired();
1342 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1348 polymake::Integer nlp =
p->give(
"N_HILBERT_BASIS");
1352 catch (
const std::exception& ex)
1354 gfan::deinitializeCddlibIfRequired();
1358 gfan::deinitializeCddlibIfRequired();
1361 WerrorS(
"overflow while converting polymake::Integer to int");
1365 res->data = (
char*) (
long) n;
1368 WerrorS(
"nHilbertBasis: unexpected parameters");
1381 gfan::initializeCddlibIfRequired();
1382 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1383 gfan::ZCone* zq = (gfan::ZCone*)
v->Data();
1389 polymake::perl::Object pms;
1390 #if (POLYMAKE_VERSION >= 305)
1391 polymake::call_function(
"minkowski_sum", *
pp, *pq) >> pms;
1393 CallPolymakeFunction(
"minkowski_sum", *
pp, *pq) >> pms;
1399 catch (
const std::exception& ex)
1401 gfan::deinitializeCddlibIfRequired();
1405 gfan::deinitializeCddlibIfRequired();
1407 res->data = (
char*) ms;
1412 gfan::initializeCddlibIfRequired();
1413 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1414 gfan::ZCone* zc = (gfan::ZCone*)
v->Data();
1415 gfan::ZCone* zq =
new gfan::ZCone(
liftUp(*zc));
1421 polymake::perl::Object pms;
1422 #if (POLYMAKE_VERSION >= 305)
1423 polymake::call_function(
"minkowski_sum", *
pp, *pq) >> pms;
1425 CallPolymakeFunction(
"minkowski_sum", *
pp, *pq) >> pms;
1431 catch (
const std::exception& ex)
1434 gfan::deinitializeCddlibIfRequired();
1439 gfan::deinitializeCddlibIfRequired();
1441 res->data = (
char*) ms;
1450 gfan::initializeCddlibIfRequired();
1451 gfan::ZCone* zc = (gfan::ZCone*)u->
Data();
1452 gfan::ZCone* zp =
new gfan::ZCone(
liftUp(*zc));
1453 gfan::ZCone* zq = (gfan::ZCone*)
v->Data();
1459 polymake::perl::Object pms;
1460 #if (POLYMAKE_VERSION >= 305)
1461 polymake::call_function(
"minkowski_sum", *
pp, *pq) >> pms;
1463 CallPolymakeFunction(
"minkowski_sum", *
pp, *pq) >> pms;
1469 catch (
const std::exception& ex)
1472 gfan::deinitializeCddlibIfRequired();
1477 gfan::deinitializeCddlibIfRequired();
1479 res->data = (
char*) ms;
1484 gfan::initializeCddlibIfRequired();
1485 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1486 gfan::ZCone* zq = (gfan::ZCone*)
v->Data();
1492 polymake::perl::Object pms;
1493 #if (POLYMAKE_VERSION >= 305)
1494 polymake::call_function(
"minkowski_sum", *
pp, *pq) >> pms;
1496 CallPolymakeFunction(
"minkowski_sum", *
pp, *pq) >> pms;
1502 catch (
const std::exception& ex)
1505 gfan::deinitializeCddlibIfRequired();
1508 gfan::deinitializeCddlibIfRequired();
1510 res->data = (
char*) ms;
1514 WerrorS(
"minkowskiSum: unexpected parameters");
1519polymake::Matrix<polymake::Integer>
verticesOf(
const polymake::perl::Object*
p,
1520 const polymake::Set<polymake::Integer>*
s)
1522 polymake::Matrix<polymake::Integer> allrays =
p->give(
"VERTICES");
1523 polymake::Matrix<polymake::Integer> wantedrays;
1525 #if (POLYMAKE_VERSION >= 305)
1526 for(
const auto i : *
s)
1531 for(polymake::Entire<polymake::Set<polymake::Integer> >::const_iterator
i=polymake::entire(*
s); !
i.at_end();
i++)
1538 WerrorS(
"overflow while converting polymake::Integer to int in raysOf");
1552 gfan::initializeCddlibIfRequired();
1553 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1560 polymake::perl::Object o(
"LinearProgram<Rational>");
1563 polymake::Set<polymake::Integer> mf =
p->give(
"LP.MAXIMAL_FACE");
1568 catch (
const std::exception& ex)
1571 gfan::deinitializeCddlibIfRequired();
1574 gfan::deinitializeCddlibIfRequired();
1577 WerrorS(
"overflow while converting polymake::Integer to int");
1581 res->data = (
char*) maxface;
1585 WerrorS(
"maximalFace: unexpected parameters");
1598 gfan::initializeCddlibIfRequired();
1599 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1606 polymake::perl::Object o(
"LinearProgram<Rational>");
1609 polymake::Set<polymake::Integer> mf =
p->give(
"LP.MINIMAL_FACE");
1614 catch (
const std::exception& ex)
1617 gfan::deinitializeCddlibIfRequired();
1620 gfan::deinitializeCddlibIfRequired();
1623 WerrorS(
"overflow while converting polymake::Integer to int");
1627 res->data = (
char*) minface;
1631 WerrorS(
"minimalFace: unexpected parameters");
1644 gfan::initializeCddlibIfRequired();
1645 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1647 if (iv->
rows()==zp->ambientDimension())
1655 polymake::perl::Object o(
"LinearProgram<Rational>");
1656 o.take(
"LINEAR_OBJECTIVE") << lo;
1658 polymake::Integer mv =
p->give(
"LP.MAXIMAL_VALUE");
1662 catch (
const std::exception& ex)
1665 gfan::deinitializeCddlibIfRequired();
1668 gfan::deinitializeCddlibIfRequired();
1671 WerrorS(
"overflow while converting polymake::Integer to int");
1675 res->data = (
char*) (
long)
m;
1679 WerrorS(
"maximalValue: vector is of wrong size");
1682 WerrorS(
"maximalValue: unexpected parameters");
1694 gfan::initializeCddlibIfRequired();
1695 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1697 if (iv->
rows()==zp->ambientDimension())
1705 polymake::perl::Object o(
"LinearProgram<Rational>");
1706 o.take(
"LINEAR_OBJECTIVE") << lo;
1708 polymake::Integer mv =
p->give(
"LP.MINIMAL_VALUE");
1712 catch (
const std::exception& ex)
1715 gfan::deinitializeCddlibIfRequired();
1718 gfan::deinitializeCddlibIfRequired();
1721 WerrorS(
"overflow while converting polymake::Integer to int");
1725 res->data = (
char*) (
long)
m;
1729 WerrorS(
"minimalValue: vector is of wrong size");
1732 WerrorS(
"minimalValue: unexpected parameters");
1742 gfan::initializeCddlibIfRequired();
1743 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1747 #if (POLYMAKE_VERSION >= 305)
1748 polymake::call_function(
"jreality",
pp->call_method(
"VISUAL"));
1750 VoidCallPolymakeFunction(
"jreality",
pp->CallPolymakeMethod(
"VISUAL"));
1754 catch (
const std::exception& ex)
1757 gfan::deinitializeCddlibIfRequired();
1760 gfan::deinitializeCddlibIfRequired();
1767 gfan::initializeCddlibIfRequired();
1768 gfan::ZFan* zf = (gfan::ZFan*)u->
Data();
1772 #if (POLYMAKE_VERSION >= 305)
1773 polymake::call_function(
"jreality",pf->call_method(
"VISUAL"));
1775 VoidCallPolymakeFunction(
"jreality",pf->CallPolymakeMethod(
"VISUAL"));
1778 catch (
const std::exception& ex)
1780 gfan::deinitializeCddlibIfRequired();
1784 gfan::deinitializeCddlibIfRequired();
1789 WerrorS(
"visual: unexpected parameters");
1798 gfan::initializeCddlibIfRequired();
1799 gfan::ZCone* zp = (gfan::ZCone*)u->
Data();
1800 gfan::ZFan* zf =
new gfan::ZFan(0);
1804 polymake::perl::Object pf;
1805 #if (POLYMAKE_VERSION >= 305)
1806 polymake::call_function(
"normal_fan", *
p) >> pf;
1808 CallPolymakeFunction(
"normal_fan",*
p) >> pf;
1813 catch (
const std::exception& ex)
1815 gfan::deinitializeCddlibIfRequired();
1819 gfan::deinitializeCddlibIfRequired();
1821 res->data = (
char*) zf;
1824 WerrorS(
"normalFan: unexpected parameters");
1833 gfan::initializeCddlibIfRequired();
1834 polymake::perl::Object pc(
"Cone<Rational>");
1837 pc.take(
"INPUT_RAYS") << pmhlines;
1844 pc.take(
"INPUT_LINEALITY") << pmlines;
1854 gfan::deinitializeCddlibIfRequired();
1856 res->data = (
char*) zc;
1859 WerrorS(
"coneViaRays: unexpected parameters");
1869 gfan::initializeCddlibIfRequired();
1870 polymake::perl::Object
pp(
"Polytope<Rational>");
1877 int flag = (int) (
long)
v->Data();
1880 case 0:
pp.take(
"POINTS") << pmpoints;
1881 case 1:
pp.take(
"VERTICES") << pmpoints;
1882 default:
WerrorS(
"polytopeViaVertices: invalid flag");
1886 pp.take(
"POINTS") << pmpoints;
1889 gfan::deinitializeCddlibIfRequired();
1891 res->data = (
char*) zp;
1894 WerrorS(
"polytopeViaVertices: unexpected parameters");
1904 gfan::initializeCddlibIfRequired();
1905 gfan::ZCone* zp = (gfan::ZCone*) u->
Data();
1910 polymake::Matrix<polymake::Integer> vert0 =
p->give(
"VERTICES");
1913 output->
m[0].
data = (
void*) vert1;
1915 polymake::Graph<> gr=
p->give(
"GRAPH.ADJACENCY");
1916 polymake::IncidenceMatrix<polymake::NonSymmetric> adj = adjacency_matrix(gr);
1919 output->
m[1].
data = (
void*) listOfEdges;
1922 catch (
const std::exception& ex)
1924 gfan::deinitializeCddlibIfRequired();
1928 gfan::deinitializeCddlibIfRequired();
1930 res->data = (
void*) output;
1933 WerrorS(
"vertexEdgeGraph: unexpected parameters");
1943 gfan::initializeCddlibIfRequired();
1944 gfan::ZCone* zp = (gfan::ZCone*) u->
Data();
1949 polymake::Matrix<polymake::Integer> vert0 =
p->give(
"VERTICES");
1952 output->
m[0].
data = (
void*) vert1;
1954 polymake::Graph<> gr=
p->give(
"GRAPH.ADJACENCY");
1955 polymake::IncidenceMatrix<polymake::NonSymmetric> adj = adjacency_matrix(gr);
1958 output->
m[1].
data = (
void*) listOfEdges;
1961 catch (
const std::exception& ex)
1963 gfan::deinitializeCddlibIfRequired();
1967 gfan::deinitializeCddlibIfRequired();
1969 res->data = (
void*) output;
1972 WerrorS(
"vertexEdgeGraph: unexpected parameters");
1981 omp_set_num_threads(1);
gfan::ZMatrix liftUp(const gfan::ZMatrix &zm)
BOOLEAN rays(leftv res, leftv args)
BOOLEAN vertices(leftv res, leftv args)
BOOLEAN blackboxDefaultOp2(int, leftv, leftv, leftv)
default procedure blackboxDefaultOp2, to be called as "default:" branch
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Class used for (list of) interpreter objects.
INLINE_THIS void Init(int l=0)
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
STATIC_VAR coordinates * points
int PmInteger2Int(const polymake::Integer &pi, bool &ok)
gfan::ZCone * PmPolytope2ZPolytope(polymake::perl::Object *pp)
polymake::Vector< polymake::Integer > Intvec2PmVectorInteger(const intvec *iv)
polymake::perl::Object * ZFan2PmFan(gfan::ZFan *zf)
gfan::ZCone * PmCone2ZCone(polymake::perl::Object *pc)
gfan::ZFan * PmFan2ZFan(polymake::perl::Object *pf)
lists PmIncidenceMatrix2ListOfIntvecs(polymake::IncidenceMatrix< polymake::NonSymmetric > *icmat)
intvec * PmMatrixInteger2Intvec(polymake::Matrix< polymake::Integer > *mi, bool &ok)
polymake::Matrix< polymake::Integer > Intvec2PmMatrixInteger(const intvec *im)
lists PmAdjacencyMatrix2ListOfEdges(polymake::IncidenceMatrix< polymake::NonSymmetric > *icmat)
polymake::perl::Object * ZCone2PmCone(gfan::ZCone *zc)
polymake::perl::Object * ZPolytope2PmPolytope(gfan::ZCone *zc)
bigintmat * PmMatrixInteger2Bigintmat(polymake::Matrix< polymake::Integer > *mi)
intvec * PmVectorInteger2Intvec(const polymake::Vector< polymake::Integer > *vi, bool &ok)
void init_polymake_help()
BOOLEAN PMnInteriorLatticePoints(leftv res, leftv args)
static BOOLEAN bbpolytope_Op2(int op, leftv res, leftv i1, leftv i2)
BOOLEAN PMisLatticePolytope(leftv res, leftv args)
BOOLEAN PMvertexAdjacencyGraph(leftv res, leftv args)
BOOLEAN PMminkowskiSum(leftv res, leftv args)
int SI_MOD_INIT() polymake(SModulFunctions *p)
BOOLEAN PMmaximalFace(leftv res, leftv args)
BOOLEAN PMfVector(leftv res, leftv args)
BOOLEAN PMisSmooth(leftv res, leftv args)
BOOLEAN normalFan(leftv res, leftv args)
BOOLEAN PMnBoundaryLatticePoints(leftv res, leftv args)
BOOLEAN PMfacetVertexLatticeDistances(leftv res, leftv args)
BOOLEAN PMisLatticeEmpty(leftv res, leftv args)
BOOLEAN PMgorensteinIndex(leftv res, leftv args)
BOOLEAN visual(leftv res, leftv args)
BOOLEAN PMehrhartPolynomialCoeff(leftv res, leftv args)
BOOLEAN PMvertexEdgeGraph(leftv res, leftv args)
BOOLEAN PMboundaryLatticePoints(leftv res, leftv args)
BOOLEAN PMisReflexive(leftv res, leftv args)
BOOLEAN PMisVeryAmple(leftv res, leftv args)
BOOLEAN PMlatticeVolume(leftv res, leftv args)
BOOLEAN PMnHilbertBasis(leftv res, leftv args)
BOOLEAN PMmaximalValue(leftv res, leftv args)
BOOLEAN PMgorensteinVector(leftv res, leftv args)
polymake::Main * init_polymake
BOOLEAN PMlatticeDegree(leftv res, leftv args)
BOOLEAN PMhVector(leftv res, leftv args)
BOOLEAN PMminimalValue(leftv res, leftv args)
BOOLEAN PMisCompressed(leftv res, leftv args)
BOOLEAN PMlatticePoints(leftv res, leftv args)
BOOLEAN PMisBounded(leftv res, leftv args)
BOOLEAN PMnLatticePoints(leftv res, leftv args)
BOOLEAN PMinteriorLatticePoints(leftv res, leftv args)
BOOLEAN PMfacetWidth(leftv res, leftv args)
BOOLEAN PMisNormal(leftv res, leftv args)
BOOLEAN PMconeViaRays(leftv res, leftv args)
BOOLEAN PMhStarVector(leftv res, leftv args)
BOOLEAN PMminimalFace(leftv res, leftv args)
BOOLEAN PMlatticeCodegree(leftv res, leftv args)
BOOLEAN PMisCanonical(leftv res, leftv args)
polymake::Matrix< polymake::Integer > verticesOf(const polymake::perl::Object *p, const polymake::Set< polymake::Integer > *s)
BOOLEAN PMfacetWidths(leftv res, leftv args)
BOOLEAN PMisTerminal(leftv res, leftv args)
BOOLEAN PMhilbertBasis(leftv res, leftv args)
BOOLEAN PMpolytopeViaVertices(leftv res, leftv args)
BOOLEAN PMisGorenstein(leftv res, leftv args)