[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Comments on version 3.1 API
From: |
Erik de Castro Lopo |
Subject: |
[Help-glpk] Comments on version 3.1 API |
Date: |
Sat, 1 Jun 2002 14:45:41 +1000 |
Andrew,
I am in the process of converting my FIR design program from version
3.0.6 to 3.1 and found something that distrubs me somewhat.
Firstly, there is no direct replacement for the function glp_new_aij().
I will be the first to admit that this is a very inefficient way of
filling in the required data but it is relatively foolproof. In addition,
since filling in the data takes less than a second and finding the solution
takes many minutes, I do not see this as a problem. To fix this minor
oversight, it would be nice to have a function
void lpx_set_mat_row_col (LPX *lp, int row, int col, double val);
to replace glp_new_aij(). Currently I am forced to do this:
lpx_set_mat_row (problem, row, 1, (&col) - 1, (&aij) - 1) ;
Anyway, that brings me to my main point, the specification of the functions
lpx_set_mat_row() and lpx_set_mat_col() which from the documentation seem to
access arrays from index 1 through N rather than the normal C language 0
through N-1.
Since anyone who is using your library is probably writing in and familiar
with C, they would be expecting arrays with a zero base index. Every
programmer who assumes this is the case with GLPK will have a bug they need
to fix before they can get any useful results out of the library.
As a library author myself I predict that you will be getting a lot of email
about this issue. Is it too late to reconsider this decision?
Regards,
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo address@hidden (Yes it's valid)
+-----------------------------------------------------------+
"Every time microshaft's stock price drops again, I rejoice. I want to see that
bunch of criminals brought to their knees. Preferably at the chopping block."
-- rixt in http://linuxtoday.com/stories/20659_flat.html
- [Help-glpk] Comments on version 3.1 API,
Erik de Castro Lopo <=