[Top][All Lists]

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

Re: [Bug-glpk] API: glp_get_num_rows

From: Andrew Makhorin
Subject: Re: [Bug-glpk] API: glp_get_num_rows
Date: Mon, 11 Aug 2008 14:52:17 +0400

> I am trying to access constraint coefficient matrix. When I use
> function glp_get_num_rows, I am getting unexpected number of rows.
> In model assign.mod (from standard glpk examples), there are 8
> elements in each of set I and set J. So total number of constraints
> should be 16. But function glp_get_num_rows returns 17. Number of
> columns are as expected (64).

> It seems that, glpk is counting obj. function as a constraint. Is
> this intentional behaviour?

Yes, all objectives are also included in the set of rows as if they
were constraints. You can distinguish them by the row type, which is
GLP_FR unlike other rows, or by theirs names. If necessary, such rows
can be removed from the model with glp_del_rows.

> But there is separate function
> glp_get_obj_func for accessing obj. fun. coefficients.

Coefficients of the very first objective in the model are used as
objective coefficients in the problem object.

reply via email to

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