I am trying to use some of Polymake's ilp routines through the callable library functionality, but I get an error message which I don't really tells me anything.
This is the piece of code I try to get working:
Code: Select all
#include <polymake/Main.h>
#include <polymake/Matrix.h>
#include <polymake/SparseMatrix.h>
#include <polymake/Rational.h>
#include <polymake/IncidenceMatrix.h>
int main(){
try {
perl::Object p("Polytope<Rational>");
p.take("VERTICES") << (ones_vector<Rational>() | 3*unit_matrix<Rational>(3));
Vector<Integer> lo(4); lo[0]=0; lo[1]=1; lo[2]=1; lo[3]=1;
perl::Object o("LinearProgram<Rational>");
o.take("LINEAR_OBJECTIVE") << lo;
p.take("LP") << o;
IncidenceMatrix<NonSymmetric> inc = p.give("LP.MAXIMAL_FACE");
} catch (const std::exception& ex) {
std::cerr << "ERROR: " << ex.what() << endl; return 1;
}
return 0;
}
Not sure whether the following piece of information will be useful to you, but this is what gdb is telling me:
Code: Select all
ren@mandelbrot:~/callable$ gdb smalltest
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/ren/callable/smalltest...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/ren/callable/smalltest
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff797c66f in pm::perl::ObjectType::find_type(char const*, unsigned long) () from /usr/local/lib/libpolymake.so
(gdb) bt
#0 0x00007ffff797c66f in pm::perl::ObjectType::find_type(char const*, unsigned long) () from /usr/local/lib/libpolymake.so
#1 0x000000000040de1b in pm::perl::ObjectType::ObjectType<19ul>(char const (&) [19ul]) ()
#2 0x000000000040cc34 in pm::perl::Object::Object<19ul>(char const (&) [19ul]) ()
#3 0x000000000040a235 in main ()
(gdb)