lemon-project-template-glpk
diff deps/glpk/examples/cplex/cplex.h @ 9:33de93886c88
Import GLPK 4.47
author | Alpar Juttner <alpar@cs.elte.hu> |
---|---|
date | Sun, 06 Nov 2011 20:59:10 +0100 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/deps/glpk/examples/cplex/cplex.h Sun Nov 06 20:59:10 2011 +0100 1.3 @@ -0,0 +1,301 @@ 1.4 +/* cplex.h (CPLEX-like interface to GLPK API) */ 1.5 + 1.6 +/*********************************************************************** 1.7 +* This code is part of GLPK (GNU Linear Programming Kit). 1.8 +* 1.9 +* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 1.10 +* 2009, 2010, 2011 Andrew Makhorin, Department for Applied Informatics, 1.11 +* Moscow Aviation Institute, Moscow, Russia. All rights reserved. 1.12 +* E-mail: <mao@gnu.org>. 1.13 +* 1.14 +* GLPK is free software: you can redistribute it and/or modify it 1.15 +* under the terms of the GNU General Public License as published by 1.16 +* the Free Software Foundation, either version 3 of the License, or 1.17 +* (at your option) any later version. 1.18 +* 1.19 +* GLPK is distributed in the hope that it will be useful, but WITHOUT 1.20 +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 1.21 +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 1.22 +* License for more details. 1.23 +* 1.24 +* You should have received a copy of the GNU General Public License 1.25 +* along with GLPK. If not, see <http://www.gnu.org/licenses/>. 1.26 +***********************************************************************/ 1.27 + 1.28 +#ifndef _CPLEX_H 1.29 +#define _CPLEX_H 1.30 + 1.31 +#ifdef __cplusplus 1.32 +extern "C" { 1.33 +#endif 1.34 + 1.35 +typedef struct CPXENV CPXENV, *CPXENVptr; 1.36 +typedef struct CPXLP CPXLP, *CPXLPptr; 1.37 + 1.38 +#define CPX_VERSION 900 1.39 + 1.40 +#define CPX_OFF 0 1.41 +#define CPX_ON 1 1.42 + 1.43 +#define CPX_INFBOUND 1e20 1.44 + 1.45 +/* error codes: */ 1.46 +#define CPXERR_NO_MEMORY 1001 1.47 +#define CPXERR_NO_ENVIRONMENT 1002 1.48 +#define CPXERR_BAD_ARGUMENT 1003 1.49 +#define CPXERR_NULL_POINTER 1004 1.50 +#define CPXERR_NO_PROBLEM 1009 1.51 +#define CPXERR_BAD_PARAM_NUM 1013 1.52 +#define CPXERR_PARAM_TOO_SMALL 1014 1.53 +#define CPXERR_PARAM_TOO_BIG 1015 1.54 +#define CPXERR_INDEX_RANGE 1200 1.55 +#define CPXERR_COL_INDEX_RANGE 1201 1.56 +#define CPXERR_ROW_INDEX_RANGE 1203 1.57 +#define CPXERR_NEGATIVE_SURPLUS 1207 1.58 +#define CPXERR_BAD_SENSE 1215 1.59 +#define CPXERR_NO_SOLN 1217 1.60 +#define CPXERR_NOT_FIXED 1221 1.61 +#define CPXERR_DUP_ENTRY 1222 1.62 +#define CPXERR_NULL_NAME 1224 1.63 +#define CPXERR_ARRAY_NOT_ASCENDING 1226 1.64 +#define CPXERR_COUNT_RANGE 1227 1.65 +#define CPXERR_BAD_LUB 1229 1.66 +#define CPXERR_BAD_STATUS 1253 1.67 +#define CPXERR_NO_BASIC_SOLN 1261 1.68 +#define CPXERR_NO_FILENAME 1421 1.69 +#define CPXERR_FAIL_OPEN_WRITE 1422 1.70 +#define CPXERR_BAD_FILETYPE 1424 1.71 +#define CPXERR_BAD_CTYPE 3021 1.72 + 1.73 +/* control parameters: */ 1.74 +#define CPX_PARAM_ADVIND 1001 1.75 +#define CPX_PARAM_AGGIND 1003 1.76 +#define CPX_PARAM_DPRIIND 1009 1.77 +#define CPX_PARAM_EPOPT 1014 1.78 +#define CPX_PARAM_EPPER 1015 1.79 +#define CPX_PARAM_EPRHS 1016 1.80 +#define CPX_PARAM_FASTMIP 1017 /* ??? */ 1.81 +#define CPX_PARAM_SIMDISPLAY 1019 1.82 +#define CPX_PARAM_ITLIM 1020 1.83 +#define CPX_PARAM_OBJLLIM 1025 1.84 +#define CPX_PARAM_OBJULIM 1026 1.85 +#define CPX_PARAM_PERIND 1027 1.86 +#define CPX_PARAM_PPRIIND 1029 1.87 +#define CPX_PARAM_PREIND 1030 1.88 +#define CPX_PARAM_REINV 1031 1.89 +#define CPX_PARAM_SCRIND 1035 1.90 +#define CPX_PARAM_DATACHECK 1056 1.91 + 1.92 +/* CPX_PARAM_DPRIIND: */ 1.93 +#define CPX_DPRIIND_AUTO 0 1.94 +#define CPX_DPRIIND_FULL 1 1.95 +#define CPX_DPRIIND_STEEP 2 1.96 +#define CPX_DPRIIND_FULL_STEEP 3 1.97 +#define CPX_DPRIIND_STEEPQSTART 4 1.98 +#define CPX_DPRIIND_DEVEX 5 1.99 + 1.100 +/* CPX_PARAM_PPRIIND: */ 1.101 +#define CPX_PPRIIND_PARTIAL (-1) 1.102 +#define CPX_PPRIIND_AUTO 0 1.103 +#define CPX_PPRIIND_DEVEX 1 1.104 +#define CPX_PPRIIND_STEEP 2 1.105 +#define CPX_PPRIIND_STEEPQSTART 3 1.106 +#define CPX_PPRIIND_FULL 4 1.107 + 1.108 +/* CPXgetprobtype: */ 1.109 +#define CPXPROB_LP 0 1.110 +#define CPXPROB_MIP 1 1.111 +#define CPXPROB_RELAXED 2 1.112 +#define CPXPROB_FIXED 3 1.113 +#define CPXPROB_QP 5 1.114 +#define CPXPROB_ZEROEDQP 6 1.115 + 1.116 +/* CPXgetobjsen: */ 1.117 +#define CPX_MIN 1 1.118 +#define CPX_MAX (-1) 1.119 + 1.120 +/* CPXgetbase: */ 1.121 +#define CPX_AT_LOWER 0 1.122 +#define CPX_BASIC 1 1.123 +#define CPX_AT_UPPER 2 1.124 +#define CPX_FREE_SUPER 3 1.125 + 1.126 +/* CPXgetstat: */ 1.127 +#define CPX_STAT_OPTIMAL 1 1.128 +#define CPX_STAT_UNBOUNDED 2 1.129 +#define CPX_STAT_INFEASIBLE 3 1.130 +#define CPX_STAT_INForUNBD 4 1.131 +#define CPX_STAT_OPTIMAL_INFEAS 5 1.132 +#define CPX_STAT_ABORT_IT_LIM 10 1.133 +#define CPX_STAT_ABORT_OBJ_LIM 12 1.134 + 1.135 +/* CPXgetmethod: */ 1.136 +#define CPX_ALG_NONE 0 1.137 +#define CPX_ALG_PRIMAL 1 1.138 +#define CPX_ALG_DUAL 2 1.139 +#define CPX_ALG_BARRIER 4 1.140 + 1.141 +/* CPXsolninfo: */ 1.142 +#define CPX_NO_SOLN 0 1.143 +#define CPX_BASIC_SOLN 1 1.144 +#define CPX_NONBASIC_SOLN 2 1.145 +#define CPX_PRIMAL_SOLN 3 1.146 + 1.147 +int CPXaddcols(CPXENV *env, CPXLP *lp, int ccnt, int nzcnt, 1.148 + const double obj[], const int cmatbeg[], const int cmatind[], 1.149 + const double cmatval[], const double lb[], const double ub[], 1.150 + char *colname[]); 1.151 + 1.152 +int CPXaddrows(CPXENV *env, CPXLP *lp, int ccnt, int rcnt, int nzcnt, 1.153 + const double rhs[], const char sense[], const int rmatbeg[], 1.154 + const int rmatind[], const double rmatval[], char *colname[], 1.155 + char *rowname[]); 1.156 + 1.157 +int CPXbaropt(CPXENV *env, CPXLP *lp); 1.158 + 1.159 +int CPXbinvrow(CPXENV *env, CPXLP *lp, int i, double y[]); 1.160 + 1.161 +int CPXchgbds(CPXENV *env, CPXLP *lp, int cnt, const int indices[], 1.162 + const char lu[], const double bd[]); 1.163 + 1.164 +int CPXchgcoeflist(CPXENV *env, CPXLP *lp, int numcoefs, 1.165 + const int rowlist[], const int collist[], const double vallist[]); 1.166 + 1.167 +void CPXchgobjsen(CPXENV *env, CPXLP *lp, int maxormin); 1.168 + 1.169 +int CPXchgsense(CPXENV *env, CPXLP *lp, int cnt, const int indices[], 1.170 + const char sense[]); 1.171 + 1.172 +int CPXcloseCPLEX(CPXENV **env); 1.173 + 1.174 +int CPXcopybase(CPXENV *env, CPXLP *lp, const int cstat[], 1.175 + const int rstat[]); 1.176 + 1.177 +int CPXcopybasednorms(CPXENV *env, CPXLP *lp, const int cstat[], 1.178 + const int rstat[], const double dnorm[]); 1.179 + 1.180 +int CPXcopylp(CPXENV *env, CPXLP *lp, int numcols, int numrows, 1.181 + int objsen, const double obj[], const double rhs[], 1.182 + const char sense[], const int matbeg[], const int matcnt[], 1.183 + const int matind[], const double matval[], const double lb[], 1.184 + const double ub[], const double rngval[]); 1.185 + 1.186 +int CPXcopylpwnames(CPXENV *env, CPXLP *lp, int numcols, int numrows, 1.187 + int objsen, const double obj[], const double rhs[], 1.188 + const char sense[], const int matbeg[], const int matcnt[], 1.189 + const int matind[], const double matval[], const double lb[], 1.190 + const double ub[], const double rngval[], char *colname[], 1.191 + char *rowname[]); 1.192 + 1.193 +CPXLP *CPXcreateprob(CPXENV *env, int *status, const char *probname); 1.194 + 1.195 +int CPXdelcols(CPXENV *env, CPXLP *lp, int begin, int end); 1.196 + 1.197 +int CPXdelrows(CPXENV *env, CPXLP *lp, int begin, int end); 1.198 + 1.199 +int CPXdelsetcols(CPXENV *env, CPXLP *lp, int delstat[]); 1.200 + 1.201 +int CPXdelsetrows(CPXENV *env, CPXLP *lp, int delstat[]); 1.202 + 1.203 +int CPXdualopt(CPXENV *env, CPXLP *lp); 1.204 + 1.205 +int CPXfreeprob(CPXENV *env, CPXLP **lp); 1.206 + 1.207 +int CPXgetbase(CPXENV *env, CPXLP *lp, int cstat[], int rstat[]); 1.208 + 1.209 +int CPXgetbasednorms(CPXENV *env, CPXLP *lp, int cstat[], int rstat[], 1.210 + double dnorm[]); 1.211 + 1.212 +int CPXgetbhead(CPXENV *env, CPXLP *lp, int head[], double x[]); 1.213 + 1.214 +int CPXgetdblparam(CPXENV *env, int whichparam, double *value); 1.215 + 1.216 +int CPXgetdj(CPXENV *env, CPXLP *lp, double dj[], int begin, int end); 1.217 + 1.218 +char *CPXgeterrorstring(CPXENV *env, int errcode, char *buffer); 1.219 + 1.220 +int CPXgetijdiv(CPXENV *env, CPXLP *lp, int *idiv, int *jdiv); 1.221 + 1.222 +int CPXgetintparam(CPXENV *env, int whichparam, int *value); 1.223 + 1.224 +int CPXgetlb(CPXENV *env, CPXLP *lp, double lb[], int begin, int end); 1.225 + 1.226 +int CPXgetmethod(CPXENV *env, CPXLP *lp); 1.227 + 1.228 +int CPXgetnumcols(CPXENV *env, CPXLP *lp); 1.229 + 1.230 +int CPXgetnumnz(CPXENV *env, CPXLP *lp); 1.231 + 1.232 +int CPXgetnumrows(CPXENV *env, CPXLP *lp); 1.233 + 1.234 +int CPXgetobjval(CPXENV *env, CPXLP *lp, double *objval); 1.235 + 1.236 +int CPXgetpi(CPXENV *env, CPXLP *lp, double pi[], int begin, int end); 1.237 + 1.238 +int CPXgetsense(CPXENV *env, CPXLP *lp, char sense[], int begin, 1.239 + int end); 1.240 + 1.241 +int CPXgetslack(CPXENV *env, CPXLP *lp, double slack[], int begin, 1.242 + int end); 1.243 + 1.244 +int CPXgetstat(CPXENV *env, CPXLP *lp); 1.245 + 1.246 +int CPXgetub(CPXENV *env, CPXLP *lp, double ub[], int begin, int end); 1.247 + 1.248 +int CPXgetweight(CPXENV *env, CPXLP *lp, int rcnt, const int rmatbeg[], 1.249 + const int rmatind[], const double rmatval[], double weight[], 1.250 + int dpriind); 1.251 + 1.252 +int CPXgetx(CPXENV *env, CPXLP *lp, double x[], int begin, int end); 1.253 + 1.254 +int CPXinfodblparam(CPXENV *env, int whichparam, double *defvalue, 1.255 + double *minvalue, double *maxvalue); 1.256 + 1.257 +int CPXinfointparam(CPXENV *env, int whichparam, int *defvalue, 1.258 + int *minvalue, int *maxvalue); 1.259 + 1.260 +int CPXlpopt(CPXENV *env, CPXLP *lp); 1.261 + 1.262 +int CPXmdleave(const CPXENV *env, CPXLP *lp, const int goodlist[], 1.263 + int goodlen, double downratio[], double upratio[]); 1.264 + 1.265 +int CPXnewcols(CPXENV *env, CPXLP *lp, int ccnt, const double obj[], 1.266 + const double lb[], const double ub[], const char ctype[], 1.267 + char *colname[]); 1.268 + 1.269 +int CPXnewrows(CPXENV *env, CPXLP *lp, int rcnt, const double rhs[], 1.270 + const char sense[], const double rngval[], char *rowname[]); 1.271 + 1.272 +CPXENV *CPXopenCPLEX(int *status); 1.273 + 1.274 +int CPXpivotin(CPXENV *env, CPXLP *lp, const int rlist[], int rlen); 1.275 + 1.276 +int CPXpivotout(CPXENV *env, CPXLP *lp, const int clist[], int clen); 1.277 + 1.278 +int CPXprimopt(CPXENV *env, CPXLP *lp); 1.279 + 1.280 +int CPXsavwrite(CPXENV *env, CPXLP *lp, const char *filename); 1.281 + 1.282 +int CPXsetdblparam(CPXENV *env, int whichparam, double newvalue); 1.283 + 1.284 +int CPXsetintparam(CPXENV *env, int whichparam, int newvalue); 1.285 + 1.286 +int CPXsolninfo(CPXENV *env, CPXLP *lp, int *solnmethod, int *solntype, 1.287 + int *pfeasind, int *dfeasind); 1.288 + 1.289 +int CPXsolution(CPXENV *env, CPXLP *lp, int *lpstat, double *objval, 1.290 + double x[], double pi[], double slack[], double dj[]); 1.291 + 1.292 +int CPXstrongbranch(CPXENV *env, CPXLP *lp, const int goodlist[], 1.293 + int goodlen, double downpen[], double uppen[], int itlim); 1.294 + 1.295 +int CPXwriteprob(CPXENV *env, CPXLP *lp, const char *filename, 1.296 + const char *filetype); 1.297 + 1.298 +#ifdef __cplusplus 1.299 +} 1.300 +#endif 1.301 + 1.302 +#endif 1.303 + 1.304 +/* eof */