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 in val
and ind gives a nonzero entry, one can switch between the two formats. With the current Clp implementation both formats involve an overhead:
beg
variant, Clp gets the end of the array from the last position in beg
(i.e., the entry one after the last row/column) and we have to copy and extend beg
for this purpose. In the matrix implementation a length information is then again computed.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()
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 |
#define CLP_VERSION VERSION |
Definition at line 77 of file lpi_clp.cpp.
Referenced by SCIPlpiGetSolverName().
#define SUMINFEASBOUND 1.0e-3 |
Definition at line 101 of file lpi_clp.cpp.
Referenced by SCIPlpiGetSolFeasibility().
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 127 of file lpi_clp.cpp.
Referenced by colpacketNum(), colpacketNum(), colpacketNum(), colpacketNum(), colpacketNum(), colpacketNum(), colpacketNum(), colpacketNum(), and colpacketNum().
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 129 of file lpi_clp.cpp.
Referenced by rowpacketNum(), rowpacketNum(), rowpacketNum(), rowpacketNum(), rowpacketNum(), rowpacketNum(), rowpacketNum(), rowpacketNum(), and rowpacketNum().
typedef SCIP_DUALPACKET COLPACKET |
Definitions for storing basis status (copied from lpi_spx.cpp)
each column needs two bits of information (basic/on_lower/on_upper)
Definition at line 126 of file lpi_clp.cpp.
typedef SCIP_DUALPACKET ROWPACKET |
each row needs two bit of information (basic/on_lower/on_upper)
Definition at line 128 of file lpi_clp.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 149 of file lpi_clp.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 171 of file lpi_clp.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 200 of file lpi_clp.cpp.
References COLS_PER_PACKET.
Referenced by lpistateCreate(), lpistateCreate(), lpistateCreate(), lpistateCreate(), lpistateCreate(), lpistateCreate(), lpistateFree(), lpistateFree(), lpistateFree(), lpistateFree(), lpistateFree(), and lpistateFree().
|
static |
returns the number of packets needed to store row packet information
nrows | number of rows to store |
Definition at line 209 of file lpi_clp.cpp.
References ROWS_PER_PACKET.
Referenced by lpistateCreate(), lpistateCreate(), lpistateCreate(), lpistateCreate(), lpistateCreate(), lpistateCreate(), lpistateFree(), lpistateFree(), lpistateFree(), lpistateFree(), 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 218 of file lpi_clp.cpp.
References assert(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, 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 234 of file lpi_clp.cpp.
References assert(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, 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 250 of file lpi_clp.cpp.
References assert(), BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), 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 271 of file lpi_clp.cpp.
References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), and rowpacketNum().
Referenced by SCIPlpiFreeState().
|
static |
marks the current LP to be unsolved
lpi | LP interface structure |
Definition at line 295 of file lpi_clp.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(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
|
static |
set factorization frequency
lpi | LP interface structure |
Definition at line 305 of file lpi_clp.cpp.
References assert(), SCIP_LPi::clp, NULL, and SCIP_LPi::setFactorizationFrequency.
Referenced by SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
|
static |
set fastmip parameters of Clp
lpi | LP interface structure |
Definition at line 321 of file lpi_clp.cpp.
References assert(), SCIP_LPi::clp, SCIP_LPi::fastmip, NULL, and TRUE.
Referenced by SCIPlpiSetIntpar().
|
static |
unset fastmip parameters of Clp (reset to default parameters)
lpi | LP interface structure |
Definition at line 419 of file lpi_clp.cpp.
References assert(), SCIP_LPi::clp, FALSE, SCIP_LPi::fastmip, and NULL.
Referenced by SCIPlpiSetIntpar().
|
static |
returns, whether the given file exists
filename | file name |
Definition at line 3956 of file lpi_clp.cpp.
References FALSE, SCIP_Bool, and TRUE.
Referenced by SCIPlpiReadLP().