exact LP interface for SoPlex
This is an implementation of SCIP's LP interface for SoPlex.
For debugging purposes, the SoPlex results can be double checked with CPLEX if WITH_LPSCHECK is defined. This may yield false positives, since the LP is dumped to a file for transferring it to CPLEX, hence, precision may be lost.
Definition in file lpiexact_spx.cpp.
#include "scip/def.h"#include "blockmemshell/memory.h"#include "scip/type_retcode.h"#include "lpiexact/type_lpiexact.h"#include "lpiexact/lpiexact.h"#include "scip/rational.h"#include "scip/rationalgmp.h"#include "soplex.h"#include "spxgithash.h"#include "scip/pub_message.h"#include "scip/struct_rational.h"#include <cassert>#include "scip/bitencode.h"Go to the source code of this file.
Data Structures | |
| class | SPxexSCIP |
| struct | SCIP_LPiExact |
| struct | SCIP_LPiState |
Macros | |
| #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 CHECK_SOPLEX_PARAM | ( | x | ) |
Definition at line 46 of file lpiexact_spx.cpp.
Referenced by SPxexSCIP::setRep(), and SPxexSCIP::trySolve().
| #define SOPLEX_SUBVERSION 0 |
Definition at line 72 of file lpiexact_spx.cpp.
| #define SOPLEX_APIVERSION 0 |
Definition at line 76 of file lpiexact_spx.cpp.
| #define SOPLEX_VERBLEVEL 5 |
verbosity level for LPINFO
Definition at line 114 of file lpiexact_spx.cpp.
Referenced by SPxexSCIP::doSolve().
| #define NULL 0 |
Definition at line 125 of file lpiexact_spx.cpp.
Referenced by SPxexSCIP::setProbname(), SPxexSCIP::SPxexSCIP(), and SPxexSCIP::~SPxexSCIP().
| #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 136 of file lpiexact_spx.cpp.
Referenced by SCIPlpiDelColset(), SCIPlpiExactChgCoef(), SCIPlpiExactChgObjsen(), SCIPlpiExactClear(), SCIPlpiExactCreate(), SCIPlpiExactDelCols(), SCIPlpiExactDelRows(), SCIPlpiExactDelRowset(), SCIPlpiExactReadState(), SCIPlpiExactSetBase(), and SCIPlpiExactWriteState().
| #define SOPLEX_TRY_ABORT | ( | x | ) |
Definition at line 181 of file lpiexact_spx.cpp.
Referenced by SPxexSCIP::SPxexSCIP().
| #define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 545 of file lpiexact_spx.cpp.
| #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 547 of file lpiexact_spx.cpp.
|
static |
| lpi | exact lpi |
| r | scip rational |
| spxr | soplex rational |
Definition at line 197 of file lpiexact_spx.cpp.
References FALSE, r, SCIP_ISFPREPRESENTABLE_UNKNOWN, SCIPlpiExactIsInfinity(), SCIPrationalSetInfinity(), and SCIPrationalSetNegInfinity().
Referenced by RsetSpxVector(), SCIPlpiExactGetBInvCol(), SCIPlpiExactGetBInvRow(), SCIPlpiExactGetBounds(), SCIPlpiExactGetCoef(), SCIPlpiExactGetCols(), SCIPlpiExactGetObj(), SCIPlpiExactGetObjval(), SCIPlpiExactGetRows(), SCIPlpiExactGetSides(), and SCIPlpiExactGetSol().
|
static |
| lpi | exact LPI |
| r | SCIP_RATIONAL array |
| src | SoPlex rational vector |
Definition at line 220 of file lpiexact_spx.cpp.
References assert(), i, NULL, r, and RsetSpxR().
Referenced by SCIPlpiExactGetDualfarkas(), SCIPlpiExactGetPrimalRay(), and SCIPlpiExactGetSol().
|
static |
set the value of a SoPlex rational from a SCIP_RATIONAL
| lpi | exact LPI |
| spxr | SoPlex Rational |
| src | SCIP_RATIONAL |
Definition at line 235 of file lpiexact_spx.cpp.
References SCIPlpiExactInfinity(), SCIPrationalGetReal(), SCIPrationalIsAbsInfinity(), and SCIPrationalIsPositive().
Referenced by SCIPlpiExactAddCols(), SCIPlpiExactAddRows(), SCIPlpiExactChgBounds(), SCIPlpiExactChgCoef(), SCIPlpiExactChgObj(), SCIPlpiExactChgSides(), and SCIPlpiExactLoadColLP().
|
static |
resizes cstat array to have at least num entries
| lpi | LP interface structure |
| num | minimal number of entries in array |
Definition at line 582 of file lpiexact_spx.cpp.
References assert(), BMSreallocMemoryArray, SCIP_LPiExact::cstat, SCIP_LPiExact::cstatsize, MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiExactGetState(), and SCIPlpiExactSetState().
|
static |
resizes rstat array to have at least num entries
| lpi | LP interface structure |
| num | minimal number of entries in array |
Definition at line 604 of file lpiexact_spx.cpp.
References assert(), BMSreallocMemoryArray, MAX, NULL, SCIP_LPiExact::rstat, SCIP_LPiExact::rstatsize, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiExactGetState(), and SCIPlpiExactSetState().
|
static |
returns the number of packets needed to store column packet information
| ncols | number of columns to store |
Definition at line 633 of file lpiexact_spx.cpp.
References COLS_PER_PACKET.
Referenced by lpistateCreate(), and lpistateFree().
|
static |
returns the number of packets needed to store row packet information
| nrows | number of rows to store |
Definition at line 642 of file lpiexact_spx.cpp.
References ROWS_PER_PACKET.
Referenced by lpistateCreate(), 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 651 of file lpiexact_spx.cpp.
References assert(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPencodeDualBit().
Referenced by SCIPlpiExactGetState().
|
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 667 of file lpiexact_spx.cpp.
References assert(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPdecodeDualBit().
Referenced by SCIPlpiExactSetState().
|
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 683 of file lpiexact_spx.cpp.
References assert(), BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), NULL, rowpacketNum(), SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiExactGetState().
|
static |
frees LPi state information
| lpistate | pointer to LPi state information (like basis information) |
| blkmem | block memory |
Definition at line 707 of file lpiexact_spx.cpp.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), NULL, and rowpacketNum().
Referenced by SCIPlpiExactFreeState().
|
static |
marks the current LP to be unsolved
Definition at line 734 of file lpiexact_spx.cpp.
References assert(), FALSE, NULL, and SCIP_LPiExact::solved.
Referenced by SCIPlpiDelColset(), SCIPlpiExactAddCols(), SCIPlpiExactAddRows(), SCIPlpiExactChgBounds(), SCIPlpiExactChgCoef(), SCIPlpiExactChgObj(), SCIPlpiExactChgObjsen(), SCIPlpiExactChgSides(), SCIPlpiExactClear(), SCIPlpiExactCreate(), SCIPlpiExactDelCols(), SCIPlpiExactDelRows(), SCIPlpiExactDelRowset(), SCIPlpiExactLoadColLP(), SCIPlpiExactSetBase(), 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 1944 of file lpiexact_spx.cpp.
References assert(), SPxexSCIP::doSolve(), SPxexSCIP::getFromScratch(), SPxexSCIP::getLpInfo(), invalidateSolution(), SCIP_LPiExact::messagehdlr, NULL, SPxexSCIP::preStrongbranchingBasisFreed(), SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, SCIPmessagePrintWarning(), SCIP_LPiExact::solved, SOPLEX_VERBLEVEL, SCIP_LPiExact::spx, TRUE, and x.
Referenced by SCIPlpiExactSolveDual(), and SCIPlpiExactSolvePrimal().
|
static |
returns, whether the given file exists
| filename | file name |
Definition at line 3392 of file lpiexact_spx.cpp.
References FALSE, NULL, SCIP_Bool, and TRUE.
Referenced by SCIPlpiExactReadLP().
|
static |
Definition at line 754 of file lpiexact_spx.cpp.
|
static |
Definition at line 756 of file lpiexact_spx.cpp.