Page 1 of 1

problem with 'load'-command

Posted: 13 May 2012, 17:05
by simon
Hi there,

I'm having difficulties reading in a list of polytopes from files that have been written by Maple/convex.
E.g. trying in polymake

Code: Select all

$B = load("<path>/p1.poly");
results in the error

Code: Select all

...'ake: ERROR: "<path>/p1.poly", line 3: error reading property 'AMBIENT_DIM': invalid Int value starting at ' ...'<path>/p1.poly", line 6: error reading property 'DIM': invalid Int value starting at ' ...'<path>/p1.poly", line 9: error reading property 'N_VERTICES': invalid Int value starting at '
the file 'p1.poly' looks as follows:

Code: Select all

AMBIENT_DIM 6 DIM 6 N_VERTICES 32 N_FACETS 10 VERTICES 2 4 0 -4 -5 1 3 2 0 0 0 -1 1 -1 2 4 0 -4 -9 1 3 2 0 0 0 -9 1 -1 2 0 0 -4 -9 1 3 2 0 4 -4 -9 1 3 2 4 0 -4 -9 5 -1 2 0 0 0 -9 9 -9 2 0 0 -4 -9 9 -5 2 0 4 -4 -9 9 -5 2 4 0 -4 -5 1 -11 2 0 0 0 -1 1 -11 2 0 0 -4 -1 1 -11 2 0 4 -4 -1 1 -11 2 4 0 -4 -9 1 -11 2 0 0 0 -9 1 -11 2 0 0 -4 -9 1 -11 2 0 4 -4 -9 1 -11 2 4 0 -4 -9 5 -11 2 0 0 0 -9 9 -11 2 0 0 -4 -9 9 -11 2 0 4 -4 -9 9 -11 2 2 0 -4 -3 1 3 2 0 0 -2 -1 1 1 2 0 0 -4 -3 1 3 1 0 0 -2 -1 1 1 2 0 0 -4 -1 1 1 2 3 1 -4 -4 1 3 2 0 1 -1 -1 1 0 2 0 4 -4 -7 1 3 1 0 2 -2 -2 2 0 2 0 4 -4 -1 1 -3 FACETS 0 1 0 0 0 0 0 2 0 0 1 0 0 0 0 -1 -1 -1 0 0 0 0 -1 0 0 -1 -1 0 0 0 1 0 0 0 0 -1 0 0 0 0 2 0 0 0 0 -1 0 -1 -1 9 0 0 0 2 0 0 11 0 0 0 0 0 2 0 0 -1 0 -1 0 -1 AFFINE_HULL VERTICES_IN_FACETS { 1 3 4 5 7 8 9 11 12 13 15 16 17 19 20 21 23 24 25 26 28 29 30 31 } { 0 2 4 5 6 8 9 10 12 13 14 16 17 18 20 21 22 24 25 26 27 29 30 31 } { 0 1 2 3 5 6 7 9 10 11 13 14 15 17 18 19 21 27 28 29 30 31 } { 0 1 6 7 8 9 10 11 12 13 18 19 20 21 22 23 25 26 27 28 30 31 } { 0 1 2 3 4 6 7 8 10 11 12 14 15 16 18 19 20 22 23 24 25 26 } { 0 1 2 3 4 5 10 11 12 13 14 15 16 17 22 23 24 26 27 28 29 31 } { 0 1 2 3 4 5 6 7 8 9 22 23 24 25 27 28 29 30 } { 2 3 4 5 6 7 8 9 14 15 16 17 18 19 20 21 } { 10 11 12 13 14 15 16 17 18 19 20 21 } { 22 23 24 25 26 27 28 29 30 31 } FAR_FACE { }
with other files, this worked: e.g.

Code: Select all

AMBIENT_DIM 3 DIM 3 N_VERTICES 4 N_FACETS 4 VERTICES 2 1 0 0 2 0 1 0 2 0 0 1 4 1 1 1 FACETS 1 0 -2 -2 1 -2 0 -2 1 -2 -2 0 -1 2 2 2 AFFINE_HULL VERTICES_IN_FACETS { 1 2 3 } { 0 2 3 } { 0 1 3 } { 0 1 2 } FAR_FACE { }
Is just some version-conflict or old format?

Regards

Re: problem with 'load'-command

Posted: 13 May 2012, 23:15
by gawrilow
Sorry, I could not reproduce the error. Both files look the same (up to concrete numeric values, naturally). Maybe you've got some invisible control character into the "bad" one, which disappeared in the posted copy?

Re: problem with 'load'-command

Posted: 14 May 2012, 10:14
by simon
mhh, I don't think so: I rewrote the first lines of the file with emacs by hand and still the same error.

Re: problem with 'load'-command

Posted: 14 May 2012, 12:31
by gawrilow
Please create a trac ticket and upload your "ill" file as an attachment to it. Hopefully it will arrive unchanged. I'm still puzzled about the non-perceivable difference between your data files.

Re: problem with 'load'-command

Posted: 14 May 2012, 16:00
by paffenholz
Have you produced the first file on a windows computer? I have seen such an error message with files that have a DOS type CR/LF. The difference is invisible in most text editors (e.g. emacs) even on other OS. Emacs might show you in the modline.

Does the error persist if you create a new file with some of the properties (typed, not copied...) on a linux computer?

Re: problem with 'load'-command

Posted: 14 May 2012, 23:49
by simon
argh! You were right: there really was s.th. wrong with the file (although I don't know why): when I re-pasted the data entered in this post in a new file, everything worked.

Thanks for the help and sry to waste your time.