[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] using lpx_read_model
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] using lpx_read_model |
Date: |
Wed, 10 Sep 2003 14:50:43 +0400 |
>As Delphi would not find the "lpx_read_model" function in the DLL, I did
>some experiments and Borland TDUMP revealed that the exact function name
>stored in the DLL is "glp_lpx_read_model".
In glpk all external names are prefixed by glp_ to keep the namespace
clean. This is implemented by using #define's, for example:
#define lpx_read_mpl glp_lpx_read_mpl
>So I declared the function as
>
>function glp_lpx_read_model(model:pchar; data:pchar ; output:pchar ):pointer;
>external 'glpk-4.dll';
>
>and called it with
>
>var
> p:pointer;
>begin
> p:=glp_lpx_read_model('a.mod',nil,'a.out');
>
>This code should work, but the only result I have seen so far (and - God
>knows why - only once) is an OUT file made of 2 lines only:
There is a VB interface to glpk. Try looking at:
http://gottfried.lindner.bei.t-online.de/glpk.htm
>IMHO the declaration of lpx_read_model would be much more usable when
>changed from
>
> LPX *lpx_read_model(char *model, char *data, char *output);
>
>into
>
> integer lpx_read_model(char *model, char *data, char *output);
>
>/* 0=success, -1=errors */
How then to return a pointer to the LP object? (Imagine that someone
needs to load another model not destroying the previously loaded one.)
- Andrew Makhorin