alpar@9: /* cplex.h (CPLEX-like interface to GLPK API) */ alpar@9: alpar@9: /*********************************************************************** alpar@9: * This code is part of GLPK (GNU Linear Programming Kit). alpar@9: * alpar@9: * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, alpar@9: * 2009, 2010, 2011 Andrew Makhorin, Department for Applied Informatics, alpar@9: * Moscow Aviation Institute, Moscow, Russia. All rights reserved. alpar@9: * E-mail: . alpar@9: * alpar@9: * GLPK is free software: you can redistribute it and/or modify it alpar@9: * under the terms of the GNU General Public License as published by alpar@9: * the Free Software Foundation, either version 3 of the License, or alpar@9: * (at your option) any later version. alpar@9: * alpar@9: * GLPK is distributed in the hope that it will be useful, but WITHOUT alpar@9: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY alpar@9: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public alpar@9: * License for more details. alpar@9: * alpar@9: * You should have received a copy of the GNU General Public License alpar@9: * along with GLPK. If not, see . alpar@9: ***********************************************************************/ alpar@9: alpar@9: #ifndef _CPLEX_H alpar@9: #define _CPLEX_H alpar@9: alpar@9: #ifdef __cplusplus alpar@9: extern "C" { alpar@9: #endif alpar@9: alpar@9: typedef struct CPXENV CPXENV, *CPXENVptr; alpar@9: typedef struct CPXLP CPXLP, *CPXLPptr; alpar@9: alpar@9: #define CPX_VERSION 900 alpar@9: alpar@9: #define CPX_OFF 0 alpar@9: #define CPX_ON 1 alpar@9: alpar@9: #define CPX_INFBOUND 1e20 alpar@9: alpar@9: /* error codes: */ alpar@9: #define CPXERR_NO_MEMORY 1001 alpar@9: #define CPXERR_NO_ENVIRONMENT 1002 alpar@9: #define CPXERR_BAD_ARGUMENT 1003 alpar@9: #define CPXERR_NULL_POINTER 1004 alpar@9: #define CPXERR_NO_PROBLEM 1009 alpar@9: #define CPXERR_BAD_PARAM_NUM 1013 alpar@9: #define CPXERR_PARAM_TOO_SMALL 1014 alpar@9: #define CPXERR_PARAM_TOO_BIG 1015 alpar@9: #define CPXERR_INDEX_RANGE 1200 alpar@9: #define CPXERR_COL_INDEX_RANGE 1201 alpar@9: #define CPXERR_ROW_INDEX_RANGE 1203 alpar@9: #define CPXERR_NEGATIVE_SURPLUS 1207 alpar@9: #define CPXERR_BAD_SENSE 1215 alpar@9: #define CPXERR_NO_SOLN 1217 alpar@9: #define CPXERR_NOT_FIXED 1221 alpar@9: #define CPXERR_DUP_ENTRY 1222 alpar@9: #define CPXERR_NULL_NAME 1224 alpar@9: #define CPXERR_ARRAY_NOT_ASCENDING 1226 alpar@9: #define CPXERR_COUNT_RANGE 1227 alpar@9: #define CPXERR_BAD_LUB 1229 alpar@9: #define CPXERR_BAD_STATUS 1253 alpar@9: #define CPXERR_NO_BASIC_SOLN 1261 alpar@9: #define CPXERR_NO_FILENAME 1421 alpar@9: #define CPXERR_FAIL_OPEN_WRITE 1422 alpar@9: #define CPXERR_BAD_FILETYPE 1424 alpar@9: #define CPXERR_BAD_CTYPE 3021 alpar@9: alpar@9: /* control parameters: */ alpar@9: #define CPX_PARAM_ADVIND 1001 alpar@9: #define CPX_PARAM_AGGIND 1003 alpar@9: #define CPX_PARAM_DPRIIND 1009 alpar@9: #define CPX_PARAM_EPOPT 1014 alpar@9: #define CPX_PARAM_EPPER 1015 alpar@9: #define CPX_PARAM_EPRHS 1016 alpar@9: #define CPX_PARAM_FASTMIP 1017 /* ??? */ alpar@9: #define CPX_PARAM_SIMDISPLAY 1019 alpar@9: #define CPX_PARAM_ITLIM 1020 alpar@9: #define CPX_PARAM_OBJLLIM 1025 alpar@9: #define CPX_PARAM_OBJULIM 1026 alpar@9: #define CPX_PARAM_PERIND 1027 alpar@9: #define CPX_PARAM_PPRIIND 1029 alpar@9: #define CPX_PARAM_PREIND 1030 alpar@9: #define CPX_PARAM_REINV 1031 alpar@9: #define CPX_PARAM_SCRIND 1035 alpar@9: #define CPX_PARAM_DATACHECK 1056 alpar@9: alpar@9: /* CPX_PARAM_DPRIIND: */ alpar@9: #define CPX_DPRIIND_AUTO 0 alpar@9: #define CPX_DPRIIND_FULL 1 alpar@9: #define CPX_DPRIIND_STEEP 2 alpar@9: #define CPX_DPRIIND_FULL_STEEP 3 alpar@9: #define CPX_DPRIIND_STEEPQSTART 4 alpar@9: #define CPX_DPRIIND_DEVEX 5 alpar@9: alpar@9: /* CPX_PARAM_PPRIIND: */ alpar@9: #define CPX_PPRIIND_PARTIAL (-1) alpar@9: #define CPX_PPRIIND_AUTO 0 alpar@9: #define CPX_PPRIIND_DEVEX 1 alpar@9: #define CPX_PPRIIND_STEEP 2 alpar@9: #define CPX_PPRIIND_STEEPQSTART 3 alpar@9: #define CPX_PPRIIND_FULL 4 alpar@9: alpar@9: /* CPXgetprobtype: */ alpar@9: #define CPXPROB_LP 0 alpar@9: #define CPXPROB_MIP 1 alpar@9: #define CPXPROB_RELAXED 2 alpar@9: #define CPXPROB_FIXED 3 alpar@9: #define CPXPROB_QP 5 alpar@9: #define CPXPROB_ZEROEDQP 6 alpar@9: alpar@9: /* CPXgetobjsen: */ alpar@9: #define CPX_MIN 1 alpar@9: #define CPX_MAX (-1) alpar@9: alpar@9: /* CPXgetbase: */ alpar@9: #define CPX_AT_LOWER 0 alpar@9: #define CPX_BASIC 1 alpar@9: #define CPX_AT_UPPER 2 alpar@9: #define CPX_FREE_SUPER 3 alpar@9: alpar@9: /* CPXgetstat: */ alpar@9: #define CPX_STAT_OPTIMAL 1 alpar@9: #define CPX_STAT_UNBOUNDED 2 alpar@9: #define CPX_STAT_INFEASIBLE 3 alpar@9: #define CPX_STAT_INForUNBD 4 alpar@9: #define CPX_STAT_OPTIMAL_INFEAS 5 alpar@9: #define CPX_STAT_ABORT_IT_LIM 10 alpar@9: #define CPX_STAT_ABORT_OBJ_LIM 12 alpar@9: alpar@9: /* CPXgetmethod: */ alpar@9: #define CPX_ALG_NONE 0 alpar@9: #define CPX_ALG_PRIMAL 1 alpar@9: #define CPX_ALG_DUAL 2 alpar@9: #define CPX_ALG_BARRIER 4 alpar@9: alpar@9: /* CPXsolninfo: */ alpar@9: #define CPX_NO_SOLN 0 alpar@9: #define CPX_BASIC_SOLN 1 alpar@9: #define CPX_NONBASIC_SOLN 2 alpar@9: #define CPX_PRIMAL_SOLN 3 alpar@9: alpar@9: int CPXaddcols(CPXENV *env, CPXLP *lp, int ccnt, int nzcnt, alpar@9: const double obj[], const int cmatbeg[], const int cmatind[], alpar@9: const double cmatval[], const double lb[], const double ub[], alpar@9: char *colname[]); alpar@9: alpar@9: int CPXaddrows(CPXENV *env, CPXLP *lp, int ccnt, int rcnt, int nzcnt, alpar@9: const double rhs[], const char sense[], const int rmatbeg[], alpar@9: const int rmatind[], const double rmatval[], char *colname[], alpar@9: char *rowname[]); alpar@9: alpar@9: int CPXbaropt(CPXENV *env, CPXLP *lp); alpar@9: alpar@9: int CPXbinvrow(CPXENV *env, CPXLP *lp, int i, double y[]); alpar@9: alpar@9: int CPXchgbds(CPXENV *env, CPXLP *lp, int cnt, const int indices[], alpar@9: const char lu[], const double bd[]); alpar@9: alpar@9: int CPXchgcoeflist(CPXENV *env, CPXLP *lp, int numcoefs, alpar@9: const int rowlist[], const int collist[], const double vallist[]); alpar@9: alpar@9: void CPXchgobjsen(CPXENV *env, CPXLP *lp, int maxormin); alpar@9: alpar@9: int CPXchgsense(CPXENV *env, CPXLP *lp, int cnt, const int indices[], alpar@9: const char sense[]); alpar@9: alpar@9: int CPXcloseCPLEX(CPXENV **env); alpar@9: alpar@9: int CPXcopybase(CPXENV *env, CPXLP *lp, const int cstat[], alpar@9: const int rstat[]); alpar@9: alpar@9: int CPXcopybasednorms(CPXENV *env, CPXLP *lp, const int cstat[], alpar@9: const int rstat[], const double dnorm[]); alpar@9: alpar@9: int CPXcopylp(CPXENV *env, CPXLP *lp, int numcols, int numrows, alpar@9: int objsen, const double obj[], const double rhs[], alpar@9: const char sense[], const int matbeg[], const int matcnt[], alpar@9: const int matind[], const double matval[], const double lb[], alpar@9: const double ub[], const double rngval[]); alpar@9: alpar@9: int CPXcopylpwnames(CPXENV *env, CPXLP *lp, int numcols, int numrows, alpar@9: int objsen, const double obj[], const double rhs[], alpar@9: const char sense[], const int matbeg[], const int matcnt[], alpar@9: const int matind[], const double matval[], const double lb[], alpar@9: const double ub[], const double rngval[], char *colname[], alpar@9: char *rowname[]); alpar@9: alpar@9: CPXLP *CPXcreateprob(CPXENV *env, int *status, const char *probname); alpar@9: alpar@9: int CPXdelcols(CPXENV *env, CPXLP *lp, int begin, int end); alpar@9: alpar@9: int CPXdelrows(CPXENV *env, CPXLP *lp, int begin, int end); alpar@9: alpar@9: int CPXdelsetcols(CPXENV *env, CPXLP *lp, int delstat[]); alpar@9: alpar@9: int CPXdelsetrows(CPXENV *env, CPXLP *lp, int delstat[]); alpar@9: alpar@9: int CPXdualopt(CPXENV *env, CPXLP *lp); alpar@9: alpar@9: int CPXfreeprob(CPXENV *env, CPXLP **lp); alpar@9: alpar@9: int CPXgetbase(CPXENV *env, CPXLP *lp, int cstat[], int rstat[]); alpar@9: alpar@9: int CPXgetbasednorms(CPXENV *env, CPXLP *lp, int cstat[], int rstat[], alpar@9: double dnorm[]); alpar@9: alpar@9: int CPXgetbhead(CPXENV *env, CPXLP *lp, int head[], double x[]); alpar@9: alpar@9: int CPXgetdblparam(CPXENV *env, int whichparam, double *value); alpar@9: alpar@9: int CPXgetdj(CPXENV *env, CPXLP *lp, double dj[], int begin, int end); alpar@9: alpar@9: char *CPXgeterrorstring(CPXENV *env, int errcode, char *buffer); alpar@9: alpar@9: int CPXgetijdiv(CPXENV *env, CPXLP *lp, int *idiv, int *jdiv); alpar@9: alpar@9: int CPXgetintparam(CPXENV *env, int whichparam, int *value); alpar@9: alpar@9: int CPXgetlb(CPXENV *env, CPXLP *lp, double lb[], int begin, int end); alpar@9: alpar@9: int CPXgetmethod(CPXENV *env, CPXLP *lp); alpar@9: alpar@9: int CPXgetnumcols(CPXENV *env, CPXLP *lp); alpar@9: alpar@9: int CPXgetnumnz(CPXENV *env, CPXLP *lp); alpar@9: alpar@9: int CPXgetnumrows(CPXENV *env, CPXLP *lp); alpar@9: alpar@9: int CPXgetobjval(CPXENV *env, CPXLP *lp, double *objval); alpar@9: alpar@9: int CPXgetpi(CPXENV *env, CPXLP *lp, double pi[], int begin, int end); alpar@9: alpar@9: int CPXgetsense(CPXENV *env, CPXLP *lp, char sense[], int begin, alpar@9: int end); alpar@9: alpar@9: int CPXgetslack(CPXENV *env, CPXLP *lp, double slack[], int begin, alpar@9: int end); alpar@9: alpar@9: int CPXgetstat(CPXENV *env, CPXLP *lp); alpar@9: alpar@9: int CPXgetub(CPXENV *env, CPXLP *lp, double ub[], int begin, int end); alpar@9: alpar@9: int CPXgetweight(CPXENV *env, CPXLP *lp, int rcnt, const int rmatbeg[], alpar@9: const int rmatind[], const double rmatval[], double weight[], alpar@9: int dpriind); alpar@9: alpar@9: int CPXgetx(CPXENV *env, CPXLP *lp, double x[], int begin, int end); alpar@9: alpar@9: int CPXinfodblparam(CPXENV *env, int whichparam, double *defvalue, alpar@9: double *minvalue, double *maxvalue); alpar@9: alpar@9: int CPXinfointparam(CPXENV *env, int whichparam, int *defvalue, alpar@9: int *minvalue, int *maxvalue); alpar@9: alpar@9: int CPXlpopt(CPXENV *env, CPXLP *lp); alpar@9: alpar@9: int CPXmdleave(const CPXENV *env, CPXLP *lp, const int goodlist[], alpar@9: int goodlen, double downratio[], double upratio[]); alpar@9: alpar@9: int CPXnewcols(CPXENV *env, CPXLP *lp, int ccnt, const double obj[], alpar@9: const double lb[], const double ub[], const char ctype[], alpar@9: char *colname[]); alpar@9: alpar@9: int CPXnewrows(CPXENV *env, CPXLP *lp, int rcnt, const double rhs[], alpar@9: const char sense[], const double rngval[], char *rowname[]); alpar@9: alpar@9: CPXENV *CPXopenCPLEX(int *status); alpar@9: alpar@9: int CPXpivotin(CPXENV *env, CPXLP *lp, const int rlist[], int rlen); alpar@9: alpar@9: int CPXpivotout(CPXENV *env, CPXLP *lp, const int clist[], int clen); alpar@9: alpar@9: int CPXprimopt(CPXENV *env, CPXLP *lp); alpar@9: alpar@9: int CPXsavwrite(CPXENV *env, CPXLP *lp, const char *filename); alpar@9: alpar@9: int CPXsetdblparam(CPXENV *env, int whichparam, double newvalue); alpar@9: alpar@9: int CPXsetintparam(CPXENV *env, int whichparam, int newvalue); alpar@9: alpar@9: int CPXsolninfo(CPXENV *env, CPXLP *lp, int *solnmethod, int *solntype, alpar@9: int *pfeasind, int *dfeasind); alpar@9: alpar@9: int CPXsolution(CPXENV *env, CPXLP *lp, int *lpstat, double *objval, alpar@9: double x[], double pi[], double slack[], double dj[]); alpar@9: alpar@9: int CPXstrongbranch(CPXENV *env, CPXLP *lp, const int goodlist[], alpar@9: int goodlen, double downpen[], double uppen[], int itlim); alpar@9: alpar@9: int CPXwriteprob(CPXENV *env, CPXLP *lp, const char *filename, alpar@9: const char *filetype); alpar@9: alpar@9: #ifdef __cplusplus alpar@9: } alpar@9: #endif alpar@9: alpar@9: #endif alpar@9: alpar@9: /* eof */