bug-glpk
[Top][All Lists]
Advanced

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

[Bug-glpk] Code with No Effect


From: Andrew Hamilton-Wright
Subject: [Bug-glpk] Code with No Effect
Date: Wed, 12 Nov 2003 09:11:16 -0500 (EST)

In looking over the code for glpk, I have found that there are
several instances of array arguments of the form:
    [lp, exp]
where "exp" is some expression.

In C, the ',' operator evaluates the argument to its left (in this
case "lp", but discards the result.  This means that the above
expression is eqivalent to
   [exp]

For an example of what I am talking about, look at
    source/glplpx6a.c
around line 2431 (I am looking at the source from the version 4.1
tarball).


While it is easy enough to remove (or ignore) these, it makes me wonder
what the original author was intending -- I assume this is not meant
to be a 2-d array reference of the form
    [lp][exp]
as the code is functional as is (at least it seems to find solutions
to the problems I have posed it).

Regards,
Andrew.






reply via email to

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