summaryrefslogtreecommitdiff
path: root/glpk-5.0/examples/cplex/cplex.h
blob: f9c64dcb210d2d89554fb850ed73e9c86c7c62eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
/* cplex.h (CPLEX-like interface to GLPK API) */

/***********************************************************************
*  This code is part of GLPK (GNU Linear Programming Kit).
*  Copyright (C) 2001-2013 Free Software Foundation, Inc.
*  Written by Andrew Makhorin <mao@gnu.org>.
*
*  GLPK is free software: you can redistribute it and/or modify it
*  under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  GLPK is distributed in the hope that it will be useful, but WITHOUT
*  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
*  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
*  License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with GLPK. If not, see <http://www.gnu.org/licenses/>.
***********************************************************************/

#ifndef _CPLEX_H
#define _CPLEX_H

#ifdef __cplusplus
extern "C" {
#endif

typedef struct CPXENV CPXENV, *CPXENVptr;
typedef struct CPXLP CPXLP, *CPXLPptr;

#define CPX_VERSION                 900

#define CPX_OFF                     0
#define CPX_ON                      1

#define CPX_INFBOUND                1e20

/* error codes: */
#define CPXERR_NO_MEMORY            1001
#define CPXERR_NO_ENVIRONMENT       1002
#define CPXERR_BAD_ARGUMENT         1003
#define CPXERR_NULL_POINTER         1004
#define CPXERR_NO_PROBLEM           1009
#define CPXERR_BAD_PARAM_NUM        1013
#define CPXERR_PARAM_TOO_SMALL      1014
#define CPXERR_PARAM_TOO_BIG        1015
#define CPXERR_INDEX_RANGE          1200
#define CPXERR_COL_INDEX_RANGE      1201
#define CPXERR_ROW_INDEX_RANGE      1203
#define CPXERR_NEGATIVE_SURPLUS     1207
#define CPXERR_BAD_SENSE            1215
#define CPXERR_NO_SOLN              1217
#define CPXERR_NOT_FIXED            1221
#define CPXERR_DUP_ENTRY            1222
#define CPXERR_NULL_NAME            1224
#define CPXERR_ARRAY_NOT_ASCENDING  1226
#define CPXERR_COUNT_RANGE          1227
#define CPXERR_BAD_LUB              1229
#define CPXERR_BAD_STATUS           1253
#define CPXERR_NO_BASIC_SOLN        1261
#define CPXERR_NO_FILENAME          1421
#define CPXERR_FAIL_OPEN_WRITE      1422
#define CPXERR_BAD_FILETYPE         1424
#define CPXERR_BAD_CTYPE            3021

/* control parameters: */
#define CPX_PARAM_ADVIND            1001
#define CPX_PARAM_AGGIND            1003
#define CPX_PARAM_DPRIIND           1009
#define CPX_PARAM_EPOPT             1014
#define CPX_PARAM_EPPER             1015
#define CPX_PARAM_EPRHS             1016
#define CPX_PARAM_FASTMIP           1017 /* ??? */
#define CPX_PARAM_SIMDISPLAY        1019
#define CPX_PARAM_ITLIM             1020
#define CPX_PARAM_OBJLLIM           1025
#define CPX_PARAM_OBJULIM           1026
#define CPX_PARAM_PERIND            1027
#define CPX_PARAM_PPRIIND           1029
#define CPX_PARAM_PREIND            1030
#define CPX_PARAM_REINV             1031
#define CPX_PARAM_SCRIND            1035
#define CPX_PARAM_DATACHECK         1056

/* CPX_PARAM_DPRIIND: */
#define CPX_DPRIIND_AUTO            0
#define CPX_DPRIIND_FULL            1
#define CPX_DPRIIND_STEEP           2
#define CPX_DPRIIND_FULL_STEEP      3
#define CPX_DPRIIND_STEEPQSTART     4
#define CPX_DPRIIND_DEVEX           5

/* CPX_PARAM_PPRIIND: */
#define CPX_PPRIIND_PARTIAL         (-1)
#define CPX_PPRIIND_AUTO            0
#define CPX_PPRIIND_DEVEX           1
#define CPX_PPRIIND_STEEP           2
#define CPX_PPRIIND_STEEPQSTART     3
#define CPX_PPRIIND_FULL            4

/* CPXgetprobtype: */
#define CPXPROB_LP                  0
#define CPXPROB_MIP                 1
#define CPXPROB_RELAXED             2
#define CPXPROB_FIXED               3
#define CPXPROB_QP                  5
#define CPXPROB_ZEROEDQP            6

/* CPXgetobjsen: */
#define CPX_MIN                     1
#define CPX_MAX                     (-1)

/* CPXgetbase: */
#define CPX_AT_LOWER                0
#define CPX_BASIC                   1
#define CPX_AT_UPPER                2
#define CPX_FREE_SUPER              3

/* CPXgetstat: */
#define CPX_STAT_OPTIMAL            1
#define CPX_STAT_UNBOUNDED          2
#define CPX_STAT_INFEASIBLE         3
#define CPX_STAT_INForUNBD          4
#define CPX_STAT_OPTIMAL_INFEAS     5
#define CPX_STAT_ABORT_IT_LIM       10
#define CPX_STAT_ABORT_OBJ_LIM      12

/* CPXgetmethod: */
#define CPX_ALG_NONE                0
#define CPX_ALG_PRIMAL              1
#define CPX_ALG_DUAL                2
#define CPX_ALG_BARRIER             4

/* CPXsolninfo: */
#define CPX_NO_SOLN                 0
#define CPX_BASIC_SOLN              1
#define CPX_NONBASIC_SOLN           2
#define CPX_PRIMAL_SOLN             3

int CPXaddcols(CPXENV *env, CPXLP *lp, int ccnt, int nzcnt,
      const double obj[], const int cmatbeg[], const int cmatind[],
      const double cmatval[], const double lb[], const double ub[],
      char *colname[]);

int CPXaddrows(CPXENV *env, CPXLP *lp, int ccnt, int rcnt, int nzcnt,
      const double rhs[], const char sense[], const int rmatbeg[],
      const int rmatind[], const double rmatval[], char *colname[],
      char *rowname[]);

int CPXbaropt(CPXENV *env, CPXLP *lp);

int CPXbinvrow(CPXENV *env, CPXLP *lp, int i, double y[]);

int CPXchgbds(CPXENV *env, CPXLP *lp, int cnt, const int indices[],
      const char lu[], const double bd[]);

int CPXchgcoeflist(CPXENV *env, CPXLP *lp, int numcoefs,
      const int rowlist[], const int collist[], const double vallist[]);

void CPXchgobjsen(CPXENV *env, CPXLP *lp, int maxormin);

int CPXchgsense(CPXENV *env, CPXLP *lp, int cnt, const int indices[],
      const char sense[]);

int CPXcloseCPLEX(CPXENV **env);

int CPXcopybase(CPXENV *env, CPXLP *lp, const int cstat[],
      const int rstat[]);

int CPXcopybasednorms(CPXENV *env, CPXLP *lp, const int cstat[],
      const int rstat[], const double dnorm[]);

int CPXcopylp(CPXENV *env, CPXLP *lp, int numcols, int numrows,
      int objsen, const double obj[], const double rhs[],
      const char sense[], const int matbeg[], const int matcnt[],
      const int matind[], const double matval[], const double lb[],
      const double ub[], const double rngval[]);

int CPXcopylpwnames(CPXENV *env, CPXLP *lp, int numcols, int numrows,
      int objsen, const double obj[], const double rhs[],
      const char sense[], const int matbeg[], const int matcnt[],
      const int matind[], const double matval[], const double lb[],
      const double ub[], const double rngval[], char *colname[],
      char *rowname[]);

CPXLP *CPXcreateprob(CPXENV *env, int *status, const char *probname);

int CPXdelcols(CPXENV *env, CPXLP *lp, int begin, int end);

int CPXdelrows(CPXENV *env, CPXLP *lp, int begin, int end);

int CPXdelsetcols(CPXENV *env, CPXLP *lp, int delstat[]);

int CPXdelsetrows(CPXENV *env, CPXLP *lp, int delstat[]);

int CPXdualopt(CPXENV *env, CPXLP *lp);

int CPXfreeprob(CPXENV *env, CPXLP **lp);

int CPXgetbase(CPXENV *env, CPXLP *lp, int cstat[], int rstat[]);

int CPXgetbasednorms(CPXENV *env, CPXLP *lp, int cstat[], int rstat[],
      double dnorm[]);

int CPXgetbhead(CPXENV *env, CPXLP *lp, int head[], double x[]);

int CPXgetdblparam(CPXENV *env, int whichparam, double *value);

int CPXgetdj(CPXENV *env, CPXLP *lp, double dj[], int begin, int end);

char *CPXgeterrorstring(CPXENV *env, int errcode, char *buffer);

int CPXgetijdiv(CPXENV *env, CPXLP *lp, int *idiv, int *jdiv);

int CPXgetintparam(CPXENV *env, int whichparam, int *value);

int CPXgetlb(CPXENV *env, CPXLP *lp, double lb[], int begin, int end);

int CPXgetmethod(CPXENV *env, CPXLP *lp);

int CPXgetnumcols(CPXENV *env, CPXLP *lp);

int CPXgetnumnz(CPXENV *env, CPXLP *lp);

int CPXgetnumrows(CPXENV *env, CPXLP *lp);

int CPXgetobjval(CPXENV *env, CPXLP *lp, double *objval);

int CPXgetpi(CPXENV *env, CPXLP *lp, double pi[], int begin, int end);

int CPXgetsense(CPXENV *env, CPXLP *lp, char sense[], int begin,
      int end);

int CPXgetslack(CPXENV *env, CPXLP *lp, double slack[], int begin,
      int end);

int CPXgetstat(CPXENV *env, CPXLP *lp);

int CPXgetub(CPXENV *env, CPXLP *lp, double ub[], int begin, int end);

int CPXgetweight(CPXENV *env, CPXLP *lp, int rcnt, const int rmatbeg[],
      const int rmatind[], const double rmatval[], double weight[],
      int dpriind);

int CPXgetx(CPXENV *env, CPXLP *lp, double x[], int begin, int end);

int CPXinfodblparam(CPXENV *env, int whichparam, double *defvalue,
      double *minvalue, double *maxvalue);

int CPXinfointparam(CPXENV *env, int whichparam, int *defvalue,
      int *minvalue, int *maxvalue);

int CPXlpopt(CPXENV *env, CPXLP *lp);

int CPXmdleave(const CPXENV *env, CPXLP *lp, const int goodlist[],
      int goodlen, double downratio[], double upratio[]);

int CPXnewcols(CPXENV *env, CPXLP *lp, int ccnt, const double obj[],
      const double lb[], const double ub[], const char ctype[],
      char *colname[]);

int CPXnewrows(CPXENV *env, CPXLP *lp, int rcnt, const double rhs[],
      const char sense[], const double rngval[], char *rowname[]);

CPXENV *CPXopenCPLEX(int *status);

int CPXpivotin(CPXENV *env, CPXLP *lp, const int rlist[], int rlen);

int CPXpivotout(CPXENV *env, CPXLP *lp, const int clist[], int clen);

int CPXprimopt(CPXENV *env, CPXLP *lp);

int CPXsavwrite(CPXENV *env, CPXLP *lp, const char *filename);

int CPXsetdblparam(CPXENV *env, int whichparam, double newvalue);

int CPXsetintparam(CPXENV *env, int whichparam, int newvalue);

int CPXsolninfo(CPXENV *env, CPXLP *lp, int *solnmethod, int *solntype,
      int *pfeasind, int *dfeasind);

int CPXsolution(CPXENV *env, CPXLP *lp, int *lpstat, double *objval,
      double x[], double pi[], double slack[], double dj[]);

int CPXstrongbranch(CPXENV *env, CPXLP *lp, const int goodlist[],
      int goodlen, double downpen[], double uppen[], int itlim);

int CPXwriteprob(CPXENV *env, CPXLP *lp, const char *filename,
      const char *filetype);

#ifdef __cplusplus
}
#endif

#endif

/* eof */