help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] glp_write_mps inconsistency


From: Andrew Makhorin
Subject: Re: [Help-glpk] glp_write_mps inconsistency
Date: Thu, 27 Nov 2008 07:50:11 +0300

> I made an attempt to identify exactly where the
> inconsistency is created through the following steps

> 1) created problem through API calls in a C program
> all of the following steps occur at the same location in the C program
> 2) wrote problem in free mps style with call glp_write_mps, that
> problem is solved with zero objective and does not contain objective
> terms
> 3) wrote problem in free mps style with call to _lpx_write_freemps,
> generated file is identical to file of case 2
> 4) specified LPX_K_MPSOBJ parameter to be one with function
> _lpx_set_int_parm, 
> 5) wrote problem in free msp style with call to _lpx_write_freemps,
> problem is solved with objective equal to cases 6 and 7, objective
> terms are included in the mps file
> 6) wrote problem in lp format
> 7) solved problem inside C program with API call glp_int_opt

> What is the correct sequence of API calls to generate an free mps style
> model with the new interface (I am using 4.32 version).
> The function lpx_set_int_parm is being phased out and I do not know if
> it would impact the execution of glp_write_mps
> Just using glp_write_mps appears to omit the objective function

The third argument to glp_write_mps is a set of control parameters,
which is *not* implemented yet. Thus, currently the only way to pass
control parameters to glp_write_mps is using the obsolete api routine
lpx_set_int_parm as follows:

   lpx_set_int_parm(lp, LPX_K_MPSOBJ, 1);
   glp_write_mps(lp, GLP_MPS_FILE, NULL, "foo.mps");

The control parameter LPX_K_MPSOBJ means the following:

0 - never write objective row
1 - always write objective row
2 - write objective row only if the problem object has no free rows
    (this is the default value)

Note that if the objective row is written, it is always the first row
in the mps file.





reply via email to

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