Re: GMPL/GLPK display objective function value
Domingo Alvarez Duarte <[email protected]> Sat, 29 Aug 2020 11:32:52 +0200
| Newsgroups | gmane.comp.gnu.glpk |
|---|---|
| Message-ID | <[email protected]> |
Hello Andrew !
Again thank you very much for your help !
After replying to your comments I reviewed again the wikibook link
(https://en.wikibooks.org/wiki/GLPK/Troubleshooting#Objective_shift_term_ignored_when_exported)
and realized that somehow I've got lost because of the of the misleading
AMPL result and both solvers report of the objective value.
Also I think that like in the exported LP file we get a comment about
the constant term, the solution file also somehow should have a comment
about it.
So in this case AMPL has a bug.
I think that this function (and similares) should have a return value
that could tell about this:
====
void glp_mpl_build_prob(glp_tran *tran, glp_prob *prob)
to
int glp_mpl_build_prob(glp_tran *tran, glp_prob *prob)
{
int ret = 0;
...
if (mpl_get_row_c0(tran, i) != 0.0) {
xprintf("glp_mpl_build_prob: row %s; constant term %.12g ig"
"nored\n",
mpl_get_row_name(tran, i), mpl_get_row_c0(tran, i));
ret = WARNING_CONST_TERM_IGNORED;
}
...
return ret;
}
====
Cheers !
On 29/8/20 11:01, Domingo Alvarez Duarte wrote:
> Hello Andrew !
>
> Thanks for reply !
>
> The problem is that the GMPL is not informed/knows anything about the
> warning/divergence in the results and goes blindly.
>
> Te exit code of glpsol also doesn't reflect anything that could be
> detected, only by visual inspection of the output or redirect the
> output and scan it for possible warnings.
>
> Somehow GMPL should have a way to acknowledge situations like these.
>
> ===
>
> >Exit code: 0
>
> ===
>
> Cheers !
>
> On 29/8/20 0:46, Andrew Makhorin wrote:
>>> While trying to implement multi solve statements I found that in GMPL
>>> the display of an objective function after solving do not show the
>>> optimal value.
>> BTW, glpsol warns about that:
>>
>> [...]
>> 38 lines were read
>> Generating Reduced_Cost...
>> Generating Width_Limit...
>> Model has been successfully generated
>> glp_mpl_build_prob: row Reduced_Cost; constant term 1 ignored
>> [...]