how to use polymake other than command line?

Questions and problems about using polymake go here.
qichen
Posts: 8
Joined: 09 Jul 2020, 02:01

how to use polymake other than command line?

Postby qichen » 31 Jul 2021, 04:43

Can I write a bunch of codes and run them one time, but not just line by line in command line terminal. More over, can I define some functions by myself and save it to a file, then use it when I needed?

User avatar
joswig
Main Author
Posts: 279
Joined: 24 Dec 2010, 11:10

Re: how to use polymake other than command line?

Postby joswig » 31 Jul 2021, 18:36

Yes to both questions.

Even the command line provide full perl functionality.

Code: Select all

> sub myowncode($) { my ($arg)=@_; return cube($arg)->VOLUME; } > print myowncode(4); 16
Then you can store a sequence of commands as a text file and apply load_commands to execute that code line by line.

For best experience, however, use the Jupyter notebook frontend, https://polymake.org/doku.php/user_guid ... []=jupyter
Here are some examples: https://github.com/micjoswig/polymake-notebooks

User avatar
gawrilow
Main Author
Posts: 422
Joined: 25 Dec 2010, 17:40

Re: how to use polymake other than command line?

Postby gawrilow » 31 Jul 2021, 23:00

You can also use the scripting facilities, as described here: https://polymake.org/doku.php/user_guid ... /scripting. You can put your frequently used functions in separate script files, if needed, because the script command can be used in other scripts too. Just think of starting every script file with an appropriate `use application "...";` command.


Return to “Helpdesk”