help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Suggestions for improvements


From: Andrew Makhorin
Subject: Re: [Help-glpk] Suggestions for improvements
Date: Mon, 26 Jul 2004 22:20:02 +0400

>2)  Currently, constant values like return values (LPX_E_OK, etc.) and
>parameters (LPX_MIN, LPX_LO, etc.) are processed by the pre-processor.
> As a result, the compiler only sees the numeric value and not the
>symbolic name.  So, for instance, an assertion failure quits with the
>message
>  "Assertion `glp_lpx_simplex( lp ) == 200' failed."
>If the definitions of these constants were changed so that the
>compiler sees the symbolic names, then the error messages would be
>much more readable and useful.  For instance, in my program I do:
>#undef LPX_E_OK
>const int LPX_E_OK = 200;
>after which I get the much better error message:
>  "Assertion `glp_lpx_simplex( lp ) == LPX_E_OK' failed."

This is a common practice. Symbolic constants defined in library headers
must not be redefined in the application program. (You do not write
something like #undef SEEK_SET and #define SEEK_SET 1234567, do you?)






reply via email to

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