Detailed Description
LP interface for Clp.
Notes on this interface:
Currently, Clp (Version 1.16) supports two ways of adding rows/columns from arrays: One uses a length array that for each row/column specifies the number of nonzeros to be added. The second uses the
beg
array that gives the starting index for each row/column. We use the latter variant. Since for LPI there should be no gaps in the corresponding arrays, i.e., every entry inval
and ind gives a nonzero entry, one can switch between the two formats. With the current Clp implementation both formats involve an overhead:- For the
beg
variant, Clp gets the end of the array from the last position inbeg
(i.e., the entry one after the last row/column) and we have to copy and extendbeg
for this purpose. In the matrix implementation a length information is then again computed. - For the
length
variant, Clp computes the number of elements from this length variant and there exists no matrix implementation that uses the length information, i.e., it is recomputed again.
Concluding: the implementation of Clp/CoinPackeMatrix could be improved. The functions affected by this are SCIPlpiLoadColLP(), SCIPlpiAddCols(), SCIPlpiAddRows()
- For the
- In former versions Clp used an "auxiliary model" that allows to save time when the model is scaled. This is discarded from version higher than 1.8.2.
- Clp needs the setting of several special flags to make sure that necessary data (e.g., rays etc.) are available. If the FASTMIP option in SCIP is true, some settings that are supposed to be faster are used. We tried to use the best settings, while still working correctly. These settings probably have to be adapted to future Clp versions. Maybe more possibilities will appear.
- At several places this interface corrects the return value of some Clp functions, e.g., isProvenPrimalInfeasible(). Currently (Version 1.16) no change in the Clp functions will be made, but this might change in the future.
Definition in file lpi_clp.cpp.
#include <ClpSimplex.hpp>
#include <ClpPrimalColumnSteepest.hpp>
#include <ClpDualRowSteepest.hpp>
#include <CoinIndexedVector.hpp>
#include <ClpConfig.h>
#include <config_clp.h>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
#include "lpi/lpi.h"
#include "scip/bitencode.h"
#include "scip/pub_message.h"
Go to the source code of this file.
Data Structures | |
struct | SCIP_LPi |
struct | SCIP_LPiState |
Macros | |
#define | CLP_VERSION VERSION |
#define | SUMINFEASBOUND 1.0e-3 |
#define | COLS_PER_PACKET SCIP_DUALPACKETSIZE |
#define | ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Typedefs | |
typedef SCIP_DUALPACKET | COLPACKET |
typedef SCIP_DUALPACKET | ROWPACKET |
Macro Definition Documentation
◆ CLP_VERSION
#define CLP_VERSION VERSION |
Definition at line 68 of file lpi_clp.cpp.
Referenced by SCIPlpiGetSolverName().
◆ SUMINFEASBOUND
#define SUMINFEASBOUND 1.0e-3 |
Definition at line 92 of file lpi_clp.cpp.
Referenced by SCIPlpiGetSolFeasibility().
◆ COLS_PER_PACKET
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 118 of file lpi_clp.cpp.
Referenced by colpacketNum().
◆ ROWS_PER_PACKET
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 120 of file lpi_clp.cpp.
Referenced by rowpacketNum().
Typedef Documentation
◆ COLPACKET
typedef SCIP_DUALPACKET COLPACKET |
Definitions for storing basis status (copied from lpi_spx.cpp)
Definition at line 117 of file lpi_clp.cpp.
◆ ROWPACKET
typedef SCIP_DUALPACKET ROWPACKET |
Definition at line 119 of file lpi_clp.cpp.
Function Documentation
◆ 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 140 of file lpi_clp.cpp.
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 162 of file lpi_clp.cpp.
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 191 of file lpi_clp.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 200 of file lpi_clp.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 209 of file lpi_clp.cpp.
References SCIP_LPiState::ncols, SCIP_LPiState::nrows, 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
Definition at line 225 of file lpi_clp.cpp.
References SCIP_LPiState::ncols, SCIP_LPiState::nrows, 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 241 of file lpi_clp.cpp.
References BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), 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 262 of file lpi_clp.cpp.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), and rowpacketNum().
Referenced by SCIPlpiFreeState().
◆ invalidateSolution()
|
static |
marks the current LP to be unsolved
- Parameters
-
lpi LP interface structure
Definition at line 286 of file lpi_clp.cpp.
References 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(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
◆ setFactorizationFrequency()
|
static |
set factorization frequency
- Parameters
-
lpi LP interface structure
Definition at line 296 of file lpi_clp.cpp.
References SCIP_LPi::clp, NULL, and SCIP_LPi::setFactorizationFrequency.
◆ setFastmipClpParameters()
|
static |
set fastmip parameters of Clp
- Parameters
-
lpi LP interface structure
Definition at line 312 of file lpi_clp.cpp.
References SCIP_LPi::clp, SCIP_LPi::fastmip, NULL, and TRUE.
Referenced by SCIPlpiSetIntpar().
◆ unsetFastmipClpParameters()
|
static |
unset fastmip parameters of Clp (reset to default parameters)
- Parameters
-
lpi LP interface structure
Definition at line 410 of file lpi_clp.cpp.
References SCIP_LPi::clp, FALSE, SCIP_LPi::fastmip, and NULL.
Referenced by SCIPlpiSetIntpar().
◆ fileExists()
|
static |
returns, whether the given file exists
- Parameters
-
filename file name
Definition at line 3930 of file lpi_clp.cpp.
Referenced by SCIPlpiReadLP().