Detailed Description
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 |
Typedefs | |
typedef SCIP_DUALPACKET | COLPACKET |
typedef SCIP_DUALPACKET | ROWPACKET |
typedef struct SCIP_CPXParam | SCIP_CPXPARAM |
Variables | |
static const int | intparam [NUMINTPARAM] |
static const int | dblparam [NUMDBLPARAM] |
static const double | dblparammin [NUMDBLPARAM] |
static const char | cpxname [] |
Macro Definition Documentation
◆ CPX_SUBVERSION
◆ CHECK_ZERO
#define CHECK_ZERO | ( | messagehdlr, | |
x | |||
) |
Definition at line 45 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().
◆ ABORT_ZERO
#define ABORT_ZERO | ( | x | ) |
Definition at line 54 of file lpi_cpx.c.
Referenced by SCIPlpiIsDualFeasible(), SCIPlpiIsDualInfeasible(), SCIPlpiIsDualUnbounded(), SCIPlpiIsPrimalFeasible(), SCIPlpiIsPrimalInfeasible(), SCIPlpiIsPrimalUnbounded(), and SCIPlpiIsStable().
◆ CPX_INT_MAX
#define CPX_INT_MAX 2100000000 /* CPLEX doesn't accept larger values in integer parameters */ |
Definition at line 63 of file lpi_cpx.c.
Referenced by checkParameterValues(), lpiStrongbranchIntegral(), SCIPlpiGetIntpar(), and SCIPlpiSetIntpar().
◆ CPX_REFACTORMAXITERS
#define CPX_REFACTORMAXITERS 50 /* maximal number of iterations allowed for producing a refactorization of the basis */ |
Definition at line 68 of file lpi_cpx.c.
Referenced by restoreLPData().
◆ CPX_MAGICZEROCONSTANT
#define CPX_MAGICZEROCONSTANT 1e-10 |
Definition at line 72 of file lpi_cpx.c.
Referenced by SCIPlpiChgBounds().
◆ COLS_PER_PACKET
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 75 of file lpi_cpx.c.
Referenced by colpacketNum().
◆ ROWS_PER_PACKET
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 77 of file lpi_cpx.c.
Referenced by rowpacketNum().
◆ NUMINTPARAM
#define NUMINTPARAM 11 |
Definition at line 81 of file lpi_cpx.c.
Referenced by checkParameterValues(), copyParameterValues(), getIntParam(), getParameterValues(), setIntParam(), and setParameterValues().
◆ NUMDBLPARAM
#define NUMDBLPARAM 7 |
Definition at line 102 of file lpi_cpx.c.
Referenced by checkParameterValues(), copyParameterValues(), getDblParam(), getParameterValues(), setDblParam(), and setParameterValues().
Typedef Documentation
◆ COLPACKET
typedef SCIP_DUALPACKET COLPACKET |
◆ ROWPACKET
typedef SCIP_DUALPACKET ROWPACKET |
◆ SCIP_CPXPARAM
typedef struct SCIP_CPXParam SCIP_CPXPARAM |
Function Documentation
◆ ensureBoundchgMem()
|
static |
resizes larray and uarray to have at least num entries
- Parameters
-
lpi LP interface structure num minimal number of entries in array
Definition at line 202 of file lpi_cpx.c.
References BMSreallocMemoryArray, SCIP_LPi::boundchgsize, SCIP_LPi::larray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIP_LPi::uarray.
Referenced by SCIPlpiChgBounds().
◆ ensureSidechgMem()
|
static |
resizes senarray, rngarray, and rngindarray to have at least num entries
- Parameters
-
lpi LP interface structure num minimal number of entries in array
Definition at line 231 of file lpi_cpx.c.
References 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().
◆ ensureValMem()
|
static |
resizes valarray and indarray to have at least num entries
- Parameters
-
lpi LP interface structure num minimal number of entries in array
Definition at line 256 of file lpi_cpx.c.
References 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().
◆ ensureCstatMem()
|
static |
resizes cstat array to have at least num entries
- Parameters
-
lpi LP interface structure num minimal number of entries in array
Definition at line 279 of file lpi_cpx.c.
References BMSreallocMemoryArray, SCIP_LPi::cstat, SCIP_LPi::cstatsize, MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by getBase(), and SCIPlpiSetState().
◆ ensureRstatMem()
|
static |
resizes rstat array to have at least num entries
- Parameters
-
lpi LP interface structure num minimal number of entries in array
Definition at line 301 of file lpi_cpx.c.
References BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rstat, SCIP_LPi::rstatsize, SCIP_ALLOC, and SCIP_OKAY.
Referenced by getBase(), SCIPlpiSetBase(), and SCIPlpiSetState().
◆ getBase()
|
static |
stores current basis in internal arrays of LPI data structure
- Parameters
-
lpi LP interface structure
Definition at line 323 of file lpi_cpx.c.
References 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().
◆ setBase()
|
static |
loads basis stored in internal arrays of LPI data structure into CPLEX
- Parameters
-
lpi LP interface structure
Definition at line 350 of file lpi_cpx.c.
References 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().
◆ colpacketNum()
|
static |
returns the number of packets needed to store column packet information
- Parameters
-
ncols number of columns to store
Definition at line 380 of file lpi_cpx.c.
References COLS_PER_PACKET.
Referenced by lpistateCreate(), and lpistateFree().
◆ rowpacketNum()
|
static |
returns the number of packets needed to store row packet information
- Parameters
-
nrows number of rows to store
Definition at line 389 of file lpi_cpx.c.
References ROWS_PER_PACKET.
Referenced by lpistateCreate(), and lpistateFree().
◆ lpistatePack()
|
static |
store row and column basis status in a packed LPi state object
- Parameters
-
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 398 of file lpi_cpx.c.
References SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPencodeDualBit().
Referenced by SCIPlpiGetState().
◆ lpistateUnpack()
|
static |
unpacks row and column basis status from a packed LPi state object
- Parameters
-
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 414 of file lpi_cpx.c.
References SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPdecodeDualBit().
Referenced by SCIPlpiSetState().
◆ lpistateCreate()
|
static |
creates LPi state information object
- Parameters
-
lpistate pointer to LPi state blkmem block memory ncols number of columns to store nrows number of rows to store
Definition at line 430 of file lpi_cpx.c.
References BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), NULL, rowpacketNum(), SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiGetState().
◆ lpistateFree()
|
static |
frees LPi state information
- Parameters
-
lpistate pointer to LPi state information (like basis information) blkmem block memory
Definition at line 451 of file lpi_cpx.c.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), NULL, and rowpacketNum().
Referenced by SCIPlpiFreeState().
◆ getParameterValues()
|
static |
gets all CPLEX parameters used in LPI
- Parameters
-
lpi LP interface structure cpxparam current parameter values for this LP
Definition at line 473 of file lpi_cpx.c.
References CHECK_ZERO, SCIP_LPi::cpxenv, dblparam, SCIP_CPXParam::dblparval, intparam, SCIP_CPXParam::intparval, SCIP_LPi::messagehdlr, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_OKAY, and SCIPdebugMessage.
Referenced by checkParameterValues(), and SCIPlpiCreate().
◆ checkParameterValues()
|
static |
in debug mode, checks validity of CPLEX parameters
- Parameters
-
lpi LP interface structure
Definition at line 499 of file lpi_cpx.c.
References CPX_INT_MAX, SCIP_LPi::cpxenv, SCIP_LPi::curparam, dblparammin, SCIP_CPXParam::dblparval, getParameterValues(), intparam, SCIP_CPXParam::intparval, MAX, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_CALL, and SCIP_OKAY.
Referenced by setParameterValues().
◆ setParameterValues()
|
static |
sets all CPLEX parameters used in LPI
- Parameters
-
lpi LP interface structure cpxparam current parameter values for this LP
Definition at line 529 of file lpi_cpx.c.
References CHECK_ZERO, checkParameterValues(), SCIP_LPi::cpxenv, SCIP_LPi::curparam, dblparam, dblparammin, SCIP_CPXParam::dblparval, 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().
◆ copyParameterValues()
|
static |
copies CPLEX parameters from source to dest
- Parameters
-
dest CPLEX parameters to copy to source CPLEX parameters which will be copied
Definition at line 576 of file lpi_cpx.c.
References SCIP_CPXParam::dblparval, SCIP_CPXParam::intparval, NUMDBLPARAM, and NUMINTPARAM.
Referenced by SCIPlpiCreate().
◆ getIntParam()
|
static |
gets a single integer parameter value
- Parameters
-
lpi LP interface structure param parameter to get value for
Definition at line 591 of file lpi_cpx.c.
References SCIP_LPi::cpxparam, intparam, SCIP_CPXParam::intparval, NULL, NUMINTPARAM, SCIPABORT, and SCIPerrorMessage.
Referenced by lpiStrongbranchIntegral(), SCIPlpiGetIntpar(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
◆ getDblParam()
|
static |
gets a single double parameter value
- Parameters
-
lpi LP interface structure param parameter to get value for
Definition at line 613 of file lpi_cpx.c.
References SCIP_LPi::cpxparam, dblparam, SCIP_CPXParam::dblparval, NULL, NUMDBLPARAM, SCIP_Real, SCIPABORT, and SCIPerrorMessage.
Referenced by lpiStrongbranchIntegral(), SCIPlpiGetRealpar(), and SCIPlpiSolveDual().
◆ setIntParam()
|
static |
sets a single integer parameter value
- Parameters
-
lpi LP interface structure param parameter to set value parval new value for parameter
Definition at line 644 of file lpi_cpx.c.
References SCIP_LPi::cpxparam, intparam, SCIP_CPXParam::intparval, NULL, NUMINTPARAM, SCIPABORT, and SCIPerrorMessage.
Referenced by lpiStrongbranchIntegral(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiSetIntpar(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranchesFrac(), and SCIPlpiStrongbranchFrac().
◆ setDblParam()
|
static |
sets a single double parameter value
- Parameters
-
lpi LP interface structure param parameter to set value parval new value for parameter
Definition at line 669 of file lpi_cpx.c.
References SCIP_LPi::cpxparam, dblparam, SCIP_CPXParam::dblparval, NULL, NUMDBLPARAM, SCIPABORT, and SCIPerrorMessage.
Referenced by SCIPlpiSetRealpar(), and SCIPlpiSolveDual().
◆ invalidateSolution()
|
static |
marks the current LP to be unsolved
- Parameters
-
lpi LP interface structure
Definition at line 699 of file lpi_cpx.c.
References FALSE, SCIP_LPi::instabilityignored, 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().
◆ cpxObjsen()
|
static |
converts SCIP's objective sense into CPLEX's objective sense
- Parameters
-
objsen objective sense
Definition at line 710 of file lpi_cpx.c.
References SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIPABORT, and SCIPerrorMessage.
Referenced by SCIPlpiChgObjsen(), and SCIPlpiLoadColLP().
◆ convertSides()
|
static |
converts SCIP's lhs/rhs pairs into CPLEX's sen/rhs/rng
- Parameters
-
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 729 of file lpi_cpx.c.
References NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngindarray, and SCIP_LPi::senarray.
Referenced by SCIPlpiAddRows(), SCIPlpiChgSides(), and SCIPlpiLoadColLP().
◆ reconvertBothSides()
|
static |
converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs
- Parameters
-
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 793 of file lpi_cpx.c.
References NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by reconvertSides().
◆ reconvertLhs()
converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs, only storing the left hand side
- Parameters
-
lpi LP interface structure nrows number of rows lhs buffer to store the left hand side vector
Definition at line 850 of file lpi_cpx.c.
References NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by reconvertSides().
◆ reconvertRhs()
converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs, only storing the right hand side
- Parameters
-
lpi LP interface structure nrows number of rows rhs buffer to store the right hand side vector
Definition at line 898 of file lpi_cpx.c.
References NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by reconvertSides().
◆ reconvertSides()
converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs
- Parameters
-
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 946 of file lpi_cpx.c.
References NULL, reconvertBothSides(), reconvertLhs(), and reconvertRhs().
Referenced by SCIPlpiGetRows(), and SCIPlpiGetSides().
◆ restoreLPData()
|
static |
after restoring the old lp data in CPLEX we need to resolve the lp to be able to retrieve correct information
- Parameters
-
lpi LP interface structure
Definition at line 964 of file lpi_cpx.c.
References 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().
Variable Documentation
◆ intparam
|
static |
Definition at line 85 of file lpi_cpx.c.
Referenced by checkParameterValues(), getIntParam(), getParameterValues(), setIntParam(), and setParameterValues().
◆ dblparam
|
static |
Definition at line 103 of file lpi_cpx.c.
Referenced by getDblParam(), getParameterValues(), setDblParam(), and setParameterValues().
◆ dblparammin
|
static |
Definition at line 114 of file lpi_cpx.c.
Referenced by checkParameterValues(), and setParameterValues().
◆ cpxname
|
static |
Definition at line 1002 of file lpi_cpx.c.
Referenced by SCIPlpiGetSolverName().