help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] glpsol - cplex format question


From: Mark Poolman
Subject: Re: [Help-glpk] glpsol - cplex format question
Date: Tue, 24 Apr 2007 19:59:18 +0400

On Tue, 2007-04-24 at 18:16 +0400, Andrew Makhorin wrote:

Thanks very much for such a prompt response !

> > This file:
> > \* MtxLP *\
> > Maximize
> > OBJ: C + A + B + D
> > Subject To
> > _C1: - A - B = 0
> > _C2: - A + C - D = 0
> > Bounds
> > A <= 1
> > B <= 1
> > D <= 1
> > C <= 1
> > End
> >
> > causes glpsolto bomb out with the message:
> >
> > lpx_read_cpxlp: reading problem data from `MtxLP-pulp.lp'...
> > MtxLP-pulp.lp:9: symbol `B' in wrong position
> > CPLEX LP file processing error
> 
> This is because 'B' in the first position is recognized as the first
> letter of the 'Bounds' keyword.
> 
> A common rule is *not to begin* identifiers in the first position,
> for example:
> 
> \* MtxLP *\
> Maximize
>    OBJ: C + A + B + D
> Subject To
>    _C1: - A - B = 0
>    _C2: - A + C - D = 0
> Bounds
>    A <= 1
>    B <= 1
>    D <= 1
>    C <= 1
> End
> 
> > It can be fixed by simply renaming variables:
> 
> Not needed.
> 
Well, actually this is in the context of automatically generated models
which are considerably larger than the example given, and there is
little control over variable names. No matter, now I  know the cause,
disambiguation won't be a problem.


> > But I can find nothing that suggests that that single letter
> > variables, other than possibly E|e can cause problems. Can anyone
> > explain this and point me to a definitive description of cplex
> > syntax ?
> 
> See Appendix C "CPLEX LP Format" in the GLPK reference manual
> included in the distribution.
> 
I did read it before posting and in my version (4.11) it is made
explicit that  "[B|b]ounds" and "bound" are synonymous, but there is
nothing to say that this applies to any initial sub-string. Presumably
this applies to all other keywords as well. It might be worth inserting
a sentence after the keywords table in C.1 advising against using
variable names that are substrings of keywords.

thanks again,

/best/*

Mark

> 
> 
> 
> 






reply via email to

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