LP interface for CPLEX >= 8.0.
Definition in file lpi_cpx.c.
#include <assert.h>#include "cplex.h"#include "scip/bitencode.h"#include "lpi/lpi.h"#include "scip/pub_message.h"Go to the source code of this file.
Data Structures | |
| struct | SCIP_CPXParam |
| struct | SCIP_LPi |
| struct | SCIP_LPiState |
| struct | SCIP_LPiNorms |
Macros | |
| #define | CPX_SUBVERSION 0 |
| #define | CHECK_ZERO(messagehdlr, x) |
| #define | ABORT_ZERO(x) |
| #define | CPX_INT_MAX 2100000000 |
| #define | CPX_REFACTORMAXITERS 50 |
| #define | CPX_MAGICZEROCONSTANT 1e-10 |
| #define | COLS_PER_PACKET SCIP_DUALPACKETSIZE |
| #define | ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
| #define | NUMINTPARAM 11 |
| #define | NUMDBLPARAM 7 |
Variables | |
| static const int | intparam [NUMINTPARAM] |
| static const int | dblparam [NUMDBLPARAM] |
| static const double | dblparammin [NUMDBLPARAM] |
| static const char | cpxname [] |
| #define CHECK_ZERO | ( | messagehdlr, | |
| x ) |
Definition at line 54 of file lpi_cpx.c.
Referenced by addRangeVars(), delRangeVars(), getBase(), getBase(), getParameterValues(), getParameterValues(), lpiSolve(), lpiStrongbranch(), lpiStrongbranch(), lpiStrongbranches(), lpiStrongbranchIntegral(), restoreLPData(), restoreLPData(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiClearState(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiFree(), SCIPlpiGetBase(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiGetBounds(), SCIPlpiGetCoef(), SCIPlpiGetColNames(), SCIPlpiGetCols(), SCIPlpiGetDualfarkas(), SCIPlpiGetIntpar(), SCIPlpiGetNCols(), SCIPlpiGetNNonz(), SCIPlpiGetNorms(), SCIPlpiGetNRows(), SCIPlpiGetObj(), SCIPlpiGetObjsen(), SCIPlpiGetObjval(), SCIPlpiGetPrimalRay(), SCIPlpiGetRealpar(), SCIPlpiGetRealSolQuality(), SCIPlpiGetRowNames(), SCIPlpiGetRows(), SCIPlpiGetSides(), SCIPlpiGetSol(), SCIPlpiGetSolFeasibility(), SCIPlpiGetState(), SCIPlpiLoadColLP(), SCIPlpiReadLP(), SCIPlpiReadState(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSetBase(), SCIPlpiSetIntpar(), SCIPlpiSetNorms(), SCIPlpiSetRealpar(), SCIPlpiSetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranchesFrac(), SCIPlpiStrongbranchFrac(), SCIPlpiWriteLP(), SCIPlpiWriteState(), setBase(), setBase(), setParameterValues(), and setParameterValues().
| #define ABORT_ZERO | ( | x | ) |
Definition at line 63 of file lpi_cpx.c.
Referenced by SCIPlpiHasDualRay(), SCIPlpiHasPrimalRay(), SCIPlpiIsDualFeasible(), SCIPlpiIsDualInfeasible(), SCIPlpiIsDualUnbounded(), SCIPlpiIsIterlimExc(), SCIPlpiIsPrimalFeasible(), SCIPlpiIsPrimalInfeasible(), SCIPlpiIsPrimalUnbounded(), SCIPlpiIsStable(), and SCIPlpiIsTimelimExc().
| #define CPX_INT_MAX 2100000000 |
Definition at line 72 of file lpi_cpx.c.
Referenced by checkParameterValues(), lpiStrongbranchIntegral(), SCIPlpiGetIntpar(), and SCIPlpiSetIntpar().
| #define CPX_REFACTORMAXITERS 50 |
Definition at line 77 of file lpi_cpx.c.
Referenced by restoreLPData().
| #define CPX_MAGICZEROCONSTANT 1e-10 |
Definition at line 81 of file lpi_cpx.c.
Referenced by SCIPlpiChgBounds().
| #define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
| #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
| #define NUMINTPARAM 11 |
Definition at line 90 of file lpi_cpx.c.
Referenced by checkParameterValues(), checkParameterValues(), copyParameterValues(), copyParameterValues(), getIntParam(), getIntParam(), getParameterValues(), getParameterValues(), setIntParam(), setIntParam(), setParameterValues(), and setParameterValues().
| #define NUMDBLPARAM 7 |
Definition at line 111 of file lpi_cpx.c.
Referenced by checkParameterValues(), checkParameterValues(), copyParameterValues(), copyParameterValues(), getDblParam(), getDblParam(), getParameterValues(), getParameterValues(), setDblParam(), setDblParam(), setParameterValues(), and setParameterValues().
| typedef struct SCIP_CPXParam SCIP_CPXPARAM |
|
static |
resizes larray and uarray to have at least num entries
| lpi | LP interface structure |
| num | minimal number of entries in array |
Definition at line 212 of file lpi_cpx.c.
References assert(), BMSreallocMemoryArray, SCIP_LPi::boundchgsize, ensureBoundchgMem(), i, SCIP_LPi::larray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIP_LPi::uarray.
Referenced by ensureBoundchgMem(), ensureBoundchgMem(), and SCIPlpiChgBounds().
|
static |
resizes senarray, rngarray, and rngindarray to have at least num entries
| lpi | LP interface structure |
| num | minimal number of entries in array |
Definition at line 241 of file lpi_cpx.c.
References assert(), BMSreallocMemoryArray, ensureSidechgMem(), MAX, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngindarray, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::senarray, and SCIP_LPi::sidechgsize.
Referenced by ensureSidechgMem(), ensureSidechgMem(), ensureSidechgMem(), SCIPlpiAddRows(), SCIPlpiChgSides(), SCIPlpiGetBase(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvCol(), SCIPlpiGetRows(), SCIPlpiGetSides(), SCIPlpiGetSol(), and SCIPlpiLoadColLP().
|
static |
resizes valarray and indarray to have at least num entries
| lpi | LP interface structure |
| num | minimal number of entries in array |
Definition at line 266 of file lpi_cpx.c.
References assert(), BMSreallocMemoryArray, ensureValMem(), SCIP_LPi::indarray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::valarray, and SCIP_LPi::valsize.
Referenced by ensureValMem(), ensureValMem(), ensureValMem(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiGetCols(), SCIPlpiGetRows(), SCIPlpiLoadColLP(), SCIPlpiScaleCol(), and SCIPlpiScaleRow().
|
static |
resizes cstat array to have at least num entries
| lpi | LP interface structure |
| num | minimal number of entries in array |
Definition at line 289 of file lpi_cpx.c.
References assert(), BMSreallocMemoryArray, SCIP_LPi::cstat, SCIP_LPi::cstatsize, ensureCstatMem(), MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.
|
static |
resizes rstat array to have at least num entries
| lpi | LP interface structure |
| num | minimal number of entries in array |
Definition at line 311 of file lpi_cpx.c.
References assert(), BMSreallocMemoryArray, ensureRstatMem(), MAX, NULL, SCIP_LPi::rstat, SCIP_LPi::rstatsize, SCIP_ALLOC, and SCIP_OKAY.
|
static |
stores current basis in internal arrays of LPI data structure
| lpi | LP interface structure |
Definition at line 333 of file lpi_cpx.c.
References assert(), CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cstat, ensureCstatMem(), ensureRstatMem(), getBase(), SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rstat, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by getBase(), getBase(), lpiStrongbranch(), lpiStrongbranchIntegral(), and SCIPlpiGetState().
|
static |
loads basis stored in internal arrays of LPI data structure into CPLEX
| lpi | LP interface structure |
Definition at line 360 of file lpi_cpx.c.
References assert(), CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cstat, SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rstat, SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_OKAY, SCIPdebugMessage, and setBase().
Referenced by lpiStrongbranch(), lpiStrongbranchIntegral(), SCIPlpiSetState(), setBase(), and setBase().
|
static |
returns the number of packets needed to store column packet information
| ncols | number of columns to store |
Definition at line 390 of file lpi_cpx.c.
References colpacketNum(), and COLS_PER_PACKET.
|
static |
returns the number of packets needed to store row packet information
| nrows | number of rows to store |
Definition at line 399 of file lpi_cpx.c.
References rowpacketNum(), and ROWS_PER_PACKET.
|
static |
store row and column basis status in a packed LPi state object
| lpistate | pointer to LPi state data |
| cstat | basis status of columns in unpacked format |
| rstat | basis status of rows in unpacked format |
Definition at line 408 of file lpi_cpx.c.
References assert(), lpistatePack(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPencodeDualBit().
|
static |
unpacks row and column basis status from a packed LPi state object
| lpistate | pointer to LPi state data |
| cstat | buffer for storing basis status of columns in unpacked format |
| rstat | buffer for storing basis status of rows in unpacked format |
Definition at line 424 of file lpi_cpx.c.
References assert(), lpistateUnpack(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPdecodeDualBit().
|
static |
creates LPi state information object
| lpistate | pointer to LPi state |
| blkmem | block memory |
| ncols | number of columns to store |
| nrows | number of rows to store |
Definition at line 440 of file lpi_cpx.c.
References assert(), BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), lpistateCreate(), NULL, rowpacketNum(), SCIP_ALLOC, and SCIP_OKAY.
|
static |
frees LPi state information
| lpistate | pointer to LPi state information (like basis information) |
| blkmem | block memory |
Definition at line 461 of file lpi_cpx.c.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), lpistateFree(), NULL, and rowpacketNum().
|
static |
gets all CPLEX parameters used in LPI
| lpi | LP interface structure |
| cpxparam | current parameter values for this LP |
Definition at line 483 of file lpi_cpx.c.
References assert(), CHECK_ZERO, SCIP_LPi::cpxenv, dblparam, SCIP_CPXParam::dblparval, getParameterValues(), i, intparam, SCIP_CPXParam::intparval, SCIP_LPi::messagehdlr, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_OKAY, and SCIPdebugMessage.
Referenced by checkParameterValues(), checkParameterValues(), getParameterValues(), getParameterValues(), and SCIPlpiCreate().
|
static |
in debug mode, checks validity of CPLEX parameters
| lpi | LP interface structure |
Definition at line 509 of file lpi_cpx.c.
References assert(), checkParameterValues(), CPX_INT_MAX, SCIP_LPi::cpxenv, SCIP_LPi::curparam, dblparammin, SCIP_CPXParam::dblparval, getParameterValues(), i, intparam, SCIP_CPXParam::intparval, MAX, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_CALL, and SCIP_OKAY.
Referenced by checkParameterValues(), checkParameterValues(), setParameterValues(), and setParameterValues().
|
static |
sets all CPLEX parameters used in LPI
| lpi | LP interface structure |
| cpxparam | current parameter values for this LP |
Definition at line 539 of file lpi_cpx.c.
References assert(), CHECK_ZERO, checkParameterValues(), SCIP_LPi::cpxenv, SCIP_LPi::curparam, dblparam, dblparammin, SCIP_CPXParam::dblparval, i, intparam, SCIP_CPXParam::intparval, MAX, SCIP_LPi::messagehdlr, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and setParameterValues().
Referenced by lpiStrongbranch(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranchesFrac(), SCIPlpiStrongbranchFrac(), setParameterValues(), and setParameterValues().
|
static |
copies CPLEX parameters from source to dest
| dest | CPLEX parameters to copy to |
| source | CPLEX parameters which will be copied |
Definition at line 586 of file lpi_cpx.c.
References copyParameterValues(), SCIP_CPXParam::dblparval, i, SCIP_CPXParam::intparval, NUMDBLPARAM, and NUMINTPARAM.
Referenced by copyParameterValues(), copyParameterValues(), and SCIPlpiCreate().
|
static |
gets a single integer parameter value
| lpi | LP interface structure |
| param | parameter to get value for |
Definition at line 601 of file lpi_cpx.c.
References assert(), SCIP_LPi::cpxparam, getIntParam(), i, intparam, SCIP_CPXParam::intparval, NULL, NUMINTPARAM, SCIPABORT, and SCIPerrorMessage.
Referenced by getIntParam(), getIntParam(), lpiStrongbranchIntegral(), SCIPlpiGetIntpar(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
|
static |
gets a single double parameter value
| lpi | LP interface structure |
| param | parameter to get value for |
Definition at line 623 of file lpi_cpx.c.
References assert(), SCIP_LPi::cpxparam, dblparam, SCIP_CPXParam::dblparval, getDblParam(), i, NULL, NUMDBLPARAM, SCIP_Real, SCIPABORT, and SCIPerrorMessage.
Referenced by getDblParam(), getDblParam(), lpiStrongbranch(), lpiStrongbranchIntegral(), SCIPlpiGetIntpar(), SCIPlpiGetObjval(), SCIPlpiGetRealpar(), and SCIPlpiSolveDual().
|
static |
sets a single integer parameter value
| lpi | LP interface structure |
| param | parameter to set value |
| parval | new value for parameter |
Definition at line 654 of file lpi_cpx.c.
References assert(), SCIP_LPi::cpxparam, i, intparam, SCIP_CPXParam::intparval, NULL, NUMINTPARAM, SCIPABORT, SCIPerrorMessage, and setIntParam().
Referenced by lpiStrongbranchIntegral(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiSetIntpar(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranchesFrac(), SCIPlpiStrongbranchFrac(), setIntParam(), and setIntParam().
|
static |
sets a single double parameter value
| lpi | LP interface structure |
| param | parameter to set value |
| parval | new value for parameter |
Definition at line 679 of file lpi_cpx.c.
References assert(), SCIP_LPi::cpxparam, dblparam, SCIP_CPXParam::dblparval, i, NULL, NUMDBLPARAM, SCIPABORT, SCIPerrorMessage, and setDblParam().
Referenced by lpiStrongbranch(), SCIPlpiSetIntpar(), SCIPlpiSetRealpar(), SCIPlpiSolveDual(), setDblParam(), and setDblParam().
|
static |
marks the current LP to be unsolved
| lpi | LP interface structure |
Definition at line 709 of file lpi_cpx.c.
References assert(), FALSE, SCIP_LPi::instabilityignored, invalidateSolution(), SCIP_LPi::method, NULL, and SCIP_LPi::solstat.
|
static |
converts SCIP's objective sense into CPLEX's objective sense
| objsen | objective sense |
Definition at line 721 of file lpi_cpx.c.
References cpxObjsen(), SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIPABORT, and SCIPerrorMessage.
Referenced by cpxObjsen(), SCIPlpiChgObjsen(), and SCIPlpiLoadColLP().
|
static |
converts SCIP's lhs/rhs pairs into CPLEX's sen/rhs/rng
| lpi | LP interface structure |
| nrows | number of rows |
| lhs | left hand side vector |
| rhs | right hand side vector |
| indoffset | index of first row in LP |
| rngcount | pointer to store the number of range rows |
Definition at line 740 of file lpi_cpx.c.
References assert(), convertSides(), i, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngindarray, SCIP_Real, and SCIP_LPi::senarray.
Referenced by convertSides(), convertSides(), convertSides(), convertSides(), SCIPlpiAddRows(), SCIPlpiChgSides(), and SCIPlpiLoadColLP().
converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs
| lpi | LP interface structure |
| nrows | number of rows |
| lhs | buffer to store the left hand side vector |
| rhs | buffer to store the right hand side vector |
Definition at line 804 of file lpi_cpx.c.
References assert(), i, NULL, reconvertBothSides(), SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_Real, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by reconvertBothSides(), reconvertBothSides(), reconvertSides(), and reconvertSides().
converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs, only storing the left hand side
| lpi | LP interface structure |
| nrows | number of rows |
| lhs | buffer to store the left hand side vector |
Definition at line 861 of file lpi_cpx.c.
References assert(), i, NULL, reconvertLhs(), SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_Real, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by reconvertLhs(), reconvertLhs(), reconvertSides(), and reconvertSides().
converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs, only storing the right hand side
| lpi | LP interface structure |
| nrows | number of rows |
| rhs | buffer to store the right hand side vector |
Definition at line 909 of file lpi_cpx.c.
References assert(), i, NULL, reconvertRhs(), SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_Real, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by reconvertRhs(), reconvertRhs(), reconvertSides(), and reconvertSides().
converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs
| lpi | LP interface structure |
| nrows | number of rows |
| lhs | buffer to store the left hand side vector, or NULL |
| rhs | buffer to store the right hand side vector, or NULL |
Definition at line 957 of file lpi_cpx.c.
References NULL, reconvertBothSides(), reconvertLhs(), reconvertRhs(), reconvertSides(), and SCIP_Real.
Referenced by reconvertSides(), reconvertSides(), reconvertSides(), SCIPlpiGetRows(), and SCIPlpiGetSides().
|
static |
after restoring the old lp data in CPLEX we need to resolve the lp to be able to retrieve correct information
| lpi | LP interface structure |
Definition at line 975 of file lpi_cpx.c.
References assert(), CHECK_ZERO, CPX_REFACTORMAXITERS, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_OKAY, and SCIPmessagePrintWarning().
Referenced by restoreLPData(), restoreLPData(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), and SCIPlpiGetBInvRow().
|
static |
Definition at line 94 of file lpi_cpx.c.
Referenced by checkParameterValues(), getIntParam(), getIntParam(), getParameterValues(), getParameterValues(), setIntParam(), setIntParam(), setParameterValues(), and setParameterValues().
|
static |
Definition at line 112 of file lpi_cpx.c.
Referenced by getDblParam(), getDblParam(), getParameterValues(), getParameterValues(), setDblParam(), setDblParam(), setParameterValues(), and setParameterValues().
|
static |
Definition at line 123 of file lpi_cpx.c.
Referenced by checkParameterValues(), checkParameterValues(), setParameterValues(), and setParameterValues().
|
static |
Definition at line 1013 of file lpi_cpx.c.
Referenced by SCIPlpiGetSolverName().