help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Got a wrong order of column by lpx_get_mat_row(lp, j, nd


From: Brady Hunsaker
Subject: Re: [Help-glpk] Got a wrong order of column by lpx_get_mat_row(lp, j, ndx, val)?
Date: Wed, 19 Jan 2005 11:05:17 -0500
User-agent: Mozilla Thunderbird 0.9 (X11/20041124)

Michael Hennebry wrote:
On Wed, 19 Jan 2005, [iso-2022-jp] $B%m!!%3%/%f%&(B wrote:


Dose anyone meet this problem:

for example  in jth row :  a*x-y+b*z=0;

by len=lpx_get_mat_row(lp, j, ndx, val), I found val=[-1,a,b], that mean the
order of column is y,x,z.
I added two new columns to this row like:

ndx[len+1]=w, ndx[len+2]=v, val[len+1]=d, val[len+2]=e, len+=2
lpx_set_mat_row(lp,j,len,ndx,val)

then I thought the jth row should be a*x-y+b*z+d*w+e*v=0, but when I tried
len=lpx_get_mat_row(lp, j, ndx, val) again,
I found it's d*w+e*v+a*x-y+b*z=0.

I wonder whether the order of columns in row is fixed and how the order of
columns in a row is arranged there.


My recollection is that there is nothing in the documentation
that says lpx_get_mat_row will always return columns in the same order.
Not even if you don't edit the problem.


I agree with Michael. This issue came up when testing the GLPK interface to COIN-OR/OSI. One of the tests for OSI fed in an instance and read some of the data back out. It initially failed for GLPK because it expected the data in a different order, even though what GLPK is doing is perfectly correct. In that case we had to modify the test itself.

--
Brady Hunsaker
Assistant Professor
Industrial Engineering
University of Pittsburgh
http://www.engr.pitt.edu/hunsaker/




reply via email to

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