diff -Nru python-glpk-0.4.45/ChangeLog python-glpk-0.4.52/ChangeLog --- python-glpk-0.4.45/ChangeLog 2010-05-11 14:52:21.000000000 +0000 +++ python-glpk-0.4.52/ChangeLog 2013-09-13 10:05:20.000000000 +0000 @@ -1,3 +1,7 @@ +2013-09-13 Joao Pedro Pedroso + + * updated interface to GLPK version 4.52 + 2010-04-25 Joao Pedro Pedroso * solved some issues related to debianization diff -Nru python-glpk-0.4.45/Makefile python-glpk-0.4.52/Makefile --- python-glpk-0.4.45/Makefile 2011-08-01 11:40:48.000000000 +0000 +++ python-glpk-0.4.52/Makefile 2013-09-11 15:01:53.000000000 +0000 @@ -1,19 +1,21 @@ DIR := $(shell basename `pwd`) +VER := '0.4.52' -deb: clean +all: clean + debuild clean + ( cd .. && pwd && tar zcvf $(DIR).tar.gz $(DIR)/* ) + ( cd .. && cp $(DIR).tar.gz python-glpk_$(VER).orig.tar.gz ) debuild -new: clean +pub: all + cp -p ../python-glpk_$(VER).orig.tar.gz ~/public_html/code/python-glpk + cp -p ../python-glpk_$(VER)-*.deb ~/public_html/code/python-glpk + +start: clean rm -rf debian ( cd .. && pwd && tar zcvf $(DIR).tar.gz $(DIR)/* ) cp -p ../$(DIR).tar.gz ../$(DIR).orig.tar.gz -web: deb - debuild clean - ( cd .. && pwd && tar zcvf $(DIR).tar.gz $(DIR)/* ) - cp -p ../*.orig.tar.gz ~/public_html/code/python-glpk - cp -p ../*.deb ~/public_html/code/python-glpk - clean: make -C src clean diff -Nru python-glpk-0.4.45/debian/changelog python-glpk-0.4.52/debian/changelog --- python-glpk-0.4.45/debian/changelog 2011-08-29 13:02:56.000000000 +0000 +++ python-glpk-0.4.52/debian/changelog 2013-12-06 16:21:43.000000000 +0000 @@ -1,3 +1,26 @@ +python-glpk (0.4.52-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Upload to unstable, for glpk transition. + * debian/control: remove manually added versioned dependencies on libglpk0. + The shared library is now libglpk36. Also, it is unnecessary to add such + versioned dependencies, because SONAME versioning ensures that the package + will work with newer versions of the library, and symbols/shlibs files + ensure that the minimal required version is enforced. + + -- Sébastien Villemot Fri, 06 Dec 2013 17:11:11 +0100 + +python-glpk (0.4.52-1) experimental; urgency=low + + * updated interface to GLPK version 4.52 + * Bug fix: "glpk.glp_printf() fails", thanks to Xypron (Closes: #597017) + [printf cannot be implemented due to a limitation in swig; function + glp_printf is no longer available from python]. + * Bug fix: "FTBFS against glpk 4.51-1", thanks to Sebastien Villemot + (Closes: #714211). + + -- Joao Pedro Pedroso Mon, 02 Sep 2013 13:49:30 +0100 + python-glpk (0.4.45-1) unstable; urgency=low * updated interface to GLPK version 4.45 (Closes: #638649). diff -Nru python-glpk-0.4.45/debian/control python-glpk-0.4.52/debian/control --- python-glpk-0.4.45/debian/control 2011-08-29 13:30:35.000000000 +0000 +++ python-glpk-0.4.52/debian/control 2013-12-06 16:13:49.000000000 +0000 @@ -2,13 +2,14 @@ Section: python Priority: optional Maintainer: Joao Pedro Pedroso -Build-Depends: debhelper (>= 8.0.0), cdbs, python-support (>= 1.0), python-all-dev, swig, make (>= 3.8), libglpk-dev (>= 4.45), libglpk-dev (<< 4.46) -Standards-Version: 3.9.2 +Build-Depends: debhelper (>= 7.0.50~), cdbs (>= 0.4.90~), python-all-dev (>= 2.6.6-3~), swig, make (>= 3.8), libglpk-dev (>= 4.52), libglpk-dev (<< 4.53) +Standards-Version: 3.9.4 +X-Python-Version: >= 2.6 Homepage: http://www.dcc.fc.up.pt/~jpp/code/python-glpk Package: python-glpk Architecture: any -Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, libglpk0 (>= 4.45), libglpk0 (<< 4.46), python-ply (>= 3.4) +Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-ply (>= 3.4) Provides: ${python:Provides} Description: Python bindings to the GNU Linear Programming Kit GLPK (GNU Linear Programming Kit) is intended for solving large-scale diff -Nru python-glpk-0.4.45/debian/pycompat python-glpk-0.4.52/debian/pycompat --- python-glpk-0.4.45/debian/pycompat 2010-05-12 11:09:26.000000000 +0000 +++ python-glpk-0.4.52/debian/pycompat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2 diff -Nru python-glpk-0.4.45/debian/rules python-glpk-0.4.52/debian/rules --- python-glpk-0.4.45/debian/rules 2010-05-12 11:08:58.000000000 +0000 +++ python-glpk-0.4.52/debian/rules 2013-09-18 16:24:35.000000000 +0000 @@ -1,7 +1,6 @@ #!/usr/bin/make -f DEB_COMPRESS_EXCLUDE := example.mps -DEB_PYTHON_SYSTEM = pysupport DEB_SRCDIR := src include /usr/share/cdbs/1/rules/debhelper.mk diff -Nru python-glpk-0.4.45/src/ChangeLog python-glpk-0.4.52/src/ChangeLog --- python-glpk-0.4.45/src/ChangeLog 2010-05-04 02:35:48.000000000 +0000 +++ python-glpk-0.4.52/src/ChangeLog 2013-09-13 10:07:53.000000000 +0000 @@ -1,4 +1,16 @@ -2010-05-02 Joao Pedro Pedroso +2013-09-13 Joao Pedro Pedroso + + * updated interface to GLPK version 4.52 + +2010-04-25 Joao Pedro Pedroso + + * solved some issues related to debianization + +2010-04-25 Joao Pedro Pedroso + + * bug corrections on the python Gnu MathProg's parser + +2010-04-25 Joao Pedro Pedroso * implemented support for modifying glpk model's data in python * updated interface to GLPK version 4.43 diff -Nru python-glpk-0.4.45/src/setup.py python-glpk-0.4.52/src/setup.py --- python-glpk-0.4.45/src/setup.py 2010-04-25 07:08:23.000000000 +0000 +++ python-glpk-0.4.52/src/setup.py 2013-09-02 13:30:06.000000000 +0000 @@ -13,8 +13,8 @@ extmods = [glpkpi]; setup (name = 'glpk', - description = 'Python-glpk package', - version = '0.3.43', + description = 'python-glpk package', + version = '0.4.52', long_description = """ Python-glpk is a free software package providing bindings in the Python programming language for the GLPK linear and integer diff -Nru python-glpk-0.4.45/src/swig/glpk.h python-glpk-0.4.52/src/swig/glpk.h --- python-glpk-0.4.45/src/swig/glpk.h 2010-05-03 10:40:31.000000000 +0000 +++ python-glpk-0.4.52/src/swig/glpk.h 2013-09-01 11:51:16.000000000 +0000 @@ -4,9 +4,9 @@ * This code is part of GLPK (GNU Linear Programming Kit). * * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -* 2009, 2010 Andrew Makhorin, Department for Applied Informatics, -* Moscow Aviation Institute, Moscow, Russia. All rights reserved. -* E-mail: . +* 2009, 2010, 2011, 2013 Andrew Makhorin, Department for Applied +* Informatics, Moscow Aviation Institute, Moscow, Russia. All rights +* reserved. E-mail: . * * GLPK is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -34,13 +34,10 @@ /* library version numbers: */ #define GLP_MAJOR_VERSION 4 -#define GLP_MINOR_VERSION 43 +#define GLP_MINOR_VERSION 52 -#ifndef GLP_PROB_DEFINED -#define GLP_PROB_DEFINED -typedef struct { double _opaque_prob[100]; } glp_prob; +typedef struct glp_prob glp_prob; /* LP/MIP problem object */ -#endif /* optimization direction flag: */ #define GLP_MIN 1 /* minimization */ @@ -52,7 +49,7 @@ #define GLP_BV 3 /* binary variable */ /* type of auxiliary/structural variable: */ -#define GLP_FR 1 /* free variable */ +#define GLP_FR 1 /* free (unbounded) variable */ #define GLP_LO 2 /* variable with lower bound */ #define GLP_UP 3 /* variable with upper bound */ #define GLP_DB 4 /* double-bounded variable */ @@ -62,7 +59,7 @@ #define GLP_BS 1 /* basic variable */ #define GLP_NL 2 /* non-basic variable on lower bound */ #define GLP_NU 3 /* non-basic variable on upper bound */ -#define GLP_NF 4 /* non-basic free variable */ +#define GLP_NF 4 /* non-basic free (unbounded) variable */ #define GLP_NS 5 /* non-basic fixed variable */ /* scaling options: */ @@ -147,11 +144,8 @@ double foo_bar[48]; /* (reserved) */ } glp_iptcp; -#ifndef GLP_TREE_DEFINED -#define GLP_TREE_DEFINED -typedef struct { double _opaque_tree[100]; } glp_tree; +typedef struct glp_tree glp_tree; /* branch-and-bound tree */ -#endif typedef struct { /* integer optimizer control parameters */ @@ -188,7 +182,20 @@ int presolve; /* enable/disable using MIP presolver */ int binarize; /* try to binarize integer variables */ int fp_heur; /* feasibility pump heuristic */ - double foo_bar[30]; /* (reserved) */ +#if 1 /* 25/V-2013 */ + int ps_heur; /* proximity search heuristic */ +#endif +#if 1 /* 29/VI-2013 */ + int ps_tm_lim; /* proxy time limit, milliseconds */ +#endif +#if 1 /* 11/VII-2013 */ + int use_sol; /* use existing solution */ + const char *save_sol; /* filename to save every new solution */ +#endif +#if 1 /* 28/V-2010 */ + int alien; /* use alien solver */ +#endif + double foo_bar[25]; /* (reserved) */ } glp_iocp; typedef struct @@ -278,11 +285,8 @@ /* (reserved for use in the future) */ } glp_cpxcp; -#ifndef GLP_TRAN_DEFINED -#define GLP_TRAN_DEFINED -typedef struct { double _opaque_tran[100]; } glp_tran; +typedef struct glp_tran glp_tran; /* MathProg translator workspace */ -#endif glp_prob *glp_create_prob(void); /* create problem object */ @@ -544,6 +548,10 @@ double glp_mip_col_val(glp_prob *P, int j); /* retrieve column value (MIP solution) */ +void glp_check_kkt(glp_prob *P, int sol, int cond, double *ae_max, + int *ae_ind, double *re_max, int *re_ind); +/* check feasibility/optimality conditions */ + int glp_print_sol(glp_prob *P, const char *fname); /* write basic solution in printable format */ @@ -755,13 +763,20 @@ int glp_main(int argc, const char *argv[]); /* stand-alone LP/MIP solver */ -/**********************************************************************/ +int glp_read_cnfsat(glp_prob *P, const char *fname); +/* read CNF-SAT problem data in DIMACS format */ -#ifndef GLP_LONG_DEFINED -#define GLP_LONG_DEFINED -typedef struct { int lo, hi; } glp_long; -/* long integer data type */ -#endif +int glp_check_cnfsat(glp_prob *P); +/* check for CNF-SAT problem instance */ + +int glp_write_cnfsat(glp_prob *P, const char *fname); +/* write CNF-SAT problem data in DIMACS format */ + +int glp_minisat1(glp_prob *P); +/* solve CNF-SAT problem with MiniSat solver */ + +int glp_intfeas1(glp_prob *P, int use_bound, int obj_bound); +/* solve integer feasibility problem */ int glp_init_env(void); /* initialize GLPK environment */ @@ -772,12 +787,16 @@ int glp_free_env(void); /* free GLPK environment */ -void glp_printf(const char *fmt, ...); -/* write formatted output to terminal */ +void glp_puts(const char *s); +/* write string on terminal */ + +/* commented by jpp for avoiding problems with swig */ +/* void glp_printf(const char *fmt, ...); */ +/* write formatted output on terminal */ /* commented by jpp for avoiding problems with swig */ /* void glp_vprintf(const char *fmt, va_list arg); */ -/* write formatted output to terminal */ +/* write formatted output on terminal */ int glp_term_out(int flag); /* enable/disable terminal output */ @@ -785,20 +804,20 @@ void glp_term_hook(int (*func)(void *info, const char *s), void *info); /* install hook to intercept terminal output */ -int glp_open_tee(const char *fname); +int glp_open_tee(const char *name); /* start copying terminal output to text file */ int glp_close_tee(void); /* stop copying terminal output to text file */ -#ifndef GLP_ERROR_DEFINED -#define GLP_ERROR_DEFINED -typedef void (*_glp_error)(const char *fmt, ...); +#ifndef GLP_ERRFUNC_DEFINED +#define GLP_ERRFUNC_DEFINED +typedef void (*glp_errfunc)(const char *fmt, ...); #endif #define glp_error glp_error_(__FILE__, __LINE__) -_glp_error glp_error_(const char *file, int line); -/* display error message and terminate execution */ +glp_errfunc glp_error_(const char *file, int line); +/* display fatal error message and terminate execution */ #define glp_assert(expr) \ ((void)((expr) || (glp_assert_(#expr, __FILE__, __LINE__), 1))) @@ -808,73 +827,33 @@ void glp_error_hook(void (*func)(void *info), void *info); /* install hook to intercept abnormal termination */ -void *glp_malloc(int size); -/* allocate memory block */ +#define glp_malloc(size) glp_alloc(1, size) +/* allocate memory block (obsolete) */ + +#define glp_calloc(n, size) glp_alloc(n, size) +/* allocate memory block (obsolete) */ -void *glp_calloc(int n, int size); +void *glp_alloc(int n, int size); /* allocate memory block */ +void *glp_realloc(void *ptr, int n, int size); +/* reallocate memory block */ + void glp_free(void *ptr); -/* free memory block */ +/* free (deallocate) memory block */ void glp_mem_limit(int limit); /* set memory usage limit */ -void glp_mem_usage(int *count, int *cpeak, glp_long *total, - glp_long *tpeak); +void glp_mem_usage(int *count, int *cpeak, size_t *total, + size_t *tpeak); /* get memory usage information */ -glp_long glp_time(void); -/* determine current universal time */ - -double glp_difftime(glp_long t1, glp_long t0); -/* compute difference between two time values */ - -/**********************************************************************/ - -#ifndef GLP_DATA_DEFINED -#define GLP_DATA_DEFINED -typedef struct { double _opaque_data[100]; } glp_data; -/* plain data file */ -#endif - -glp_data *glp_sdf_open_file(const char *fname); -/* open plain data file */ - -void glp_sdf_set_jump(glp_data *data, void *jump); -/* set up error handling */ - -void glp_sdf_error(glp_data *data, const char *fmt, ...); -/* print error message */ - -void glp_sdf_warning(glp_data *data, const char *fmt, ...); -/* print warning message */ - -int glp_sdf_read_int(glp_data *data); -/* read integer number */ - -double glp_sdf_read_num(glp_data *data); -/* read floating-point number */ +typedef struct glp_graph glp_graph; +typedef struct glp_vertex glp_vertex; +typedef struct glp_arc glp_arc; -const char *glp_sdf_read_item(glp_data *data); -/* read data item */ - -const char *glp_sdf_read_text(glp_data *data); -/* read text until end of line */ - -int glp_sdf_line(glp_data *data); -/* determine current line number */ - -void glp_sdf_close_file(glp_data *data); -/* close plain data file */ - -/**********************************************************************/ - -typedef struct _glp_graph glp_graph; -typedef struct _glp_vertex glp_vertex; -typedef struct _glp_arc glp_arc; - -struct _glp_graph +struct glp_graph { /* graph descriptor */ void *pool; /* DMP *pool; */ /* memory pool to store graph components */ @@ -898,7 +877,7 @@ /* size of data associated with each arc (0 to 256 bytes) */ }; -struct _glp_vertex +struct glp_vertex { /* vertex descriptor */ int i; /* vertex ordinal number, 1 <= i <= nv */ @@ -919,7 +898,7 @@ /* pointer to the (unordered) list of outgoing arcs */ }; -struct _glp_arc +struct glp_arc { /* arc descriptor */ glp_vertex *tail; /* pointer to the tail endpoint */ @@ -989,6 +968,10 @@ int a_cost, double *sol, int a_x, int v_pi); /* find minimum-cost flow with out-of-kilter algorithm */ +int glp_mincost_relax4(glp_graph *G, int v_rhs, int a_low, int a_cap, + int a_cost, int crash, double *sol, int a_x, int a_rc); +/* find minimum-cost flow with Bertsekas-Tseng relaxation method */ + void glp_maxflow_lp(glp_prob *P, glp_graph *G, int names, int s, int t, int a_cap); /* convert maximum flow problem to LP */ @@ -1016,6 +999,9 @@ int glp_asnprob_hall(glp_graph *G, int v_set, int a_x); /* find bipartite matching of maximum cardinality */ +double glp_cpp(glp_graph *G, int v_t, int v_es, int v_ls); +/* solve critical path problem */ + int glp_read_mincost(glp_graph *G, int v_rhs, int a_low, int a_cap, int a_cost, const char *fname); /* read min-cost flow problem data in DIMACS format */ @@ -1050,6 +1036,9 @@ const int parm[1+15]); /* Klingman's network problem generator */ +void glp_netgen_prob(int nprob, int parm[1+15]); +/* Klingman's standard network problem instance */ + int glp_gridgen(glp_graph *G, int v_rhs, int a_cap, int a_cost, const int parm[1+14]); /* grid-like network problem generator */ @@ -1070,672 +1059,6 @@ int glp_wclique_exact(glp_graph *G, int v_wgt, double *sol, int v_set); /* find maximum weight clique with exact algorithm */ -/*********************************************************************** -* NOTE: All symbols defined below are obsolete and kept here only for -* backward compatibility. -***********************************************************************/ - -#define LPX glp_prob - -/* problem class: */ -#define LPX_LP 100 /* linear programming (LP) */ -#define LPX_MIP 101 /* mixed integer programming (MIP) */ - -/* type of auxiliary/structural variable: */ -#define LPX_FR 110 /* free variable */ -#define LPX_LO 111 /* variable with lower bound */ -#define LPX_UP 112 /* variable with upper bound */ -#define LPX_DB 113 /* double-bounded variable */ -#define LPX_FX 114 /* fixed variable */ - -/* optimization direction flag: */ -#define LPX_MIN 120 /* minimization */ -#define LPX_MAX 121 /* maximization */ - -/* status of primal basic solution: */ -#define LPX_P_UNDEF 132 /* primal solution is undefined */ -#define LPX_P_FEAS 133 /* solution is primal feasible */ -#define LPX_P_INFEAS 134 /* solution is primal infeasible */ -#define LPX_P_NOFEAS 135 /* no primal feasible solution exists */ - -/* status of dual basic solution: */ -#define LPX_D_UNDEF 136 /* dual solution is undefined */ -#define LPX_D_FEAS 137 /* solution is dual feasible */ -#define LPX_D_INFEAS 138 /* solution is dual infeasible */ -#define LPX_D_NOFEAS 139 /* no dual feasible solution exists */ - -/* status of auxiliary/structural variable: */ -#define LPX_BS 140 /* basic variable */ -#define LPX_NL 141 /* non-basic variable on lower bound */ -#define LPX_NU 142 /* non-basic variable on upper bound */ -#define LPX_NF 143 /* non-basic free variable */ -#define LPX_NS 144 /* non-basic fixed variable */ - -/* status of interior-point solution: */ -#define LPX_T_UNDEF 150 /* interior solution is undefined */ -#define LPX_T_OPT 151 /* interior solution is optimal */ - -/* kind of structural variable: */ -#define LPX_CV 160 /* continuous variable */ -#define LPX_IV 161 /* integer variable */ - -/* status of integer solution: */ -#define LPX_I_UNDEF 170 /* integer solution is undefined */ -#define LPX_I_OPT 171 /* integer solution is optimal */ -#define LPX_I_FEAS 172 /* integer solution is feasible */ -#define LPX_I_NOFEAS 173 /* no integer solution exists */ - -/* status codes reported by the routine lpx_get_status: */ -#define LPX_OPT 180 /* optimal */ -#define LPX_FEAS 181 /* feasible */ -#define LPX_INFEAS 182 /* infeasible */ -#define LPX_NOFEAS 183 /* no feasible */ -#define LPX_UNBND 184 /* unbounded */ -#define LPX_UNDEF 185 /* undefined */ - -/* exit codes returned by solver routines: */ -#define LPX_E_OK 200 /* success */ -#define LPX_E_EMPTY 201 /* empty problem */ -#define LPX_E_BADB 202 /* invalid initial basis */ -#define LPX_E_INFEAS 203 /* infeasible initial solution */ -#define LPX_E_FAULT 204 /* unable to start the search */ -#define LPX_E_OBJLL 205 /* objective lower limit reached */ -#define LPX_E_OBJUL 206 /* objective upper limit reached */ -#define LPX_E_ITLIM 207 /* iterations limit exhausted */ -#define LPX_E_TMLIM 208 /* time limit exhausted */ -#define LPX_E_NOFEAS 209 /* no feasible solution */ -#define LPX_E_INSTAB 210 /* numerical instability */ -#define LPX_E_SING 211 /* problems with basis matrix */ -#define LPX_E_NOCONV 212 /* no convergence (interior) */ -#define LPX_E_NOPFS 213 /* no primal feas. sol. (LP presolver) */ -#define LPX_E_NODFS 214 /* no dual feas. sol. (LP presolver) */ -#define LPX_E_MIPGAP 215 /* relative mip gap tolerance reached */ - -/* control parameter identifiers: */ -#define LPX_K_MSGLEV 300 /* lp->msg_lev */ -#define LPX_K_SCALE 301 /* lp->scale */ -#define LPX_K_DUAL 302 /* lp->dual */ -#define LPX_K_PRICE 303 /* lp->price */ -#define LPX_K_RELAX 304 /* lp->relax */ -#define LPX_K_TOLBND 305 /* lp->tol_bnd */ -#define LPX_K_TOLDJ 306 /* lp->tol_dj */ -#define LPX_K_TOLPIV 307 /* lp->tol_piv */ -#define LPX_K_ROUND 308 /* lp->round */ -#define LPX_K_OBJLL 309 /* lp->obj_ll */ -#define LPX_K_OBJUL 310 /* lp->obj_ul */ -#define LPX_K_ITLIM 311 /* lp->it_lim */ -#define LPX_K_ITCNT 312 /* lp->it_cnt */ -#define LPX_K_TMLIM 313 /* lp->tm_lim */ -#define LPX_K_OUTFRQ 314 /* lp->out_frq */ -#define LPX_K_OUTDLY 315 /* lp->out_dly */ -#define LPX_K_BRANCH 316 /* lp->branch */ -#define LPX_K_BTRACK 317 /* lp->btrack */ -#define LPX_K_TOLINT 318 /* lp->tol_int */ -#define LPX_K_TOLOBJ 319 /* lp->tol_obj */ -#define LPX_K_MPSINFO 320 /* lp->mps_info */ -#define LPX_K_MPSOBJ 321 /* lp->mps_obj */ -#define LPX_K_MPSORIG 322 /* lp->mps_orig */ -#define LPX_K_MPSWIDE 323 /* lp->mps_wide */ -#define LPX_K_MPSFREE 324 /* lp->mps_free */ -#define LPX_K_MPSSKIP 325 /* lp->mps_skip */ -#define LPX_K_LPTORIG 326 /* lp->lpt_orig */ -#define LPX_K_PRESOL 327 /* lp->presol */ -#define LPX_K_BINARIZE 328 /* lp->binarize */ -#define LPX_K_USECUTS 329 /* lp->use_cuts */ -#define LPX_K_BFTYPE 330 /* lp->bfcp->type */ -#define LPX_K_MIPGAP 331 /* lp->mip_gap */ - -#define LPX_C_COVER 0x01 /* mixed cover cuts */ -#define LPX_C_CLIQUE 0x02 /* clique cuts */ -#define LPX_C_GOMORY 0x04 /* Gomory's mixed integer cuts */ -#define LPX_C_MIR 0x08 /* mixed integer rounding cuts */ -#define LPX_C_ALL 0xFF /* all cuts */ - -typedef struct -{ /* this structure contains results reported by the routines which - checks Karush-Kuhn-Tucker conditions (for details see comments - to those routines) */ - /*--------------------------------------------------------------*/ - /* xR - A * xS = 0 (KKT.PE) */ - double pe_ae_max; - /* largest absolute error */ - int pe_ae_row; - /* number of row with largest absolute error */ - double pe_re_max; - /* largest relative error */ - int pe_re_row; - /* number of row with largest relative error */ - int pe_quality; - /* quality of primal solution: - 'H' - high - 'M' - medium - 'L' - low - '?' - primal solution is wrong */ - /*--------------------------------------------------------------*/ - /* l[k] <= x[k] <= u[k] (KKT.PB) */ - double pb_ae_max; - /* largest absolute error */ - int pb_ae_ind; - /* number of variable with largest absolute error */ - double pb_re_max; - /* largest relative error */ - int pb_re_ind; - /* number of variable with largest relative error */ - int pb_quality; - /* quality of primal feasibility: - 'H' - high - 'M' - medium - 'L' - low - '?' - primal solution is infeasible */ - /*--------------------------------------------------------------*/ - /* A' * (dR - cR) + (dS - cS) = 0 (KKT.DE) */ - double de_ae_max; - /* largest absolute error */ - int de_ae_col; - /* number of column with largest absolute error */ - double de_re_max; - /* largest relative error */ - int de_re_col; - /* number of column with largest relative error */ - int de_quality; - /* quality of dual solution: - 'H' - high - 'M' - medium - 'L' - low - '?' - dual solution is wrong */ - /*--------------------------------------------------------------*/ - /* d[k] >= 0 or d[k] <= 0 (KKT.DB) */ - double db_ae_max; - /* largest absolute error */ - int db_ae_ind; - /* number of variable with largest absolute error */ - double db_re_max; - /* largest relative error */ - int db_re_ind; - /* number of variable with largest relative error */ - int db_quality; - /* quality of dual feasibility: - 'H' - high - 'M' - medium - 'L' - low - '?' - dual solution is infeasible */ - /*--------------------------------------------------------------*/ - /* (x[k] - bound of x[k]) * d[k] = 0 (KKT.CS) */ - double cs_ae_max; - /* largest absolute error */ - int cs_ae_ind; - /* number of variable with largest absolute error */ - double cs_re_max; - /* largest relative error */ - int cs_re_ind; - /* number of variable with largest relative error */ - int cs_quality; - /* quality of complementary slackness: - 'H' - high - 'M' - medium - 'L' - low - '?' - primal and dual solutions are not complementary */ -} LPXKKT; - -#define lpx_create_prob _glp_lpx_create_prob -LPX *lpx_create_prob(void); -/* create problem object */ - -#define lpx_set_prob_name _glp_lpx_set_prob_name -void lpx_set_prob_name(LPX *lp, const char *name); -/* assign (change) problem name */ - -#define lpx_set_obj_name _glp_lpx_set_obj_name -void lpx_set_obj_name(LPX *lp, const char *name); -/* assign (change) objective function name */ - -#define lpx_set_obj_dir _glp_lpx_set_obj_dir -void lpx_set_obj_dir(LPX *lp, int dir); -/* set (change) optimization direction flag */ - -#define lpx_add_rows _glp_lpx_add_rows -int lpx_add_rows(LPX *lp, int nrs); -/* add new rows to problem object */ - -#define lpx_add_cols _glp_lpx_add_cols -int lpx_add_cols(LPX *lp, int ncs); -/* add new columns to problem object */ - -#define lpx_set_row_name _glp_lpx_set_row_name -void lpx_set_row_name(LPX *lp, int i, const char *name); -/* assign (change) row name */ - -#define lpx_set_col_name _glp_lpx_set_col_name -void lpx_set_col_name(LPX *lp, int j, const char *name); -/* assign (change) column name */ - -#define lpx_set_row_bnds _glp_lpx_set_row_bnds -void lpx_set_row_bnds(LPX *lp, int i, int type, double lb, double ub); -/* set (change) row bounds */ - -#define lpx_set_col_bnds _glp_lpx_set_col_bnds -void lpx_set_col_bnds(LPX *lp, int j, int type, double lb, double ub); -/* set (change) column bounds */ - -#define lpx_set_obj_coef _glp_lpx_set_obj_coef -void lpx_set_obj_coef(glp_prob *lp, int j, double coef); -/* set (change) obj. coefficient or constant term */ - -#define lpx_set_mat_row _glp_lpx_set_mat_row -void lpx_set_mat_row(LPX *lp, int i, int len, const int ind[], - const double val[]); -/* set (replace) row of the constraint matrix */ - -#define lpx_set_mat_col _glp_lpx_set_mat_col -void lpx_set_mat_col(LPX *lp, int j, int len, const int ind[], - const double val[]); -/* set (replace) column of the constraint matrix */ - -#define lpx_load_matrix _glp_lpx_load_matrix -void lpx_load_matrix(LPX *lp, int ne, const int ia[], const int ja[], - const double ar[]); -/* load (replace) the whole constraint matrix */ - -#define lpx_del_rows _glp_lpx_del_rows -void lpx_del_rows(LPX *lp, int nrs, const int num[]); -/* delete specified rows from problem object */ - -#define lpx_del_cols _glp_lpx_del_cols -void lpx_del_cols(LPX *lp, int ncs, const int num[]); -/* delete specified columns from problem object */ - -#define lpx_delete_prob _glp_lpx_delete_prob -void lpx_delete_prob(LPX *lp); -/* delete problem object */ - -#define lpx_get_prob_name _glp_lpx_get_prob_name -const char *lpx_get_prob_name(LPX *lp); -/* retrieve problem name */ - -#define lpx_get_obj_name _glp_lpx_get_obj_name -const char *lpx_get_obj_name(LPX *lp); -/* retrieve objective function name */ - -#define lpx_get_obj_dir _glp_lpx_get_obj_dir -int lpx_get_obj_dir(LPX *lp); -/* retrieve optimization direction flag */ - -#define lpx_get_num_rows _glp_lpx_get_num_rows -int lpx_get_num_rows(LPX *lp); -/* retrieve number of rows */ - -#define lpx_get_num_cols _glp_lpx_get_num_cols -int lpx_get_num_cols(LPX *lp); -/* retrieve number of columns */ - -#define lpx_get_row_name _glp_lpx_get_row_name -const char *lpx_get_row_name(LPX *lp, int i); -/* retrieve row name */ - -#define lpx_get_col_name _glp_lpx_get_col_name -const char *lpx_get_col_name(LPX *lp, int j); -/* retrieve column name */ - -#define lpx_get_row_type _glp_lpx_get_row_type -int lpx_get_row_type(LPX *lp, int i); -/* retrieve row type */ - -#define lpx_get_row_lb _glp_lpx_get_row_lb -double lpx_get_row_lb(LPX *lp, int i); -/* retrieve row lower bound */ - -#define lpx_get_row_ub _glp_lpx_get_row_ub -double lpx_get_row_ub(LPX *lp, int i); -/* retrieve row upper bound */ - -#define lpx_get_row_bnds _glp_lpx_get_row_bnds -void lpx_get_row_bnds(LPX *lp, int i, int *typx, double *lb, - double *ub); -/* retrieve row bounds */ - -#define lpx_get_col_type _glp_lpx_get_col_type -int lpx_get_col_type(LPX *lp, int j); -/* retrieve column type */ - -#define lpx_get_col_lb _glp_lpx_get_col_lb -double lpx_get_col_lb(LPX *lp, int j); -/* retrieve column lower bound */ - -#define lpx_get_col_ub _glp_lpx_get_col_ub -double lpx_get_col_ub(LPX *lp, int j); -/* retrieve column upper bound */ - -#define lpx_get_col_bnds _glp_lpx_get_col_bnds -void lpx_get_col_bnds(LPX *lp, int j, int *typx, double *lb, - double *ub); -/* retrieve column bounds */ - -#define lpx_get_obj_coef _glp_lpx_get_obj_coef -double lpx_get_obj_coef(LPX *lp, int j); -/* retrieve obj. coefficient or constant term */ - -#define lpx_get_num_nz _glp_lpx_get_num_nz -int lpx_get_num_nz(LPX *lp); -/* retrieve number of constraint coefficients */ - -#define lpx_get_mat_row _glp_lpx_get_mat_row -int lpx_get_mat_row(LPX *lp, int i, int ind[], double val[]); -/* retrieve row of the constraint matrix */ - -#define lpx_get_mat_col _glp_lpx_get_mat_col -int lpx_get_mat_col(LPX *lp, int j, int ind[], double val[]); -/* retrieve column of the constraint matrix */ - -#define lpx_create_index _glp_lpx_create_index -void lpx_create_index(LPX *lp); -/* create the name index */ - -#define lpx_find_row _glp_lpx_find_row -int lpx_find_row(LPX *lp, const char *name); -/* find row by its name */ - -#define lpx_find_col _glp_lpx_find_col -int lpx_find_col(LPX *lp, const char *name); -/* find column by its name */ - -#define lpx_delete_index _glp_lpx_delete_index -void lpx_delete_index(LPX *lp); -/* delete the name index */ - -#define lpx_scale_prob _glp_lpx_scale_prob -void lpx_scale_prob(LPX *lp); -/* scale problem data */ - -#define lpx_unscale_prob _glp_lpx_unscale_prob -void lpx_unscale_prob(LPX *lp); -/* unscale problem data */ - -#define lpx_set_row_stat _glp_lpx_set_row_stat -void lpx_set_row_stat(LPX *lp, int i, int stat); -/* set (change) row status */ - -#define lpx_set_col_stat _glp_lpx_set_col_stat -void lpx_set_col_stat(LPX *lp, int j, int stat); -/* set (change) column status */ - -#define lpx_std_basis _glp_lpx_std_basis -void lpx_std_basis(LPX *lp); -/* construct standard initial LP basis */ - -#define lpx_adv_basis _glp_lpx_adv_basis -void lpx_adv_basis(LPX *lp); -/* construct advanced initial LP basis */ - -#define lpx_cpx_basis _glp_lpx_cpx_basis -void lpx_cpx_basis(LPX *lp); -/* construct Bixby's initial LP basis */ - -#define lpx_simplex _glp_lpx_simplex -int lpx_simplex(LPX *lp); -/* easy-to-use driver to the simplex method */ - -#define lpx_exact _glp_lpx_exact -int lpx_exact(LPX *lp); -/* easy-to-use driver to the exact simplex method */ - -#define lpx_get_status _glp_lpx_get_status -int lpx_get_status(LPX *lp); -/* retrieve generic status of basic solution */ - -#define lpx_get_prim_stat _glp_lpx_get_prim_stat -int lpx_get_prim_stat(LPX *lp); -/* retrieve primal status of basic solution */ - -#define lpx_get_dual_stat _glp_lpx_get_dual_stat -int lpx_get_dual_stat(LPX *lp); -/* retrieve dual status of basic solution */ - -#define lpx_get_obj_val _glp_lpx_get_obj_val -double lpx_get_obj_val(LPX *lp); -/* retrieve objective value (basic solution) */ - -#define lpx_get_row_stat _glp_lpx_get_row_stat -int lpx_get_row_stat(LPX *lp, int i); -/* retrieve row status (basic solution) */ - -#define lpx_get_row_prim _glp_lpx_get_row_prim -double lpx_get_row_prim(LPX *lp, int i); -/* retrieve row primal value (basic solution) */ - -#define lpx_get_row_dual _glp_lpx_get_row_dual -double lpx_get_row_dual(LPX *lp, int i); -/* retrieve row dual value (basic solution) */ - -#define lpx_get_row_info _glp_lpx_get_row_info -void lpx_get_row_info(LPX *lp, int i, int *tagx, double *vx, - double *dx); -/* obtain row solution information */ - -#define lpx_get_col_stat _glp_lpx_get_col_stat -int lpx_get_col_stat(LPX *lp, int j); -/* retrieve column status (basic solution) */ - -#define lpx_get_col_prim _glp_lpx_get_col_prim -double lpx_get_col_prim(LPX *lp, int j); -/* retrieve column primal value (basic solution) */ - -#define lpx_get_col_dual _glp_lpx_get_col_dual -double lpx_get_col_dual(glp_prob *lp, int j); -/* retrieve column dual value (basic solution) */ - -#define lpx_get_col_info _glp_lpx_get_col_info -void lpx_get_col_info(LPX *lp, int j, int *tagx, double *vx, - double *dx); -/* obtain column solution information (obsolete) */ - -#define lpx_get_ray_info _glp_lpx_get_ray_info -int lpx_get_ray_info(LPX *lp); -/* determine what causes primal unboundness */ - -#define lpx_check_kkt _glp_lpx_check_kkt -void lpx_check_kkt(LPX *lp, int scaled, LPXKKT *kkt); -/* check Karush-Kuhn-Tucker conditions */ - -#define lpx_warm_up _glp_lpx_warm_up -int lpx_warm_up(LPX *lp); -/* "warm up" LP basis */ - -#define lpx_eval_tab_row _glp_lpx_eval_tab_row -int lpx_eval_tab_row(LPX *lp, int k, int ind[], double val[]); -/* compute row of the simplex table */ - -#define lpx_eval_tab_col _glp_lpx_eval_tab_col -int lpx_eval_tab_col(LPX *lp, int k, int ind[], double val[]); -/* compute column of the simplex table */ - -#define lpx_transform_row _glp_lpx_transform_row -int lpx_transform_row(LPX *lp, int len, int ind[], double val[]); -/* transform explicitly specified row */ - -#define lpx_transform_col _glp_lpx_transform_col -int lpx_transform_col(LPX *lp, int len, int ind[], double val[]); -/* transform explicitly specified column */ - -#define lpx_prim_ratio_test _glp_lpx_prim_ratio_test -int lpx_prim_ratio_test(LPX *lp, int len, const int ind[], - const double val[], int how, double tol); -/* perform primal ratio test */ - -#define lpx_dual_ratio_test _glp_lpx_dual_ratio_test -int lpx_dual_ratio_test(LPX *lp, int len, const int ind[], - const double val[], int how, double tol); -/* perform dual ratio test */ - -#define lpx_interior _glp_lpx_interior -int lpx_interior(LPX *lp); -/* easy-to-use driver to the interior point method */ - -#define lpx_ipt_status _glp_lpx_ipt_status -int lpx_ipt_status(LPX *lp); -/* retrieve status of interior-point solution */ - -#define lpx_ipt_obj_val _glp_lpx_ipt_obj_val -double lpx_ipt_obj_val(LPX *lp); -/* retrieve objective value (interior point) */ - -#define lpx_ipt_row_prim _glp_lpx_ipt_row_prim -double lpx_ipt_row_prim(LPX *lp, int i); -/* retrieve row primal value (interior point) */ - -#define lpx_ipt_row_dual _glp_lpx_ipt_row_dual -double lpx_ipt_row_dual(LPX *lp, int i); -/* retrieve row dual value (interior point) */ - -#define lpx_ipt_col_prim _glp_lpx_ipt_col_prim -double lpx_ipt_col_prim(LPX *lp, int j); -/* retrieve column primal value (interior point) */ - -#define lpx_ipt_col_dual _glp_lpx_ipt_col_dual -double lpx_ipt_col_dual(LPX *lp, int j); -/* retrieve column dual value (interior point) */ - -#define lpx_set_class _glp_lpx_set_class -void lpx_set_class(LPX *lp, int klass); -/* set problem class */ - -#define lpx_get_class _glp_lpx_get_class -int lpx_get_class(LPX *lp); -/* determine problem klass */ - -#define lpx_set_col_kind _glp_lpx_set_col_kind -void lpx_set_col_kind(LPX *lp, int j, int kind); -/* set (change) column kind */ - -#define lpx_get_col_kind _glp_lpx_get_col_kind -int lpx_get_col_kind(LPX *lp, int j); -/* retrieve column kind */ - -#define lpx_get_num_int _glp_lpx_get_num_int -int lpx_get_num_int(LPX *lp); -/* retrieve number of integer columns */ - -#define lpx_get_num_bin _glp_lpx_get_num_bin -int lpx_get_num_bin(LPX *lp); -/* retrieve number of binary columns */ - -#define lpx_integer _glp_lpx_integer -int lpx_integer(LPX *lp); -/* easy-to-use driver to the branch-and-bound method */ - -#define lpx_intopt _glp_lpx_intopt -int lpx_intopt(LPX *lp); -/* easy-to-use driver to the branch-and-bound method */ - -#define lpx_mip_status _glp_lpx_mip_status -int lpx_mip_status(LPX *lp); -/* retrieve status of MIP solution */ - -#define lpx_mip_obj_val _glp_lpx_mip_obj_val -double lpx_mip_obj_val(LPX *lp); -/* retrieve objective value (MIP solution) */ - -#define lpx_mip_row_val _glp_lpx_mip_row_val -double lpx_mip_row_val(LPX *lp, int i); -/* retrieve row value (MIP solution) */ - -#define lpx_mip_col_val _glp_lpx_mip_col_val -double lpx_mip_col_val(LPX *lp, int j); -/* retrieve column value (MIP solution) */ - -#define lpx_check_int _glp_lpx_check_int -void lpx_check_int(LPX *lp, LPXKKT *kkt); -/* check integer feasibility conditions */ - -#define lpx_reset_parms _glp_lpx_reset_parms -void lpx_reset_parms(LPX *lp); -/* reset control parameters to default values */ - -#define lpx_set_int_parm _glp_lpx_set_int_parm -void lpx_set_int_parm(LPX *lp, int parm, int val); -/* set (change) integer control parameter */ - -#define lpx_get_int_parm _glp_lpx_get_int_parm -int lpx_get_int_parm(LPX *lp, int parm); -/* query integer control parameter */ - -#define lpx_set_real_parm _glp_lpx_set_real_parm -void lpx_set_real_parm(LPX *lp, int parm, double val); -/* set (change) real control parameter */ - -#define lpx_get_real_parm _glp_lpx_get_real_parm -double lpx_get_real_parm(LPX *lp, int parm); -/* query real control parameter */ - -#define lpx_read_mps _glp_lpx_read_mps -LPX *lpx_read_mps(const char *fname); -/* read problem data in fixed MPS format */ - -#define lpx_write_mps _glp_lpx_write_mps -int lpx_write_mps(LPX *lp, const char *fname); -/* write problem data in fixed MPS format */ - -#define lpx_read_bas _glp_lpx_read_bas -int lpx_read_bas(LPX *lp, const char *fname); -/* read LP basis in fixed MPS format */ - -#define lpx_write_bas _glp_lpx_write_bas -int lpx_write_bas(LPX *lp, const char *fname); -/* write LP basis in fixed MPS format */ - -#define lpx_read_freemps _glp_lpx_read_freemps -LPX *lpx_read_freemps(const char *fname); -/* read problem data in free MPS format */ - -#define lpx_write_freemps _glp_lpx_write_freemps -int lpx_write_freemps(LPX *lp, const char *fname); -/* write problem data in free MPS format */ - -#define lpx_read_cpxlp _glp_lpx_read_cpxlp -LPX *lpx_read_cpxlp(const char *fname); -/* read problem data in CPLEX LP format */ - -#define lpx_write_cpxlp _glp_lpx_write_cpxlp -int lpx_write_cpxlp(LPX *lp, const char *fname); -/* write problem data in CPLEX LP format */ - -#define lpx_read_model _glp_lpx_read_model -LPX *lpx_read_model(const char *model, const char *data, - const char *output); -/* read LP/MIP model written in GNU MathProg language */ - -#define lpx_print_prob _glp_lpx_print_prob -int lpx_print_prob(LPX *lp, const char *fname); -/* write problem data in plain text format */ - -#define lpx_print_sol _glp_lpx_print_sol -int lpx_print_sol(LPX *lp, const char *fname); -/* write LP problem solution in printable format */ - -#define lpx_print_sens_bnds _glp_lpx_print_sens_bnds -int lpx_print_sens_bnds(LPX *lp, const char *fname); -/* write bounds sensitivity information */ - -#define lpx_print_ips _glp_lpx_print_ips -int lpx_print_ips(LPX *lp, const char *fname); -/* write interior point solution in printable format */ - -#define lpx_print_mip _glp_lpx_print_mip -int lpx_print_mip(LPX *lp, const char *fname); -/* write MIP problem solution in printable format */ - -#define lpx_is_b_avail _glp_lpx_is_b_avail -int lpx_is_b_avail(LPX *lp); -/* check if LP basis is available */ - -#define lpx_write_pb _glp_lpx_write_pb -int lpx_write_pb(LPX *lp, const char *fname, int normalized, - int binarize); -/* write problem data in (normalized) OPB format */ - -#define lpx_main _glp_lpx_main -int lpx_main(int argc, const char *argv[]); -/* stand-alone LP/MIP solver */ - #ifdef __cplusplus } #endif