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 | |||
) |
◆ ABORT_ZERO
#define ABORT_ZERO | ( | x | ) |
◆ CPX_INT_MAX
#define CPX_INT_MAX 2100000000 /* CPLEX doesn't accept larger values in integer parameters */ |
◆ CPX_REFACTORMAXITERS
◆ CPX_MAGICZEROCONSTANT
◆ COLS_PER_PACKET
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
◆ ROWS_PER_PACKET
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
◆ NUMINTPARAM
◆ NUMDBLPARAM
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 212 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 241 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 266 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 289 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 311 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 333 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 360 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 390 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 399 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 408 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 424 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 440 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 461 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 483 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 509 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 539 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 586 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 601 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 623 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 654 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 679 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 709 of file lpi_cpx.c.
References 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().
◆ cpxObjsen()
|
static |
converts SCIP's objective sense into CPLEX's objective sense
- Parameters
-
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().
◆ 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 740 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 804 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 861 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 909 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 957 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 975 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 94 of file lpi_cpx.c.
Referenced by checkParameterValues(), getIntParam(), getParameterValues(), setIntParam(), and setParameterValues().
◆ dblparam
|
static |
Definition at line 112 of file lpi_cpx.c.
Referenced by getDblParam(), getParameterValues(), setDblParam(), and setParameterValues().
◆ dblparammin
|
static |
Definition at line 123 of file lpi_cpx.c.
Referenced by checkParameterValues(), and setParameterValues().
◆ cpxname
|
static |
Definition at line 1013 of file lpi_cpx.c.
Referenced by SCIPlpiGetSolverName().