Detailed Description
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 |
Typedefs | |
| typedef SCIP_DUALPACKET | COLPACKET |
| typedef SCIP_DUALPACKET | ROWPACKET |
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] |
Macro Definition Documentation
◆ CHECK_SOPLEX_PARAM
| #define CHECK_SOPLEX_PARAM | ( | x | ) |
Definition at line 46 of file lpiexact_spx.cpp.
◆ SOPLEX_SUBVERSION
| #define SOPLEX_SUBVERSION 0 |
Definition at line 72 of file lpiexact_spx.cpp.
◆ SOPLEX_APIVERSION
| #define SOPLEX_APIVERSION 0 |
Definition at line 76 of file lpiexact_spx.cpp.
◆ SOPLEX_VERBLEVEL
| #define SOPLEX_VERBLEVEL 5 |
verbosity level for LPINFO
Definition at line 114 of file lpiexact_spx.cpp.
◆ NULL
| #define NULL 0 |
Definition at line 125 of file lpiexact_spx.cpp.
◆ SOPLEX_TRY
| #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.
◆ SOPLEX_TRY_ABORT
| #define SOPLEX_TRY_ABORT | ( | x | ) |
Definition at line 181 of file lpiexact_spx.cpp.
◆ COLS_PER_PACKET
| #define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 545 of file lpiexact_spx.cpp.
◆ ROWS_PER_PACKET
| #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 547 of file lpiexact_spx.cpp.
Typedef Documentation
◆ COLPACKET
| typedef SCIP_DUALPACKET COLPACKET |
Definition at line 544 of file lpiexact_spx.cpp.
◆ ROWPACKET
| typedef SCIP_DUALPACKET ROWPACKET |
Definition at line 546 of file lpiexact_spx.cpp.
Function Documentation
◆ RsetSpxR()
|
static |
- Parameters
-
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().
◆ RsetSpxVector()
|
static |
- Parameters
-
lpi exact LPI r SCIP_RATIONAL array src SoPlex rational vector
Definition at line 220 of file lpiexact_spx.cpp.
References NULL, r, and RsetSpxR().
Referenced by SCIPlpiExactGetDualfarkas(), SCIPlpiExactGetPrimalRay(), and SCIPlpiExactGetSol().
◆ SpxRSetRat()
|
static |
set the value of a SoPlex rational from a SCIP_RATIONAL
- Parameters
-
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().
◆ 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 582 of file lpiexact_spx.cpp.
References BMSreallocMemoryArray, SCIP_LPiExact::cstat, SCIP_LPiExact::cstatsize, MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiExactGetState(), and SCIPlpiExactSetState().
◆ 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 604 of file lpiexact_spx.cpp.
References BMSreallocMemoryArray, MAX, NULL, SCIP_LPiExact::rstat, SCIP_LPiExact::rstatsize, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiExactGetState(), and SCIPlpiExactSetState().
◆ colpacketNum()
|
static |
returns the number of packets needed to store column packet information
- Parameters
-
ncols number of columns to store
Definition at line 633 of file lpiexact_spx.cpp.
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 642 of file lpiexact_spx.cpp.
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 651 of file lpiexact_spx.cpp.
References SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPencodeDualBit().
Referenced by SCIPlpiExactGetState().
◆ 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 667 of file lpiexact_spx.cpp.
References SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPdecodeDualBit().
Referenced by SCIPlpiExactSetState().
◆ 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 683 of file lpiexact_spx.cpp.
References BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), NULL, rowpacketNum(), SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiExactGetState().
◆ lpistateFree()
|
static |
frees LPi state information
- Parameters
-
lpistate pointer to LPi state information (like basis information) blkmem block memory
Definition at line 707 of file lpiexact_spx.cpp.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), NULL, and rowpacketNum().
Referenced by SCIPlpiExactFreeState().
◆ invalidateSolution()
|
static |
marks the current LP to be unsolved
Definition at line 734 of file lpiexact_spx.cpp.
References 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().
◆ spxSolve()
|
static |
solves LP – used for both, primal and dual simplex, because SoPlex doesn't distinct the two cases
- Parameters
-
lpi LP interface structure
Definition at line 1957 of file lpiexact_spx.cpp.
References 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, Status(), TRUE, UNKNOWN, and x.
Referenced by SCIPlpiExactSolveDual(), and SCIPlpiExactSolvePrimal().
◆ fileExists()
|
static |
returns, whether the given file exists
- Parameters
-
filename file name
Definition at line 3405 of file lpiexact_spx.cpp.
References FALSE, NULL, and TRUE.
Referenced by SCIPlpiExactReadLP().
Variable Documentation
◆ spxname
|
static |
Definition at line 754 of file lpiexact_spx.cpp.
Referenced by SCIPlpiExactGetSolverName().
◆ spxdesc
|
static |
Definition at line 756 of file lpiexact_spx.cpp.
Referenced by SCIPlpiExactGetSolverDesc().