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 /* CPLEX doesn't accept larger values in integer parameters */ |
#define | CPX_REFACTORMAXITERS 50 /* maximal number of iterations allowed for producing a refactorization of the basis */ |
#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 getBase(), getParameterValues(), lpiStrongbranchIntegral(), restoreLPData(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiFree(), SCIPlpiGetBase(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiGetBounds(), SCIPlpiGetCoef(), SCIPlpiGetColNames(), SCIPlpiGetCols(), SCIPlpiGetDualfarkas(), SCIPlpiGetNorms(), SCIPlpiGetObj(), SCIPlpiGetObjval(), SCIPlpiGetPrimalRay(), SCIPlpiGetRealSolQuality(), SCIPlpiGetRowNames(), SCIPlpiGetRows(), SCIPlpiGetSides(), SCIPlpiGetSol(), SCIPlpiGetSolFeasibility(), SCIPlpiLoadColLP(), SCIPlpiReadState(), SCIPlpiSetBase(), SCIPlpiSetNorms(), SCIPlpiSetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranchesFrac(), SCIPlpiStrongbranchFrac(), SCIPlpiWriteState(), setBase(), and setParameterValues().
#define ABORT_ZERO | ( | x | ) |
Definition at line 63 of file lpi_cpx.c.
Referenced by SCIPlpiIsDualFeasible(), SCIPlpiIsDualInfeasible(), SCIPlpiIsDualUnbounded(), SCIPlpiIsPrimalFeasible(), SCIPlpiIsPrimalInfeasible(), SCIPlpiIsPrimalUnbounded(), and SCIPlpiIsStable().
#define CPX_INT_MAX 2100000000 /* CPLEX doesn't accept larger values in integer parameters */ |
Definition at line 72 of file lpi_cpx.c.
Referenced by checkParameterValues(), lpiStrongbranchIntegral(), SCIPlpiGetIntpar(), and SCIPlpiSetIntpar().
#define CPX_REFACTORMAXITERS 50 /* maximal number of iterations allowed for producing a refactorization of the basis */ |
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, i, SCIP_LPi::larray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIP_LPi::uarray.
Referenced by 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, MAX, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngindarray, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::senarray, and SCIP_LPi::sidechgsize.
Referenced by SCIPlpiAddRows(), SCIPlpiChgSides(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvCol(), SCIPlpiGetRows(), SCIPlpiGetSides(), 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, SCIP_LPi::indarray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::valarray, and SCIP_LPi::valsize.
Referenced by SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), 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, MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by getBase(), and SCIPlpiSetState().
|
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, MAX, NULL, SCIP_LPi::rstat, SCIP_LPi::rstatsize, SCIP_ALLOC, and SCIP_OKAY.
Referenced by getBase(), SCIPlpiSetBase(), and SCIPlpiSetState().
|
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(), SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rstat, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by 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, and SCIPdebugMessage.
Referenced by lpiStrongbranchIntegral(), and SCIPlpiSetState().
|
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 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 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(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPencodeDualBit().
Referenced by SCIPlpiGetState().
|
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(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPdecodeDualBit().
Referenced by SCIPlpiSetState().
|
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(), NULL, rowpacketNum(), SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiGetState().
|
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(), NULL, and rowpacketNum().
Referenced by SCIPlpiFreeState().
|
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, i, intparam, SCIP_CPXParam::intparval, SCIP_LPi::messagehdlr, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_OKAY, and SCIPdebugMessage.
Referenced by checkParameterValues(), 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(), 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 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, and SCIPdebugMessage.
Referenced by SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranchesFrac(), and SCIPlpiStrongbranchFrac().
|
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 SCIP_CPXParam::dblparval, i, SCIP_CPXParam::intparval, NUMDBLPARAM, and NUMINTPARAM.
Referenced by 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, i, intparam, SCIP_CPXParam::intparval, NULL, NUMINTPARAM, SCIPABORT, and SCIPerrorMessage.
Referenced by 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, i, NULL, NUMDBLPARAM, SCIP_Real, SCIPABORT, and SCIPerrorMessage.
Referenced by lpiStrongbranchIntegral(), 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, and SCIPerrorMessage.
Referenced by lpiStrongbranchIntegral(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiSetIntpar(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranchesFrac(), and SCIPlpiStrongbranchFrac().
|
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, and SCIPerrorMessage.
Referenced by SCIPlpiSetRealpar(), and SCIPlpiSolveDual().
|
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, SCIP_LPi::method, NULL, and SCIP_LPi::solstat.
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiLoadColLP(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSetBase(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
|
static |
converts SCIP's objective sense into CPLEX's objective sense
objsen | objective sense |
Definition at line 721 of file lpi_cpx.c.
References SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIPABORT, and SCIPerrorMessage.
Referenced by 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(), i, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngindarray, SCIP_Real, and SCIP_LPi::senarray.
Referenced by 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, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_Real, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by 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, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_Real, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by 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, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_Real, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by 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(), and SCIP_Real.
Referenced by 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, SCIP_OKAY, and SCIPmessagePrintWarning().
Referenced by 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().