LP interface for HiGHS 1.4 and higher.
This is an implementation of SCIP's LP interface for the open-source solver HiGHS.
The most important open todos are:
Definition in file lpi_highs.cpp.
#include <cassert>#include <cstdlib>#include <string>#include <vector>#include <Highs.h>#include <lp_data/HighsLpUtils.h>#include "lpi/lpi.h"#include "scip/bitencode.h"#include "scip/pub_message.h"#include "scip/type_lp.h"Go to the source code of this file.
Data Structures | |
| class | HighsSCIP |
| struct | SCIP_LPi |
| struct | SCIP_LPiState |
Macros | |
| #define | HIGHS_relDiff(val1, val2) |
| #define | HIGHS_CALL(x) |
| #define | HIGHS_CALL_WITH_WARNING(x) |
| #define | COLS_PER_PACKET SCIP_DUALPACKETSIZE |
| #define | ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Miscellaneous Methods | |
| static char | highsname [30] |
| static char | highsdesc [200] |
| 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) |
| #define HIGHS_relDiff | ( | val1, | |
| val2 ) |
| #define HIGHS_CALL | ( | x | ) |
Macro for a single HiGHS call for which exceptions have to be caught. We make no distinction between different exception types, e.g., between memory allocation and other exceptions. Additionally, we check if HiGHS returns kOk as status and return an LP error if not.
Definition at line 70 of file lpi_highs.cpp.
Referenced by checkMatrixValue(), lpiSolve(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiClearState(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiGetCoef(), SCIPlpiGetCols(), SCIPlpiGetDualfarkas(), SCIPlpiGetIntpar(), SCIPlpiGetObjval(), SCIPlpiGetPrimalRay(), SCIPlpiGetRealpar(), SCIPlpiGetRows(), SCIPlpiGetSol(), SCIPlpiHasDualRay(), SCIPlpiHasPrimalRay(), SCIPlpiIsStable(), SCIPlpiLoadColLP(), SCIPlpiReadLP(), SCIPlpiReadState(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSetBase(), SCIPlpiSetIntpar(), SCIPlpiSetRealpar(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiWriteLP(), and SCIPlpiWriteState().
| #define HIGHS_CALL_WITH_WARNING | ( | x | ) |
A relaxed version of HIGHS_CALL that accepts status kWarning.
Definition at line 102 of file lpi_highs.cpp.
Referenced by lpiSolve(), SCIPlpiAddCols(), SCIPlpiAddRows(), and SCIPlpiGetIterations().
| #define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
each column needs two bits of information (basic/on_lower/on_upper)
Definition at line 172 of file lpi_highs.cpp.
| #define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
each row needs two bit of information (basic/on_lower/on_upper)
Definition at line 174 of file lpi_highs.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 191 of file lpi_highs.cpp.
References assert(), BMSreallocMemoryArray, SCIP_LPi::cstat, SCIP_LPi::cstatsize, ensureCstatMem(), MAX, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.
|
static |
resizes rstat array to have at least num entries
| lpi | LP interface structure |
| num | minimal number of entries in array |
Definition at line 214 of file lpi_highs.cpp.
References assert(), BMSreallocMemoryArray, ensureRstatMem(), MAX, NULL, SCIP_LPi::rstat, SCIP_LPi::rstatsize, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.
|
static |
returns the number of packets needed to store column packet information
| ncols | number of columns to store |
Definition at line 242 of file lpi_highs.cpp.
References colpacketNum(), and COLS_PER_PACKET.
|
static |
returns the number of packets needed to store row packet information
| nrows | number of rows to store |
Definition at line 251 of file lpi_highs.cpp.
References rowpacketNum(), and ROWS_PER_PACKET.
|
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 260 of file lpi_highs.cpp.
References assert(), lpistatePack(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPencodeDualBit().
|
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 276 of file lpi_highs.cpp.
References assert(), lpistateUnpack(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPdecodeDualBit().
|
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 292 of file lpi_highs.cpp.
References assert(), BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), lpistateCreate(), NULL, rowpacketNum(), SCIP_ALLOC, and SCIP_OKAY.
|
static |
frees LPi state information
| lpistate | pointer to LPi state information (like basis information) |
| blkmem | block memory |
Definition at line 316 of file lpi_highs.cpp.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), lpistateFree(), NULL, and rowpacketNum().
|
static |
marks the current LP to be unsolved
| lpi | LP interface structure |
Definition at line 340 of file lpi_highs.cpp.
References assert(), FALSE, invalidateSolution(), NULL, and SCIP_LPi::solved.
|
static |
converts basis statuses
Definition at line 350 of file lpi_highs.cpp.
References assert(), basestatToHighsBasisStatus(), SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, and SCIPerrorMessage.
Referenced by basestatToHighsBasisStatus(), and SCIPlpiSetBase().
|
static |
returns a string representation of the simplex strategy parameter
Definition at line 373 of file lpi_highs.cpp.
References simplexStrategyToString().
Referenced by lpiSolve(), and simplexStrategyToString().
|
static |
checks that matrix values are within range defined by HiGHS parameters
| lpi | LP interface structure |
| value | value of coefficient |
Definition at line 396 of file lpi_highs.cpp.
References assert(), checkMatrixValue(), SCIP_LPi::highs, HIGHS_CALL, SCIP_OKAY, and SCIP_Real.
Referenced by checkMatrixValue(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgCoef(), and SCIPlpiLoadColLP().
|
static |
calls HiGHS to solve the LP with given settings
| lpi | LP interface structure |
Definition at line 417 of file lpi_highs.cpp.
References assert(), FALSE, SCIP_LPi::fromscratch, SCIP_LPi::highs, HIGHS_CALL, HIGHS_CALL_WITH_WARNING, lpiSolve(), NULL, SCIP_LPi::presolve, SCIP_CALL, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, simplexStrategyToString(), SCIP_LPi::solved, and TRUE.
Referenced by lpiSolve(), lpiSolve(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
|
static |
Definition at line 527 of file lpi_highs.cpp.
Referenced by SCIPlpiGetSolverName().
|
static |
Definition at line 528 of file lpi_highs.cpp.
Referenced by SCIPlpiGetSolverDesc().