Hi all,
I am still very new to Polymake (but have managed to do my first computations!) and I have a question regarding reading a .txt file. I have a txt file where each of its rows describes the vertices of a polytope, i.e., the file looks like this:
[[0,0],[1,0],[1,2]]
[[0,0],[1,0],[0,1],[1,1]]
...
I want to read the file line by line and create a polytope with the entry from each line. My reasoning is that I could create a matrix from each line, then insert a column of ones and build the polytope I want. So far, I have managed to read the file and compiled all lines of the file into an array @lines
If I now print the following
print "\$lines = $lines\n";
I obtain the correct result for each line where i is between 0 and the number of lines of the txt file. However, if I try to create a matrix using for example
my $m=new Matrix<Rational>(<$lines[0]>);
print $m;
this does not generate an ERROR but it does not print my matrix m. I am not sure what the error here is, but I believe it has something to do with the data type obtained from the txt file. For example, if I write
my $m=new Matrix<Rational>([[0,0],[1,0],[1,2]]);
print $m;
this describes precisely the object I want to obtain from the code above. Could you help me realize my mistake? Or is there an easier way of constructing a polytope from such a txt file?
Thank you!