Detailed Description
LP interface for Xpress-MP.
This interface was revised for Xpress 26. Therefore, we removed all legacy code.
Xpress requires that column and row names are unique. Since column and row names are not needed we ignore all column and row names to avoid the uniqueness issue.
Definition in file lpi_xprs.c.
#include <assert.h>
#include <string.h>
#include <strings.h>
#include "xprs.h"
#include "scip/bitencode.h"
#include "scip/pub_misc.h"
#include "scip/pub_message.h"
#include "lpi/lpi.h"
Go to the source code of this file.
Data Structures | |
struct | SCIP_LPi |
struct | SCIP_LPiState |
Macros | |
#define | XPRS_LPQUICKPRESOLVE 8207 |
#define | XPRS_LP_OPTIMAL_SCALEDINFEAS 16 |
#define | CHECK_ZERO(messagehdlr, x) |
#define | ABORT_ZERO(messagehdlr, retval, x) |
#define | COLS_PER_PACKET SCIP_DUALPACKETSIZE |
#define | ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Typedefs | |
typedef SCIP_DUALPACKET | COLPACKET |
typedef SCIP_DUALPACKET | ROWPACKET |
Miscellaneous Methods | |
static char | xprsname [100] |
const char * | SCIPlpiGetSolverName (void) |
const char * | SCIPlpiGetSolverDesc (void) |
void * | SCIPlpiGetSolverPointer (SCIP_LPI *lpi) |
SCIP_RETCODE | SCIPlpiSetIntegralityInformation (SCIP_LPI *lpi, int ncols, int *intInfo) |
SCIP_Bool | SCIPlpiHasPrimalSolve (void) |
SCIP_Bool | SCIPlpiHasDualSolve (void) |
SCIP_Bool | SCIPlpiHasBarrierSolve (void) |
Macro Definition Documentation
◆ XPRS_LPQUICKPRESOLVE
#define XPRS_LPQUICKPRESOLVE 8207 |
Definition at line 46 of file lpi_xprs.c.
Referenced by lpiSolve().
◆ XPRS_LP_OPTIMAL_SCALEDINFEAS
#define XPRS_LP_OPTIMAL_SCALEDINFEAS 16 |
Definition at line 50 of file lpi_xprs.c.
Referenced by lpiSolve(), SCIPlpiIsDualFeasible(), SCIPlpiIsOptimal(), SCIPlpiIsPrimalFeasible(), and SCIPlpiIsStable().
◆ CHECK_ZERO
#define CHECK_ZERO | ( | messagehdlr, | |
x | |||
) |
Definition at line 52 of file lpi_xprs.c.
Referenced by lpiSolve(), lpiStrongbranch(), lpiStrongbranches(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiFree(), SCIPlpiGetBase(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiGetBounds(), SCIPlpiGetCoef(), SCIPlpiGetCols(), SCIPlpiGetDualfarkas(), SCIPlpiGetIntpar(), SCIPlpiGetNCols(), SCIPlpiGetNNonz(), SCIPlpiGetNRows(), SCIPlpiGetObj(), SCIPlpiGetObjsen(), SCIPlpiGetObjval(), SCIPlpiGetPrimalRay(), SCIPlpiGetRealpar(), SCIPlpiGetRows(), SCIPlpiGetSides(), SCIPlpiGetSol(), SCIPlpiGetState(), SCIPlpiLoadColLP(), SCIPlpiReadLP(), SCIPlpiReadState(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSetBase(), SCIPlpiSetIntpar(), SCIPlpiSetRealpar(), SCIPlpiSetState(), SCIPlpiSolveBarrier(), SCIPlpiWriteLP(), and SCIPlpiWriteState().
◆ ABORT_ZERO
#define ABORT_ZERO | ( | messagehdlr, | |
retval, | |||
x | |||
) |
Definition at line 61 of file lpi_xprs.c.
Referenced by SCIPlpiHasDualRay(), SCIPlpiHasPrimalRay(), SCIPlpiIsDualFeasible(), SCIPlpiIsIterlimExc(), SCIPlpiIsPrimalFeasible(), and SCIPlpiIsTimelimExc().
◆ COLS_PER_PACKET
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 72 of file lpi_xprs.c.
Referenced by colpacketNum().
◆ ROWS_PER_PACKET
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 74 of file lpi_xprs.c.
Referenced by rowpacketNum().
Typedef Documentation
◆ COLPACKET
typedef SCIP_DUALPACKET COLPACKET |
Definition at line 71 of file lpi_xprs.c.
◆ ROWPACKET
typedef SCIP_DUALPACKET ROWPACKET |
Definition at line 73 of file lpi_xprs.c.
Function Documentation
◆ debugCheckColrang()
|
static |
check that the column range fits
- Parameters
-
lpi LP interface structure firstcol first column to be deleted lastcol last column to be deleted
Definition at line 133 of file lpi_xprs.c.
References SCIP_LPi::ncols, and SCIP_LPi::xprslp.
Referenced by SCIPlpiDelCols(), and SCIPlpiGetCols().
◆ debugCheckRowrang()
|
static |
check that the row range fits
- Parameters
-
lpi LP interface structure firstrow first row to be deleted lastrow last row to be deleted
Definition at line 147 of file lpi_xprs.c.
References SCIP_LPi::nrows, and SCIP_LPi::xprslp.
Referenced by SCIPlpiDelRows(), and SCIPlpiGetRows().
◆ ensureBoundchgMem()
|
static |
resizes larray and uarray to have at least num entries and fill it with 'L' and 'U' for the lower and upper bound markers
- Parameters
-
lpi LP interface structure num minimal number of entries in array
Definition at line 178 of file lpi_xprs.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 rhsarray to have at least num entries
- Parameters
-
lpi LP interface structure num minimal number of entries in array
Definition at line 207 of file lpi_xprs.c.
References BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::senarray, and SCIP_LPi::sidechgsize.
Referenced by SCIPlpiAddRows(), SCIPlpiChgSides(), SCIPlpiGetSides(), SCIPlpiGetSol(), 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 231 of file lpi_xprs.c.
References BMSreallocMemoryArray, SCIP_LPi::indarray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::valarray, and SCIP_LPi::valsize.
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetCols(), SCIPlpiGetRows(), SCIPlpiLoadColLP(), 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 254 of file lpi_xprs.c.
References BMSreallocMemoryArray, SCIP_LPi::cstat, SCIP_LPi::cstatsize, MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiGetState(), 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 276 of file lpi_xprs.c.
References BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rstat, SCIP_LPi::rstatsize, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiGetState(), 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 306 of file lpi_xprs.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 315 of file lpi_xprs.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 (row status w.r.t. slack columns)
Definition at line 324 of file lpi_xprs.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 (row status w.r.t. slack columns)
Definition at line 340 of file lpi_xprs.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 356 of file lpi_xprs.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 377 of file lpi_xprs.c.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), NULL, and rowpacketNum().
Referenced by SCIPlpiFreeState().
◆ xprsObjsen()
|
static |
converts SCIP's objective sense into CPLEX's objective sense
- Parameters
-
objsen objective sense
Definition at line 401 of file lpi_xprs.c.
References SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIPABORT, and SCIPerrorMessage.
Referenced by SCIPlpiChgObjsen().
◆ convertSides()
|
static |
converts SCIP's lhs/rhs pairs into Xpress' sen/rhs/rng
- Parameters
-
lpi LP interface structure nrows number of rows lhss left hand side vector rhss right hand side vector
Definition at line 420 of file lpi_xprs.c.
References SCIP_LPi::nrows, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, and SCIP_LPi::senarray.
Referenced by SCIPlpiAddRows(), SCIPlpiChgSides(), and SCIPlpiLoadColLP().
◆ reconvertBothSides()
|
static |
converts Xpress' sen/rhs/rng triplets into SCIP's lhs/rhs pairs
- Parameters
-
lpi LP interface structure nrows number of rows lhss buffer to store the left hand side vector rhss buffer to store the right hand side vector
Definition at line 469 of file lpi_xprs.c.
References SCIP_LPi::nrows, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by reconvertSides().
◆ reconvertLhs()
converts Xpress' 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 lhss buffer to store the left hand side vector
Definition at line 518 of file lpi_xprs.c.
References SCIP_LPi::nrows, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by reconvertSides().
◆ reconvertRhs()
converts Xpress' 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 rhss buffer to store the right hand side vector
Definition at line 563 of file lpi_xprs.c.
References SCIP_LPi::nrows, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by reconvertSides().
◆ reconvertSides()
converts Xpress' 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 608 of file lpi_xprs.c.
References NULL, reconvertBothSides(), reconvertLhs(), and reconvertRhs().
Referenced by SCIPlpiGetSides().
◆ invalidateSolution()
|
static |
marks the current LP to be unsolved
Definition at line 628 of file lpi_xprs.c.
References NULL, and SCIP_LPi::solstat.
Referenced by lpiSolve(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiLoadColLP(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), and SCIPlpiSetBase().
◆ lpiSolve()
|
static |
solve LP
- Parameters
-
lpi LP interface structure method indicates the method to use ('p' - primal, 'd' - dual, 'b' - barrier)
Definition at line 1839 of file lpi_xprs.c.
References CHECK_ZERO, SCIP_LPi::clearstate, FALSE, invalidateSolution(), SCIP_LPi::iterations, SCIP_LPi::messagehdlr, NULL, SCIP_LPi::par_fastlp, SCIP_LPi::par_presolve, SCIP_OKAY, SCIPdebugMessage, SCIP_LPi::solisbasic, SCIP_LPi::solstat, TRUE, XPRS_LP_OPTIMAL_SCALEDINFEAS, XPRS_LPQUICKPRESOLVE, and SCIP_LPi::xprslp.
Referenced by SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
◆ lpiStrongbranch()
|
static |
performs strong branching iterations on one candidate
- Parameters
-
lpi LP interface structure col column to apply strong branching on psol current primal solution value of column itlim iteration limit for strong branchings down stores dual bound after branching column down up stores dual bound after branching column up downvalid stores whether the returned down value is a valid dual bound; otherwise, it can only be used as an estimate value upvalid stores whether the returned up value is a valid dual bound; otherwise, it can only be used as an estimate value iter stores total number of strong branching iterations, or -1; may be NULL
Definition at line 2022 of file lpi_xprs.c.
References CHECK_ZERO, EPSCEIL, EPSFLOOR, FALSE, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_OBJSEN_MINIMIZE, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetObjsen(), TRUE, and SCIP_LPi::xprslp.
Referenced by SCIPlpiStrongbranchFrac(), and SCIPlpiStrongbranchInt().
◆ lpiStrongbranches()
|
static |
performs strong branching iterations on given candidates
- Parameters
-
lpi LP interface structure cols columns to apply strong branching on ncols number of columns psols current primal solution values of columns (might be integral) itlim iteration limit for strong branchings down stores dual bounds after branching columns down up stores dual bounds after branching columns up downvalid stores whether the returned down values are valid dual bounds; otherwise, they can only be used as an estimate values upvalid stores whether the returned up values are a valid dual bounds; otherwise, they can only be used as an estimate values iter stores total number of strong branching iterations, or -1; may be NULL
Definition at line 2106 of file lpi_xprs.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, EPSCEIL, EPSFLOOR, FALSE, SCIP_LPi::messagehdlr, SCIP_LPi::ncols, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OBJSEN_MINIMIZE, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetObjsen(), TRUE, and SCIP_LPi::xprslp.
Referenced by SCIPlpiStrongbranchesFrac(), and SCIPlpiStrongbranchesInt().
Variable Documentation
◆ xprsname
|
static |
Definition at line 647 of file lpi_xprs.c.
Referenced by SCIPlpiGetSolverName().