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