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: glpk xypron
Subject: Re: [Help-glpk] [Fwd: Problem with GLPK when trying to find value functions]
Date: Thu, 26 Jul 2012 17:49:55 +0200

Hello Sergey,

a segmentation fault implies that you access memory for variables without 
having allocated the memory.

In the GLPK library index 0 is often not used. E.g. if you want to use function 
glp_set_mat_row to set 3 values you need to allocate memory for arrays with 4 
elements.

Please, have a close look at glpk-4.47/doc/glpk.pdf.

Best regards

Xypron

> -------- Forwarded Message --------
> From: Sergey Kuznetsov <address@hidden>
> To: address@hidden
> Subject: Problem with GLPK when trying to find value functions
> 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   
> 
> 
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk



reply via email to

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