Re: [Help-glpk] Can't read CPLEX file

2006-03-07 Thread Paulo J. Matos
On 06/03/06, Andrew Makhorin [EMAIL PROTECTED] wrote:
  I currently have GLPK 4.9 installed and the following CPLEX file:
  maximize 1
  st
  - 2 x1 - 3 x2 = -1
  2 x1 + 3 x2 = 1
  - 1 x1 - 1 x2 = -4
  1 x1 + 1 x2 = 4
  bounds
  x1 free
  x2 free
  end
 
  Cplex can read it.
  glpsolve:
  $ glpsol --cpxlp test.lp
  lpx_read_cpxlp: reading problem data from `test.lp'...
  test.lp:2: missing variable name
  CPLEX LP file processing error
 
 
  Why?

 Because there is a syntax error in maximize statement. Note that
 glpk does not support some features allowed in recent versions of
 cplex format, in particular, constant terms in the objective.
 For details about compatibility please consult the glpk reference
 manual (Appendix C CPLEX LP Format, pp.79-84).

 If you need only a feasible solution, simply specify any variable
 as the objective, for example:

maximize x1



Thanks, and is it possible to have it output the solution found?
I searched --help flag but found nothing.

Paulo Matos





--
Paulo Jorge Matos - pocm at sat inesc-id pt
Web: http://sat.inesc-id.pt/~pocm
Computer and Software Engineering
INESC-ID - SAT Group


___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] Can't read CPLEX file

2006-03-07 Thread Andrew Makhorin
 Thanks, and is it possible to have it output the solution found?
 I searched --help flag but found nothing.

To write the solution into a file for further browsing use the
option '-o filename'.

P.S. Another, more correct way to specify a dummy objective in
cplex lp format is the following:

minimize foo;
...
bounds
...
foo = 0
...



___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] Can't read CPLEX file

2006-03-05 Thread Andrew Makhorin
 I currently have GLPK 4.9 installed and the following CPLEX file:
 maximize 1
 st
 - 2 x1 - 3 x2 = -1
 2 x1 + 3 x2 = 1
 - 1 x1 - 1 x2 = -4
 1 x1 + 1 x2 = 4
 bounds
 x1 free
 x2 free
 end
 
 Cplex can read it.
 glpsolve:
 $ glpsol --cpxlp test.lp
 lpx_read_cpxlp: reading problem data from `test.lp'...
 test.lp:2: missing variable name
 CPLEX LP file processing error
 
 
 Why?

Because there is a syntax error in maximize statement. Note that
glpk does not support some features allowed in recent versions of
cplex format, in particular, constant terms in the objective.
For details about compatibility please consult the glpk reference
manual (Appendix C CPLEX LP Format, pp.79-84).

If you need only a feasible solution, simply specify any variable
as the objective, for example:

   maximize x1





___
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk