[Top][All Lists]

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

[Help-glpk] GLPK API change

From: Robbie Morrison
Subject: [Help-glpk] GLPK API change
Date: Fri, 27 Apr 2007 17:44:48 +0200
User-agent: Thunderbird (X11/20070306)

Hello GLPK list

Following on from the discussion about the new GLPK API.
And I realize that some of the current issues are to be
addressed in upcoming GLPK 4.16.

I assume one can not (naively) add a preprocessor hash-define
as follows:


extern "C" {             // linkage advice for C++ compiler
#  include <glpk.h>      // GLPK API header for version 4.15 or better

#define lpx_ _glp_lpx_   // hack for code containing old GLPK calls

int main()
    LPX* my_lpx;
    my_lpx = lpx_create_prob();  // pre-4.15 GLPK call


Is there some other hash-define we can use?

In addition, is there any reason not to introduce a
GLPK namespace in order to differentiate the new APIs
from the old, for instance:

    glpk::LPX* my_lpx;   // note the hypothetical namespace
    my_lpx = glpk::lpx_create_prob();

Does that not work for C programming?  Because it would
be quite sensible for C++ coding as far as I can tell.

regards to all and many thanks to Andrew Makhorin
Robbie Morrison
PhD student -- policy-oriented energy system simulation
Institute for Energy Engineering (IET)
Technical University of Berlin (TU-Berlin), Germany

reply via email to

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