Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346/***************************************************************************1**2** polymake_main.cpp Sebastian Gutsche A file to provide Polymake3** to GAP.4**5*/67#include "loadgap.h"89# define MORE_TESTS 1101112// This is the include of the polymake headers,13// make shure that you have installed polymake properly1415#include <polymake/Main.h>16#include <polymake/Matrix.h>17#include <polymake/Rational.h>1819#include <iostream>20#include <map>21#include <utility>2223#include "polymake_fktn.h"24#include "polymake_polytopes.h"25#include "polymake_cone.h"26#include "polymake_fan.h"27#include "polymake_tropical.h"2829using std::cerr;30using std::endl;31using std::string;32using std::map;33using std::pair;343536static Polymake_Data akt_data;3738Obj TheTypeExternalPolymakeCone;39Obj TheTypeExternalPolymakeFan;40Obj TheTypeExternalPolymakePolytope;41Obj TheTypeExternalPolymakeTropicalHypersurface;42Obj TheTypeExternalPolymakeTropicalPolytope;4344Obj FuncPOLYMAKE_CREATE_CONE_BY_RAYS( Obj self, Obj rays ) {4546polymake_start( &akt_data );47return REAL_CREATE_CONE_BY_RAYS( &akt_data,rays);4849}5051Obj FuncPOLYMAKE_CREATE_CONE_BY_RAYS_UNSAVE( Obj self, Obj rays ) {5253polymake_start( &akt_data );54return REAL_CREATE_CONE_BY_RAYS_UNSAVE( &akt_data,rays);5556}575859Obj FuncPOLYMAKE_CREATE_CONE_BY_INEQUALITIES( Obj self, Obj rays ) {6061polymake_start( &akt_data );62return REAL_CREATE_CONE_BY_INEQUALITIES( &akt_data,rays);6364}65666768Obj FuncPOLYMAKE_CREATE_DUAL_CONE_OF_CONE( Obj self, Obj cone ) {6970return REAL_CREATE_DUAL_CONE_OF_CONE( &akt_data, cone );7172}737475Obj FuncPOLYMAKE_IS_NONEMPTY_POLYTOPE( Obj self, Obj cone ){7677//return REAL_IS_SIMPLICIAL_OBJECT( &akt_data, cone );78return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "FEASIBLE" );7980}818283Obj FuncPOLYMAKE_IS_SIMPLICIAL_OBJECT( Obj self, Obj cone ){8485//return REAL_IS_SIMPLICIAL_OBJECT( &akt_data, cone );86return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SIMPLICIAL" );8788}899091Obj FuncPOLYMAKE_IS_SIMPLE_OBJECT( Obj self, Obj cone ){9293//return REAL_IS_SIMPLICIAL_OBJECT( &akt_data, cone );94return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SIMPLE" );9596}979899Obj FuncPOLYMAKE_IS_SIMPLICIAL_CONE( Obj self, Obj cone ){100101//return REAL_IS_SIMPLICIAL_OBJECT( &akt_data, cone );102return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SIMPLICIAL_CONE" );103104}105106107108Obj FuncPOLYMAKE_IS_LATTICE_OBJECT( Obj self, Obj cone ) {109110//return REAL_IS_LATTICE_OBJECT( &akt_data, cone );111return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "LATTICE" );112113}114115116Obj FuncPOLYMAKE_IS_NORMAL_OBJECT( Obj self, Obj cone ) {117118//return REAL_IS_NORMAL_OBJECT( &akt_data, cone );119return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "NORMAL" );120121}122123124Obj FuncPOLYMAKE_IS_VERYAMPLE_OBJECT( Obj self, Obj cone ) {125126//return REAL_IS_VERYAMPLE_OBJECT( &akt_data, cone );127return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "VERY_AMPLE" );128129}130131132Obj FuncPOLYMAKE_IS_SMOOTH_OBJECT( Obj self, Obj cone ) {133134//return REAL_IS_SMOOTH_OBJECT( &akt_data, cone );135return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SMOOTH" );136137}138139140141Obj FuncPOLYMAKE_IS_STRICTLY_CONVEX_CONE( Obj self, Obj cone){142143//return REAL_IS_STRICTLY_CONVEX_CONE( &akt_data, cone );144return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "POINTED" );145146}147148149Obj FuncPOLYMAKE_IS_SMOOTH_CONE( Obj self, Obj cone){150151return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "SMOOTH_CONE" );152153}154155Obj FuncPOLYMAKE_GENERATING_RAYS_OF_CONE( Obj self, Obj cone){156157return REAL_GENERATING_RAYS_OF_CONE( &akt_data, cone );158159}160161Obj FuncPOLYMAKE_CREATE_POLYTOPE_BY_POINTS( Obj self, Obj polytope ){162163polymake_start( &akt_data );164return REAL_CREATE_POLYTOPE_BY_POINTS( &akt_data, polytope );165166}167168Obj FuncPOLYMAKE_VERTICES_OF_POLYTOPE( Obj self, Obj polytope){169170return REAL_VERTICES_OF_POLYTOPE( &akt_data, polytope);171172}173174Obj FuncPOLYMAKE_CREATE_POLYTOPE_BY_INEQUALITIES( Obj self, Obj polytope ){175176polymake_start( &akt_data );177return REAL_CREATE_POLYTOPE_BY_INEQUALITIES( &akt_data, polytope );178179}180181Obj FuncPOLYMAKE_AMBIENT_DIM_OF_CONE( Obj self, Obj cone ){182183return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, cone, "CONE_AMBIENT_DIM" );184185}186187Obj FuncPOLYMAKE_DIM_OF_CONE( Obj self, Obj cone ){188189return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, cone, "CONE_DIM" );190191}192193Obj FuncPOLYMAKE_AMBIENT_DIM_OF_FAN( Obj self, Obj fan ){194195return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, fan, "FAN_AMBIENT_DIM" );196197}198199Obj FuncPOLYMAKE_DIM_OF_FAN( Obj self, Obj fan ){200201return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, fan, "FAN_DIM" );202203}204205Obj FuncPOLYMAKE_HILBERT_BASIS_OF_CONE( Obj self, Obj cone ){206207return REAL_HILBERT_BASIS_OF_CONE( &akt_data, cone );208209}210211Obj FuncPOLYMAKE_RAYS_IN_FACETS( Obj self, Obj cone ){212213return REAL_RAYS_IN_FACETS( &akt_data, cone );214215}216217Obj FuncPOLYMAKE_LATTICE_POINTS_OF_POLYTOPE( Obj self, Obj polytope ){218219return REAL_LATTICE_POINTS_OF_POLYTOPE( &akt_data, polytope );220221}222223Obj FuncPOLYMAKE_FAN_BY_CONES( Obj self, Obj cones ){224225polymake_start( &akt_data );226return REAL_FAN_BY_CONES( &akt_data, cones );227228}229230Obj FuncPOLYMAKE_FAN_BY_RAYS_AND_CONES( Obj self, Obj rays, Obj cones ){231232polymake_start( &akt_data );233return REAL_FAN_BY_RAYS_AND_CONES( &akt_data, rays, cones );234235}236237Obj FuncPOLYMAKE_FAN_BY_RAYS_AND_CONES_UNSAVE( Obj self, Obj rays, Obj cones ){238239polymake_start( &akt_data );240return REAL_FAN_BY_RAYS_AND_CONES_UNSAVE( &akt_data, rays, cones );241242}243244Obj FuncPOLYMAKE_RAYS_IN_MAXCONES_OF_FAN( Obj self, Obj fan){245246return REAL_RAYS_IN_MAXCONES_OF_FAN( &akt_data, fan );247248}249250Obj FuncPOLYMAKE_RAYS_OF_FAN( Obj self, Obj fan){251252return REAL_RAYS_OF_FAN( &akt_data, fan );253254}255256Obj FuncPOLYMAKE_IS_POINTED_FAN( Obj self, Obj fan){257258return REAL_OBJECT_HAS_PROPERTY( &akt_data, fan, "POINTED" );259260}261262Obj FuncPOLYMAKE_IS_SMOOTH_FAN( Obj self, Obj fan ){263264return REAL_OBJECT_HAS_PROPERTY( &akt_data, fan, "SMOOTH_FAN" );265266}267268Obj FuncPOLYMAKE_IS_COMPLETE_FAN( Obj self, Obj fan ){269270return REAL_OBJECT_HAS_PROPERTY( &akt_data, fan, "COMPLETE" );271272}273274Obj FuncPOLYMAKE_OBJECT_HAS_PROPERTY( Obj self, Obj conv, Obj prop){275276if( ! IS_STRING( prop ) )277ErrorMayQuit(" given property is not a string", 0 ,0 );278279return REAL_OBJECT_HAS_PROPERTY( &akt_data, conv, CSTR_STRING( prop ) );280281}282283Obj FuncPOLYMAKE_OBJECT_HAS_INT_PROPERTY( Obj self, Obj conv, Obj prop){284285if( ! IS_STRING( prop ) )286ErrorMayQuit(" given property is not a string", 0 ,0 );287288return REAL_OBJECT_HAS_INT_PROPERTY( &akt_data, conv, CSTR_STRING( prop ) );289290}291292Obj FuncPOLYMAKE_IS_REGULAR_OBJECT( Obj self, Obj fan ){293294return REAL_OBJECT_HAS_PROPERTY( &akt_data, fan, "REGULAR" );295296}297298Obj FuncPOLYMAKE_NORMALFAN_OF_POLYTOPE( Obj self, Obj polytope ){299300polymake_start( &akt_data );301return REAL_NORMALFAN_OF_POLYTOPE( &akt_data, polytope );302303}304305Obj FuncPOLYMAKE_IS_FULL_DIMENSIONAL_OBJECT( Obj self, Obj cone ){306307return REAL_OBJECT_HAS_PROPERTY( &akt_data, cone, "FULL_DIM" );308309}310311Obj FuncPOLYMAKE_IS_BOUNDED_POLYTOPE( Obj self, Obj polytope ){312313return REAL_OBJECT_HAS_PROPERTY( &akt_data, polytope, "BOUNDED" );314315}316317Obj FuncPOLYMAKE_DRAW( Obj self, Obj cone ){318319polymake_start( &akt_data );320return REAL_POLYMAKE_DRAW( &akt_data, cone );321322}323324Obj FuncPOLYMAKE_SKETCH( Obj self, Obj cone ){325326polymake_start( &akt_data );327return REAL_POLYMAKE_SKETCH( &akt_data, cone );328329}330331Obj FuncPOLYMAKE_SKETCH_WITH_OPTIONS_KERNEL( Obj self, Obj cone, Obj filename, Obj options ){332333polymake_start( &akt_data );334return REAL_POLYMAKE_SKETCH_WITH_OPTIONS( &akt_data, cone, filename, options );335336}337338Obj FuncPOLYMAKE_DEFINING_INEQUALITIES_OF_CONE( Obj self, Obj cone ){339340return REAL_DEFINING_INEQUALITIES_OF_CONE( &akt_data, cone );341342}343344Obj FuncPOLYMAKE_FACET_INEQUALITIES_OF_POLYTOPE( Obj self, Obj poly ){345346return REAL_FACET_INEQUALITIES_OF_POLYTOPE( &akt_data, poly );347348}349350Obj FuncPOLYMAKE_EQUALITIES_OF_POLYTOPE( Obj self, Obj poly ){351352return REAL_EQUALITIES_OF_POLYTOPE( &akt_data, poly );353354}355356Obj FuncPOLYMAKE_INTERIOR_LATTICE_POINTS( Obj self, Obj poly ){357358return REAL_INTERIOR_LATTICE_POINTS( &akt_data, poly );359360}361362Obj FuncPOLYMAKE_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS( Obj self, Obj points ){363364polymake_start( &akt_data );365return REAL_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS( &akt_data, points );366367}368369Obj FuncPOLYMAKE_HOMOGENEOUS_POINTS_OF_POLYTOPE( Obj self, Obj polytope ){370371return REAL_HOMOGENEOUS_POINTS_OF_POLYTOPE( &akt_data, polytope );372373}374375Obj FuncPOLYMAKE_TAIL_CONE_OF_POLYTOPE( Obj self, Obj polytope ){376377polymake_start( &akt_data );378return REAL_TAIL_CONE_OF_POLYTOPE( &akt_data, polytope );379380}381382Obj FuncPOLYMAKE_LINEALITY_SPACE_OF_CONE( Obj self, Obj cone ){383384return REAL_LINEALITY_SPACE_OF_CONE( &akt_data, cone );385386}387388Obj FuncPOLYMAKE_MINKOWSKI_SUM( Obj self, Obj polytope1, Obj polytope2 ){389390return REAL_MINKOWSKI_SUM( &akt_data, polytope1, polytope2 );391392}393394Obj FuncPOLYMAKE_INTERSECTION_OF_CONES( Obj self, Obj cone1, Obj cone2 ){395396return REAL_INTERSECTION_OF_CONES( &akt_data, cone1, cone2 );397398}399400Obj FuncPOLYMAKE_INTERSECTION_OF_POLYTOPES( Obj self, Obj cone1, Obj cone2 ){401402return REAL_INTERSECTION_OF_POLYTOPES( &akt_data, cone1, cone2 );403404}405406Obj FuncPOLYMAKE_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES( Obj self, Obj equalities, Obj inequalities ){407408polymake_start( &akt_data );409return REAL_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES( &akt_data, equalities, inequalities );410411}412413Obj FuncPOLYMAKE_EQUALITIES_OF_CONE( Obj self, Obj cone ){414415return REAL_EQUALITIES_OF_CONE( &akt_data, cone );416417}418419Obj FuncPOLYMAKE_STELLAR_SUBDIVISION( Obj self, Obj ray, Obj fan){420421return REAL_STELLAR_SUBDIVISION( &akt_data, ray, fan );422423}424425Obj FuncPOLYMAKE_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS( Obj self, Obj mon, Obj coeff){426427polymake_start( &akt_data );428return REAL_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS( &akt_data, mon, coeff );429430}431432Obj FuncPOLYMAKE_MONOMIALS_OF_HYPERSURFACE( Obj self, Obj surf ){433434polymake_start( &akt_data );435return REAL_MONOMIALS_OF_HYPERSURFACE( &akt_data, surf );436437}438439Obj FuncPOLYMAKE_LATTICE_POINTS_GENERATORS( Obj self, Obj polytope ){440441polymake_start( &akt_data );442return REAL_LATTICE_POINTS_GENERATORS( &akt_data, polytope );443444}445446Obj FuncPOLYMAKE_TROPICAL_POLYTOPE_BY_POINTS( Obj self, Obj points ){447448polymake_start( &akt_data );449return REAL_TROPICAL_POLYTOPE_BY_POINTS( &akt_data, points );450451}452453Obj FuncPOLYMAKE_SET_PROPERTY_TRUE( Obj self, Obj conv, Obj prop){454455if( ! IS_STRING( prop ) )456ErrorMayQuit(" given property is not a string", 0 ,0 );457458REAL_SET_PROPERTY_TRUE( &akt_data, conv, CSTR_STRING( prop ) );459return INTOBJ_INT( 0 );460461}462463Obj FuncPOLYMAKE_RESET_WORKSPACE( Obj self ){464465delete akt_data.main_polymake_session;466akt_data.main_polymake_session = new polymake::Main;467akt_data.main_polymake_scope = new polymake::perl::Scope(akt_data.main_polymake_session->newScope());468469return True;470471}472473Obj FuncPOLYMAKE_F_VECTOR_OF_FAN( Obj self, Obj fan ){474475return REAL_F_VECTOR( &akt_data, fan );476477}478479Obj FuncPOLYMAKE_PROPERTIES( Obj self, Obj cone ){480481return REAL_POLYMAKE_PROPERTIES( &akt_data, cone );482483}484485/******************************************************************************486*V GVarFuncs . . . . . . . . . . . . . . . . . . list of functions to export487*/488static StructGVarFunc GVarFuncs [] = {489490{ "POLYMAKE_CREATE_CONE_BY_RAYS", 1, "rays",491(Obj(*)())FuncPOLYMAKE_CREATE_CONE_BY_RAYS,492"polymake_main.cpp:POLYMAKE_CREATE_CONE_BY_RAYS" },493494{ "POLYMAKE_CREATE_CONE_BY_RAYS_UNSAVE", 1, "rays",495(Obj(*)())FuncPOLYMAKE_CREATE_CONE_BY_RAYS_UNSAVE,496"polymake_main.cpp:POLYMAKE_CREATE_CONE_BY_RAYS_UNSAVE" },497498{ "POLYMAKE_CREATE_CONE_BY_INEQUALITIES", 1, "rays",499(Obj(*)())FuncPOLYMAKE_CREATE_CONE_BY_INEQUALITIES,500"polymake_main.cpp:POLYMAKE_CREATE_CONE_BY_INEQUALITIES" },501502{ "POLYMAKE_CREATE_DUAL_CONE_OF_CONE", 1, "cone",503(Obj(*)())FuncPOLYMAKE_CREATE_DUAL_CONE_OF_CONE,504"polymake_main.cpp:POLYMAKE_CREATE_DUAL_CONE_OF_CONE" },505506{ "POLYMAKE_IS_NONEMPTY_POLYTOPE", 1, "cone",507(Obj(*)())FuncPOLYMAKE_IS_NONEMPTY_POLYTOPE,508"polymake_main.cpp:POLYMAKE_IS_NONEMPTY_POLYTOPE" },509510{ "POLYMAKE_IS_SIMPLICIAL_OBJECT", 1, "cone",511(Obj(*)())FuncPOLYMAKE_IS_SIMPLICIAL_OBJECT,512"polymake_main.cpp:POLYMAKE_IS_SIMPLICIAL_OBJECT" },513514{ "POLYMAKE_IS_SIMPLE_OBJECT", 1, "cone",515(Obj(*)())FuncPOLYMAKE_IS_SIMPLE_OBJECT,516"polymake_main.cpp:POLYMAKE_IS_SIMPLE_OBJECT" },517518{ "POLYMAKE_IS_SIMPLICIAL_CONE", 1, "cone",519(Obj(*)())FuncPOLYMAKE_IS_SIMPLICIAL_CONE,520"polymake_main.cpp:POLYMAKE_IS_SIMPLICIAL_CONE" },521522{ "POLYMAKE_IS_LATTICE_OBJECT", 1, "cone",523(Obj(*)())FuncPOLYMAKE_IS_LATTICE_OBJECT,524"polymake_main.cpp:POLYMAKE_IS_LATTICE_OBJECT" },525526{ "POLYMAKE_IS_NORMAL_OBJECT", 1, "cone",527(Obj(*)())FuncPOLYMAKE_IS_NORMAL_OBJECT,528"polymake_main.cpp:POLYMAKE_IS_NORMAL_OBJECT" },529530{ "POLYMAKE_IS_VERYAMPLE_OBJECT", 1, "cone",531(Obj(*)())FuncPOLYMAKE_IS_VERYAMPLE_OBJECT,532"polymake_main.cpp:POLYMAKE_IS_VERYAMPLE_OBJECT" },533534{ "POLYMAKE_IS_SMOOTH_OBJECT", 1, "cone",535(Obj(*)())FuncPOLYMAKE_IS_SMOOTH_OBJECT,536"polymake_main.cpp:POLYMAKE_IS_SMOOTH_OBJECT" },537538{ "POLYMAKE_IS_STRICTLY_CONVEX_CONE", 1, "cone",539(Obj(*)())FuncPOLYMAKE_IS_STRICTLY_CONVEX_CONE,540"polymake_main.cpp:POLYMAKE_IS_STRICTLY_CONVEX_CONE" },541542{ "POLYMAKE_IS_SMOOTH_CONE", 1, "cone",543(Obj(*)())FuncPOLYMAKE_IS_SMOOTH_CONE,544"polymake_main.cpp:POLYMAKE_IS_SMOOTH_CONE" },545546{ "POLYMAKE_GENERATING_RAYS_OF_CONE", 1, "cone",547(Obj(*)())FuncPOLYMAKE_GENERATING_RAYS_OF_CONE,548"polymake_main.cpp:POLYMAKE_GENERATING_RAYS_OF_CONE" },549550{ "POLYMAKE_CREATE_POLYTOPE_BY_POINTS", 1, "polytope",551(Obj(*)())FuncPOLYMAKE_CREATE_POLYTOPE_BY_POINTS,552"polymake_main.cpp:POLYMAKE_CREATE_POLYTOPE_BY_POINTS" },553554{ "POLYMAKE_VERTICES_OF_POLYTOPE", 1, "polytope",555(Obj(*)())FuncPOLYMAKE_VERTICES_OF_POLYTOPE,556"polymake_main.cpp:POLYMAKE_VERTICES_OF_POLYTOPE" },557558{ "POLYMAKE_CREATE_POLYTOPE_BY_INEQUALITIES", 1, "polytope",559(Obj(*)())FuncPOLYMAKE_CREATE_POLYTOPE_BY_INEQUALITIES,560"polymake_main.cpp:POLYMAKE_CREATE_POLYTOPE_BY_INEQUALITIES" },561562{ "POLYMAKE_AMBIENT_DIM_OF_CONE", 1, "cone",563(Obj(*)())FuncPOLYMAKE_AMBIENT_DIM_OF_CONE,564"polymake_main.cpp:POLYMAKE_AMBIENT_DIM_OF_CONE" },565566{ "POLYMAKE_DIM_OF_CONE", 1, "cone",567(Obj(*)())FuncPOLYMAKE_DIM_OF_CONE,568"polymake_main.cpp:POLYMAKE_DIM_OF_CONE" },569570{ "POLYMAKE_HILBERT_BASIS_OF_CONE", 1, "cone",571(Obj(*)())FuncPOLYMAKE_HILBERT_BASIS_OF_CONE,572"polymake_main.cpp:POLYMAKE_HILBERT_BASIS_OF_CONE" },573574{ "POLYMAKE_RAYS_IN_FACETS", 1, "cone",575(Obj(*)())FuncPOLYMAKE_RAYS_IN_FACETS,576"polymake_main.cpp:POLYMAKE_RAYS_IN_FACETS" },577578{ "POLYMAKE_LATTICE_POINTS_OF_POLYTOPE", 1, "polytope",579(Obj(*)())FuncPOLYMAKE_LATTICE_POINTS_OF_POLYTOPE,580"polymake_main.cpp:POLYMAKE_LATTICE_POINTS_OF_POLYTOPE" },581582{ "POLYMAKE_FAN_BY_CONES", 1, "cones",583(Obj(*)())FuncPOLYMAKE_FAN_BY_CONES,584"polymake_main.cpp:POLYMAKE_FAN_BY_CONES" },585586{ "POLYMAKE_FAN_BY_RAYS_AND_CONES", 2, "rays,cones",587(Obj(*)())FuncPOLYMAKE_FAN_BY_RAYS_AND_CONES,588"polymake_main.cpp:POLYMAKE_FAN_BY_RAYS_AND_CONES" },589590{ "POLYMAKE_FAN_BY_RAYS_AND_CONES_UNSAVE", 2, "rays,cones",591(Obj(*)())FuncPOLYMAKE_FAN_BY_RAYS_AND_CONES_UNSAVE,592"polymake_main.cpp:POLYMAKE_FAN_BY_RAYS_AND_CONES_UNSAVE" },593594{ "POLYMAKE_RAYS_IN_MAXCONES_OF_FAN", 1, "fan",595(Obj(*)())FuncPOLYMAKE_RAYS_IN_MAXCONES_OF_FAN,596"polymake_main.cpp:POLYMAKE_RAYS_IN_MAXCONES_OF_FAN" },597598{ "POLYMAKE_RAYS_OF_FAN", 1, "fan",599(Obj(*)())FuncPOLYMAKE_RAYS_OF_FAN,600"polymake_main.cpp:POLYMAKE_RAYS_OF_FAN" },601602{ "POLYMAKE_IS_POINTED_FAN", 1, "fan",603(Obj(*)())FuncPOLYMAKE_IS_POINTED_FAN,604"polymake_main.cpp:POLYMAKE_IS_POINTED_FAN" },605606{ "POLYMAKE_IS_SMOOTH_FAN", 1, "fan",607(Obj(*)())FuncPOLYMAKE_IS_SMOOTH_FAN,608"polymake_main.cpp:POLYMAKE_IS_SMOOTH_FAN" },609610{ "POLYMAKE_IS_COMPLETE_FAN", 1, "fan",611(Obj(*)())FuncPOLYMAKE_IS_COMPLETE_FAN,612"polymake_main.cpp:POLYMAKE_IS_COMPLETE_FAN" },613614{ "POLYMAKE_OBJECT_HAS_PROPERTY", 2, "conv,prop",615(Obj(*)())FuncPOLYMAKE_OBJECT_HAS_PROPERTY,616"polymake_main.cpp:POLYMAKE_OBJECT_HAS_PROPERTY" },617618{ "POLYMAKE_OBJECT_HAS_INT_PROPERTY", 2, "conv,prop",619(Obj(*)())FuncPOLYMAKE_OBJECT_HAS_INT_PROPERTY,620"polymake_main.cpp:POLYMAKE_OBJECT_HAS_INT_PROPERTY" },621622{ "POLYMAKE_IS_REGULAR_OBJECT", 1, "fan",623(Obj(*)())FuncPOLYMAKE_IS_REGULAR_OBJECT,624"polymake_main.cpp:POLYMAKE_IS_REGULAR_OBJECT" },625626{ "POLYMAKE_NORMALFAN_OF_POLYTOPE", 1, "polytope",627(Obj(*)())FuncPOLYMAKE_NORMALFAN_OF_POLYTOPE,628"polymake_main.cpp:POLYMAKE_NORMALFAN_OF_POLYTOPE" },629630{ "POLYMAKE_AMBIENT_DIM_OF_FAN", 1, "fan",631(Obj(*)())FuncPOLYMAKE_AMBIENT_DIM_OF_FAN,632"polymake_main.cpp:POLYMAKE_AMBIENT_DIM_OF_FAN" },633634{ "POLYMAKE_DIM_OF_FAN", 1, "fan",635(Obj(*)())FuncPOLYMAKE_DIM_OF_FAN,636"polymake_main.cpp:POLYMAKE_DIM_OF_FAN" },637638{ "POLYMAKE_IS_FULL_DIMENSIONAL_OBJECT", 1, "cone",639(Obj(*)())FuncPOLYMAKE_IS_FULL_DIMENSIONAL_OBJECT,640"polymake_main.cpp:POLYMAKE_IS_FULL_DIMENSIONAL_OBJECT" },641642{ "POLYMAKE_DRAW", 1, "cone",643(Obj(*)())FuncPOLYMAKE_DRAW,644"polymake_main.cpp:POLYMAKE_DRAW" },645646{ "POLYMAKE_SKETCH", 1, "cone",647(Obj(*)())FuncPOLYMAKE_SKETCH,648"polymake_main.cpp:POLYMAKE_SKETCH" },649650{ "POLYMAKE_SKETCH_WITH_OPTIONS_KERNEL", 3, "cone,filename,options",651(Obj(*)())FuncPOLYMAKE_SKETCH_WITH_OPTIONS_KERNEL,652"polymake_main.cpp:POLYMAKE_SKETCH_WITH_OPTIONS_KERNEL" },653654{ "POLYMAKE_DEFINING_INEQUALITIES_OF_CONE", 1, "cone",655(Obj(*)())FuncPOLYMAKE_DEFINING_INEQUALITIES_OF_CONE,656"polymake_main.cpp:POLYMAKE_DEFINING_INEQUALITIES_OF_CONE" },657658{ "POLYMAKE_RESET_WORKSPACE", 0, "",659(Obj(*)())FuncPOLYMAKE_RESET_WORKSPACE,660"polymake_main.cpp:POLYMAKE_RESET_WORKSPACE" },661662{ "POLYMAKE_FACET_INEQUALITIES_OF_POLYTOPE", 1, "poly",663(Obj(*)())FuncPOLYMAKE_FACET_INEQUALITIES_OF_POLYTOPE,664"polymake_main.cpp:POLYMAKE_FACET_INEQUALITIES_OF_POLYTOPE" },665666{ "POLYMAKE_EQUALITIES_OF_POLYTOPE", 1, "poly",667(Obj(*)())FuncPOLYMAKE_EQUALITIES_OF_POLYTOPE,668"polymake_main.cpp:POLYMAKE_EQUALITIES_OF_POLYTOPE" },669670{ "POLYMAKE_INTERIOR_LATTICE_POINTS", 1, "poly",671(Obj(*)())FuncPOLYMAKE_INTERIOR_LATTICE_POINTS,672"polymake_main.cpp:POLYMAKE_INTERIOR_LATTICE_POINTS" },673674{ "POLYMAKE_IS_BOUNDED_POLYTOPE", 1, "polytope",675(Obj(*)())FuncPOLYMAKE_IS_BOUNDED_POLYTOPE,676"polymake_main.cpp:POLYMAKE_IS_BOUNDED_POLYTOPE" },677678{ "POLYMAKE_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS", 1, "points",679(Obj(*)())FuncPOLYMAKE_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS,680"polymake_main.cpp:POLYMAKE_CREATE_POLYTOPE_BY_HOMOGENEOUS_POINTS" },681682{ "POLYMAKE_HOMOGENEOUS_POINTS_OF_POLYTOPE", 1, "polytope",683(Obj(*)())FuncPOLYMAKE_HOMOGENEOUS_POINTS_OF_POLYTOPE,684"polymake_main.cpp:POLYMAKE_HOMOGENEOUS_POINTS_OF_POLYTOPE" },685686{ "POLYMAKE_TAIL_CONE_OF_POLYTOPE", 1, "polytope",687(Obj(*)())FuncPOLYMAKE_TAIL_CONE_OF_POLYTOPE,688"polymake_main.cpp:POLYMAKE_TAIL_CONE_OF_POLYTOPE" },689690{ "POLYMAKE_MINKOWSKI_SUM", 2, "polytope1,polytope2",691(Obj(*)())FuncPOLYMAKE_MINKOWSKI_SUM,692"polymake_main.cpp:POLYMAKE_MINKOWSKI_SUM" },693694{ "POLYMAKE_LINEALITY_SPACE_OF_CONE", 1, "cone",695(Obj(*)())FuncPOLYMAKE_LINEALITY_SPACE_OF_CONE,696"polymake_main.cpp:POLYMAKE_LINEALITY_SPACE_OF_CONE" },697698{ "POLYMAKE_EQUALITIES_OF_CONE", 1, "cone",699(Obj(*)())FuncPOLYMAKE_EQUALITIES_OF_CONE,700"polymake_main.cpp:POLYMAKE_EQUALITIES_OF_CONE" },701702{ "POLYMAKE_STELLAR_SUBDIVISION", 2, "ray,fan",703(Obj(*)())FuncPOLYMAKE_STELLAR_SUBDIVISION,704"polymake_main.cpp:STELLAR_SUBDIVSION" },705706{ "POLYMAKE_SET_PROPERTY_TRUE", 2, "conv,prop",707(Obj(*)())FuncPOLYMAKE_SET_PROPERTY_TRUE,708"polymake_main.cpp:POLYMAKE_SET_PROPERTY_TRUE" },709710{ "POLYMAKE_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES", 2, "equalities,inequalities",711(Obj(*)())FuncPOLYMAKE_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES,712"polymake_main.cpp:POLYMAKE_CREATE_CONE_BY_EQUALITIES_AND_INEQUALITIES" },713714{ "POLYMAKE_INTERSECTION_OF_CONES", 2, "cone1,cone2",715(Obj(*)())FuncPOLYMAKE_INTERSECTION_OF_CONES,716"polymake_main.cpp:POLYMAKE_INTERSECTION_OF_CONES" },717718{ "POLYMAKE_INTERSECTION_OF_POLYTOPES", 2, "cone1,cone2",719(Obj(*)())FuncPOLYMAKE_INTERSECTION_OF_POLYTOPES,720"polymake_main.cpp:POLYMAKE_INTERSECTION_OF_POLYTOPES" },721722{ "POLYMAKE_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS", 2, "mon,coeff",723(Obj(*)())FuncPOLYMAKE_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS,724"polymake_main.cpp:POLYMAKE_TROPICAL_HYPERSURFACE_BY_MONOMS_AND_COEFFICIENTS" },725726{ "POLYMAKE_MONOMIALS_OF_HYPERSURFACE", 1, "surf",727(Obj(*)())FuncPOLYMAKE_MONOMIALS_OF_HYPERSURFACE,728"polymake_main.cpp:POLYMAKE_MONOMIALS_OF_HYPERSURFACE" },729730{ "POLYMAKE_LATTICE_POINTS_GENERATORS", 1, "polytope",731(Obj(*)())FuncPOLYMAKE_LATTICE_POINTS_GENERATORS,732"polymake_main.cpp:POLYMAKE_LATTICE_POINTS_GENERATORS" },733734{ "POLYMAKE_TROPICAL_POLYTOPE_BY_POINTS", 1, "points",735(Obj(*)())FuncPOLYMAKE_TROPICAL_POLYTOPE_BY_POINTS,736"polymake_main.cpp:POLYMAKE_TROPICAL_POLYTOPE_BY_POINTS" },737738{ "POLYMAKE_F_VECTOR_OF_FAN", 1, "fan",739(Obj(*)())FuncPOLYMAKE_F_VECTOR_OF_FAN,740"polymake_main.cpp:POLYMAKE_F_VECTOR_OF_FAN" },741742{ "POLYMAKE_PROPERTIES", 1, "cone",743(Obj(*)())FuncPOLYMAKE_PROPERTIES,744"polymake_main.cpp:POLYMAKE_PROPERTIES" },745746{ 0 }747};748749/******************************************************************************750*F InitKernel( <module> ) . . . . . . . . initialise kernel data structures751*/752static Int InitKernel ( StructInitInfo *module )753{754755polymake_start( &akt_data );756/* init filters and functions */757InitHdlrFuncsFromTable( GVarFuncs );758759760InitCopyGVar( "TheTypeExternalPolymakeCone", &TheTypeExternalPolymakeCone );761InitCopyGVar( "TheTypeExternalPolymakeFan", &TheTypeExternalPolymakeFan );762InitCopyGVar( "TheTypeExternalPolymakePolytope", &TheTypeExternalPolymakePolytope );763InitCopyGVar( "TheTypeExternalPolymakeTropicalHypersurface", &TheTypeExternalPolymakeTropicalHypersurface );764InitCopyGVar( "TheTypeExternalPolymakeTropicalPolytope", &TheTypeExternalPolymakeTropicalPolytope );765766InfoBags[T_POLYMAKE].name = "ExternalPolymakeObject";767InitMarkFuncBags(T_POLYMAKE, &MarkOneSubBags);768InitFreeFuncBag(T_POLYMAKE, &ExternalPolymakeObjectFreeFunc);769TypeObjFuncs[T_POLYMAKE] = &ExternalPolymakeObjectTypeFunc;770771772/* return success */773return 0;774}775776/******************************************************************************777*F InitLibrary( <module> ) . . . . . . . initialise library data structures778*/779static Int InitLibrary ( StructInitInfo *module )780{781// Int i, gvar;782//783// // We start with initialising the polymake classes.784// akt_data.initialized = false;785// // akt_data.main_polymake_session = new polymake::Main;786// // akt_data.main_polymake_scope = new polymake::perl::Scope(akt_data.main_polymake_session->newScope());787// // akt_data.main_polymake_session->set_application("polytope");788// // akt_data.main_polymake_session->set_custom("$Verbose::scheduler",1);789// //This is pretty slow.790// //akt_data.polymake_objects = new map<int, pm::perl::Object*>;791// //akt_data.new_polymake_object_number=0;792// // We now have everything to handle polymake, lets do the gapthings793794InitGVarFuncsFromTable(GVarFuncs);795/* return success */796return 0;797}798799/******************************************************************************800*F InitInfopl() . . . . . . . . . . . . . . . . . table of init functions801*/802static StructInitInfo module = {803/* type = */ MODULE_DYNAMIC,804/* name = */ "polymake_main",805/* revision_c = */ 0,806/* revision_h = */ 0,807/* version = */ 0,808/* crc = */ 0,809/* initKernel = */ InitKernel,810/* initLibrary = */ InitLibrary,811/* checkInit = */ 0,812/* preSave = */ 0,813/* postSave = */ 0,814/* postRestore = */ 0815};816817extern "C" {818819StructInitInfo * Init__Dynamic ( void )820{821return &module;822}823824}825826827/*828*829* This program is free software; you can redistribute it and/or modify830* it under the terms of the GNU General Public License as published by831* the Free Software Foundation; version 2 of the License.832*833* This program is distributed in the hope that it will be useful,834* but WITHOUT ANY WARRANTY; without even the implied warranty of835* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the836* GNU General Public License for more details.837*838* You should have received a copy of the GNU General Public License839* along with this program; if not, write to the Free Software840* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA841*842*/843844845