help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] python wrapper for glpk


From: Kent Polk
Subject: [Help-glpk] python wrapper for glpk
Date: Thu, 30 May 2002 14:17:10 -0500 (CDT)

Enhancement Request for glpk:

Hello. We are using glpk in conjunction with a SWIGged Python
wrapper I developed for determining how to automatically arrange
family member information in an appropriate order for laboratory
genotyping. It works quite nicely, though we have to go through a
sequence of awkward manipulations that we would like to see simplified
later.

The main problem I have is that SWIG cannot parse the glpk.h include
file properly.  SWIG apparently can't parse defines embedded within
a structure definition.  If you could see to move 6 lines in the
include file, I could provide a totally automated way to create a
Python wrapper for glpk.  I understand that clarily may slightly
suffer, but I think that the benefits outweigh the drawbacks.

I have included a context diff output file for the manual changes
I have to make to glpk.h each time it is updated.

I can provide the python setup.py file and the glpk.i file if you
wish. I have a NetBSD source pkg pretty much finished except for
the above problem. The setup.py works for Solaris also.

Thanks

Kent Polk
Sr. Research Analyst, Genetics Dept.
SFBR


---------------

*** /opt/pkg/include/glpk.h     Thu May 30 12:58:13 2002
--- swig_glpk.h Thu May 30 13:18:40 2002
***************
*** 317,336 ****
  extern int glp_interior(LPI *lpi);
  /* solve LP problem using interior point method */
  
  struct bnb
  {     /* branch-and-bound method parameter block */
        int branch;
        /* this parameter specifies what branching heuristic should be
           used by the solver: */
- #define BB_FIRST  0  /* branch on the first variable */
- #define BB_LAST   1  /* branch on the last variable */
- #define BB_DRTOM  2  /* branch using heuristic by Driebeck and Tomlin */
        int btrack;
        /* this parameter specifies what backtracking heuristic should be
           used by the solver: */
- #define BB_FIFO   0  /* backtrack using FIFO heuristic */
- #define BB_LIFO   1  /* backtrack using LIFO heuristic */
- #define BB_BESTP  2  /* backtrack using the best projection heuristic */
        double tol_int;
        /* absolute tolerance which is used to see if the solution is
           integer feasible */
--- 317,336 ----
  extern int glp_interior(LPI *lpi);
  /* solve LP problem using interior point method */
  
+ #define BB_FIRST  0  /* branch on the first variable */
+ #define BB_LAST   1  /* branch on the last variable */
+ #define BB_DRTOM  2  /* branch using heuristic by Driebeck and Tomlin */
+ #define BB_FIFO   0  /* backtrack using FIFO heuristic */
+ #define BB_LIFO   1  /* backtrack using LIFO heuristic */
+ #define BB_BESTP  2  /* backtrack using the best projection heuristic */
  struct bnb
  {     /* branch-and-bound method parameter block */
        int branch;
        /* this parameter specifies what branching heuristic should be
           used by the solver: */
        int btrack;
        /* this parameter specifies what backtracking heuristic should be
           used by the solver: */
        double tol_int;
        /* absolute tolerance which is used to see if the solution is
           integer feasible */



reply via email to

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