Search found 14 matches

Go to advanced search

by SimonKing
24 Mar 2017, 14:49
Forum: Helpdesk
Topic: Reading a script gives error, but directly using the script's content works
Replies: 12
Views: 13294

Re: Reading a script gives error, but directly using the script's content works

Well, maybe the function name sounds misleading. simulate_shell_input does exactly what you want, just avoiding any fuss with pseudo-terminals, because perl can process any strings as long as they fit into the memory. Thus if you start polymake using the callable library object polymake::Main, it d...
by SimonKing
24 Mar 2017, 09:50
Forum: Helpdesk
Topic: Reading a script gives error, but directly using the script's content works
Replies: 12
Views: 13294

Re: Reading a script gives error, but directly using the script's content works

Another idea for your connection: If you are calling polymake from C++ code, you can use the new function simulate_shell_input where you can pass an input string of any length. You won't need to generate any script files at all. In a pexpect interface, you do not *simulate* shell input, but you *do...
by SimonKing
23 Mar 2017, 14:17
Forum: Helpdesk
Topic: Reading a script gives error, but directly using the script's content works
Replies: 12
Views: 13294

Re: Reading a script gives error, but directly using the script's content works

Freeing the memory is not a big deal, just say undef $x; or @x=(); and everything is gone; later you can assign something else to it again. But the name itself stays in the package name table, ... ... which means I couldn't use "declare" again interactively, but still would have to use &q...
by SimonKing
23 Mar 2017, 13:40
Forum: Helpdesk
Topic: Reading a script gives error, but directly using the script's content works
Replies: 12
Views: 13294

Re: Reading a script gives error, but directly using the script's content works

Yes, "declare" can safely be used on the command line as well, but only once, when the variable is introduced first time. For scripts, there is an exception: if a script is executed repeatedly, "declare" are ignored. Yes, I just noticed. My question is related with the Sage<->po...
by SimonKing
23 Mar 2017, 13:27
Forum: Helpdesk
Topic: Reading a script gives error, but directly using the script's content works
Replies: 12
Views: 13294

Re: Reading a script gives error, but directly using the script's content works

Thank you very much! When I put "declare" into the file then it works (and "declare" also gives no error when used in the command line).

Best regards,
Simon
by SimonKing
23 Mar 2017, 12:49
Forum: Helpdesk
Topic: Reading a script gives error, but directly using the script's content works
Replies: 12
Views: 13294

Reading a script gives error, but directly using the script's content works

Hi! I've put the following into a file `test.pmk`: @x=([[12, -2, -3, -5, -8, -13, -21, -34, -55], [0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0],...
by SimonKing
03 Mar 2017, 22:09
Forum: Helpdesk
Topic: Setting random seed
Replies: 3
Views: 5050

Re: Setting random seed

> help 'rand_sphere'; ... I am afraid that doesn't answer my question. I know that I can supply a random seed to certain functions. What I wonder: Is there a way to bring Polymake into a state such that the same sequence of commands starting from that state will always have the same result, of cour...
by SimonKing
03 Mar 2017, 19:05
Forum: Helpdesk
Topic: Setting random seed
Replies: 3
Views: 5050

Setting random seed

Dear all, I'd like to be able to set a random seed, so that subsequent calls to functions such as `rand_sphere` will have a predictable result. I tried polytope > srand(5); polytope > $P = rand_sphere(4, 23); polytope > $V = $P->VERTICES; polytope > @R = @$V[5]; polytope > print @R; 1 77945067315655...
by SimonKing
02 Mar 2017, 22:45
Forum: Helpdesk
Topic: Listing all available functions/members
Replies: 10
Views: 11283

Re: Listing all available functions/members

I've got an uneasy feeling that you'll spend a lot of time and efforts duplicating the polymake completion capabilities but at the end still not be able to offer an adequate user experience; there are simply too many edge cases you'd have to consider. But weirdly enough, I can't find the script fil...
by SimonKing
02 Mar 2017, 22:19
Forum: Helpdesk
Topic: Listing all available functions/members
Replies: 10
Views: 11283

Re: Listing all available functions/members

A Polytope is a "big object" which has properties which are listed by the code given. The VERTICES form a "small object" of type Matrix. They do not have properties, so the code does not apply. OK, I had expected to get an empty list in that case. But catching the error is of co...

Go to advanced search