bug-glpk
[Top][All Lists]
Advanced

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

Re: [Bug-glpk] Bug with LP format


From: Andrew Makhorin
Subject: Re: [Bug-glpk] Bug with LP format
Date: Sat, 3 Nov 2007 14:18:51 +0300

> I think I've come across a bug with the function 'lpx_write_cpxlp' for
> writing linear programs in CPLEX LP format. The problem is with upper 
> bounded variables that do not have lower bound. Such a variable say x is 
> written by GLPK as  x <=  upper_bound in the  Bounds section of the LP 
> file.  But since variables in LP format are understood to be 
> non-negative, in fact CPLEX understands  0 <= x <= upper_bound, which is 
> not the intended meaning. Instead, GLPK should write something like -Inf 
> <= x <= upper_bound. I attach a program that produces an LP file which, 
> once fed into CPLEX, allows one to see the error if CPLEX is asked to 
> write the linear program again (or if it is asked for the lower bound of 
> the variable).

Thank you for your bug report.

The bug will be fixed in a next release of the package.

To fix the bug right now please replace line 1134 (file glplpx16.c,
routine lpx_write_cpxlp):

   fprintf(fp, " %s <= %.*g\n", cname, DBL_DIG, ub);

by the following line:

   fprintf(fp, " -inf <= %s <= %.*g\n", cname, DBL_DIG, ub);

> By the way, congratulations on your excellent code. :-)

Thank you for your interest in glpk.





reply via email to

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