Page 1 of 1

Using .h files in Perl script

Posted: 07 Mar 2019, 18:27
by jrei
Dear Polymake Team,

Is it possible, and if yes how, to use the classes and methods implemented in the header files in "apps/graph/include" in a perl script or the interactive shell?

Kind regards,
JR

Re: Using .h files in Perl script

Posted: 07 Mar 2019, 22:34
by gawrilow
Some of them - yes, some others not. There is some gluing magic in place which has to be written for every C++ function and class in order to make them visible on the perl side.

To get an overview of what is already available from the interactive shell and scripts, you can browse the interactive help system. For example, change to application "graph" and enter help "functions/ or help "objects/ then use TAB completion to see the proposals. Or look at the release documentation at https://polymake.org/release_docs/latest/graph.html, it contains the same information.

If a function that you are looking for is missing, it will probably be possible to provide the missing glue, but it's a too vast topic to be explained in a single forum post. The general procedure is explained here: https://polymake.org/doku.php/user_guid ... on_to_perl for functions and here: https://polymake.org/doku.php/user_guid ... pe_binding for classes, but this stuff is more oriented at experienced polymake developers. Maybe you just ask concretely for things you need.

Re: Using .h files in Perl script

Posted: 08 Mar 2019, 12:36
by jrei
Thanks for the answer,
My Question was aimed at the different implementations of dijkstras shortest path algorithm. After checking i found them to be available as shortest_path_dijkstra.

Kind regards,
JR