help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] [Fwd: Problem with GLPK when trying to find value functi


From: Robbie Morrison
Subject: Re: [Help-glpk] [Fwd: Problem with GLPK when trying to find value functions]
Date: Fri, 27 Jul 2012 04:41:25 +1200
User-agent: SquirrelMail/1.4.22

Hello Sergey

------------------------------------------------------------
To:           address@hidden
Subject:      Problem with GLPK when trying to find value functions
From:         Sergey Kuznetsov <address@hidden>
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) : address@hidden
Webmail (preferred)           : address@hidden
[from Webmail client]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]