rev |
line source |
alpar@9
|
1 /* glpk.h */
|
alpar@9
|
2
|
alpar@9
|
3 /***********************************************************************
|
alpar@9
|
4 * This code is part of GLPK (GNU Linear Programming Kit).
|
alpar@9
|
5 *
|
alpar@9
|
6 * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
|
alpar@9
|
7 * 2009, 2010, 2011 Andrew Makhorin, Department for Applied Informatics,
|
alpar@9
|
8 * Moscow Aviation Institute, Moscow, Russia. All rights reserved.
|
alpar@9
|
9 * E-mail: <mao@gnu.org>.
|
alpar@9
|
10 *
|
alpar@9
|
11 * GLPK is free software: you can redistribute it and/or modify it
|
alpar@9
|
12 * under the terms of the GNU General Public License as published by
|
alpar@9
|
13 * the Free Software Foundation, either version 3 of the License, or
|
alpar@9
|
14 * (at your option) any later version.
|
alpar@9
|
15 *
|
alpar@9
|
16 * GLPK is distributed in the hope that it will be useful, but WITHOUT
|
alpar@9
|
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
alpar@9
|
18 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
alpar@9
|
19 * License for more details.
|
alpar@9
|
20 *
|
alpar@9
|
21 * You should have received a copy of the GNU General Public License
|
alpar@9
|
22 * along with GLPK. If not, see <http://www.gnu.org/licenses/>.
|
alpar@9
|
23 ***********************************************************************/
|
alpar@9
|
24
|
alpar@9
|
25 #ifndef GLPK_H
|
alpar@9
|
26 #define GLPK_H
|
alpar@9
|
27
|
alpar@9
|
28 #include <stdarg.h>
|
alpar@9
|
29 #include <stddef.h>
|
alpar@9
|
30
|
alpar@9
|
31 #ifdef __cplusplus
|
alpar@9
|
32 extern "C" {
|
alpar@9
|
33 #endif
|
alpar@9
|
34
|
alpar@9
|
35 /* library version numbers: */
|
alpar@9
|
36 #define GLP_MAJOR_VERSION 4
|
alpar@9
|
37 #define GLP_MINOR_VERSION 47
|
alpar@9
|
38
|
alpar@9
|
39 #ifndef GLP_PROB_DEFINED
|
alpar@9
|
40 #define GLP_PROB_DEFINED
|
alpar@9
|
41 typedef struct { double _opaque_prob[100]; } glp_prob;
|
alpar@9
|
42 /* LP/MIP problem object */
|
alpar@9
|
43 #endif
|
alpar@9
|
44
|
alpar@9
|
45 /* optimization direction flag: */
|
alpar@9
|
46 #define GLP_MIN 1 /* minimization */
|
alpar@9
|
47 #define GLP_MAX 2 /* maximization */
|
alpar@9
|
48
|
alpar@9
|
49 /* kind of structural variable: */
|
alpar@9
|
50 #define GLP_CV 1 /* continuous variable */
|
alpar@9
|
51 #define GLP_IV 2 /* integer variable */
|
alpar@9
|
52 #define GLP_BV 3 /* binary variable */
|
alpar@9
|
53
|
alpar@9
|
54 /* type of auxiliary/structural variable: */
|
alpar@9
|
55 #define GLP_FR 1 /* free variable */
|
alpar@9
|
56 #define GLP_LO 2 /* variable with lower bound */
|
alpar@9
|
57 #define GLP_UP 3 /* variable with upper bound */
|
alpar@9
|
58 #define GLP_DB 4 /* double-bounded variable */
|
alpar@9
|
59 #define GLP_FX 5 /* fixed variable */
|
alpar@9
|
60
|
alpar@9
|
61 /* status of auxiliary/structural variable: */
|
alpar@9
|
62 #define GLP_BS 1 /* basic variable */
|
alpar@9
|
63 #define GLP_NL 2 /* non-basic variable on lower bound */
|
alpar@9
|
64 #define GLP_NU 3 /* non-basic variable on upper bound */
|
alpar@9
|
65 #define GLP_NF 4 /* non-basic free variable */
|
alpar@9
|
66 #define GLP_NS 5 /* non-basic fixed variable */
|
alpar@9
|
67
|
alpar@9
|
68 /* scaling options: */
|
alpar@9
|
69 #define GLP_SF_GM 0x01 /* perform geometric mean scaling */
|
alpar@9
|
70 #define GLP_SF_EQ 0x10 /* perform equilibration scaling */
|
alpar@9
|
71 #define GLP_SF_2N 0x20 /* round scale factors to power of two */
|
alpar@9
|
72 #define GLP_SF_SKIP 0x40 /* skip if problem is well scaled */
|
alpar@9
|
73 #define GLP_SF_AUTO 0x80 /* choose scaling options automatically */
|
alpar@9
|
74
|
alpar@9
|
75 /* solution indicator: */
|
alpar@9
|
76 #define GLP_SOL 1 /* basic solution */
|
alpar@9
|
77 #define GLP_IPT 2 /* interior-point solution */
|
alpar@9
|
78 #define GLP_MIP 3 /* mixed integer solution */
|
alpar@9
|
79
|
alpar@9
|
80 /* solution status: */
|
alpar@9
|
81 #define GLP_UNDEF 1 /* solution is undefined */
|
alpar@9
|
82 #define GLP_FEAS 2 /* solution is feasible */
|
alpar@9
|
83 #define GLP_INFEAS 3 /* solution is infeasible */
|
alpar@9
|
84 #define GLP_NOFEAS 4 /* no feasible solution exists */
|
alpar@9
|
85 #define GLP_OPT 5 /* solution is optimal */
|
alpar@9
|
86 #define GLP_UNBND 6 /* solution is unbounded */
|
alpar@9
|
87
|
alpar@9
|
88 typedef struct
|
alpar@9
|
89 { /* basis factorization control parameters */
|
alpar@9
|
90 int msg_lev; /* (reserved) */
|
alpar@9
|
91 int type; /* factorization type: */
|
alpar@9
|
92 #define GLP_BF_FT 1 /* LUF + Forrest-Tomlin */
|
alpar@9
|
93 #define GLP_BF_BG 2 /* LUF + Schur compl. + Bartels-Golub */
|
alpar@9
|
94 #define GLP_BF_GR 3 /* LUF + Schur compl. + Givens rotation */
|
alpar@9
|
95 int lu_size; /* luf.sv_size */
|
alpar@9
|
96 double piv_tol; /* luf.piv_tol */
|
alpar@9
|
97 int piv_lim; /* luf.piv_lim */
|
alpar@9
|
98 int suhl; /* luf.suhl */
|
alpar@9
|
99 double eps_tol; /* luf.eps_tol */
|
alpar@9
|
100 double max_gro; /* luf.max_gro */
|
alpar@9
|
101 int nfs_max; /* fhv.hh_max */
|
alpar@9
|
102 double upd_tol; /* fhv.upd_tol */
|
alpar@9
|
103 int nrs_max; /* lpf.n_max */
|
alpar@9
|
104 int rs_size; /* lpf.v_size */
|
alpar@9
|
105 double foo_bar[38]; /* (reserved) */
|
alpar@9
|
106 } glp_bfcp;
|
alpar@9
|
107
|
alpar@9
|
108 typedef struct
|
alpar@9
|
109 { /* simplex method control parameters */
|
alpar@9
|
110 int msg_lev; /* message level: */
|
alpar@9
|
111 #define GLP_MSG_OFF 0 /* no output */
|
alpar@9
|
112 #define GLP_MSG_ERR 1 /* warning and error messages only */
|
alpar@9
|
113 #define GLP_MSG_ON 2 /* normal output */
|
alpar@9
|
114 #define GLP_MSG_ALL 3 /* full output */
|
alpar@9
|
115 #define GLP_MSG_DBG 4 /* debug output */
|
alpar@9
|
116 int meth; /* simplex method option: */
|
alpar@9
|
117 #define GLP_PRIMAL 1 /* use primal simplex */
|
alpar@9
|
118 #define GLP_DUALP 2 /* use dual; if it fails, use primal */
|
alpar@9
|
119 #define GLP_DUAL 3 /* use dual simplex */
|
alpar@9
|
120 int pricing; /* pricing technique: */
|
alpar@9
|
121 #define GLP_PT_STD 0x11 /* standard (Dantzig rule) */
|
alpar@9
|
122 #define GLP_PT_PSE 0x22 /* projected steepest edge */
|
alpar@9
|
123 int r_test; /* ratio test technique: */
|
alpar@9
|
124 #define GLP_RT_STD 0x11 /* standard (textbook) */
|
alpar@9
|
125 #define GLP_RT_HAR 0x22 /* two-pass Harris' ratio test */
|
alpar@9
|
126 double tol_bnd; /* spx.tol_bnd */
|
alpar@9
|
127 double tol_dj; /* spx.tol_dj */
|
alpar@9
|
128 double tol_piv; /* spx.tol_piv */
|
alpar@9
|
129 double obj_ll; /* spx.obj_ll */
|
alpar@9
|
130 double obj_ul; /* spx.obj_ul */
|
alpar@9
|
131 int it_lim; /* spx.it_lim */
|
alpar@9
|
132 int tm_lim; /* spx.tm_lim (milliseconds) */
|
alpar@9
|
133 int out_frq; /* spx.out_frq */
|
alpar@9
|
134 int out_dly; /* spx.out_dly (milliseconds) */
|
alpar@9
|
135 int presolve; /* enable/disable using LP presolver */
|
alpar@9
|
136 double foo_bar[36]; /* (reserved) */
|
alpar@9
|
137 } glp_smcp;
|
alpar@9
|
138
|
alpar@9
|
139 typedef struct
|
alpar@9
|
140 { /* interior-point solver control parameters */
|
alpar@9
|
141 int msg_lev; /* message level (see glp_smcp) */
|
alpar@9
|
142 int ord_alg; /* ordering algorithm: */
|
alpar@9
|
143 #define GLP_ORD_NONE 0 /* natural (original) ordering */
|
alpar@9
|
144 #define GLP_ORD_QMD 1 /* quotient minimum degree (QMD) */
|
alpar@9
|
145 #define GLP_ORD_AMD 2 /* approx. minimum degree (AMD) */
|
alpar@9
|
146 #define GLP_ORD_SYMAMD 3 /* approx. minimum degree (SYMAMD) */
|
alpar@9
|
147 double foo_bar[48]; /* (reserved) */
|
alpar@9
|
148 } glp_iptcp;
|
alpar@9
|
149
|
alpar@9
|
150 #ifndef GLP_TREE_DEFINED
|
alpar@9
|
151 #define GLP_TREE_DEFINED
|
alpar@9
|
152 typedef struct { double _opaque_tree[100]; } glp_tree;
|
alpar@9
|
153 /* branch-and-bound tree */
|
alpar@9
|
154 #endif
|
alpar@9
|
155
|
alpar@9
|
156 typedef struct
|
alpar@9
|
157 { /* integer optimizer control parameters */
|
alpar@9
|
158 int msg_lev; /* message level (see glp_smcp) */
|
alpar@9
|
159 int br_tech; /* branching technique: */
|
alpar@9
|
160 #define GLP_BR_FFV 1 /* first fractional variable */
|
alpar@9
|
161 #define GLP_BR_LFV 2 /* last fractional variable */
|
alpar@9
|
162 #define GLP_BR_MFV 3 /* most fractional variable */
|
alpar@9
|
163 #define GLP_BR_DTH 4 /* heuristic by Driebeck and Tomlin */
|
alpar@9
|
164 #define GLP_BR_PCH 5 /* hybrid pseudocost heuristic */
|
alpar@9
|
165 int bt_tech; /* backtracking technique: */
|
alpar@9
|
166 #define GLP_BT_DFS 1 /* depth first search */
|
alpar@9
|
167 #define GLP_BT_BFS 2 /* breadth first search */
|
alpar@9
|
168 #define GLP_BT_BLB 3 /* best local bound */
|
alpar@9
|
169 #define GLP_BT_BPH 4 /* best projection heuristic */
|
alpar@9
|
170 double tol_int; /* mip.tol_int */
|
alpar@9
|
171 double tol_obj; /* mip.tol_obj */
|
alpar@9
|
172 int tm_lim; /* mip.tm_lim (milliseconds) */
|
alpar@9
|
173 int out_frq; /* mip.out_frq (milliseconds) */
|
alpar@9
|
174 int out_dly; /* mip.out_dly (milliseconds) */
|
alpar@9
|
175 void (*cb_func)(glp_tree *T, void *info);
|
alpar@9
|
176 /* mip.cb_func */
|
alpar@9
|
177 void *cb_info; /* mip.cb_info */
|
alpar@9
|
178 int cb_size; /* mip.cb_size */
|
alpar@9
|
179 int pp_tech; /* preprocessing technique: */
|
alpar@9
|
180 #define GLP_PP_NONE 0 /* disable preprocessing */
|
alpar@9
|
181 #define GLP_PP_ROOT 1 /* preprocessing only on root level */
|
alpar@9
|
182 #define GLP_PP_ALL 2 /* preprocessing on all levels */
|
alpar@9
|
183 double mip_gap; /* relative MIP gap tolerance */
|
alpar@9
|
184 int mir_cuts; /* MIR cuts (GLP_ON/GLP_OFF) */
|
alpar@9
|
185 int gmi_cuts; /* Gomory's cuts (GLP_ON/GLP_OFF) */
|
alpar@9
|
186 int cov_cuts; /* cover cuts (GLP_ON/GLP_OFF) */
|
alpar@9
|
187 int clq_cuts; /* clique cuts (GLP_ON/GLP_OFF) */
|
alpar@9
|
188 int presolve; /* enable/disable using MIP presolver */
|
alpar@9
|
189 int binarize; /* try to binarize integer variables */
|
alpar@9
|
190 int fp_heur; /* feasibility pump heuristic */
|
alpar@9
|
191 #if 1 /* 28/V-2010 */
|
alpar@9
|
192 int alien; /* use alien solver */
|
alpar@9
|
193 #endif
|
alpar@9
|
194 double foo_bar[29]; /* (reserved) */
|
alpar@9
|
195 } glp_iocp;
|
alpar@9
|
196
|
alpar@9
|
197 typedef struct
|
alpar@9
|
198 { /* additional row attributes */
|
alpar@9
|
199 int level;
|
alpar@9
|
200 /* subproblem level at which the row was added */
|
alpar@9
|
201 int origin;
|
alpar@9
|
202 /* row origin flag: */
|
alpar@9
|
203 #define GLP_RF_REG 0 /* regular constraint */
|
alpar@9
|
204 #define GLP_RF_LAZY 1 /* "lazy" constraint */
|
alpar@9
|
205 #define GLP_RF_CUT 2 /* cutting plane constraint */
|
alpar@9
|
206 int klass;
|
alpar@9
|
207 /* row class descriptor: */
|
alpar@9
|
208 #define GLP_RF_GMI 1 /* Gomory's mixed integer cut */
|
alpar@9
|
209 #define GLP_RF_MIR 2 /* mixed integer rounding cut */
|
alpar@9
|
210 #define GLP_RF_COV 3 /* mixed cover cut */
|
alpar@9
|
211 #define GLP_RF_CLQ 4 /* clique cut */
|
alpar@9
|
212 double foo_bar[7];
|
alpar@9
|
213 /* (reserved) */
|
alpar@9
|
214 } glp_attr;
|
alpar@9
|
215
|
alpar@9
|
216 /* enable/disable flag: */
|
alpar@9
|
217 #define GLP_ON 1 /* enable something */
|
alpar@9
|
218 #define GLP_OFF 0 /* disable something */
|
alpar@9
|
219
|
alpar@9
|
220 /* reason codes: */
|
alpar@9
|
221 #define GLP_IROWGEN 0x01 /* request for row generation */
|
alpar@9
|
222 #define GLP_IBINGO 0x02 /* better integer solution found */
|
alpar@9
|
223 #define GLP_IHEUR 0x03 /* request for heuristic solution */
|
alpar@9
|
224 #define GLP_ICUTGEN 0x04 /* request for cut generation */
|
alpar@9
|
225 #define GLP_IBRANCH 0x05 /* request for branching */
|
alpar@9
|
226 #define GLP_ISELECT 0x06 /* request for subproblem selection */
|
alpar@9
|
227 #define GLP_IPREPRO 0x07 /* request for preprocessing */
|
alpar@9
|
228
|
alpar@9
|
229 /* branch selection indicator: */
|
alpar@9
|
230 #define GLP_NO_BRNCH 0 /* select no branch */
|
alpar@9
|
231 #define GLP_DN_BRNCH 1 /* select down-branch */
|
alpar@9
|
232 #define GLP_UP_BRNCH 2 /* select up-branch */
|
alpar@9
|
233
|
alpar@9
|
234 /* return codes: */
|
alpar@9
|
235 #define GLP_EBADB 0x01 /* invalid basis */
|
alpar@9
|
236 #define GLP_ESING 0x02 /* singular matrix */
|
alpar@9
|
237 #define GLP_ECOND 0x03 /* ill-conditioned matrix */
|
alpar@9
|
238 #define GLP_EBOUND 0x04 /* invalid bounds */
|
alpar@9
|
239 #define GLP_EFAIL 0x05 /* solver failed */
|
alpar@9
|
240 #define GLP_EOBJLL 0x06 /* objective lower limit reached */
|
alpar@9
|
241 #define GLP_EOBJUL 0x07 /* objective upper limit reached */
|
alpar@9
|
242 #define GLP_EITLIM 0x08 /* iteration limit exceeded */
|
alpar@9
|
243 #define GLP_ETMLIM 0x09 /* time limit exceeded */
|
alpar@9
|
244 #define GLP_ENOPFS 0x0A /* no primal feasible solution */
|
alpar@9
|
245 #define GLP_ENODFS 0x0B /* no dual feasible solution */
|
alpar@9
|
246 #define GLP_EROOT 0x0C /* root LP optimum not provided */
|
alpar@9
|
247 #define GLP_ESTOP 0x0D /* search terminated by application */
|
alpar@9
|
248 #define GLP_EMIPGAP 0x0E /* relative mip gap tolerance reached */
|
alpar@9
|
249 #define GLP_ENOFEAS 0x0F /* no primal/dual feasible solution */
|
alpar@9
|
250 #define GLP_ENOCVG 0x10 /* no convergence */
|
alpar@9
|
251 #define GLP_EINSTAB 0x11 /* numerical instability */
|
alpar@9
|
252 #define GLP_EDATA 0x12 /* invalid data */
|
alpar@9
|
253 #define GLP_ERANGE 0x13 /* result out of range */
|
alpar@9
|
254
|
alpar@9
|
255 /* condition indicator: */
|
alpar@9
|
256 #define GLP_KKT_PE 1 /* primal equalities */
|
alpar@9
|
257 #define GLP_KKT_PB 2 /* primal bounds */
|
alpar@9
|
258 #define GLP_KKT_DE 3 /* dual equalities */
|
alpar@9
|
259 #define GLP_KKT_DB 4 /* dual bounds */
|
alpar@9
|
260 #define GLP_KKT_CS 5 /* complementary slackness */
|
alpar@9
|
261
|
alpar@9
|
262 /* MPS file format: */
|
alpar@9
|
263 #define GLP_MPS_DECK 1 /* fixed (ancient) */
|
alpar@9
|
264 #define GLP_MPS_FILE 2 /* free (modern) */
|
alpar@9
|
265
|
alpar@9
|
266 typedef struct
|
alpar@9
|
267 { /* MPS format control parameters */
|
alpar@9
|
268 int blank;
|
alpar@9
|
269 /* character code to replace blanks in symbolic names */
|
alpar@9
|
270 char *obj_name;
|
alpar@9
|
271 /* objective row name */
|
alpar@9
|
272 double tol_mps;
|
alpar@9
|
273 /* zero tolerance for MPS data */
|
alpar@9
|
274 double foo_bar[17];
|
alpar@9
|
275 /* (reserved for use in the future) */
|
alpar@9
|
276 } glp_mpscp;
|
alpar@9
|
277
|
alpar@9
|
278 typedef struct
|
alpar@9
|
279 { /* CPLEX LP format control parameters */
|
alpar@9
|
280 double foo_bar[20];
|
alpar@9
|
281 /* (reserved for use in the future) */
|
alpar@9
|
282 } glp_cpxcp;
|
alpar@9
|
283
|
alpar@9
|
284 #ifndef GLP_TRAN_DEFINED
|
alpar@9
|
285 #define GLP_TRAN_DEFINED
|
alpar@9
|
286 typedef struct { double _opaque_tran[100]; } glp_tran;
|
alpar@9
|
287 /* MathProg translator workspace */
|
alpar@9
|
288 #endif
|
alpar@9
|
289
|
alpar@9
|
290 glp_prob *glp_create_prob(void);
|
alpar@9
|
291 /* create problem object */
|
alpar@9
|
292
|
alpar@9
|
293 void glp_set_prob_name(glp_prob *P, const char *name);
|
alpar@9
|
294 /* assign (change) problem name */
|
alpar@9
|
295
|
alpar@9
|
296 void glp_set_obj_name(glp_prob *P, const char *name);
|
alpar@9
|
297 /* assign (change) objective function name */
|
alpar@9
|
298
|
alpar@9
|
299 void glp_set_obj_dir(glp_prob *P, int dir);
|
alpar@9
|
300 /* set (change) optimization direction flag */
|
alpar@9
|
301
|
alpar@9
|
302 int glp_add_rows(glp_prob *P, int nrs);
|
alpar@9
|
303 /* add new rows to problem object */
|
alpar@9
|
304
|
alpar@9
|
305 int glp_add_cols(glp_prob *P, int ncs);
|
alpar@9
|
306 /* add new columns to problem object */
|
alpar@9
|
307
|
alpar@9
|
308 void glp_set_row_name(glp_prob *P, int i, const char *name);
|
alpar@9
|
309 /* assign (change) row name */
|
alpar@9
|
310
|
alpar@9
|
311 void glp_set_col_name(glp_prob *P, int j, const char *name);
|
alpar@9
|
312 /* assign (change) column name */
|
alpar@9
|
313
|
alpar@9
|
314 void glp_set_row_bnds(glp_prob *P, int i, int type, double lb,
|
alpar@9
|
315 double ub);
|
alpar@9
|
316 /* set (change) row bounds */
|
alpar@9
|
317
|
alpar@9
|
318 void glp_set_col_bnds(glp_prob *P, int j, int type, double lb,
|
alpar@9
|
319 double ub);
|
alpar@9
|
320 /* set (change) column bounds */
|
alpar@9
|
321
|
alpar@9
|
322 void glp_set_obj_coef(glp_prob *P, int j, double coef);
|
alpar@9
|
323 /* set (change) obj. coefficient or constant term */
|
alpar@9
|
324
|
alpar@9
|
325 void glp_set_mat_row(glp_prob *P, int i, int len, const int ind[],
|
alpar@9
|
326 const double val[]);
|
alpar@9
|
327 /* set (replace) row of the constraint matrix */
|
alpar@9
|
328
|
alpar@9
|
329 void glp_set_mat_col(glp_prob *P, int j, int len, const int ind[],
|
alpar@9
|
330 const double val[]);
|
alpar@9
|
331 /* set (replace) column of the constraint matrix */
|
alpar@9
|
332
|
alpar@9
|
333 void glp_load_matrix(glp_prob *P, int ne, const int ia[],
|
alpar@9
|
334 const int ja[], const double ar[]);
|
alpar@9
|
335 /* load (replace) the whole constraint matrix */
|
alpar@9
|
336
|
alpar@9
|
337 int glp_check_dup(int m, int n, int ne, const int ia[], const int ja[]);
|
alpar@9
|
338 /* check for duplicate elements in sparse matrix */
|
alpar@9
|
339
|
alpar@9
|
340 void glp_sort_matrix(glp_prob *P);
|
alpar@9
|
341 /* sort elements of the constraint matrix */
|
alpar@9
|
342
|
alpar@9
|
343 void glp_del_rows(glp_prob *P, int nrs, const int num[]);
|
alpar@9
|
344 /* delete specified rows from problem object */
|
alpar@9
|
345
|
alpar@9
|
346 void glp_del_cols(glp_prob *P, int ncs, const int num[]);
|
alpar@9
|
347 /* delete specified columns from problem object */
|
alpar@9
|
348
|
alpar@9
|
349 void glp_copy_prob(glp_prob *dest, glp_prob *prob, int names);
|
alpar@9
|
350 /* copy problem object content */
|
alpar@9
|
351
|
alpar@9
|
352 void glp_erase_prob(glp_prob *P);
|
alpar@9
|
353 /* erase problem object content */
|
alpar@9
|
354
|
alpar@9
|
355 void glp_delete_prob(glp_prob *P);
|
alpar@9
|
356 /* delete problem object */
|
alpar@9
|
357
|
alpar@9
|
358 const char *glp_get_prob_name(glp_prob *P);
|
alpar@9
|
359 /* retrieve problem name */
|
alpar@9
|
360
|
alpar@9
|
361 const char *glp_get_obj_name(glp_prob *P);
|
alpar@9
|
362 /* retrieve objective function name */
|
alpar@9
|
363
|
alpar@9
|
364 int glp_get_obj_dir(glp_prob *P);
|
alpar@9
|
365 /* retrieve optimization direction flag */
|
alpar@9
|
366
|
alpar@9
|
367 int glp_get_num_rows(glp_prob *P);
|
alpar@9
|
368 /* retrieve number of rows */
|
alpar@9
|
369
|
alpar@9
|
370 int glp_get_num_cols(glp_prob *P);
|
alpar@9
|
371 /* retrieve number of columns */
|
alpar@9
|
372
|
alpar@9
|
373 const char *glp_get_row_name(glp_prob *P, int i);
|
alpar@9
|
374 /* retrieve row name */
|
alpar@9
|
375
|
alpar@9
|
376 const char *glp_get_col_name(glp_prob *P, int j);
|
alpar@9
|
377 /* retrieve column name */
|
alpar@9
|
378
|
alpar@9
|
379 int glp_get_row_type(glp_prob *P, int i);
|
alpar@9
|
380 /* retrieve row type */
|
alpar@9
|
381
|
alpar@9
|
382 double glp_get_row_lb(glp_prob *P, int i);
|
alpar@9
|
383 /* retrieve row lower bound */
|
alpar@9
|
384
|
alpar@9
|
385 double glp_get_row_ub(glp_prob *P, int i);
|
alpar@9
|
386 /* retrieve row upper bound */
|
alpar@9
|
387
|
alpar@9
|
388 int glp_get_col_type(glp_prob *P, int j);
|
alpar@9
|
389 /* retrieve column type */
|
alpar@9
|
390
|
alpar@9
|
391 double glp_get_col_lb(glp_prob *P, int j);
|
alpar@9
|
392 /* retrieve column lower bound */
|
alpar@9
|
393
|
alpar@9
|
394 double glp_get_col_ub(glp_prob *P, int j);
|
alpar@9
|
395 /* retrieve column upper bound */
|
alpar@9
|
396
|
alpar@9
|
397 double glp_get_obj_coef(glp_prob *P, int j);
|
alpar@9
|
398 /* retrieve obj. coefficient or constant term */
|
alpar@9
|
399
|
alpar@9
|
400 int glp_get_num_nz(glp_prob *P);
|
alpar@9
|
401 /* retrieve number of constraint coefficients */
|
alpar@9
|
402
|
alpar@9
|
403 int glp_get_mat_row(glp_prob *P, int i, int ind[], double val[]);
|
alpar@9
|
404 /* retrieve row of the constraint matrix */
|
alpar@9
|
405
|
alpar@9
|
406 int glp_get_mat_col(glp_prob *P, int j, int ind[], double val[]);
|
alpar@9
|
407 /* retrieve column of the constraint matrix */
|
alpar@9
|
408
|
alpar@9
|
409 void glp_create_index(glp_prob *P);
|
alpar@9
|
410 /* create the name index */
|
alpar@9
|
411
|
alpar@9
|
412 int glp_find_row(glp_prob *P, const char *name);
|
alpar@9
|
413 /* find row by its name */
|
alpar@9
|
414
|
alpar@9
|
415 int glp_find_col(glp_prob *P, const char *name);
|
alpar@9
|
416 /* find column by its name */
|
alpar@9
|
417
|
alpar@9
|
418 void glp_delete_index(glp_prob *P);
|
alpar@9
|
419 /* delete the name index */
|
alpar@9
|
420
|
alpar@9
|
421 void glp_set_rii(glp_prob *P, int i, double rii);
|
alpar@9
|
422 /* set (change) row scale factor */
|
alpar@9
|
423
|
alpar@9
|
424 void glp_set_sjj(glp_prob *P, int j, double sjj);
|
alpar@9
|
425 /* set (change) column scale factor */
|
alpar@9
|
426
|
alpar@9
|
427 double glp_get_rii(glp_prob *P, int i);
|
alpar@9
|
428 /* retrieve row scale factor */
|
alpar@9
|
429
|
alpar@9
|
430 double glp_get_sjj(glp_prob *P, int j);
|
alpar@9
|
431 /* retrieve column scale factor */
|
alpar@9
|
432
|
alpar@9
|
433 void glp_scale_prob(glp_prob *P, int flags);
|
alpar@9
|
434 /* scale problem data */
|
alpar@9
|
435
|
alpar@9
|
436 void glp_unscale_prob(glp_prob *P);
|
alpar@9
|
437 /* unscale problem data */
|
alpar@9
|
438
|
alpar@9
|
439 void glp_set_row_stat(glp_prob *P, int i, int stat);
|
alpar@9
|
440 /* set (change) row status */
|
alpar@9
|
441
|
alpar@9
|
442 void glp_set_col_stat(glp_prob *P, int j, int stat);
|
alpar@9
|
443 /* set (change) column status */
|
alpar@9
|
444
|
alpar@9
|
445 void glp_std_basis(glp_prob *P);
|
alpar@9
|
446 /* construct standard initial LP basis */
|
alpar@9
|
447
|
alpar@9
|
448 void glp_adv_basis(glp_prob *P, int flags);
|
alpar@9
|
449 /* construct advanced initial LP basis */
|
alpar@9
|
450
|
alpar@9
|
451 void glp_cpx_basis(glp_prob *P);
|
alpar@9
|
452 /* construct Bixby's initial LP basis */
|
alpar@9
|
453
|
alpar@9
|
454 int glp_simplex(glp_prob *P, const glp_smcp *parm);
|
alpar@9
|
455 /* solve LP problem with the simplex method */
|
alpar@9
|
456
|
alpar@9
|
457 int glp_exact(glp_prob *P, const glp_smcp *parm);
|
alpar@9
|
458 /* solve LP problem in exact arithmetic */
|
alpar@9
|
459
|
alpar@9
|
460 void glp_init_smcp(glp_smcp *parm);
|
alpar@9
|
461 /* initialize simplex method control parameters */
|
alpar@9
|
462
|
alpar@9
|
463 int glp_get_status(glp_prob *P);
|
alpar@9
|
464 /* retrieve generic status of basic solution */
|
alpar@9
|
465
|
alpar@9
|
466 int glp_get_prim_stat(glp_prob *P);
|
alpar@9
|
467 /* retrieve status of primal basic solution */
|
alpar@9
|
468
|
alpar@9
|
469 int glp_get_dual_stat(glp_prob *P);
|
alpar@9
|
470 /* retrieve status of dual basic solution */
|
alpar@9
|
471
|
alpar@9
|
472 double glp_get_obj_val(glp_prob *P);
|
alpar@9
|
473 /* retrieve objective value (basic solution) */
|
alpar@9
|
474
|
alpar@9
|
475 int glp_get_row_stat(glp_prob *P, int i);
|
alpar@9
|
476 /* retrieve row status */
|
alpar@9
|
477
|
alpar@9
|
478 double glp_get_row_prim(glp_prob *P, int i);
|
alpar@9
|
479 /* retrieve row primal value (basic solution) */
|
alpar@9
|
480
|
alpar@9
|
481 double glp_get_row_dual(glp_prob *P, int i);
|
alpar@9
|
482 /* retrieve row dual value (basic solution) */
|
alpar@9
|
483
|
alpar@9
|
484 int glp_get_col_stat(glp_prob *P, int j);
|
alpar@9
|
485 /* retrieve column status */
|
alpar@9
|
486
|
alpar@9
|
487 double glp_get_col_prim(glp_prob *P, int j);
|
alpar@9
|
488 /* retrieve column primal value (basic solution) */
|
alpar@9
|
489
|
alpar@9
|
490 double glp_get_col_dual(glp_prob *P, int j);
|
alpar@9
|
491 /* retrieve column dual value (basic solution) */
|
alpar@9
|
492
|
alpar@9
|
493 int glp_get_unbnd_ray(glp_prob *P);
|
alpar@9
|
494 /* determine variable causing unboundedness */
|
alpar@9
|
495
|
alpar@9
|
496 int glp_interior(glp_prob *P, const glp_iptcp *parm);
|
alpar@9
|
497 /* solve LP problem with the interior-point method */
|
alpar@9
|
498
|
alpar@9
|
499 void glp_init_iptcp(glp_iptcp *parm);
|
alpar@9
|
500 /* initialize interior-point solver control parameters */
|
alpar@9
|
501
|
alpar@9
|
502 int glp_ipt_status(glp_prob *P);
|
alpar@9
|
503 /* retrieve status of interior-point solution */
|
alpar@9
|
504
|
alpar@9
|
505 double glp_ipt_obj_val(glp_prob *P);
|
alpar@9
|
506 /* retrieve objective value (interior point) */
|
alpar@9
|
507
|
alpar@9
|
508 double glp_ipt_row_prim(glp_prob *P, int i);
|
alpar@9
|
509 /* retrieve row primal value (interior point) */
|
alpar@9
|
510
|
alpar@9
|
511 double glp_ipt_row_dual(glp_prob *P, int i);
|
alpar@9
|
512 /* retrieve row dual value (interior point) */
|
alpar@9
|
513
|
alpar@9
|
514 double glp_ipt_col_prim(glp_prob *P, int j);
|
alpar@9
|
515 /* retrieve column primal value (interior point) */
|
alpar@9
|
516
|
alpar@9
|
517 double glp_ipt_col_dual(glp_prob *P, int j);
|
alpar@9
|
518 /* retrieve column dual value (interior point) */
|
alpar@9
|
519
|
alpar@9
|
520 void glp_set_col_kind(glp_prob *P, int j, int kind);
|
alpar@9
|
521 /* set (change) column kind */
|
alpar@9
|
522
|
alpar@9
|
523 int glp_get_col_kind(glp_prob *P, int j);
|
alpar@9
|
524 /* retrieve column kind */
|
alpar@9
|
525
|
alpar@9
|
526 int glp_get_num_int(glp_prob *P);
|
alpar@9
|
527 /* retrieve number of integer columns */
|
alpar@9
|
528
|
alpar@9
|
529 int glp_get_num_bin(glp_prob *P);
|
alpar@9
|
530 /* retrieve number of binary columns */
|
alpar@9
|
531
|
alpar@9
|
532 int glp_intopt(glp_prob *P, const glp_iocp *parm);
|
alpar@9
|
533 /* solve MIP problem with the branch-and-bound method */
|
alpar@9
|
534
|
alpar@9
|
535 void glp_init_iocp(glp_iocp *parm);
|
alpar@9
|
536 /* initialize integer optimizer control parameters */
|
alpar@9
|
537
|
alpar@9
|
538 int glp_mip_status(glp_prob *P);
|
alpar@9
|
539 /* retrieve status of MIP solution */
|
alpar@9
|
540
|
alpar@9
|
541 double glp_mip_obj_val(glp_prob *P);
|
alpar@9
|
542 /* retrieve objective value (MIP solution) */
|
alpar@9
|
543
|
alpar@9
|
544 double glp_mip_row_val(glp_prob *P, int i);
|
alpar@9
|
545 /* retrieve row value (MIP solution) */
|
alpar@9
|
546
|
alpar@9
|
547 double glp_mip_col_val(glp_prob *P, int j);
|
alpar@9
|
548 /* retrieve column value (MIP solution) */
|
alpar@9
|
549
|
alpar@9
|
550 int glp_print_sol(glp_prob *P, const char *fname);
|
alpar@9
|
551 /* write basic solution in printable format */
|
alpar@9
|
552
|
alpar@9
|
553 int glp_read_sol(glp_prob *P, const char *fname);
|
alpar@9
|
554 /* read basic solution from text file */
|
alpar@9
|
555
|
alpar@9
|
556 int glp_write_sol(glp_prob *P, const char *fname);
|
alpar@9
|
557 /* write basic solution to text file */
|
alpar@9
|
558
|
alpar@9
|
559 int glp_print_ranges(glp_prob *P, int len, const int list[],
|
alpar@9
|
560 int flags, const char *fname);
|
alpar@9
|
561 /* print sensitivity analysis report */
|
alpar@9
|
562
|
alpar@9
|
563 int glp_print_ipt(glp_prob *P, const char *fname);
|
alpar@9
|
564 /* write interior-point solution in printable format */
|
alpar@9
|
565
|
alpar@9
|
566 int glp_read_ipt(glp_prob *P, const char *fname);
|
alpar@9
|
567 /* read interior-point solution from text file */
|
alpar@9
|
568
|
alpar@9
|
569 int glp_write_ipt(glp_prob *P, const char *fname);
|
alpar@9
|
570 /* write interior-point solution to text file */
|
alpar@9
|
571
|
alpar@9
|
572 int glp_print_mip(glp_prob *P, const char *fname);
|
alpar@9
|
573 /* write MIP solution in printable format */
|
alpar@9
|
574
|
alpar@9
|
575 int glp_read_mip(glp_prob *P, const char *fname);
|
alpar@9
|
576 /* read MIP solution from text file */
|
alpar@9
|
577
|
alpar@9
|
578 int glp_write_mip(glp_prob *P, const char *fname);
|
alpar@9
|
579 /* write MIP solution to text file */
|
alpar@9
|
580
|
alpar@9
|
581 int glp_bf_exists(glp_prob *P);
|
alpar@9
|
582 /* check if the basis factorization exists */
|
alpar@9
|
583
|
alpar@9
|
584 int glp_factorize(glp_prob *P);
|
alpar@9
|
585 /* compute the basis factorization */
|
alpar@9
|
586
|
alpar@9
|
587 int glp_bf_updated(glp_prob *P);
|
alpar@9
|
588 /* check if the basis factorization has been updated */
|
alpar@9
|
589
|
alpar@9
|
590 void glp_get_bfcp(glp_prob *P, glp_bfcp *parm);
|
alpar@9
|
591 /* retrieve basis factorization control parameters */
|
alpar@9
|
592
|
alpar@9
|
593 void glp_set_bfcp(glp_prob *P, const glp_bfcp *parm);
|
alpar@9
|
594 /* change basis factorization control parameters */
|
alpar@9
|
595
|
alpar@9
|
596 int glp_get_bhead(glp_prob *P, int k);
|
alpar@9
|
597 /* retrieve the basis header information */
|
alpar@9
|
598
|
alpar@9
|
599 int glp_get_row_bind(glp_prob *P, int i);
|
alpar@9
|
600 /* retrieve row index in the basis header */
|
alpar@9
|
601
|
alpar@9
|
602 int glp_get_col_bind(glp_prob *P, int j);
|
alpar@9
|
603 /* retrieve column index in the basis header */
|
alpar@9
|
604
|
alpar@9
|
605 void glp_ftran(glp_prob *P, double x[]);
|
alpar@9
|
606 /* perform forward transformation (solve system B*x = b) */
|
alpar@9
|
607
|
alpar@9
|
608 void glp_btran(glp_prob *P, double x[]);
|
alpar@9
|
609 /* perform backward transformation (solve system B'*x = b) */
|
alpar@9
|
610
|
alpar@9
|
611 int glp_warm_up(glp_prob *P);
|
alpar@9
|
612 /* "warm up" LP basis */
|
alpar@9
|
613
|
alpar@9
|
614 int glp_eval_tab_row(glp_prob *P, int k, int ind[], double val[]);
|
alpar@9
|
615 /* compute row of the simplex tableau */
|
alpar@9
|
616
|
alpar@9
|
617 int glp_eval_tab_col(glp_prob *P, int k, int ind[], double val[]);
|
alpar@9
|
618 /* compute column of the simplex tableau */
|
alpar@9
|
619
|
alpar@9
|
620 int glp_transform_row(glp_prob *P, int len, int ind[], double val[]);
|
alpar@9
|
621 /* transform explicitly specified row */
|
alpar@9
|
622
|
alpar@9
|
623 int glp_transform_col(glp_prob *P, int len, int ind[], double val[]);
|
alpar@9
|
624 /* transform explicitly specified column */
|
alpar@9
|
625
|
alpar@9
|
626 int glp_prim_rtest(glp_prob *P, int len, const int ind[],
|
alpar@9
|
627 const double val[], int dir, double eps);
|
alpar@9
|
628 /* perform primal ratio test */
|
alpar@9
|
629
|
alpar@9
|
630 int glp_dual_rtest(glp_prob *P, int len, const int ind[],
|
alpar@9
|
631 const double val[], int dir, double eps);
|
alpar@9
|
632 /* perform dual ratio test */
|
alpar@9
|
633
|
alpar@9
|
634 void glp_analyze_bound(glp_prob *P, int k, double *value1, int *var1,
|
alpar@9
|
635 double *value2, int *var2);
|
alpar@9
|
636 /* analyze active bound of non-basic variable */
|
alpar@9
|
637
|
alpar@9
|
638 void glp_analyze_coef(glp_prob *P, int k, double *coef1, int *var1,
|
alpar@9
|
639 double *value1, double *coef2, int *var2, double *value2);
|
alpar@9
|
640 /* analyze objective coefficient at basic variable */
|
alpar@9
|
641
|
alpar@9
|
642 int glp_ios_reason(glp_tree *T);
|
alpar@9
|
643 /* determine reason for calling the callback routine */
|
alpar@9
|
644
|
alpar@9
|
645 glp_prob *glp_ios_get_prob(glp_tree *T);
|
alpar@9
|
646 /* access the problem object */
|
alpar@9
|
647
|
alpar@9
|
648 void glp_ios_tree_size(glp_tree *T, int *a_cnt, int *n_cnt,
|
alpar@9
|
649 int *t_cnt);
|
alpar@9
|
650 /* determine size of the branch-and-bound tree */
|
alpar@9
|
651
|
alpar@9
|
652 int glp_ios_curr_node(glp_tree *T);
|
alpar@9
|
653 /* determine current active subproblem */
|
alpar@9
|
654
|
alpar@9
|
655 int glp_ios_next_node(glp_tree *T, int p);
|
alpar@9
|
656 /* determine next active subproblem */
|
alpar@9
|
657
|
alpar@9
|
658 int glp_ios_prev_node(glp_tree *T, int p);
|
alpar@9
|
659 /* determine previous active subproblem */
|
alpar@9
|
660
|
alpar@9
|
661 int glp_ios_up_node(glp_tree *T, int p);
|
alpar@9
|
662 /* determine parent subproblem */
|
alpar@9
|
663
|
alpar@9
|
664 int glp_ios_node_level(glp_tree *T, int p);
|
alpar@9
|
665 /* determine subproblem level */
|
alpar@9
|
666
|
alpar@9
|
667 double glp_ios_node_bound(glp_tree *T, int p);
|
alpar@9
|
668 /* determine subproblem local bound */
|
alpar@9
|
669
|
alpar@9
|
670 int glp_ios_best_node(glp_tree *T);
|
alpar@9
|
671 /* find active subproblem with best local bound */
|
alpar@9
|
672
|
alpar@9
|
673 double glp_ios_mip_gap(glp_tree *T);
|
alpar@9
|
674 /* compute relative MIP gap */
|
alpar@9
|
675
|
alpar@9
|
676 void *glp_ios_node_data(glp_tree *T, int p);
|
alpar@9
|
677 /* access subproblem application-specific data */
|
alpar@9
|
678
|
alpar@9
|
679 void glp_ios_row_attr(glp_tree *T, int i, glp_attr *attr);
|
alpar@9
|
680 /* retrieve additional row attributes */
|
alpar@9
|
681
|
alpar@9
|
682 int glp_ios_pool_size(glp_tree *T);
|
alpar@9
|
683 /* determine current size of the cut pool */
|
alpar@9
|
684
|
alpar@9
|
685 int glp_ios_add_row(glp_tree *T,
|
alpar@9
|
686 const char *name, int klass, int flags, int len, const int ind[],
|
alpar@9
|
687 const double val[], int type, double rhs);
|
alpar@9
|
688 /* add row (constraint) to the cut pool */
|
alpar@9
|
689
|
alpar@9
|
690 void glp_ios_del_row(glp_tree *T, int i);
|
alpar@9
|
691 /* remove row (constraint) from the cut pool */
|
alpar@9
|
692
|
alpar@9
|
693 void glp_ios_clear_pool(glp_tree *T);
|
alpar@9
|
694 /* remove all rows (constraints) from the cut pool */
|
alpar@9
|
695
|
alpar@9
|
696 int glp_ios_can_branch(glp_tree *T, int j);
|
alpar@9
|
697 /* check if can branch upon specified variable */
|
alpar@9
|
698
|
alpar@9
|
699 void glp_ios_branch_upon(glp_tree *T, int j, int sel);
|
alpar@9
|
700 /* choose variable to branch upon */
|
alpar@9
|
701
|
alpar@9
|
702 void glp_ios_select_node(glp_tree *T, int p);
|
alpar@9
|
703 /* select subproblem to continue the search */
|
alpar@9
|
704
|
alpar@9
|
705 int glp_ios_heur_sol(glp_tree *T, const double x[]);
|
alpar@9
|
706 /* provide solution found by heuristic */
|
alpar@9
|
707
|
alpar@9
|
708 void glp_ios_terminate(glp_tree *T);
|
alpar@9
|
709 /* terminate the solution process */
|
alpar@9
|
710
|
alpar@9
|
711 void glp_init_mpscp(glp_mpscp *parm);
|
alpar@9
|
712 /* initialize MPS format control parameters */
|
alpar@9
|
713
|
alpar@9
|
714 int glp_read_mps(glp_prob *P, int fmt, const glp_mpscp *parm,
|
alpar@9
|
715 const char *fname);
|
alpar@9
|
716 /* read problem data in MPS format */
|
alpar@9
|
717
|
alpar@9
|
718 int glp_write_mps(glp_prob *P, int fmt, const glp_mpscp *parm,
|
alpar@9
|
719 const char *fname);
|
alpar@9
|
720 /* write problem data in MPS format */
|
alpar@9
|
721
|
alpar@9
|
722 void glp_init_cpxcp(glp_cpxcp *parm);
|
alpar@9
|
723 /* initialize CPLEX LP format control parameters */
|
alpar@9
|
724
|
alpar@9
|
725 int glp_read_lp(glp_prob *P, const glp_cpxcp *parm, const char *fname);
|
alpar@9
|
726 /* read problem data in CPLEX LP format */
|
alpar@9
|
727
|
alpar@9
|
728 int glp_write_lp(glp_prob *P, const glp_cpxcp *parm, const char *fname);
|
alpar@9
|
729 /* write problem data in CPLEX LP format */
|
alpar@9
|
730
|
alpar@9
|
731 int glp_read_prob(glp_prob *P, int flags, const char *fname);
|
alpar@9
|
732 /* read problem data in GLPK format */
|
alpar@9
|
733
|
alpar@9
|
734 int glp_write_prob(glp_prob *P, int flags, const char *fname);
|
alpar@9
|
735 /* write problem data in GLPK format */
|
alpar@9
|
736
|
alpar@9
|
737 glp_tran *glp_mpl_alloc_wksp(void);
|
alpar@9
|
738 /* allocate the MathProg translator workspace */
|
alpar@9
|
739
|
alpar@9
|
740 int glp_mpl_read_model(glp_tran *tran, const char *fname, int skip);
|
alpar@9
|
741 /* read and translate model section */
|
alpar@9
|
742
|
alpar@9
|
743 int glp_mpl_read_data(glp_tran *tran, const char *fname);
|
alpar@9
|
744 /* read and translate data section */
|
alpar@9
|
745
|
alpar@9
|
746 int glp_mpl_generate(glp_tran *tran, const char *fname);
|
alpar@9
|
747 /* generate the model */
|
alpar@9
|
748
|
alpar@9
|
749 void glp_mpl_build_prob(glp_tran *tran, glp_prob *prob);
|
alpar@9
|
750 /* build LP/MIP problem instance from the model */
|
alpar@9
|
751
|
alpar@9
|
752 int glp_mpl_postsolve(glp_tran *tran, glp_prob *prob, int sol);
|
alpar@9
|
753 /* postsolve the model */
|
alpar@9
|
754
|
alpar@9
|
755 void glp_mpl_free_wksp(glp_tran *tran);
|
alpar@9
|
756 /* free the MathProg translator workspace */
|
alpar@9
|
757
|
alpar@9
|
758 int glp_main(int argc, const char *argv[]);
|
alpar@9
|
759 /* stand-alone LP/MIP solver */
|
alpar@9
|
760
|
alpar@9
|
761 /**********************************************************************/
|
alpar@9
|
762
|
alpar@9
|
763 int glp_read_cnfsat(glp_prob *P, const char *fname);
|
alpar@9
|
764 /* read CNF-SAT problem data in DIMACS format */
|
alpar@9
|
765
|
alpar@9
|
766 int glp_check_cnfsat(glp_prob *P);
|
alpar@9
|
767 /* check for CNF-SAT problem instance */
|
alpar@9
|
768
|
alpar@9
|
769 int glp_write_cnfsat(glp_prob *P, const char *fname);
|
alpar@9
|
770 /* write CNF-SAT problem data in DIMACS format */
|
alpar@9
|
771
|
alpar@9
|
772 int glp_minisat1(glp_prob *P);
|
alpar@9
|
773 /* solve CNF-SAT problem with MiniSat solver */
|
alpar@9
|
774
|
alpar@9
|
775 int glp_intfeas1(glp_prob *P, int use_bound, int obj_bound);
|
alpar@9
|
776 /* solve integer feasibility problem */
|
alpar@9
|
777
|
alpar@9
|
778 /**********************************************************************/
|
alpar@9
|
779
|
alpar@9
|
780 #ifndef GLP_LONG_DEFINED
|
alpar@9
|
781 #define GLP_LONG_DEFINED
|
alpar@9
|
782 typedef struct { int lo, hi; } glp_long;
|
alpar@9
|
783 /* long integer data type */
|
alpar@9
|
784 #endif
|
alpar@9
|
785
|
alpar@9
|
786 int glp_init_env(void);
|
alpar@9
|
787 /* initialize GLPK environment */
|
alpar@9
|
788
|
alpar@9
|
789 const char *glp_version(void);
|
alpar@9
|
790 /* determine library version */
|
alpar@9
|
791
|
alpar@9
|
792 int glp_free_env(void);
|
alpar@9
|
793 /* free GLPK environment */
|
alpar@9
|
794
|
alpar@9
|
795 void glp_printf(const char *fmt, ...);
|
alpar@9
|
796 /* write formatted output to terminal */
|
alpar@9
|
797
|
alpar@9
|
798 void glp_vprintf(const char *fmt, va_list arg);
|
alpar@9
|
799 /* write formatted output to terminal */
|
alpar@9
|
800
|
alpar@9
|
801 int glp_term_out(int flag);
|
alpar@9
|
802 /* enable/disable terminal output */
|
alpar@9
|
803
|
alpar@9
|
804 void glp_term_hook(int (*func)(void *info, const char *s), void *info);
|
alpar@9
|
805 /* install hook to intercept terminal output */
|
alpar@9
|
806
|
alpar@9
|
807 int glp_open_tee(const char *fname);
|
alpar@9
|
808 /* start copying terminal output to text file */
|
alpar@9
|
809
|
alpar@9
|
810 int glp_close_tee(void);
|
alpar@9
|
811 /* stop copying terminal output to text file */
|
alpar@9
|
812
|
alpar@9
|
813 #ifndef GLP_ERROR_DEFINED
|
alpar@9
|
814 #define GLP_ERROR_DEFINED
|
alpar@9
|
815 typedef void (*_glp_error)(const char *fmt, ...);
|
alpar@9
|
816 #endif
|
alpar@9
|
817
|
alpar@9
|
818 #define glp_error glp_error_(__FILE__, __LINE__)
|
alpar@9
|
819 _glp_error glp_error_(const char *file, int line);
|
alpar@9
|
820 /* display error message and terminate execution */
|
alpar@9
|
821
|
alpar@9
|
822 #define glp_assert(expr) \
|
alpar@9
|
823 ((void)((expr) || (glp_assert_(#expr, __FILE__, __LINE__), 1)))
|
alpar@9
|
824 void glp_assert_(const char *expr, const char *file, int line);
|
alpar@9
|
825 /* check for logical condition */
|
alpar@9
|
826
|
alpar@9
|
827 void glp_error_hook(void (*func)(void *info), void *info);
|
alpar@9
|
828 /* install hook to intercept abnormal termination */
|
alpar@9
|
829
|
alpar@9
|
830 void *glp_malloc(int size);
|
alpar@9
|
831 /* allocate memory block */
|
alpar@9
|
832
|
alpar@9
|
833 void *glp_calloc(int n, int size);
|
alpar@9
|
834 /* allocate memory block */
|
alpar@9
|
835
|
alpar@9
|
836 void glp_free(void *ptr);
|
alpar@9
|
837 /* free memory block */
|
alpar@9
|
838
|
alpar@9
|
839 void glp_mem_limit(int limit);
|
alpar@9
|
840 /* set memory usage limit */
|
alpar@9
|
841
|
alpar@9
|
842 void glp_mem_usage(int *count, int *cpeak, glp_long *total,
|
alpar@9
|
843 glp_long *tpeak);
|
alpar@9
|
844 /* get memory usage information */
|
alpar@9
|
845
|
alpar@9
|
846 glp_long glp_time(void);
|
alpar@9
|
847 /* determine current universal time */
|
alpar@9
|
848
|
alpar@9
|
849 double glp_difftime(glp_long t1, glp_long t0);
|
alpar@9
|
850 /* compute difference between two time values */
|
alpar@9
|
851
|
alpar@9
|
852 /**********************************************************************/
|
alpar@9
|
853
|
alpar@9
|
854 #ifndef GLP_DATA_DEFINED
|
alpar@9
|
855 #define GLP_DATA_DEFINED
|
alpar@9
|
856 typedef struct { double _opaque_data[100]; } glp_data;
|
alpar@9
|
857 /* plain data file */
|
alpar@9
|
858 #endif
|
alpar@9
|
859
|
alpar@9
|
860 glp_data *glp_sdf_open_file(const char *fname);
|
alpar@9
|
861 /* open plain data file */
|
alpar@9
|
862
|
alpar@9
|
863 void glp_sdf_set_jump(glp_data *data, void *jump);
|
alpar@9
|
864 /* set up error handling */
|
alpar@9
|
865
|
alpar@9
|
866 void glp_sdf_error(glp_data *data, const char *fmt, ...);
|
alpar@9
|
867 /* print error message */
|
alpar@9
|
868
|
alpar@9
|
869 void glp_sdf_warning(glp_data *data, const char *fmt, ...);
|
alpar@9
|
870 /* print warning message */
|
alpar@9
|
871
|
alpar@9
|
872 int glp_sdf_read_int(glp_data *data);
|
alpar@9
|
873 /* read integer number */
|
alpar@9
|
874
|
alpar@9
|
875 double glp_sdf_read_num(glp_data *data);
|
alpar@9
|
876 /* read floating-point number */
|
alpar@9
|
877
|
alpar@9
|
878 const char *glp_sdf_read_item(glp_data *data);
|
alpar@9
|
879 /* read data item */
|
alpar@9
|
880
|
alpar@9
|
881 const char *glp_sdf_read_text(glp_data *data);
|
alpar@9
|
882 /* read text until end of line */
|
alpar@9
|
883
|
alpar@9
|
884 int glp_sdf_line(glp_data *data);
|
alpar@9
|
885 /* determine current line number */
|
alpar@9
|
886
|
alpar@9
|
887 void glp_sdf_close_file(glp_data *data);
|
alpar@9
|
888 /* close plain data file */
|
alpar@9
|
889
|
alpar@9
|
890 /**********************************************************************/
|
alpar@9
|
891
|
alpar@9
|
892 typedef struct _glp_graph glp_graph;
|
alpar@9
|
893 typedef struct _glp_vertex glp_vertex;
|
alpar@9
|
894 typedef struct _glp_arc glp_arc;
|
alpar@9
|
895
|
alpar@9
|
896 struct _glp_graph
|
alpar@9
|
897 { /* graph descriptor */
|
alpar@9
|
898 void *pool; /* DMP *pool; */
|
alpar@9
|
899 /* memory pool to store graph components */
|
alpar@9
|
900 char *name;
|
alpar@9
|
901 /* graph name (1 to 255 chars); NULL means no name is assigned
|
alpar@9
|
902 to the graph */
|
alpar@9
|
903 int nv_max;
|
alpar@9
|
904 /* length of the vertex list (enlarged automatically) */
|
alpar@9
|
905 int nv;
|
alpar@9
|
906 /* number of vertices in the graph, 0 <= nv <= nv_max */
|
alpar@9
|
907 int na;
|
alpar@9
|
908 /* number of arcs in the graph, na >= 0 */
|
alpar@9
|
909 glp_vertex **v; /* glp_vertex *v[1+nv_max]; */
|
alpar@9
|
910 /* v[i], 1 <= i <= nv, is a pointer to i-th vertex */
|
alpar@9
|
911 void *index; /* AVL *index; */
|
alpar@9
|
912 /* vertex index to find vertices by their names; NULL means the
|
alpar@9
|
913 index does not exist */
|
alpar@9
|
914 int v_size;
|
alpar@9
|
915 /* size of data associated with each vertex (0 to 256 bytes) */
|
alpar@9
|
916 int a_size;
|
alpar@9
|
917 /* size of data associated with each arc (0 to 256 bytes) */
|
alpar@9
|
918 };
|
alpar@9
|
919
|
alpar@9
|
920 struct _glp_vertex
|
alpar@9
|
921 { /* vertex descriptor */
|
alpar@9
|
922 int i;
|
alpar@9
|
923 /* vertex ordinal number, 1 <= i <= nv */
|
alpar@9
|
924 char *name;
|
alpar@9
|
925 /* vertex name (1 to 255 chars); NULL means no name is assigned
|
alpar@9
|
926 to the vertex */
|
alpar@9
|
927 void *entry; /* AVLNODE *entry; */
|
alpar@9
|
928 /* pointer to corresponding entry in the vertex index; NULL means
|
alpar@9
|
929 that either the index does not exist or the vertex has no name
|
alpar@9
|
930 assigned */
|
alpar@9
|
931 void *data;
|
alpar@9
|
932 /* pointer to data associated with the vertex */
|
alpar@9
|
933 void *temp;
|
alpar@9
|
934 /* working pointer */
|
alpar@9
|
935 glp_arc *in;
|
alpar@9
|
936 /* pointer to the (unordered) list of incoming arcs */
|
alpar@9
|
937 glp_arc *out;
|
alpar@9
|
938 /* pointer to the (unordered) list of outgoing arcs */
|
alpar@9
|
939 };
|
alpar@9
|
940
|
alpar@9
|
941 struct _glp_arc
|
alpar@9
|
942 { /* arc descriptor */
|
alpar@9
|
943 glp_vertex *tail;
|
alpar@9
|
944 /* pointer to the tail endpoint */
|
alpar@9
|
945 glp_vertex *head;
|
alpar@9
|
946 /* pointer to the head endpoint */
|
alpar@9
|
947 void *data;
|
alpar@9
|
948 /* pointer to data associated with the arc */
|
alpar@9
|
949 void *temp;
|
alpar@9
|
950 /* working pointer */
|
alpar@9
|
951 glp_arc *t_prev;
|
alpar@9
|
952 /* pointer to previous arc having the same tail endpoint */
|
alpar@9
|
953 glp_arc *t_next;
|
alpar@9
|
954 /* pointer to next arc having the same tail endpoint */
|
alpar@9
|
955 glp_arc *h_prev;
|
alpar@9
|
956 /* pointer to previous arc having the same head endpoint */
|
alpar@9
|
957 glp_arc *h_next;
|
alpar@9
|
958 /* pointer to next arc having the same head endpoint */
|
alpar@9
|
959 };
|
alpar@9
|
960
|
alpar@9
|
961 glp_graph *glp_create_graph(int v_size, int a_size);
|
alpar@9
|
962 /* create graph */
|
alpar@9
|
963
|
alpar@9
|
964 void glp_set_graph_name(glp_graph *G, const char *name);
|
alpar@9
|
965 /* assign (change) graph name */
|
alpar@9
|
966
|
alpar@9
|
967 int glp_add_vertices(glp_graph *G, int nadd);
|
alpar@9
|
968 /* add new vertices to graph */
|
alpar@9
|
969
|
alpar@9
|
970 void glp_set_vertex_name(glp_graph *G, int i, const char *name);
|
alpar@9
|
971 /* assign (change) vertex name */
|
alpar@9
|
972
|
alpar@9
|
973 glp_arc *glp_add_arc(glp_graph *G, int i, int j);
|
alpar@9
|
974 /* add new arc to graph */
|
alpar@9
|
975
|
alpar@9
|
976 void glp_del_vertices(glp_graph *G, int ndel, const int num[]);
|
alpar@9
|
977 /* delete vertices from graph */
|
alpar@9
|
978
|
alpar@9
|
979 void glp_del_arc(glp_graph *G, glp_arc *a);
|
alpar@9
|
980 /* delete arc from graph */
|
alpar@9
|
981
|
alpar@9
|
982 void glp_erase_graph(glp_graph *G, int v_size, int a_size);
|
alpar@9
|
983 /* erase graph content */
|
alpar@9
|
984
|
alpar@9
|
985 void glp_delete_graph(glp_graph *G);
|
alpar@9
|
986 /* delete graph */
|
alpar@9
|
987
|
alpar@9
|
988 void glp_create_v_index(glp_graph *G);
|
alpar@9
|
989 /* create vertex name index */
|
alpar@9
|
990
|
alpar@9
|
991 int glp_find_vertex(glp_graph *G, const char *name);
|
alpar@9
|
992 /* find vertex by its name */
|
alpar@9
|
993
|
alpar@9
|
994 void glp_delete_v_index(glp_graph *G);
|
alpar@9
|
995 /* delete vertex name index */
|
alpar@9
|
996
|
alpar@9
|
997 int glp_read_graph(glp_graph *G, const char *fname);
|
alpar@9
|
998 /* read graph from plain text file */
|
alpar@9
|
999
|
alpar@9
|
1000 int glp_write_graph(glp_graph *G, const char *fname);
|
alpar@9
|
1001 /* write graph to plain text file */
|
alpar@9
|
1002
|
alpar@9
|
1003 void glp_mincost_lp(glp_prob *P, glp_graph *G, int names, int v_rhs,
|
alpar@9
|
1004 int a_low, int a_cap, int a_cost);
|
alpar@9
|
1005 /* convert minimum cost flow problem to LP */
|
alpar@9
|
1006
|
alpar@9
|
1007 int glp_mincost_okalg(glp_graph *G, int v_rhs, int a_low, int a_cap,
|
alpar@9
|
1008 int a_cost, double *sol, int a_x, int v_pi);
|
alpar@9
|
1009 /* find minimum-cost flow with out-of-kilter algorithm */
|
alpar@9
|
1010
|
alpar@9
|
1011 void glp_maxflow_lp(glp_prob *P, glp_graph *G, int names, int s,
|
alpar@9
|
1012 int t, int a_cap);
|
alpar@9
|
1013 /* convert maximum flow problem to LP */
|
alpar@9
|
1014
|
alpar@9
|
1015 int glp_maxflow_ffalg(glp_graph *G, int s, int t, int a_cap,
|
alpar@9
|
1016 double *sol, int a_x, int v_cut);
|
alpar@9
|
1017 /* find maximal flow with Ford-Fulkerson algorithm */
|
alpar@9
|
1018
|
alpar@9
|
1019 int glp_check_asnprob(glp_graph *G, int v_set);
|
alpar@9
|
1020 /* check correctness of assignment problem data */
|
alpar@9
|
1021
|
alpar@9
|
1022 /* assignment problem formulation: */
|
alpar@9
|
1023 #define GLP_ASN_MIN 1 /* perfect matching (minimization) */
|
alpar@9
|
1024 #define GLP_ASN_MAX 2 /* perfect matching (maximization) */
|
alpar@9
|
1025 #define GLP_ASN_MMP 3 /* maximum matching */
|
alpar@9
|
1026
|
alpar@9
|
1027 int glp_asnprob_lp(glp_prob *P, int form, glp_graph *G, int names,
|
alpar@9
|
1028 int v_set, int a_cost);
|
alpar@9
|
1029 /* convert assignment problem to LP */
|
alpar@9
|
1030
|
alpar@9
|
1031 int glp_asnprob_okalg(int form, glp_graph *G, int v_set, int a_cost,
|
alpar@9
|
1032 double *sol, int a_x);
|
alpar@9
|
1033 /* solve assignment problem with out-of-kilter algorithm */
|
alpar@9
|
1034
|
alpar@9
|
1035 int glp_asnprob_hall(glp_graph *G, int v_set, int a_x);
|
alpar@9
|
1036 /* find bipartite matching of maximum cardinality */
|
alpar@9
|
1037
|
alpar@9
|
1038 double glp_cpp(glp_graph *G, int v_t, int v_es, int v_ls);
|
alpar@9
|
1039 /* solve critical path problem */
|
alpar@9
|
1040
|
alpar@9
|
1041 int glp_read_mincost(glp_graph *G, int v_rhs, int a_low, int a_cap,
|
alpar@9
|
1042 int a_cost, const char *fname);
|
alpar@9
|
1043 /* read min-cost flow problem data in DIMACS format */
|
alpar@9
|
1044
|
alpar@9
|
1045 int glp_write_mincost(glp_graph *G, int v_rhs, int a_low, int a_cap,
|
alpar@9
|
1046 int a_cost, const char *fname);
|
alpar@9
|
1047 /* write min-cost flow problem data in DIMACS format */
|
alpar@9
|
1048
|
alpar@9
|
1049 int glp_read_maxflow(glp_graph *G, int *s, int *t, int a_cap,
|
alpar@9
|
1050 const char *fname);
|
alpar@9
|
1051 /* read maximum flow problem data in DIMACS format */
|
alpar@9
|
1052
|
alpar@9
|
1053 int glp_write_maxflow(glp_graph *G, int s, int t, int a_cap,
|
alpar@9
|
1054 const char *fname);
|
alpar@9
|
1055 /* write maximum flow problem data in DIMACS format */
|
alpar@9
|
1056
|
alpar@9
|
1057 int glp_read_asnprob(glp_graph *G, int v_set, int a_cost, const char
|
alpar@9
|
1058 *fname);
|
alpar@9
|
1059 /* read assignment problem data in DIMACS format */
|
alpar@9
|
1060
|
alpar@9
|
1061 int glp_write_asnprob(glp_graph *G, int v_set, int a_cost, const char
|
alpar@9
|
1062 *fname);
|
alpar@9
|
1063 /* write assignment problem data in DIMACS format */
|
alpar@9
|
1064
|
alpar@9
|
1065 int glp_read_ccdata(glp_graph *G, int v_wgt, const char *fname);
|
alpar@9
|
1066 /* read graph in DIMACS clique/coloring format */
|
alpar@9
|
1067
|
alpar@9
|
1068 int glp_write_ccdata(glp_graph *G, int v_wgt, const char *fname);
|
alpar@9
|
1069 /* write graph in DIMACS clique/coloring format */
|
alpar@9
|
1070
|
alpar@9
|
1071 int glp_netgen(glp_graph *G, int v_rhs, int a_cap, int a_cost,
|
alpar@9
|
1072 const int parm[1+15]);
|
alpar@9
|
1073 /* Klingman's network problem generator */
|
alpar@9
|
1074
|
alpar@9
|
1075 int glp_gridgen(glp_graph *G, int v_rhs, int a_cap, int a_cost,
|
alpar@9
|
1076 const int parm[1+14]);
|
alpar@9
|
1077 /* grid-like network problem generator */
|
alpar@9
|
1078
|
alpar@9
|
1079 int glp_rmfgen(glp_graph *G, int *s, int *t, int a_cap,
|
alpar@9
|
1080 const int parm[1+5]);
|
alpar@9
|
1081 /* Goldfarb's maximum flow problem generator */
|
alpar@9
|
1082
|
alpar@9
|
1083 int glp_weak_comp(glp_graph *G, int v_num);
|
alpar@9
|
1084 /* find all weakly connected components of graph */
|
alpar@9
|
1085
|
alpar@9
|
1086 int glp_strong_comp(glp_graph *G, int v_num);
|
alpar@9
|
1087 /* find all strongly connected components of graph */
|
alpar@9
|
1088
|
alpar@9
|
1089 int glp_top_sort(glp_graph *G, int v_num);
|
alpar@9
|
1090 /* topological sorting of acyclic digraph */
|
alpar@9
|
1091
|
alpar@9
|
1092 int glp_wclique_exact(glp_graph *G, int v_wgt, double *sol, int v_set);
|
alpar@9
|
1093 /* find maximum weight clique with exact algorithm */
|
alpar@9
|
1094
|
alpar@9
|
1095 /***********************************************************************
|
alpar@9
|
1096 * NOTE: All symbols defined below are obsolete and kept here only for
|
alpar@9
|
1097 * backward compatibility.
|
alpar@9
|
1098 ***********************************************************************/
|
alpar@9
|
1099
|
alpar@9
|
1100 #define LPX glp_prob
|
alpar@9
|
1101
|
alpar@9
|
1102 /* problem class: */
|
alpar@9
|
1103 #define LPX_LP 100 /* linear programming (LP) */
|
alpar@9
|
1104 #define LPX_MIP 101 /* mixed integer programming (MIP) */
|
alpar@9
|
1105
|
alpar@9
|
1106 /* type of auxiliary/structural variable: */
|
alpar@9
|
1107 #define LPX_FR 110 /* free variable */
|
alpar@9
|
1108 #define LPX_LO 111 /* variable with lower bound */
|
alpar@9
|
1109 #define LPX_UP 112 /* variable with upper bound */
|
alpar@9
|
1110 #define LPX_DB 113 /* double-bounded variable */
|
alpar@9
|
1111 #define LPX_FX 114 /* fixed variable */
|
alpar@9
|
1112
|
alpar@9
|
1113 /* optimization direction flag: */
|
alpar@9
|
1114 #define LPX_MIN 120 /* minimization */
|
alpar@9
|
1115 #define LPX_MAX 121 /* maximization */
|
alpar@9
|
1116
|
alpar@9
|
1117 /* status of primal basic solution: */
|
alpar@9
|
1118 #define LPX_P_UNDEF 132 /* primal solution is undefined */
|
alpar@9
|
1119 #define LPX_P_FEAS 133 /* solution is primal feasible */
|
alpar@9
|
1120 #define LPX_P_INFEAS 134 /* solution is primal infeasible */
|
alpar@9
|
1121 #define LPX_P_NOFEAS 135 /* no primal feasible solution exists */
|
alpar@9
|
1122
|
alpar@9
|
1123 /* status of dual basic solution: */
|
alpar@9
|
1124 #define LPX_D_UNDEF 136 /* dual solution is undefined */
|
alpar@9
|
1125 #define LPX_D_FEAS 137 /* solution is dual feasible */
|
alpar@9
|
1126 #define LPX_D_INFEAS 138 /* solution is dual infeasible */
|
alpar@9
|
1127 #define LPX_D_NOFEAS 139 /* no dual feasible solution exists */
|
alpar@9
|
1128
|
alpar@9
|
1129 /* status of auxiliary/structural variable: */
|
alpar@9
|
1130 #define LPX_BS 140 /* basic variable */
|
alpar@9
|
1131 #define LPX_NL 141 /* non-basic variable on lower bound */
|
alpar@9
|
1132 #define LPX_NU 142 /* non-basic variable on upper bound */
|
alpar@9
|
1133 #define LPX_NF 143 /* non-basic free variable */
|
alpar@9
|
1134 #define LPX_NS 144 /* non-basic fixed variable */
|
alpar@9
|
1135
|
alpar@9
|
1136 /* status of interior-point solution: */
|
alpar@9
|
1137 #define LPX_T_UNDEF 150 /* interior solution is undefined */
|
alpar@9
|
1138 #define LPX_T_OPT 151 /* interior solution is optimal */
|
alpar@9
|
1139
|
alpar@9
|
1140 /* kind of structural variable: */
|
alpar@9
|
1141 #define LPX_CV 160 /* continuous variable */
|
alpar@9
|
1142 #define LPX_IV 161 /* integer variable */
|
alpar@9
|
1143
|
alpar@9
|
1144 /* status of integer solution: */
|
alpar@9
|
1145 #define LPX_I_UNDEF 170 /* integer solution is undefined */
|
alpar@9
|
1146 #define LPX_I_OPT 171 /* integer solution is optimal */
|
alpar@9
|
1147 #define LPX_I_FEAS 172 /* integer solution is feasible */
|
alpar@9
|
1148 #define LPX_I_NOFEAS 173 /* no integer solution exists */
|
alpar@9
|
1149
|
alpar@9
|
1150 /* status codes reported by the routine lpx_get_status: */
|
alpar@9
|
1151 #define LPX_OPT 180 /* optimal */
|
alpar@9
|
1152 #define LPX_FEAS 181 /* feasible */
|
alpar@9
|
1153 #define LPX_INFEAS 182 /* infeasible */
|
alpar@9
|
1154 #define LPX_NOFEAS 183 /* no feasible */
|
alpar@9
|
1155 #define LPX_UNBND 184 /* unbounded */
|
alpar@9
|
1156 #define LPX_UNDEF 185 /* undefined */
|
alpar@9
|
1157
|
alpar@9
|
1158 /* exit codes returned by solver routines: */
|
alpar@9
|
1159 #define LPX_E_OK 200 /* success */
|
alpar@9
|
1160 #define LPX_E_EMPTY 201 /* empty problem */
|
alpar@9
|
1161 #define LPX_E_BADB 202 /* invalid initial basis */
|
alpar@9
|
1162 #define LPX_E_INFEAS 203 /* infeasible initial solution */
|
alpar@9
|
1163 #define LPX_E_FAULT 204 /* unable to start the search */
|
alpar@9
|
1164 #define LPX_E_OBJLL 205 /* objective lower limit reached */
|
alpar@9
|
1165 #define LPX_E_OBJUL 206 /* objective upper limit reached */
|
alpar@9
|
1166 #define LPX_E_ITLIM 207 /* iterations limit exhausted */
|
alpar@9
|
1167 #define LPX_E_TMLIM 208 /* time limit exhausted */
|
alpar@9
|
1168 #define LPX_E_NOFEAS 209 /* no feasible solution */
|
alpar@9
|
1169 #define LPX_E_INSTAB 210 /* numerical instability */
|
alpar@9
|
1170 #define LPX_E_SING 211 /* problems with basis matrix */
|
alpar@9
|
1171 #define LPX_E_NOCONV 212 /* no convergence (interior) */
|
alpar@9
|
1172 #define LPX_E_NOPFS 213 /* no primal feas. sol. (LP presolver) */
|
alpar@9
|
1173 #define LPX_E_NODFS 214 /* no dual feas. sol. (LP presolver) */
|
alpar@9
|
1174 #define LPX_E_MIPGAP 215 /* relative mip gap tolerance reached */
|
alpar@9
|
1175
|
alpar@9
|
1176 /* control parameter identifiers: */
|
alpar@9
|
1177 #define LPX_K_MSGLEV 300 /* lp->msg_lev */
|
alpar@9
|
1178 #define LPX_K_SCALE 301 /* lp->scale */
|
alpar@9
|
1179 #define LPX_K_DUAL 302 /* lp->dual */
|
alpar@9
|
1180 #define LPX_K_PRICE 303 /* lp->price */
|
alpar@9
|
1181 #define LPX_K_RELAX 304 /* lp->relax */
|
alpar@9
|
1182 #define LPX_K_TOLBND 305 /* lp->tol_bnd */
|
alpar@9
|
1183 #define LPX_K_TOLDJ 306 /* lp->tol_dj */
|
alpar@9
|
1184 #define LPX_K_TOLPIV 307 /* lp->tol_piv */
|
alpar@9
|
1185 #define LPX_K_ROUND 308 /* lp->round */
|
alpar@9
|
1186 #define LPX_K_OBJLL 309 /* lp->obj_ll */
|
alpar@9
|
1187 #define LPX_K_OBJUL 310 /* lp->obj_ul */
|
alpar@9
|
1188 #define LPX_K_ITLIM 311 /* lp->it_lim */
|
alpar@9
|
1189 #define LPX_K_ITCNT 312 /* lp->it_cnt */
|
alpar@9
|
1190 #define LPX_K_TMLIM 313 /* lp->tm_lim */
|
alpar@9
|
1191 #define LPX_K_OUTFRQ 314 /* lp->out_frq */
|
alpar@9
|
1192 #define LPX_K_OUTDLY 315 /* lp->out_dly */
|
alpar@9
|
1193 #define LPX_K_BRANCH 316 /* lp->branch */
|
alpar@9
|
1194 #define LPX_K_BTRACK 317 /* lp->btrack */
|
alpar@9
|
1195 #define LPX_K_TOLINT 318 /* lp->tol_int */
|
alpar@9
|
1196 #define LPX_K_TOLOBJ 319 /* lp->tol_obj */
|
alpar@9
|
1197 #define LPX_K_MPSINFO 320 /* lp->mps_info */
|
alpar@9
|
1198 #define LPX_K_MPSOBJ 321 /* lp->mps_obj */
|
alpar@9
|
1199 #define LPX_K_MPSORIG 322 /* lp->mps_orig */
|
alpar@9
|
1200 #define LPX_K_MPSWIDE 323 /* lp->mps_wide */
|
alpar@9
|
1201 #define LPX_K_MPSFREE 324 /* lp->mps_free */
|
alpar@9
|
1202 #define LPX_K_MPSSKIP 325 /* lp->mps_skip */
|
alpar@9
|
1203 #define LPX_K_LPTORIG 326 /* lp->lpt_orig */
|
alpar@9
|
1204 #define LPX_K_PRESOL 327 /* lp->presol */
|
alpar@9
|
1205 #define LPX_K_BINARIZE 328 /* lp->binarize */
|
alpar@9
|
1206 #define LPX_K_USECUTS 329 /* lp->use_cuts */
|
alpar@9
|
1207 #define LPX_K_BFTYPE 330 /* lp->bfcp->type */
|
alpar@9
|
1208 #define LPX_K_MIPGAP 331 /* lp->mip_gap */
|
alpar@9
|
1209
|
alpar@9
|
1210 #define LPX_C_COVER 0x01 /* mixed cover cuts */
|
alpar@9
|
1211 #define LPX_C_CLIQUE 0x02 /* clique cuts */
|
alpar@9
|
1212 #define LPX_C_GOMORY 0x04 /* Gomory's mixed integer cuts */
|
alpar@9
|
1213 #define LPX_C_MIR 0x08 /* mixed integer rounding cuts */
|
alpar@9
|
1214 #define LPX_C_ALL 0xFF /* all cuts */
|
alpar@9
|
1215
|
alpar@9
|
1216 typedef struct
|
alpar@9
|
1217 { /* this structure contains results reported by the routines which
|
alpar@9
|
1218 checks Karush-Kuhn-Tucker conditions (for details see comments
|
alpar@9
|
1219 to those routines) */
|
alpar@9
|
1220 /*--------------------------------------------------------------*/
|
alpar@9
|
1221 /* xR - A * xS = 0 (KKT.PE) */
|
alpar@9
|
1222 double pe_ae_max;
|
alpar@9
|
1223 /* largest absolute error */
|
alpar@9
|
1224 int pe_ae_row;
|
alpar@9
|
1225 /* number of row with largest absolute error */
|
alpar@9
|
1226 double pe_re_max;
|
alpar@9
|
1227 /* largest relative error */
|
alpar@9
|
1228 int pe_re_row;
|
alpar@9
|
1229 /* number of row with largest relative error */
|
alpar@9
|
1230 int pe_quality;
|
alpar@9
|
1231 /* quality of primal solution:
|
alpar@9
|
1232 'H' - high
|
alpar@9
|
1233 'M' - medium
|
alpar@9
|
1234 'L' - low
|
alpar@9
|
1235 '?' - primal solution is wrong */
|
alpar@9
|
1236 /*--------------------------------------------------------------*/
|
alpar@9
|
1237 /* l[k] <= x[k] <= u[k] (KKT.PB) */
|
alpar@9
|
1238 double pb_ae_max;
|
alpar@9
|
1239 /* largest absolute error */
|
alpar@9
|
1240 int pb_ae_ind;
|
alpar@9
|
1241 /* number of variable with largest absolute error */
|
alpar@9
|
1242 double pb_re_max;
|
alpar@9
|
1243 /* largest relative error */
|
alpar@9
|
1244 int pb_re_ind;
|
alpar@9
|
1245 /* number of variable with largest relative error */
|
alpar@9
|
1246 int pb_quality;
|
alpar@9
|
1247 /* quality of primal feasibility:
|
alpar@9
|
1248 'H' - high
|
alpar@9
|
1249 'M' - medium
|
alpar@9
|
1250 'L' - low
|
alpar@9
|
1251 '?' - primal solution is infeasible */
|
alpar@9
|
1252 /*--------------------------------------------------------------*/
|
alpar@9
|
1253 /* A' * (dR - cR) + (dS - cS) = 0 (KKT.DE) */
|
alpar@9
|
1254 double de_ae_max;
|
alpar@9
|
1255 /* largest absolute error */
|
alpar@9
|
1256 int de_ae_col;
|
alpar@9
|
1257 /* number of column with largest absolute error */
|
alpar@9
|
1258 double de_re_max;
|
alpar@9
|
1259 /* largest relative error */
|
alpar@9
|
1260 int de_re_col;
|
alpar@9
|
1261 /* number of column with largest relative error */
|
alpar@9
|
1262 int de_quality;
|
alpar@9
|
1263 /* quality of dual solution:
|
alpar@9
|
1264 'H' - high
|
alpar@9
|
1265 'M' - medium
|
alpar@9
|
1266 'L' - low
|
alpar@9
|
1267 '?' - dual solution is wrong */
|
alpar@9
|
1268 /*--------------------------------------------------------------*/
|
alpar@9
|
1269 /* d[k] >= 0 or d[k] <= 0 (KKT.DB) */
|
alpar@9
|
1270 double db_ae_max;
|
alpar@9
|
1271 /* largest absolute error */
|
alpar@9
|
1272 int db_ae_ind;
|
alpar@9
|
1273 /* number of variable with largest absolute error */
|
alpar@9
|
1274 double db_re_max;
|
alpar@9
|
1275 /* largest relative error */
|
alpar@9
|
1276 int db_re_ind;
|
alpar@9
|
1277 /* number of variable with largest relative error */
|
alpar@9
|
1278 int db_quality;
|
alpar@9
|
1279 /* quality of dual feasibility:
|
alpar@9
|
1280 'H' - high
|
alpar@9
|
1281 'M' - medium
|
alpar@9
|
1282 'L' - low
|
alpar@9
|
1283 '?' - dual solution is infeasible */
|
alpar@9
|
1284 /*--------------------------------------------------------------*/
|
alpar@9
|
1285 /* (x[k] - bound of x[k]) * d[k] = 0 (KKT.CS) */
|
alpar@9
|
1286 double cs_ae_max;
|
alpar@9
|
1287 /* largest absolute error */
|
alpar@9
|
1288 int cs_ae_ind;
|
alpar@9
|
1289 /* number of variable with largest absolute error */
|
alpar@9
|
1290 double cs_re_max;
|
alpar@9
|
1291 /* largest relative error */
|
alpar@9
|
1292 int cs_re_ind;
|
alpar@9
|
1293 /* number of variable with largest relative error */
|
alpar@9
|
1294 int cs_quality;
|
alpar@9
|
1295 /* quality of complementary slackness:
|
alpar@9
|
1296 'H' - high
|
alpar@9
|
1297 'M' - medium
|
alpar@9
|
1298 'L' - low
|
alpar@9
|
1299 '?' - primal and dual solutions are not complementary */
|
alpar@9
|
1300 } LPXKKT;
|
alpar@9
|
1301
|
alpar@9
|
1302 #define lpx_create_prob _glp_lpx_create_prob
|
alpar@9
|
1303 LPX *lpx_create_prob(void);
|
alpar@9
|
1304 /* create problem object */
|
alpar@9
|
1305
|
alpar@9
|
1306 #define lpx_set_prob_name _glp_lpx_set_prob_name
|
alpar@9
|
1307 void lpx_set_prob_name(LPX *lp, const char *name);
|
alpar@9
|
1308 /* assign (change) problem name */
|
alpar@9
|
1309
|
alpar@9
|
1310 #define lpx_set_obj_name _glp_lpx_set_obj_name
|
alpar@9
|
1311 void lpx_set_obj_name(LPX *lp, const char *name);
|
alpar@9
|
1312 /* assign (change) objective function name */
|
alpar@9
|
1313
|
alpar@9
|
1314 #define lpx_set_obj_dir _glp_lpx_set_obj_dir
|
alpar@9
|
1315 void lpx_set_obj_dir(LPX *lp, int dir);
|
alpar@9
|
1316 /* set (change) optimization direction flag */
|
alpar@9
|
1317
|
alpar@9
|
1318 #define lpx_add_rows _glp_lpx_add_rows
|
alpar@9
|
1319 int lpx_add_rows(LPX *lp, int nrs);
|
alpar@9
|
1320 /* add new rows to problem object */
|
alpar@9
|
1321
|
alpar@9
|
1322 #define lpx_add_cols _glp_lpx_add_cols
|
alpar@9
|
1323 int lpx_add_cols(LPX *lp, int ncs);
|
alpar@9
|
1324 /* add new columns to problem object */
|
alpar@9
|
1325
|
alpar@9
|
1326 #define lpx_set_row_name _glp_lpx_set_row_name
|
alpar@9
|
1327 void lpx_set_row_name(LPX *lp, int i, const char *name);
|
alpar@9
|
1328 /* assign (change) row name */
|
alpar@9
|
1329
|
alpar@9
|
1330 #define lpx_set_col_name _glp_lpx_set_col_name
|
alpar@9
|
1331 void lpx_set_col_name(LPX *lp, int j, const char *name);
|
alpar@9
|
1332 /* assign (change) column name */
|
alpar@9
|
1333
|
alpar@9
|
1334 #define lpx_set_row_bnds _glp_lpx_set_row_bnds
|
alpar@9
|
1335 void lpx_set_row_bnds(LPX *lp, int i, int type, double lb, double ub);
|
alpar@9
|
1336 /* set (change) row bounds */
|
alpar@9
|
1337
|
alpar@9
|
1338 #define lpx_set_col_bnds _glp_lpx_set_col_bnds
|
alpar@9
|
1339 void lpx_set_col_bnds(LPX *lp, int j, int type, double lb, double ub);
|
alpar@9
|
1340 /* set (change) column bounds */
|
alpar@9
|
1341
|
alpar@9
|
1342 #define lpx_set_obj_coef _glp_lpx_set_obj_coef
|
alpar@9
|
1343 void lpx_set_obj_coef(glp_prob *lp, int j, double coef);
|
alpar@9
|
1344 /* set (change) obj. coefficient or constant term */
|
alpar@9
|
1345
|
alpar@9
|
1346 #define lpx_set_mat_row _glp_lpx_set_mat_row
|
alpar@9
|
1347 void lpx_set_mat_row(LPX *lp, int i, int len, const int ind[],
|
alpar@9
|
1348 const double val[]);
|
alpar@9
|
1349 /* set (replace) row of the constraint matrix */
|
alpar@9
|
1350
|
alpar@9
|
1351 #define lpx_set_mat_col _glp_lpx_set_mat_col
|
alpar@9
|
1352 void lpx_set_mat_col(LPX *lp, int j, int len, const int ind[],
|
alpar@9
|
1353 const double val[]);
|
alpar@9
|
1354 /* set (replace) column of the constraint matrix */
|
alpar@9
|
1355
|
alpar@9
|
1356 #define lpx_load_matrix _glp_lpx_load_matrix
|
alpar@9
|
1357 void lpx_load_matrix(LPX *lp, int ne, const int ia[], const int ja[],
|
alpar@9
|
1358 const double ar[]);
|
alpar@9
|
1359 /* load (replace) the whole constraint matrix */
|
alpar@9
|
1360
|
alpar@9
|
1361 #define lpx_del_rows _glp_lpx_del_rows
|
alpar@9
|
1362 void lpx_del_rows(LPX *lp, int nrs, const int num[]);
|
alpar@9
|
1363 /* delete specified rows from problem object */
|
alpar@9
|
1364
|
alpar@9
|
1365 #define lpx_del_cols _glp_lpx_del_cols
|
alpar@9
|
1366 void lpx_del_cols(LPX *lp, int ncs, const int num[]);
|
alpar@9
|
1367 /* delete specified columns from problem object */
|
alpar@9
|
1368
|
alpar@9
|
1369 #define lpx_delete_prob _glp_lpx_delete_prob
|
alpar@9
|
1370 void lpx_delete_prob(LPX *lp);
|
alpar@9
|
1371 /* delete problem object */
|
alpar@9
|
1372
|
alpar@9
|
1373 #define lpx_get_prob_name _glp_lpx_get_prob_name
|
alpar@9
|
1374 const char *lpx_get_prob_name(LPX *lp);
|
alpar@9
|
1375 /* retrieve problem name */
|
alpar@9
|
1376
|
alpar@9
|
1377 #define lpx_get_obj_name _glp_lpx_get_obj_name
|
alpar@9
|
1378 const char *lpx_get_obj_name(LPX *lp);
|
alpar@9
|
1379 /* retrieve objective function name */
|
alpar@9
|
1380
|
alpar@9
|
1381 #define lpx_get_obj_dir _glp_lpx_get_obj_dir
|
alpar@9
|
1382 int lpx_get_obj_dir(LPX *lp);
|
alpar@9
|
1383 /* retrieve optimization direction flag */
|
alpar@9
|
1384
|
alpar@9
|
1385 #define lpx_get_num_rows _glp_lpx_get_num_rows
|
alpar@9
|
1386 int lpx_get_num_rows(LPX *lp);
|
alpar@9
|
1387 /* retrieve number of rows */
|
alpar@9
|
1388
|
alpar@9
|
1389 #define lpx_get_num_cols _glp_lpx_get_num_cols
|
alpar@9
|
1390 int lpx_get_num_cols(LPX *lp);
|
alpar@9
|
1391 /* retrieve number of columns */
|
alpar@9
|
1392
|
alpar@9
|
1393 #define lpx_get_row_name _glp_lpx_get_row_name
|
alpar@9
|
1394 const char *lpx_get_row_name(LPX *lp, int i);
|
alpar@9
|
1395 /* retrieve row name */
|
alpar@9
|
1396
|
alpar@9
|
1397 #define lpx_get_col_name _glp_lpx_get_col_name
|
alpar@9
|
1398 const char *lpx_get_col_name(LPX *lp, int j);
|
alpar@9
|
1399 /* retrieve column name */
|
alpar@9
|
1400
|
alpar@9
|
1401 #define lpx_get_row_type _glp_lpx_get_row_type
|
alpar@9
|
1402 int lpx_get_row_type(LPX *lp, int i);
|
alpar@9
|
1403 /* retrieve row type */
|
alpar@9
|
1404
|
alpar@9
|
1405 #define lpx_get_row_lb _glp_lpx_get_row_lb
|
alpar@9
|
1406 double lpx_get_row_lb(LPX *lp, int i);
|
alpar@9
|
1407 /* retrieve row lower bound */
|
alpar@9
|
1408
|
alpar@9
|
1409 #define lpx_get_row_ub _glp_lpx_get_row_ub
|
alpar@9
|
1410 double lpx_get_row_ub(LPX *lp, int i);
|
alpar@9
|
1411 /* retrieve row upper bound */
|
alpar@9
|
1412
|
alpar@9
|
1413 #define lpx_get_row_bnds _glp_lpx_get_row_bnds
|
alpar@9
|
1414 void lpx_get_row_bnds(LPX *lp, int i, int *typx, double *lb,
|
alpar@9
|
1415 double *ub);
|
alpar@9
|
1416 /* retrieve row bounds */
|
alpar@9
|
1417
|
alpar@9
|
1418 #define lpx_get_col_type _glp_lpx_get_col_type
|
alpar@9
|
1419 int lpx_get_col_type(LPX *lp, int j);
|
alpar@9
|
1420 /* retrieve column type */
|
alpar@9
|
1421
|
alpar@9
|
1422 #define lpx_get_col_lb _glp_lpx_get_col_lb
|
alpar@9
|
1423 double lpx_get_col_lb(LPX *lp, int j);
|
alpar@9
|
1424 /* retrieve column lower bound */
|
alpar@9
|
1425
|
alpar@9
|
1426 #define lpx_get_col_ub _glp_lpx_get_col_ub
|
alpar@9
|
1427 double lpx_get_col_ub(LPX *lp, int j);
|
alpar@9
|
1428 /* retrieve column upper bound */
|
alpar@9
|
1429
|
alpar@9
|
1430 #define lpx_get_col_bnds _glp_lpx_get_col_bnds
|
alpar@9
|
1431 void lpx_get_col_bnds(LPX *lp, int j, int *typx, double *lb,
|
alpar@9
|
1432 double *ub);
|
alpar@9
|
1433 /* retrieve column bounds */
|
alpar@9
|
1434
|
alpar@9
|
1435 #define lpx_get_obj_coef _glp_lpx_get_obj_coef
|
alpar@9
|
1436 double lpx_get_obj_coef(LPX *lp, int j);
|
alpar@9
|
1437 /* retrieve obj. coefficient or constant term */
|
alpar@9
|
1438
|
alpar@9
|
1439 #define lpx_get_num_nz _glp_lpx_get_num_nz
|
alpar@9
|
1440 int lpx_get_num_nz(LPX *lp);
|
alpar@9
|
1441 /* retrieve number of constraint coefficients */
|
alpar@9
|
1442
|
alpar@9
|
1443 #define lpx_get_mat_row _glp_lpx_get_mat_row
|
alpar@9
|
1444 int lpx_get_mat_row(LPX *lp, int i, int ind[], double val[]);
|
alpar@9
|
1445 /* retrieve row of the constraint matrix */
|
alpar@9
|
1446
|
alpar@9
|
1447 #define lpx_get_mat_col _glp_lpx_get_mat_col
|
alpar@9
|
1448 int lpx_get_mat_col(LPX *lp, int j, int ind[], double val[]);
|
alpar@9
|
1449 /* retrieve column of the constraint matrix */
|
alpar@9
|
1450
|
alpar@9
|
1451 #define lpx_create_index _glp_lpx_create_index
|
alpar@9
|
1452 void lpx_create_index(LPX *lp);
|
alpar@9
|
1453 /* create the name index */
|
alpar@9
|
1454
|
alpar@9
|
1455 #define lpx_find_row _glp_lpx_find_row
|
alpar@9
|
1456 int lpx_find_row(LPX *lp, const char *name);
|
alpar@9
|
1457 /* find row by its name */
|
alpar@9
|
1458
|
alpar@9
|
1459 #define lpx_find_col _glp_lpx_find_col
|
alpar@9
|
1460 int lpx_find_col(LPX *lp, const char *name);
|
alpar@9
|
1461 /* find column by its name */
|
alpar@9
|
1462
|
alpar@9
|
1463 #define lpx_delete_index _glp_lpx_delete_index
|
alpar@9
|
1464 void lpx_delete_index(LPX *lp);
|
alpar@9
|
1465 /* delete the name index */
|
alpar@9
|
1466
|
alpar@9
|
1467 #define lpx_scale_prob _glp_lpx_scale_prob
|
alpar@9
|
1468 void lpx_scale_prob(LPX *lp);
|
alpar@9
|
1469 /* scale problem data */
|
alpar@9
|
1470
|
alpar@9
|
1471 #define lpx_unscale_prob _glp_lpx_unscale_prob
|
alpar@9
|
1472 void lpx_unscale_prob(LPX *lp);
|
alpar@9
|
1473 /* unscale problem data */
|
alpar@9
|
1474
|
alpar@9
|
1475 #define lpx_set_row_stat _glp_lpx_set_row_stat
|
alpar@9
|
1476 void lpx_set_row_stat(LPX *lp, int i, int stat);
|
alpar@9
|
1477 /* set (change) row status */
|
alpar@9
|
1478
|
alpar@9
|
1479 #define lpx_set_col_stat _glp_lpx_set_col_stat
|
alpar@9
|
1480 void lpx_set_col_stat(LPX *lp, int j, int stat);
|
alpar@9
|
1481 /* set (change) column status */
|
alpar@9
|
1482
|
alpar@9
|
1483 #define lpx_std_basis _glp_lpx_std_basis
|
alpar@9
|
1484 void lpx_std_basis(LPX *lp);
|
alpar@9
|
1485 /* construct standard initial LP basis */
|
alpar@9
|
1486
|
alpar@9
|
1487 #define lpx_adv_basis _glp_lpx_adv_basis
|
alpar@9
|
1488 void lpx_adv_basis(LPX *lp);
|
alpar@9
|
1489 /* construct advanced initial LP basis */
|
alpar@9
|
1490
|
alpar@9
|
1491 #define lpx_cpx_basis _glp_lpx_cpx_basis
|
alpar@9
|
1492 void lpx_cpx_basis(LPX *lp);
|
alpar@9
|
1493 /* construct Bixby's initial LP basis */
|
alpar@9
|
1494
|
alpar@9
|
1495 #define lpx_simplex _glp_lpx_simplex
|
alpar@9
|
1496 int lpx_simplex(LPX *lp);
|
alpar@9
|
1497 /* easy-to-use driver to the simplex method */
|
alpar@9
|
1498
|
alpar@9
|
1499 #define lpx_exact _glp_lpx_exact
|
alpar@9
|
1500 int lpx_exact(LPX *lp);
|
alpar@9
|
1501 /* easy-to-use driver to the exact simplex method */
|
alpar@9
|
1502
|
alpar@9
|
1503 #define lpx_get_status _glp_lpx_get_status
|
alpar@9
|
1504 int lpx_get_status(LPX *lp);
|
alpar@9
|
1505 /* retrieve generic status of basic solution */
|
alpar@9
|
1506
|
alpar@9
|
1507 #define lpx_get_prim_stat _glp_lpx_get_prim_stat
|
alpar@9
|
1508 int lpx_get_prim_stat(LPX *lp);
|
alpar@9
|
1509 /* retrieve primal status of basic solution */
|
alpar@9
|
1510
|
alpar@9
|
1511 #define lpx_get_dual_stat _glp_lpx_get_dual_stat
|
alpar@9
|
1512 int lpx_get_dual_stat(LPX *lp);
|
alpar@9
|
1513 /* retrieve dual status of basic solution */
|
alpar@9
|
1514
|
alpar@9
|
1515 #define lpx_get_obj_val _glp_lpx_get_obj_val
|
alpar@9
|
1516 double lpx_get_obj_val(LPX *lp);
|
alpar@9
|
1517 /* retrieve objective value (basic solution) */
|
alpar@9
|
1518
|
alpar@9
|
1519 #define lpx_get_row_stat _glp_lpx_get_row_stat
|
alpar@9
|
1520 int lpx_get_row_stat(LPX *lp, int i);
|
alpar@9
|
1521 /* retrieve row status (basic solution) */
|
alpar@9
|
1522
|
alpar@9
|
1523 #define lpx_get_row_prim _glp_lpx_get_row_prim
|
alpar@9
|
1524 double lpx_get_row_prim(LPX *lp, int i);
|
alpar@9
|
1525 /* retrieve row primal value (basic solution) */
|
alpar@9
|
1526
|
alpar@9
|
1527 #define lpx_get_row_dual _glp_lpx_get_row_dual
|
alpar@9
|
1528 double lpx_get_row_dual(LPX *lp, int i);
|
alpar@9
|
1529 /* retrieve row dual value (basic solution) */
|
alpar@9
|
1530
|
alpar@9
|
1531 #define lpx_get_row_info _glp_lpx_get_row_info
|
alpar@9
|
1532 void lpx_get_row_info(LPX *lp, int i, int *tagx, double *vx,
|
alpar@9
|
1533 double *dx);
|
alpar@9
|
1534 /* obtain row solution information */
|
alpar@9
|
1535
|
alpar@9
|
1536 #define lpx_get_col_stat _glp_lpx_get_col_stat
|
alpar@9
|
1537 int lpx_get_col_stat(LPX *lp, int j);
|
alpar@9
|
1538 /* retrieve column status (basic solution) */
|
alpar@9
|
1539
|
alpar@9
|
1540 #define lpx_get_col_prim _glp_lpx_get_col_prim
|
alpar@9
|
1541 double lpx_get_col_prim(LPX *lp, int j);
|
alpar@9
|
1542 /* retrieve column primal value (basic solution) */
|
alpar@9
|
1543
|
alpar@9
|
1544 #define lpx_get_col_dual _glp_lpx_get_col_dual
|
alpar@9
|
1545 double lpx_get_col_dual(glp_prob *lp, int j);
|
alpar@9
|
1546 /* retrieve column dual value (basic solution) */
|
alpar@9
|
1547
|
alpar@9
|
1548 #define lpx_get_col_info _glp_lpx_get_col_info
|
alpar@9
|
1549 void lpx_get_col_info(LPX *lp, int j, int *tagx, double *vx,
|
alpar@9
|
1550 double *dx);
|
alpar@9
|
1551 /* obtain column solution information (obsolete) */
|
alpar@9
|
1552
|
alpar@9
|
1553 #define lpx_get_ray_info _glp_lpx_get_ray_info
|
alpar@9
|
1554 int lpx_get_ray_info(LPX *lp);
|
alpar@9
|
1555 /* determine what causes primal unboundness */
|
alpar@9
|
1556
|
alpar@9
|
1557 #define lpx_check_kkt _glp_lpx_check_kkt
|
alpar@9
|
1558 void lpx_check_kkt(LPX *lp, int scaled, LPXKKT *kkt);
|
alpar@9
|
1559 /* check Karush-Kuhn-Tucker conditions */
|
alpar@9
|
1560
|
alpar@9
|
1561 #define lpx_warm_up _glp_lpx_warm_up
|
alpar@9
|
1562 int lpx_warm_up(LPX *lp);
|
alpar@9
|
1563 /* "warm up" LP basis */
|
alpar@9
|
1564
|
alpar@9
|
1565 #define lpx_eval_tab_row _glp_lpx_eval_tab_row
|
alpar@9
|
1566 int lpx_eval_tab_row(LPX *lp, int k, int ind[], double val[]);
|
alpar@9
|
1567 /* compute row of the simplex table */
|
alpar@9
|
1568
|
alpar@9
|
1569 #define lpx_eval_tab_col _glp_lpx_eval_tab_col
|
alpar@9
|
1570 int lpx_eval_tab_col(LPX *lp, int k, int ind[], double val[]);
|
alpar@9
|
1571 /* compute column of the simplex table */
|
alpar@9
|
1572
|
alpar@9
|
1573 #define lpx_transform_row _glp_lpx_transform_row
|
alpar@9
|
1574 int lpx_transform_row(LPX *lp, int len, int ind[], double val[]);
|
alpar@9
|
1575 /* transform explicitly specified row */
|
alpar@9
|
1576
|
alpar@9
|
1577 #define lpx_transform_col _glp_lpx_transform_col
|
alpar@9
|
1578 int lpx_transform_col(LPX *lp, int len, int ind[], double val[]);
|
alpar@9
|
1579 /* transform explicitly specified column */
|
alpar@9
|
1580
|
alpar@9
|
1581 #define lpx_prim_ratio_test _glp_lpx_prim_ratio_test
|
alpar@9
|
1582 int lpx_prim_ratio_test(LPX *lp, int len, const int ind[],
|
alpar@9
|
1583 const double val[], int how, double tol);
|
alpar@9
|
1584 /* perform primal ratio test */
|
alpar@9
|
1585
|
alpar@9
|
1586 #define lpx_dual_ratio_test _glp_lpx_dual_ratio_test
|
alpar@9
|
1587 int lpx_dual_ratio_test(LPX *lp, int len, const int ind[],
|
alpar@9
|
1588 const double val[], int how, double tol);
|
alpar@9
|
1589 /* perform dual ratio test */
|
alpar@9
|
1590
|
alpar@9
|
1591 #define lpx_interior _glp_lpx_interior
|
alpar@9
|
1592 int lpx_interior(LPX *lp);
|
alpar@9
|
1593 /* easy-to-use driver to the interior point method */
|
alpar@9
|
1594
|
alpar@9
|
1595 #define lpx_ipt_status _glp_lpx_ipt_status
|
alpar@9
|
1596 int lpx_ipt_status(LPX *lp);
|
alpar@9
|
1597 /* retrieve status of interior-point solution */
|
alpar@9
|
1598
|
alpar@9
|
1599 #define lpx_ipt_obj_val _glp_lpx_ipt_obj_val
|
alpar@9
|
1600 double lpx_ipt_obj_val(LPX *lp);
|
alpar@9
|
1601 /* retrieve objective value (interior point) */
|
alpar@9
|
1602
|
alpar@9
|
1603 #define lpx_ipt_row_prim _glp_lpx_ipt_row_prim
|
alpar@9
|
1604 double lpx_ipt_row_prim(LPX *lp, int i);
|
alpar@9
|
1605 /* retrieve row primal value (interior point) */
|
alpar@9
|
1606
|
alpar@9
|
1607 #define lpx_ipt_row_dual _glp_lpx_ipt_row_dual
|
alpar@9
|
1608 double lpx_ipt_row_dual(LPX *lp, int i);
|
alpar@9
|
1609 /* retrieve row dual value (interior point) */
|
alpar@9
|
1610
|
alpar@9
|
1611 #define lpx_ipt_col_prim _glp_lpx_ipt_col_prim
|
alpar@9
|
1612 double lpx_ipt_col_prim(LPX *lp, int j);
|
alpar@9
|
1613 /* retrieve column primal value (interior point) */
|
alpar@9
|
1614
|
alpar@9
|
1615 #define lpx_ipt_col_dual _glp_lpx_ipt_col_dual
|
alpar@9
|
1616 double lpx_ipt_col_dual(LPX *lp, int j);
|
alpar@9
|
1617 /* retrieve column dual value (interior point) */
|
alpar@9
|
1618
|
alpar@9
|
1619 #define lpx_set_class _glp_lpx_set_class
|
alpar@9
|
1620 void lpx_set_class(LPX *lp, int klass);
|
alpar@9
|
1621 /* set problem class */
|
alpar@9
|
1622
|
alpar@9
|
1623 #define lpx_get_class _glp_lpx_get_class
|
alpar@9
|
1624 int lpx_get_class(LPX *lp);
|
alpar@9
|
1625 /* determine problem klass */
|
alpar@9
|
1626
|
alpar@9
|
1627 #define lpx_set_col_kind _glp_lpx_set_col_kind
|
alpar@9
|
1628 void lpx_set_col_kind(LPX *lp, int j, int kind);
|
alpar@9
|
1629 /* set (change) column kind */
|
alpar@9
|
1630
|
alpar@9
|
1631 #define lpx_get_col_kind _glp_lpx_get_col_kind
|
alpar@9
|
1632 int lpx_get_col_kind(LPX *lp, int j);
|
alpar@9
|
1633 /* retrieve column kind */
|
alpar@9
|
1634
|
alpar@9
|
1635 #define lpx_get_num_int _glp_lpx_get_num_int
|
alpar@9
|
1636 int lpx_get_num_int(LPX *lp);
|
alpar@9
|
1637 /* retrieve number of integer columns */
|
alpar@9
|
1638
|
alpar@9
|
1639 #define lpx_get_num_bin _glp_lpx_get_num_bin
|
alpar@9
|
1640 int lpx_get_num_bin(LPX *lp);
|
alpar@9
|
1641 /* retrieve number of binary columns */
|
alpar@9
|
1642
|
alpar@9
|
1643 #define lpx_integer _glp_lpx_integer
|
alpar@9
|
1644 int lpx_integer(LPX *lp);
|
alpar@9
|
1645 /* easy-to-use driver to the branch-and-bound method */
|
alpar@9
|
1646
|
alpar@9
|
1647 #define lpx_intopt _glp_lpx_intopt
|
alpar@9
|
1648 int lpx_intopt(LPX *lp);
|
alpar@9
|
1649 /* easy-to-use driver to the branch-and-bound method */
|
alpar@9
|
1650
|
alpar@9
|
1651 #define lpx_mip_status _glp_lpx_mip_status
|
alpar@9
|
1652 int lpx_mip_status(LPX *lp);
|
alpar@9
|
1653 /* retrieve status of MIP solution */
|
alpar@9
|
1654
|
alpar@9
|
1655 #define lpx_mip_obj_val _glp_lpx_mip_obj_val
|
alpar@9
|
1656 double lpx_mip_obj_val(LPX *lp);
|
alpar@9
|
1657 /* retrieve objective value (MIP solution) */
|
alpar@9
|
1658
|
alpar@9
|
1659 #define lpx_mip_row_val _glp_lpx_mip_row_val
|
alpar@9
|
1660 double lpx_mip_row_val(LPX *lp, int i);
|
alpar@9
|
1661 /* retrieve row value (MIP solution) */
|
alpar@9
|
1662
|
alpar@9
|
1663 #define lpx_mip_col_val _glp_lpx_mip_col_val
|
alpar@9
|
1664 double lpx_mip_col_val(LPX *lp, int j);
|
alpar@9
|
1665 /* retrieve column value (MIP solution) */
|
alpar@9
|
1666
|
alpar@9
|
1667 #define lpx_check_int _glp_lpx_check_int
|
alpar@9
|
1668 void lpx_check_int(LPX *lp, LPXKKT *kkt);
|
alpar@9
|
1669 /* check integer feasibility conditions */
|
alpar@9
|
1670
|
alpar@9
|
1671 #define lpx_reset_parms _glp_lpx_reset_parms
|
alpar@9
|
1672 void lpx_reset_parms(LPX *lp);
|
alpar@9
|
1673 /* reset control parameters to default values */
|
alpar@9
|
1674
|
alpar@9
|
1675 #define lpx_set_int_parm _glp_lpx_set_int_parm
|
alpar@9
|
1676 void lpx_set_int_parm(LPX *lp, int parm, int val);
|
alpar@9
|
1677 /* set (change) integer control parameter */
|
alpar@9
|
1678
|
alpar@9
|
1679 #define lpx_get_int_parm _glp_lpx_get_int_parm
|
alpar@9
|
1680 int lpx_get_int_parm(LPX *lp, int parm);
|
alpar@9
|
1681 /* query integer control parameter */
|
alpar@9
|
1682
|
alpar@9
|
1683 #define lpx_set_real_parm _glp_lpx_set_real_parm
|
alpar@9
|
1684 void lpx_set_real_parm(LPX *lp, int parm, double val);
|
alpar@9
|
1685 /* set (change) real control parameter */
|
alpar@9
|
1686
|
alpar@9
|
1687 #define lpx_get_real_parm _glp_lpx_get_real_parm
|
alpar@9
|
1688 double lpx_get_real_parm(LPX *lp, int parm);
|
alpar@9
|
1689 /* query real control parameter */
|
alpar@9
|
1690
|
alpar@9
|
1691 #define lpx_read_mps _glp_lpx_read_mps
|
alpar@9
|
1692 LPX *lpx_read_mps(const char *fname);
|
alpar@9
|
1693 /* read problem data in fixed MPS format */
|
alpar@9
|
1694
|
alpar@9
|
1695 #define lpx_write_mps _glp_lpx_write_mps
|
alpar@9
|
1696 int lpx_write_mps(LPX *lp, const char *fname);
|
alpar@9
|
1697 /* write problem data in fixed MPS format */
|
alpar@9
|
1698
|
alpar@9
|
1699 #define lpx_read_bas _glp_lpx_read_bas
|
alpar@9
|
1700 int lpx_read_bas(LPX *lp, const char *fname);
|
alpar@9
|
1701 /* read LP basis in fixed MPS format */
|
alpar@9
|
1702
|
alpar@9
|
1703 #define lpx_write_bas _glp_lpx_write_bas
|
alpar@9
|
1704 int lpx_write_bas(LPX *lp, const char *fname);
|
alpar@9
|
1705 /* write LP basis in fixed MPS format */
|
alpar@9
|
1706
|
alpar@9
|
1707 #define lpx_read_freemps _glp_lpx_read_freemps
|
alpar@9
|
1708 LPX *lpx_read_freemps(const char *fname);
|
alpar@9
|
1709 /* read problem data in free MPS format */
|
alpar@9
|
1710
|
alpar@9
|
1711 #define lpx_write_freemps _glp_lpx_write_freemps
|
alpar@9
|
1712 int lpx_write_freemps(LPX *lp, const char *fname);
|
alpar@9
|
1713 /* write problem data in free MPS format */
|
alpar@9
|
1714
|
alpar@9
|
1715 #define lpx_read_cpxlp _glp_lpx_read_cpxlp
|
alpar@9
|
1716 LPX *lpx_read_cpxlp(const char *fname);
|
alpar@9
|
1717 /* read problem data in CPLEX LP format */
|
alpar@9
|
1718
|
alpar@9
|
1719 #define lpx_write_cpxlp _glp_lpx_write_cpxlp
|
alpar@9
|
1720 int lpx_write_cpxlp(LPX *lp, const char *fname);
|
alpar@9
|
1721 /* write problem data in CPLEX LP format */
|
alpar@9
|
1722
|
alpar@9
|
1723 #define lpx_read_model _glp_lpx_read_model
|
alpar@9
|
1724 LPX *lpx_read_model(const char *model, const char *data,
|
alpar@9
|
1725 const char *output);
|
alpar@9
|
1726 /* read LP/MIP model written in GNU MathProg language */
|
alpar@9
|
1727
|
alpar@9
|
1728 #define lpx_print_prob _glp_lpx_print_prob
|
alpar@9
|
1729 int lpx_print_prob(LPX *lp, const char *fname);
|
alpar@9
|
1730 /* write problem data in plain text format */
|
alpar@9
|
1731
|
alpar@9
|
1732 #define lpx_print_sol _glp_lpx_print_sol
|
alpar@9
|
1733 int lpx_print_sol(LPX *lp, const char *fname);
|
alpar@9
|
1734 /* write LP problem solution in printable format */
|
alpar@9
|
1735
|
alpar@9
|
1736 #define lpx_print_sens_bnds _glp_lpx_print_sens_bnds
|
alpar@9
|
1737 int lpx_print_sens_bnds(LPX *lp, const char *fname);
|
alpar@9
|
1738 /* write bounds sensitivity information */
|
alpar@9
|
1739
|
alpar@9
|
1740 #define lpx_print_ips _glp_lpx_print_ips
|
alpar@9
|
1741 int lpx_print_ips(LPX *lp, const char *fname);
|
alpar@9
|
1742 /* write interior point solution in printable format */
|
alpar@9
|
1743
|
alpar@9
|
1744 #define lpx_print_mip _glp_lpx_print_mip
|
alpar@9
|
1745 int lpx_print_mip(LPX *lp, const char *fname);
|
alpar@9
|
1746 /* write MIP problem solution in printable format */
|
alpar@9
|
1747
|
alpar@9
|
1748 #define lpx_is_b_avail _glp_lpx_is_b_avail
|
alpar@9
|
1749 int lpx_is_b_avail(LPX *lp);
|
alpar@9
|
1750 /* check if LP basis is available */
|
alpar@9
|
1751
|
alpar@9
|
1752 #define lpx_write_pb _glp_lpx_write_pb
|
alpar@9
|
1753 int lpx_write_pb(LPX *lp, const char *fname, int normalized,
|
alpar@9
|
1754 int binarize);
|
alpar@9
|
1755 /* write problem data in (normalized) OPB format */
|
alpar@9
|
1756
|
alpar@9
|
1757 #define lpx_main _glp_lpx_main
|
alpar@9
|
1758 int lpx_main(int argc, const char *argv[]);
|
alpar@9
|
1759 /* stand-alone LP/MIP solver */
|
alpar@9
|
1760
|
alpar@9
|
1761 #ifdef __cplusplus
|
alpar@9
|
1762 }
|
alpar@9
|
1763 #endif
|
alpar@9
|
1764
|
alpar@9
|
1765 #endif
|
alpar@9
|
1766
|
alpar@9
|
1767 /* eof */
|