Hello Sergey ------------------------------------------------------------ To: [email protected] Subject: Problem with GLPK when trying to find value functions From: Sergey Kuznetsov <[email protected]> Date: Wed, 25 Jul 2012 19:19:39 +0000 ------------------------------------------------------------
> Hello, > > I'm using GLPK to find value functions, it's a family > of linear programs with right-hand side as parameter. > > For instance, I'm constructing 3D integer lattice and > at each site (point) I need to find optimal solution > using site coordinates as right-hand side (in this case > it's 3D vector). > > I wrote a function that solves the linear program using > GLPK. At first it crashed on the second call. I > replaced glp_delete_prob() on gpl_erase_prob() and it > worked well for [0;3]^3 lattice (and [0;3]^2 > lattice). The problems began [0;4]^2 (2D) lattice. I > have segmentation fault and it's unusual because in > [0;3]^3 I'm solving more programs. > > OS : Linux Debian, i686; Compiler: GCC 4.7.1 > Test instances: 3D: 4 columns, 3 rows; 2D: 3 columns, 2 rows; all the > entries (matrix, objective function coeff, right-hand side) are > integers. > > Clearly, the problems begin when I'm setting span of > the lattice to 4 (5, 6, etc.). > > If anybody has any idea how to fix this, please help > me. Thanks > > Sergey Kuznetsov Run your program under 'valgrind': http://en.wikipedia.org/wiki/Valgrind http://valgrind.org It is dead easy to do so: $ valgrind [valgrind-options] myprog [my-options] 'valgrind' should pick up initialized variables and out of bounds array access. If not already on your system, 'valgrind' is available via debian package 'valgrind' (or my system). One other thought: GLPK is not officially thread safe: do you call GLPK concurrently? HTH, Robbie --- Robbie Morrison PhD student -- policy-oriented energy system simulation Technical University of Berlin (TU-Berlin), Germany University email (redirected) : [email protected] Webmail (preferred) : [email protected] [from Webmail client] _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
