[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] constraint numbering in glpk
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] constraint numbering in glpk |
Date: |
Wed, 06 Jul 2011 09:43:09 +0400 |
> I have a mps file given to me by someone else (our collaborators). I
> read the MPS file into my program with GLP_MPS_FILE as the argument to
> glp_mps_read function (I am using C API). In the program I change the
> right hand sides of some of the constraints (which are already there
> in the model). I am observing that the read model considers the
> objective function as constraint number 1, then the first actual
> constraint as constraint number 2, and so on. This is because, only
> when I consider this numbering of constraints I get the same results
> as reported by another solver (which I know is giving the right
> values). Is my observation correct ??
Yes, all rows specified in the ROWS section of the mps file, including
free ones (N), become rows (constraints) in the problem object.
Note that the very first row of N type is also used as the objective
function row (i.e. its coefficients are duplicated and stored
separately), so you can remove that row from the problem object with
glp_del_rows to restore the numbering, which you expect.