examples/cplex/cplex.h
author Alpar Juttner <alpar@cs.elte.hu>
Mon, 06 Dec 2010 13:09:21 +0100
changeset 1 c445c931472f
permissions -rw-r--r--
Import glpk-4.45

- Generated files and doc/notes are removed
alpar@1
     1
/* cplex.h (CPLEX-like interface to GLPK API) */
alpar@1
     2
alpar@1
     3
/***********************************************************************
alpar@1
     4
*  This code is part of GLPK (GNU Linear Programming Kit).
alpar@1
     5
*
alpar@1
     6
*  Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
alpar@1
     7
*  2009, 2010 Andrew Makhorin, Department for Applied Informatics,
alpar@1
     8
*  Moscow Aviation Institute, Moscow, Russia. All rights reserved.
alpar@1
     9
*  E-mail: <mao@gnu.org>.
alpar@1
    10
*
alpar@1
    11
*  GLPK is free software: you can redistribute it and/or modify it
alpar@1
    12
*  under the terms of the GNU General Public License as published by
alpar@1
    13
*  the Free Software Foundation, either version 3 of the License, or
alpar@1
    14
*  (at your option) any later version.
alpar@1
    15
*
alpar@1
    16
*  GLPK is distributed in the hope that it will be useful, but WITHOUT
alpar@1
    17
*  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
alpar@1
    18
*  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
alpar@1
    19
*  License for more details.
alpar@1
    20
*
alpar@1
    21
*  You should have received a copy of the GNU General Public License
alpar@1
    22
*  along with GLPK. If not, see <http://www.gnu.org/licenses/>.
alpar@1
    23
***********************************************************************/
alpar@1
    24
alpar@1
    25
#ifndef _CPLEX_H
alpar@1
    26
#define _CPLEX_H
alpar@1
    27
alpar@1
    28
#ifdef __cplusplus
alpar@1
    29
extern "C" {
alpar@1
    30
#endif
alpar@1
    31
alpar@1
    32
typedef struct CPXENV CPXENV, *CPXENVptr;
alpar@1
    33
typedef struct CPXLP CPXLP, *CPXLPptr;
alpar@1
    34
alpar@1
    35
#define CPX_VERSION                 900
alpar@1
    36
alpar@1
    37
#define CPX_OFF                     0
alpar@1
    38
#define CPX_ON                      1
alpar@1
    39
alpar@1
    40
#define CPX_INFBOUND                1e20
alpar@1
    41
alpar@1
    42
/* error codes: */
alpar@1
    43
#define CPXERR_NO_MEMORY            1001
alpar@1
    44
#define CPXERR_NO_ENVIRONMENT       1002
alpar@1
    45
#define CPXERR_BAD_ARGUMENT         1003
alpar@1
    46
#define CPXERR_NULL_POINTER         1004
alpar@1
    47
#define CPXERR_NO_PROBLEM           1009
alpar@1
    48
#define CPXERR_BAD_PARAM_NUM        1013
alpar@1
    49
#define CPXERR_PARAM_TOO_SMALL      1014
alpar@1
    50
#define CPXERR_PARAM_TOO_BIG        1015
alpar@1
    51
#define CPXERR_INDEX_RANGE          1200
alpar@1
    52
#define CPXERR_COL_INDEX_RANGE      1201
alpar@1
    53
#define CPXERR_ROW_INDEX_RANGE      1203
alpar@1
    54
#define CPXERR_NEGATIVE_SURPLUS     1207
alpar@1
    55
#define CPXERR_BAD_SENSE            1215
alpar@1
    56
#define CPXERR_NO_SOLN              1217
alpar@1
    57
#define CPXERR_NOT_FIXED            1221
alpar@1
    58
#define CPXERR_DUP_ENTRY            1222
alpar@1
    59
#define CPXERR_NULL_NAME            1224
alpar@1
    60
#define CPXERR_ARRAY_NOT_ASCENDING  1226
alpar@1
    61
#define CPXERR_COUNT_RANGE          1227
alpar@1
    62
#define CPXERR_BAD_LUB              1229
alpar@1
    63
#define CPXERR_BAD_STATUS           1253
alpar@1
    64
#define CPXERR_NO_BASIC_SOLN        1261
alpar@1
    65
#define CPXERR_NO_FILENAME          1421
alpar@1
    66
#define CPXERR_FAIL_OPEN_WRITE      1422
alpar@1
    67
#define CPXERR_BAD_FILETYPE         1424
alpar@1
    68
#define CPXERR_BAD_CTYPE            3021
alpar@1
    69
alpar@1
    70
/* control parameters: */
alpar@1
    71
#define CPX_PARAM_ADVIND            1001
alpar@1
    72
#define CPX_PARAM_AGGIND            1003
alpar@1
    73
#define CPX_PARAM_DPRIIND           1009
alpar@1
    74
#define CPX_PARAM_EPOPT             1014
alpar@1
    75
#define CPX_PARAM_EPPER             1015
alpar@1
    76
#define CPX_PARAM_EPRHS             1016
alpar@1
    77
#define CPX_PARAM_FASTMIP           1017 /* ??? */
alpar@1
    78
#define CPX_PARAM_SIMDISPLAY        1019
alpar@1
    79
#define CPX_PARAM_ITLIM             1020
alpar@1
    80
#define CPX_PARAM_OBJLLIM           1025
alpar@1
    81
#define CPX_PARAM_OBJULIM           1026
alpar@1
    82
#define CPX_PARAM_PERIND            1027
alpar@1
    83
#define CPX_PARAM_PPRIIND           1029
alpar@1
    84
#define CPX_PARAM_PREIND            1030
alpar@1
    85
#define CPX_PARAM_REINV             1031
alpar@1
    86
#define CPX_PARAM_SCRIND            1035
alpar@1
    87
#define CPX_PARAM_DATACHECK         1056
alpar@1
    88
alpar@1
    89
/* CPX_PARAM_DPRIIND: */
alpar@1
    90
#define CPX_DPRIIND_AUTO            0
alpar@1
    91
#define CPX_DPRIIND_FULL            1
alpar@1
    92
#define CPX_DPRIIND_STEEP           2
alpar@1
    93
#define CPX_DPRIIND_FULL_STEEP      3
alpar@1
    94
#define CPX_DPRIIND_STEEPQSTART     4
alpar@1
    95
#define CPX_DPRIIND_DEVEX           5
alpar@1
    96
alpar@1
    97
/* CPX_PARAM_PPRIIND: */
alpar@1
    98
#define CPX_PPRIIND_PARTIAL         (-1)
alpar@1
    99
#define CPX_PPRIIND_AUTO            0
alpar@1
   100
#define CPX_PPRIIND_DEVEX           1
alpar@1
   101
#define CPX_PPRIIND_STEEP           2
alpar@1
   102
#define CPX_PPRIIND_STEEPQSTART     3
alpar@1
   103
#define CPX_PPRIIND_FULL            4
alpar@1
   104
alpar@1
   105
/* CPXgetprobtype: */
alpar@1
   106
#define CPXPROB_LP                  0
alpar@1
   107
#define CPXPROB_MIP                 1
alpar@1
   108
#define CPXPROB_RELAXED             2
alpar@1
   109
#define CPXPROB_FIXED               3
alpar@1
   110
#define CPXPROB_QP                  5
alpar@1
   111
#define CPXPROB_ZEROEDQP            6
alpar@1
   112
alpar@1
   113
/* CPXgetobjsen: */
alpar@1
   114
#define CPX_MIN                     1
alpar@1
   115
#define CPX_MAX                     (-1)
alpar@1
   116
alpar@1
   117
/* CPXgetbase: */
alpar@1
   118
#define CPX_AT_LOWER                0
alpar@1
   119
#define CPX_BASIC                   1
alpar@1
   120
#define CPX_AT_UPPER                2
alpar@1
   121
#define CPX_FREE_SUPER              3
alpar@1
   122
alpar@1
   123
/* CPXgetstat: */
alpar@1
   124
#define CPX_STAT_OPTIMAL            1
alpar@1
   125
#define CPX_STAT_UNBOUNDED          2
alpar@1
   126
#define CPX_STAT_INFEASIBLE         3
alpar@1
   127
#define CPX_STAT_INForUNBD          4
alpar@1
   128
#define CPX_STAT_OPTIMAL_INFEAS     5
alpar@1
   129
#define CPX_STAT_ABORT_IT_LIM       10
alpar@1
   130
#define CPX_STAT_ABORT_OBJ_LIM      12
alpar@1
   131
alpar@1
   132
/* CPXgetmethod: */
alpar@1
   133
#define CPX_ALG_NONE                0
alpar@1
   134
#define CPX_ALG_PRIMAL              1
alpar@1
   135
#define CPX_ALG_DUAL                2
alpar@1
   136
#define CPX_ALG_BARRIER             4
alpar@1
   137
alpar@1
   138
/* CPXsolninfo: */
alpar@1
   139
#define CPX_NO_SOLN                 0
alpar@1
   140
#define CPX_BASIC_SOLN              1
alpar@1
   141
#define CPX_NONBASIC_SOLN           2
alpar@1
   142
#define CPX_PRIMAL_SOLN             3
alpar@1
   143
alpar@1
   144
int CPXaddcols(CPXENV *env, CPXLP *lp, int ccnt, int nzcnt,
alpar@1
   145
      const double obj[], const int cmatbeg[], const int cmatind[],
alpar@1
   146
      const double cmatval[], const double lb[], const double ub[],
alpar@1
   147
      char *colname[]);
alpar@1
   148
alpar@1
   149
int CPXaddrows(CPXENV *env, CPXLP *lp, int ccnt, int rcnt, int nzcnt,
alpar@1
   150
      const double rhs[], const char sense[], const int rmatbeg[],
alpar@1
   151
      const int rmatind[], const double rmatval[], char *colname[],
alpar@1
   152
      char *rowname[]);
alpar@1
   153
alpar@1
   154
int CPXbaropt(CPXENV *env, CPXLP *lp);
alpar@1
   155
alpar@1
   156
int CPXbinvrow(CPXENV *env, CPXLP *lp, int i, double y[]);
alpar@1
   157
alpar@1
   158
int CPXchgbds(CPXENV *env, CPXLP *lp, int cnt, const int indices[],
alpar@1
   159
      const char lu[], const double bd[]);
alpar@1
   160
alpar@1
   161
int CPXchgcoeflist(CPXENV *env, CPXLP *lp, int numcoefs,
alpar@1
   162
      const int rowlist[], const int collist[], const double vallist[]);
alpar@1
   163
alpar@1
   164
void CPXchgobjsen(CPXENV *env, CPXLP *lp, int maxormin);
alpar@1
   165
alpar@1
   166
int CPXchgsense(CPXENV *env, CPXLP *lp, int cnt, const int indices[],
alpar@1
   167
      const char sense[]);
alpar@1
   168
alpar@1
   169
int CPXcloseCPLEX(CPXENV **env);
alpar@1
   170
alpar@1
   171
int CPXcopybase(CPXENV *env, CPXLP *lp, const int cstat[],
alpar@1
   172
      const int rstat[]);
alpar@1
   173
alpar@1
   174
int CPXcopybasednorms(CPXENV *env, CPXLP *lp, const int cstat[],
alpar@1
   175
      const int rstat[], const double dnorm[]);
alpar@1
   176
alpar@1
   177
int CPXcopylp(CPXENV *env, CPXLP *lp, int numcols, int numrows,
alpar@1
   178
      int objsen, const double obj[], const double rhs[],
alpar@1
   179
      const char sense[], const int matbeg[], const int matcnt[],
alpar@1
   180
      const int matind[], const double matval[], const double lb[],
alpar@1
   181
      const double ub[], const double rngval[]);
alpar@1
   182
alpar@1
   183
int CPXcopylpwnames(CPXENV *env, CPXLP *lp, int numcols, int numrows,
alpar@1
   184
      int objsen, const double obj[], const double rhs[],
alpar@1
   185
      const char sense[], const int matbeg[], const int matcnt[],
alpar@1
   186
      const int matind[], const double matval[], const double lb[],
alpar@1
   187
      const double ub[], const double rngval[], char *colname[],
alpar@1
   188
      char *rowname[]);
alpar@1
   189
alpar@1
   190
CPXLP *CPXcreateprob(CPXENV *env, int *status, const char *probname);
alpar@1
   191
alpar@1
   192
int CPXdelcols(CPXENV *env, CPXLP *lp, int begin, int end);
alpar@1
   193
alpar@1
   194
int CPXdelrows(CPXENV *env, CPXLP *lp, int begin, int end);
alpar@1
   195
alpar@1
   196
int CPXdelsetcols(CPXENV *env, CPXLP *lp, int delstat[]);
alpar@1
   197
alpar@1
   198
int CPXdelsetrows(CPXENV *env, CPXLP *lp, int delstat[]);
alpar@1
   199
alpar@1
   200
int CPXdualopt(CPXENV *env, CPXLP *lp);
alpar@1
   201
alpar@1
   202
int CPXfreeprob(CPXENV *env, CPXLP **lp);
alpar@1
   203
alpar@1
   204
int CPXgetbase(CPXENV *env, CPXLP *lp, int cstat[], int rstat[]);
alpar@1
   205
alpar@1
   206
int CPXgetbasednorms(CPXENV *env, CPXLP *lp, int cstat[], int rstat[],
alpar@1
   207
      double dnorm[]);
alpar@1
   208
alpar@1
   209
int CPXgetbhead(CPXENV *env, CPXLP *lp, int head[], double x[]);
alpar@1
   210
alpar@1
   211
int CPXgetdblparam(CPXENV *env, int whichparam, double *value);
alpar@1
   212
alpar@1
   213
int CPXgetdj(CPXENV *env, CPXLP *lp, double dj[], int begin, int end);
alpar@1
   214
alpar@1
   215
char *CPXgeterrorstring(CPXENV *env, int errcode, char *buffer);
alpar@1
   216
alpar@1
   217
int CPXgetijdiv(CPXENV *env, CPXLP *lp, int *idiv, int *jdiv);
alpar@1
   218
alpar@1
   219
int CPXgetintparam(CPXENV *env, int whichparam, int *value);
alpar@1
   220
alpar@1
   221
int CPXgetlb(CPXENV *env, CPXLP *lp, double lb[], int begin, int end);
alpar@1
   222
alpar@1
   223
int CPXgetmethod(CPXENV *env, CPXLP *lp);
alpar@1
   224
alpar@1
   225
int CPXgetnumcols(CPXENV *env, CPXLP *lp);
alpar@1
   226
alpar@1
   227
int CPXgetnumnz(CPXENV *env, CPXLP *lp);
alpar@1
   228
alpar@1
   229
int CPXgetnumrows(CPXENV *env, CPXLP *lp);
alpar@1
   230
alpar@1
   231
int CPXgetobjval(CPXENV *env, CPXLP *lp, double *objval);
alpar@1
   232
alpar@1
   233
int CPXgetpi(CPXENV *env, CPXLP *lp, double pi[], int begin, int end);
alpar@1
   234
alpar@1
   235
int CPXgetsense(CPXENV *env, CPXLP *lp, char sense[], int begin,
alpar@1
   236
      int end);
alpar@1
   237
alpar@1
   238
int CPXgetslack(CPXENV *env, CPXLP *lp, double slack[], int begin,
alpar@1
   239
      int end);
alpar@1
   240
alpar@1
   241
int CPXgetstat(CPXENV *env, CPXLP *lp);
alpar@1
   242
alpar@1
   243
int CPXgetub(CPXENV *env, CPXLP *lp, double ub[], int begin, int end);
alpar@1
   244
alpar@1
   245
int CPXgetweight(CPXENV *env, CPXLP *lp, int rcnt, const int rmatbeg[],
alpar@1
   246
      const int rmatind[], const double rmatval[], double weight[],
alpar@1
   247
      int dpriind);
alpar@1
   248
alpar@1
   249
int CPXgetx(CPXENV *env, CPXLP *lp, double x[], int begin, int end);
alpar@1
   250
alpar@1
   251
int CPXinfodblparam(CPXENV *env, int whichparam, double *defvalue,
alpar@1
   252
      double *minvalue, double *maxvalue);
alpar@1
   253
alpar@1
   254
int CPXinfointparam(CPXENV *env, int whichparam, int *defvalue,
alpar@1
   255
      int *minvalue, int *maxvalue);
alpar@1
   256
alpar@1
   257
int CPXlpopt(CPXENV *env, CPXLP *lp);
alpar@1
   258
alpar@1
   259
int CPXmdleave(const CPXENV *env, CPXLP *lp, const int goodlist[],
alpar@1
   260
      int goodlen, double downratio[], double upratio[]);
alpar@1
   261
alpar@1
   262
int CPXnewcols(CPXENV *env, CPXLP *lp, int ccnt, const double obj[],
alpar@1
   263
      const double lb[], const double ub[], const char ctype[],
alpar@1
   264
      char *colname[]);
alpar@1
   265
alpar@1
   266
int CPXnewrows(CPXENV *env, CPXLP *lp, int rcnt, const double rhs[],
alpar@1
   267
      const char sense[], const double rngval[], char *rowname[]);
alpar@1
   268
alpar@1
   269
CPXENV *CPXopenCPLEX(int *status);
alpar@1
   270
alpar@1
   271
int CPXpivotin(CPXENV *env, CPXLP *lp, const int rlist[], int rlen);
alpar@1
   272
alpar@1
   273
int CPXpivotout(CPXENV *env, CPXLP *lp, const int clist[], int clen);
alpar@1
   274
alpar@1
   275
int CPXprimopt(CPXENV *env, CPXLP *lp);
alpar@1
   276
alpar@1
   277
int CPXsavwrite(CPXENV *env, CPXLP *lp, const char *filename);
alpar@1
   278
alpar@1
   279
int CPXsetdblparam(CPXENV *env, int whichparam, double newvalue);
alpar@1
   280
alpar@1
   281
int CPXsetintparam(CPXENV *env, int whichparam, int newvalue);
alpar@1
   282
alpar@1
   283
int CPXsolninfo(CPXENV *env, CPXLP *lp, int *solnmethod, int *solntype,
alpar@1
   284
      int *pfeasind, int *dfeasind);
alpar@1
   285
alpar@1
   286
int CPXsolution(CPXENV *env, CPXLP *lp, int *lpstat, double *objval,
alpar@1
   287
      double x[], double pi[], double slack[], double dj[]);
alpar@1
   288
alpar@1
   289
int CPXstrongbranch(CPXENV *env, CPXLP *lp, const int goodlist[],
alpar@1
   290
      int goodlen, double downpen[], double uppen[], int itlim);
alpar@1
   291
alpar@1
   292
int CPXwriteprob(CPXENV *env, CPXLP *lp, const char *filename,
alpar@1
   293
      const char *filetype);
alpar@1
   294
alpar@1
   295
#ifdef __cplusplus
alpar@1
   296
}
alpar@1
   297
#endif
alpar@1
   298
alpar@1
   299
#endif
alpar@1
   300
alpar@1
   301
/* eof */