LP interface for SoPlex version 2.0 and higher.
This is an implementation of SCIP's LP interface for SoPlex using the extended and improved interface of SoPlex 2.0
For debugging purposes, the SoPlex results can be double checked with CPLEX if SCIP_WITH_LPSCHECK is defined. This may yield false positives, since the LP is dumped to a file for transfering it to CPLEX, hence, precision may be lost.
Definition in file lpi_spx2.cpp.
#include "scip/config.h"
#include "soplex.h"
#include "spxgithash.h"
#include "scip/pub_message.h"
#include <cassert>
#include "lpi/lpi.h"
#include "scip/bitencode.h"
Go to the source code of this file.
Data Structures | |
struct | SCIP_LPi |
struct | SCIP_LPiState |
struct | SCIP_LPiNorms |
Macros | |
#define | STRONGBRANCH_RESTOREBASIS |
#define | CHECK_SOPLEX_PARAM(x) |
#define | SOPLEX_SUBVERSION 0 |
#define | SOPLEX_APIVERSION 0 |
#define | SOPLEX_VERBLEVEL 5 |
#define | NULL 0 |
#define | SOPLEX_TRY(messagehdlr, x) |
#define | SOPLEX_TRY_ABORT(x) |
#define | COLS_PER_PACKET SCIP_DUALPACKETSIZE |
#define | ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Variables | |
static const char | spxname [20] = {'S', 'o', 'P', 'l', 'e', 'x', ' ', SOPLEX_VERSION/100 + '0', '.', (SOPLEX_VERSION % 100)/10 + '0', '.', SOPLEX_VERSION % 10 + '0', '\0'} |
static const char | spxdesc [200] |
#define STRONGBRANCH_RESTOREBASIS |
if defined then in SCIPlpiStrongbranch() we restore the basis after the down branch and after the up branch; if false only after the end of a strong branching phase, which however seems to mostly increase strong branching time and iterations
Definition at line 39 of file lpi_spx2.cpp.
#define CHECK_SOPLEX_PARAM | ( | x | ) |
Definition at line 79 of file lpi_spx2.cpp.
#define SOPLEX_SUBVERSION 0 |
Definition at line 102 of file lpi_spx2.cpp.
#define SOPLEX_APIVERSION 0 |
Definition at line 106 of file lpi_spx2.cpp.
#define SOPLEX_VERBLEVEL 5 |
verbosity level for LPINFO
Definition at line 132 of file lpi_spx2.cpp.
#define NULL 0 |
Definition at line 142 of file lpi_spx2.cpp.
#define SOPLEX_TRY | ( | messagehdlr, | |
x ) |
Macro for a single SoPlex call for which exceptions have to be catched - return an LP error. We make no distinction between different exception types, e.g., between memory allocation and other exceptions.
Definition at line 153 of file lpi_spx2.cpp.
Referenced by SCIPlpiChgCoef(), SCIPlpiChgObjsen(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiReadState(), SCIPlpiSetBase(), and SCIPlpiWriteState().
#define SOPLEX_TRY_ABORT | ( | x | ) |
Definition at line 198 of file lpi_spx2.cpp.
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 761 of file lpi_spx2.cpp.
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 763 of file lpi_spx2.cpp.
|
static |
resizes cstat array to have at least num entries
lpi | LP interface structure |
num | minimal number of entries in array |
Definition at line 807 of file lpi_spx2.cpp.
References assert(), BMSreallocMemoryArray, SCIP_LPi::cstat, SCIP_LPi::cstatsize, MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiGetState(), 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 829 of file lpi_spx2.cpp.
References assert(), BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rstat, SCIP_LPi::rstatsize, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiGetState(), and SCIPlpiSetState().
|
static |
returns the number of packets needed to store column packet information
ncols | number of columns to store |
Definition at line 858 of file lpi_spx2.cpp.
References COLS_PER_PACKET.
Referenced by lpistateCreate(), lpistateCreate(), lpistateFree(), and lpistateFree().
|
static |
returns the number of packets needed to store row packet information
nrows | number of rows to store |
Definition at line 867 of file lpi_spx2.cpp.
References ROWS_PER_PACKET.
Referenced by lpistateCreate(), lpistateCreate(), lpistateFree(), and lpistateFree().
|
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 876 of file lpi_spx2.cpp.
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 892 of file lpi_spx2.cpp.
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 908 of file lpi_spx2.cpp.
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 932 of file lpi_spx2.cpp.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), NULL, and rowpacketNum().
Referenced by SCIPlpiFreeState().
|
static |
marks the current LP to be unsolved
Definition at line 959 of file lpi_spx2.cpp.
References assert(), FALSE, NULL, and SCIP_LPi::solved.
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiLoadColLP(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSetBase(), spxSolve(), and spxSolve().
|
static |
solves LP – used for both, primal and dual simplex, because SoPlex doesn't distinct the two cases
lpi | LP interface structure |
Definition at line 2362 of file lpi_spx2.cpp.
References assert(), invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, SCIPmessagePrintWarning(), SCIP_LPi::solved, SOPLEX_VERBLEVEL, SCIP_LPi::spx, TRUE, and x.
Referenced by SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
|
static |
performs strong branching iterations on one arbitrary candidate
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 2507 of file lpi_spx2.cpp.
References assert(), EPSCEIL, EPSFLOOR, FALSE, NULL, SCIP_Bool, SCIP_LPERROR, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SOPLEX_VERBLEVEL, SCIP_LPi::spx, and TRUE.
Referenced by SCIPlpiStrongbranchesFrac(), SCIPlpiStrongbranchesInt(), SCIPlpiStrongbranchFrac(), and SCIPlpiStrongbranchInt().
|
static |
returns, whether the given file exists
filename | file name |
Definition at line 4608 of file lpi_spx2.cpp.
References FALSE, NULL, SCIP_Bool, and TRUE.
Referenced by SCIPlpiReadLP().
|
static |
Definition at line 979 of file lpi_spx2.cpp.
|
static |
Definition at line 981 of file lpi_spx2.cpp.