Page 1 of 1

how to use polymake other than command line?

Posted: 31 Jul 2021, 04:43
by qichen
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?

Re: how to use polymake other than command line?

Posted: 31 Jul 2021, 18:36
by joswig
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

Re: how to use polymake other than command line?

Posted: 31 Jul 2021, 23:00
by gawrilow
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.