Page 1 of 2
tutorial on LP
Posted: 12 May 2011, 07:56
by babulnath
I have been able to install polymake and run many of the tutorial exercises. But the Linear program exercise does not run. It gives me the following error :-
ERROR: reference to an undeclared variable $self at /usr/local/share/polymake/perllib/Polymake/Core/PlainFile.pm line 248
How should I correct it ?
Re: tutorial on LP
Posted: 12 May 2011, 11:16
by paffenholz
Could you please give the commands that lead to the error, or point to the tutorial that contains the failing commands?
Re: tutorial on LP
Posted: 12 May 2011, 13:31
by joswig
... and, of course, the polymake version, the operating system etc.
Re: tutorial on LP
Posted: 12 May 2011, 13:53
by babulnath
I am using polymake 2.9.9 which I compiled from the source.
My operating system is Ubuntu 9.04 Jaunty Jackalope.
the lines that give the error are:
$ polymake linear_program.poly MAXIMAL_VALUES
polymake: ERROR: reference to an undeclared variable $self at /usr/local/share/polymake/perllib/Polymake/Core/PlainFile.pm line 248.
Here I am not using polymake interactively. However even in the interactive mode the result is the same.
Re: tutorial on LP
Posted: 12 May 2011, 13:56
by babulnath
the linear_program.poly is as follows:
OBJECTIVES
0 1 1 1
INEQUALITIES
0 1 0 0
0 0 1 0
0 0 0 1
1 -1 0 0
1 0 -1 0
1 0 0 -1
5/2 -1 -1 -1
8 -1 17 0
Re: tutorial on LP
Posted: 12 May 2011, 15:02
by paffenholz
The property OBJECTIVES does not exist, and the function that transforms your plain text file into the new file format accordingly fails. The given error message is maybe not very clear ...
If you want to use polymake in compatibility mode than your file should define the property LINEAR_OBJECTIVE, and you can ask for LP.MAXIMAL_VALUE at the comand line (no "S" at the end). The prefix "LP." is necessary as linear programs have been redesigned to be a proper subobject with their own properties that may occur multiple times in a polymake object.
Re: tutorial on LP
Posted: 13 May 2011, 02:21
by babulnath
Thanks so much Herr Paffenholz. I will try now as you have directed.
Re: tutorial on LP
Posted: 13 May 2011, 07:55
by babulnath
I tried. But it is still giving the same error. I think it has something to do with the
local variable in Perl. In subroutine PlainFile the value of the variable $self is undefined.
Re: tutorial on LP
Posted: 13 May 2011, 08:22
by gawrilow
In subroutine PlainFile the value of the variable $self is undefined.
Indeed, this corner or PlainFile.pm has been left unattended for a while. If you want to use this functionality, please apply the patch attached below:
Code: Select all
cd /usr/local/share/polymake
sudo patch -p0 <.../PlainFile.patch
Re: tutorial on LP
Posted: 13 May 2011, 08:38
by babulnath
Thank you very much.