LP interface for Gurobi.
This LPI is beta! It only works with Gurobi versions >= 7.0.2.
Definition in file lpi_grb.c.
#include <assert.h>
#include <string.h>
#include "gurobi_c.h"
#include "lpi/lpi.h"
#include "scip/pub_message.h"
#include "scip/pub_misc_sort.h"
Go to the source code of this file.
Macros | |
#define | GRB_INFBOUND 1e+20 |
#define | CHECK_ZERO(messagehdlr, x) |
#define | SVECTOR GRBsvec |
#define | SCIP_DUALPACKETSIZE (sizeof(SCIP_DUALPACKET)*4) |
#define | COLS_PER_PACKET SCIP_DUALPACKETSIZE |
#define | ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
#define | GRB_REFACTORMAXITERS 50 |
#define | NUMINTPARAM 4 |
#define | NUMDBLPARAM 6 |
Typedefs | |
typedef unsigned int | SCIP_DUALPACKET |
typedef SCIP_DUALPACKET | COLPACKET |
typedef SCIP_DUALPACKET | ROWPACKET |
typedef struct GRBParam | GRBPARAM |
Variables | |
static unsigned char | warnedbeta = 0 |
static const char * | intparam [NUMINTPARAM] |
static const char * | dblparam [NUMDBLPARAM] |
static const double | dblparammin [NUMDBLPARAM] |
static GRBenv * | grbenv = NULL |
static int | numlp = 0 |
static char | grbname [100] |
#define GRB_INFBOUND 1e+20 |
Definition at line 48 of file lpi_grb.c.
Referenced by SCIPlpiAddCols(), and SCIPlpiGetCols().
#define CHECK_ZERO | ( | messagehdlr, | |
x | |||
) |
Definition at line 50 of file lpi_grb.c.
Referenced by addRangeVars(), delRangeVars(), getBase(), getParameterValues(), lpiStrongbranch(), restoreLPData(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiClearState(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiFree(), SCIPlpiGetBase(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiGetBounds(), SCIPlpiGetCoef(), SCIPlpiGetCols(), SCIPlpiGetDualfarkas(), SCIPlpiGetNCols(), SCIPlpiGetNNonz(), SCIPlpiGetNorms(), SCIPlpiGetNRows(), SCIPlpiGetObj(), SCIPlpiGetObjsen(), SCIPlpiGetObjval(), SCIPlpiGetPrimalRay(), SCIPlpiGetRealpar(), SCIPlpiGetRealSolQuality(), SCIPlpiGetRows(), SCIPlpiGetSides(), SCIPlpiGetSol(), SCIPlpiGetSolFeasibility(), SCIPlpiLoadColLP(), SCIPlpiReadLP(), SCIPlpiReadState(), SCIPlpiSetBase(), SCIPlpiSetRealpar(), SCIPlpiSetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiWriteLP(), SCIPlpiWriteState(), setBase(), and setParameterValues().
#define SVECTOR GRBsvec |
Definition at line 59 of file lpi_grb.c.
Referenced by SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), and SCIPlpiGetBInvRow().
#define SCIP_DUALPACKETSIZE (sizeof(SCIP_DUALPACKET)*4) |
each entry needs two bits of information
Definition at line 63 of file lpi_grb.c.
Referenced by SCIPdecodeDualBitNeg(), and SCIPencodeDualBitNeg().
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 66 of file lpi_grb.c.
Referenced by colpacketNum().
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 68 of file lpi_grb.c.
Referenced by rowpacketNum().
#define GRB_REFACTORMAXITERS 50 |
maximal number of iterations allowed for producing a refactorization of the basis
Definition at line 74 of file lpi_grb.c.
Referenced by restoreLPData().
#define NUMINTPARAM 4 |
number of Gurobi integer parameters that can be changed
Definition at line 78 of file lpi_grb.c.
Referenced by checkParameterValues(), copyParameterValues(), getIntParam(), getParameterValues(), setIntParam(), and setParameterValues().
#define NUMDBLPARAM 6 |
number of Gurobi double parameters that can be changed
Definition at line 89 of file lpi_grb.c.
Referenced by checkParameterValues(), copyParameterValues(), getDblParam(), getParameterValues(), setDblParam(), and setParameterValues().
typedef unsigned int SCIP_DUALPACKET |
typedef SCIP_DUALPACKET COLPACKET |
typedef SCIP_DUALPACKET ROWPACKET |
|
static |
resizes senarray to have at least num entries
lpi | LP interface structure |
num | minimal number of entries in array |
Definition at line 188 of file lpi_grb.c.
References BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngidxarray, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::senarray, and SCIP_LPi::sidechgsize.
Referenced by SCIPlpiAddRows(), SCIPlpiChgSides(), SCIPlpiGetRows(), SCIPlpiGetSides(), SCIPlpiGetSol(), and SCIPlpiLoadColLP().
|
static |
resizes valarray and indarray to have at least num entries
lpi | LP interface structure |
num | minimal number of entries in array |
Definition at line 213 of file lpi_grb.c.
References BMSreallocMemoryArray, SCIP_LPi::indarray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::valarray, and SCIP_LPi::valsize.
Referenced by SCIPlpiScaleCol(), and SCIPlpiScaleRow().
|
static |
resizes cstat array to have at least num entries
lpi | LP interface structure |
num | minimal number of entries in array |
Definition at line 236 of file lpi_grb.c.
References BMSreallocMemoryArray, SCIP_LPi::cstat, SCIP_LPi::cstatsize, MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by getBase(), SCIPlpiSetBase(), 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 258 of file lpi_grb.c.
References BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rstat, SCIP_LPi::rstatsize, SCIP_ALLOC, and SCIP_OKAY.
Referenced by getBase(), SCIPlpiSetBase(), and SCIPlpiSetState().
|
static |
resizes rngrowmap array to have at least num entries
lpi | LP interface structure |
num | minimal number of entries in array |
Definition at line 280 of file lpi_grb.c.
References BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rngrowmap, SCIP_LPi::rngrowmapsize, SCIP_ALLOC, and SCIP_OKAY.
Referenced by addRangeInfo(), SCIPlpiAddRows(), and SCIPlpiChgSides().
|
static |
resizes rngrows and rngvals arrays to have at least num entries
lpi | LP interface structure |
num | minimal number of entries in array |
Definition at line 305 of file lpi_grb.c.
References BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rngrows, SCIP_LPi::rngrowssize, SCIP_LPi::rngvals, SCIP_ALLOC, and SCIP_OKAY.
Referenced by addRangeInfo(), and SCIPlpiChgSides().
|
static |
stores current basis in internal arrays of LPI data structure
lpi | LP interface structure |
success | whether basis information has successfully been obtained |
Definition at line 328 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::cstat, ensureCstatMem(), ensureRstatMem(), FALSE, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rstat, SCIP_CALL, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, and TRUE.
Referenced by lpiStrongbranch(), and SCIPlpiGetState().
|
static |
loads basis stored in internal arrays of LPI data structure into Gurobi
lpi | LP interface structure |
Definition at line 386 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::cstat, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rstat, SCIP_OKAY, and SCIPdebugMessage.
Referenced by lpiStrongbranch(), and SCIPlpiSetState().
|
static |
returns the number of packets needed to store column packet information
ncols | number of columns to store |
Definition at line 419 of file lpi_grb.c.
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 428 of file lpi_grb.c.
References ROWS_PER_PACKET.
Referenced by lpistateCreate(), and lpistateFree().
|
static |
encode a negated dual bit vector into packed format
inp | unpacked input vector |
out | buffer to store the packed vector |
count | number of elements |
Definition at line 440 of file lpi_grb.c.
References NULL, and SCIP_DUALPACKETSIZE.
Referenced by lpistatePack().
|
static |
decode a packed dual bit vector into negated unpacked format
inp | packed input vector |
out | buffer to store unpacked vector |
count | number of elements |
Definition at line 511 of file lpi_grb.c.
References NULL, and SCIP_DUALPACKETSIZE.
Referenced by lpistateUnpack().
|
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 587 of file lpi_grb.c.
References SCIP_LPiState::ncols, SCIP_LPiState::nrngrows, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPencodeDualBitNeg().
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 603 of file lpi_grb.c.
References SCIP_LPiState::ncols, SCIP_LPiState::nrngrows, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPdecodeDualBitNeg().
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 |
nrngrows | number of ranged rows |
Definition at line 619 of file lpi_grb.c.
References BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), NULL, 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 641 of file lpi_grb.c.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, colpacketNum(), NULL, and rowpacketNum().
Referenced by SCIPlpiFreeState().
|
static |
gets all Gurobi parameters used in LPI
lpi | LP interface structure |
grbparam | Gurobi parameters |
Definition at line 663 of file lpi_grb.c.
References CHECK_ZERO, dblparam, SCIP_LPi::grbenv, intparam, SCIP_LPi::messagehdlr, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_OKAY, and SCIPdebugMessage.
Referenced by checkParameterValues(), and SCIPlpiCreate().
|
static |
in debug mode, checks validity of Gurobi parameters
lpi | LP interface structure |
Definition at line 690 of file lpi_grb.c.
References SCIP_LPi::curparam, dblparammin, SCIP_CPXParam::dblparval, getParameterValues(), SCIP_CPXParam::intparval, MAX, NUMDBLPARAM, NUMINTPARAM, SCIP_CALL, and SCIP_OKAY.
Referenced by setParameterValues().
|
static |
sets all Gurobi parameters used in LPI
lpi | LP interface structure |
grbparam | Gurobi parameters |
Definition at line 710 of file lpi_grb.c.
References CHECK_ZERO, checkParameterValues(), SCIP_LPi::curparam, dblparam, dblparammin, SCIP_CPXParam::dblparval, SCIP_LPi::grbenv, intparam, SCIP_CPXParam::intparval, MAX, SCIP_LPi::messagehdlr, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by lpiStrongbranch(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
copies Gurobi parameters from source to dest
dest | destination Gurobi parameters |
source | original Gurobi parameters |
Definition at line 751 of file lpi_grb.c.
References NUMDBLPARAM, and NUMINTPARAM.
Referenced by SCIPlpiCreate().
|
static |
gets a single integer parameter value
lpi | LP interface structure |
param | parameter name |
p | value of parameter |
Definition at line 766 of file lpi_grb.c.
References SCIP_LPi::grbparam, intparam, NULL, NUMINTPARAM, SCIP_LPERROR, SCIP_OKAY, and SCIPerrorMessage.
Referenced by SCIPlpiGetIntpar().
|
static |
sets a single integer parameter value
lpi | LP interface structure |
param | parameter name |
parval | value of parameter |
Definition at line 791 of file lpi_grb.c.
References SCIP_LPi::grbparam, intparam, NULL, NUMINTPARAM, SCIP_LPERROR, SCIP_OKAY, and SCIPerrorMessage.
Referenced by SCIPlpiSetIntpar().
|
static |
gets a single double parameter value
Definition at line 816 of file lpi_grb.c.
References dblparam, SCIP_LPi::grbparam, NULL, NUMDBLPARAM, SCIP_LPERROR, SCIP_OKAY, and SCIPerrorMessage.
Referenced by lpiStrongbranch(), SCIPlpiGetIntpar(), SCIPlpiGetRealpar(), and SCIPlpiSolveDual().
|
static |
sets a single double parameter value
lpi | LP interface structure |
param | parameter name |
parval | value of parameter |
Definition at line 837 of file lpi_grb.c.
References dblparam, SCIP_LPi::grbparam, NULL, NUMDBLPARAM, SCIP_LPERROR, SCIP_OKAY, and SCIPerrorMessage.
Referenced by lpiStrongbranch(), SCIPlpiSetIntpar(), and SCIPlpiSetRealpar().
|
static |
marks the current LP to be unsolved
lpi | LP interface structure |
Definition at line 862 of file lpi_grb.c.
References NULL, and SCIP_LPi::solstat.
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiLoadColLP(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSetBase(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
|
static |
converts SCIP's lhs/rhs pairs into Gurobi's sen/rhs
lpi | LP interface structure |
nrows | number of rows |
lhs | left hand side vector |
rhs | right hand side vector |
rngcount | number of ranged rows found |
Definition at line 872 of file lpi_grb.c.
References NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngidxarray, SCIP_DEFAULT_INFINITY, SCIP_OKAY, and SCIP_LPi::senarray.
Referenced by SCIPlpiAddRows(), SCIPlpiChgSides(), and SCIPlpiLoadColLP().
|
static |
converts Gurobi's sen/rhs pairs into SCIP's lhs/rhs pairs
lpi | LP interface structure |
firstrow | first row to get sides for |
lastrow | last row to get sides for |
lhs | buffer to store the left hand side vector, or NULL |
rhs | buffer to store the right hand side vector, or NULL |
Definition at line 929 of file lpi_grb.c.
References SCIP_LPi::nrngrows, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngrowmap, SCIP_LPi::rngvals, SCIP_DEFAULT_INFINITY, SCIP_LPERROR, SCIP_OKAY, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.
Referenced by SCIPlpiGetRows(), and SCIPlpiGetSides().
|
static |
after restoring old LP data, need to resolve the LP to be able to retrieve correct information
lpi | LP interface structure |
Definition at line 990 of file lpi_grb.c.
References CHECK_ZERO, GRB_REFACTORMAXITERS, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPmessagePrintWarning().
Referenced by SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), and SCIPlpiGetBInvRow().
|
static |
verifies in debug mode that ranged row information is consistent
lpi | LP interface structure |
Definition at line 1022 of file lpi_grb.c.
References SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngrowmap, SCIP_LPi::rngrowmapsize, SCIP_LPi::rngrows, SCIP_LPi::rngrowssize, SCIP_LPi::rngvals, SCIP_CALL_ABORT, and SCIPlpiGetNRows().
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiLoadColLP(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranchesFrac(), SCIPlpiStrongbranchesInt(), SCIPlpiStrongbranchFrac(), and SCIPlpiStrongbranchInt().
|
static |
adds range variables to Gurobi LP
lpi | LP interface structure |
Definition at line 1064 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngrowmap, SCIP_LPi::rngrows, SCIP_LPi::rngvals, SCIP_LPi::rngvarsadded, SCIP_OKAY, and TRUE.
Referenced by lpiStrongbranch(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
|
static |
deletes range variables from Gurobi LP
lpi | LP interface structure |
Definition at line 1095 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, FALSE, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, SCIP_LPi::rngvarsadded, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, and SCIPlpiGetNCols().
Referenced by addRangeInfo(), SCIPlpiAddCols(), SCIPlpiChgSides(), SCIPlpiDelRows(), and SCIPlpiDelRowset().
|
static |
clear ranged row information
lpi | LP interface structure |
Definition at line 1125 of file lpi_grb.c.
References BMSfreeMemoryArrayNull, SCIP_LPi::nrngrows, SCIP_LPi::rngrowmap, SCIP_LPi::rngrowmapsize, SCIP_LPi::rngrows, SCIP_LPi::rngrowssize, SCIP_LPi::rngvals, and SCIP_LPi::rngvarsadded.
Referenced by SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiDelRows(), and SCIPlpiDelRowset().
|
static |
creates or updates maps for ranged rows after new rows have been added
lpi | LP interface structure |
rngcount | number of ranged rows added |
firstrow | index of first row that was added |
Definition at line 1142 of file lpi_grb.c.
References delRangeVars(), ensureRngrowmapMem(), ensureRngrowsMem(), SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngarray, SCIP_LPi::rngidxarray, SCIP_LPi::rngrowmap, SCIP_LPi::rngrows, SCIP_LPi::rngvals, SCIP_LPi::rngvarsadded, SCIP_CALL, SCIP_OKAY, SCIPlpiGetNCols(), and SCIPlpiGetNRows().
Referenced by SCIPlpiAddRows(), and SCIPlpiLoadColLP().
const char* SCIPlpiGetSolverName | ( | void | ) |
const char* SCIPlpiGetSolverDesc | ( | void | ) |
void* SCIPlpiGetSolverPointer | ( | SCIP_LPI * | lpi | ) |
gets pointer for LP solver - use only with great care
Here we return the pointer to the model.
lpi | pointer to an LP interface structure |
Definition at line 1234 of file lpi_grb.c.
References SCIP_LPi::grbmodel.
SCIP_RETCODE SCIPlpiSetIntegralityInformation | ( | SCIP_LPI * | lpi, |
int | ncols, | ||
int * | intInfo | ||
) |
pass integrality information to LP solver
lpi | pointer to an LP interface structure |
ncols | length of integrality array |
intInfo | integrality array (0: continuous, 1: integer) |
Definition at line 1242 of file lpi_grb.c.
References SCIP_LPERROR, and SCIPerrorMessage.
SCIP_RETCODE SCIPlpiCreate | ( | SCIP_LPI ** | lpi, |
SCIP_MESSAGEHDLR * | messagehdlr, | ||
const char * | name, | ||
SCIP_OBJSEN | objsen | ||
) |
creates an LP problem object
lpi | pointer to an LP interface structure |
messagehdlr | message handler to use for printing messages, or NULL |
name | problem name |
objsen | objective sense |
Definition at line 1265 of file lpi_grb.c.
References BMSallocMemory, CHECK_ZERO, checkRangeInfo(), copyParameterValues(), FALSE, getParameterValues(), grbenv, invalidateSolution(), NULL, numlp, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_LPPAR_PRICING, SCIP_OKAY, SCIP_PRICING_LPIDEFAULT, SCIP_Real, SCIPdebugMessage, SCIPlpiChgObjsen(), SCIPlpiSetIntpar(), SCIPmessagePrintWarning(), and warnedbeta.
SCIP_RETCODE SCIPlpiFree | ( | SCIP_LPI ** | lpi | ) |
deletes an LP problem object
lpi | pointer to an LP interface structure |
Definition at line 1352 of file lpi_grb.c.
References BMSfreeMemory, BMSfreeMemoryArrayNull, CHECK_ZERO, grbenv, NULL, numlp, SCIP_OKAY, and SCIPdebugMessage.
SCIP_RETCODE SCIPlpiLoadColLP | ( | SCIP_LPI * | lpi, |
SCIP_OBJSEN | objsen, | ||
int | ncols, | ||
const SCIP_Real * | obj, | ||
const SCIP_Real * | lb, | ||
const SCIP_Real * | ub, | ||
char ** | colnames, | ||
int | nrows, | ||
const SCIP_Real * | lhs, | ||
const SCIP_Real * | rhs, | ||
char ** | rownames, | ||
int | nnonz, | ||
const int * | beg, | ||
const int * | ind, | ||
const SCIP_Real * | val | ||
) |
copies LP data with column matrix into LP solver
lpi | LP interface structure |
objsen | objective sense |
ncols | number of columns |
obj | objective function values of columns |
lb | lower bounds of columns |
ub | upper bounds of columns |
colnames | column names, or NULL |
nrows | number of rows |
lhs | left hand sides of rows |
rhs | right hand sides of rows |
rownames | row names, or NULL |
nnonz | number of nonzero elements in the constraint matrix |
beg | start index of each column in ind- and val-array |
ind | row indices of constraint matrix entries |
val | values of constraint matrix entries |
Definition at line 1401 of file lpi_grb.c.
References addRangeInfo(), BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, checkRangeInfo(), convertSides(), ensureSidechgMem(), SCIP_LPi::grbenv, SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rhsarray, SCIP_ALLOC, SCIP_CALL, SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiGetNCols(), SCIPlpiGetNNonz(), SCIPlpiGetNRows(), and SCIP_LPi::senarray.
SCIP_RETCODE SCIPlpiAddCols | ( | SCIP_LPI * | lpi, |
int | ncols, | ||
const SCIP_Real * | obj, | ||
const SCIP_Real * | lb, | ||
const SCIP_Real * | ub, | ||
char ** | colnames, | ||
int | nnonz, | ||
const int * | beg, | ||
const int * | ind, | ||
const SCIP_Real * | val | ||
) |
adds columns to the LP
lpi | LP interface structure |
ncols | number of columns to be added |
obj | objective function values of new columns |
lb | lower bounds of new columns |
ub | upper bounds of new columns |
colnames | column names, or NULL |
nnonz | number of nonzero elements to be added to the constraint matrix |
beg | start index of each column in ind- and val-array, or NULL if nnonz == 0 |
ind | row indices of constraint matrix entries, or NULL if nnonz == 0 |
val | values of constraint matrix entries, or NULL if nnonz == 0 |
Definition at line 1489 of file lpi_grb.c.
References CHECK_ZERO, checkRangeInfo(), delRangeVars(), GRB_INFBOUND, SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngvarsadded, SCIP_CALL, SCIP_DEFAULT_INFINITY, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, and SCIPlpiGetNRows().
SCIP_RETCODE SCIPlpiDelCols | ( | SCIP_LPI * | lpi, |
int | firstcol, | ||
int | lastcol | ||
) |
deletes all columns in the given range from LP
lpi | LP interface structure |
firstcol | first column to be deleted |
lastcol | last column to be deleted |
Definition at line 1551 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, checkRangeInfo(), SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPlpiGetNCols().
SCIP_RETCODE SCIPlpiDelColset | ( | SCIP_LPI * | lpi, |
int * | dstat | ||
) |
deletes columns from LP; the new position of a column must not be greater that its old position
lpi | LP interface structure |
dstat | deletion status of columns input: 1 if column should be deleted, 0 if not output: new position of column, -1 if column was deleted |
Definition at line 1594 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, checkRangeInfo(), SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPlpiGetNCols().
SCIP_RETCODE SCIPlpiAddRows | ( | SCIP_LPI * | lpi, |
int | nrows, | ||
const SCIP_Real * | lhs, | ||
const SCIP_Real * | rhs, | ||
char ** | rownames, | ||
int | nnonz, | ||
const int * | beg, | ||
const int * | ind, | ||
const SCIP_Real * | val | ||
) |
adds rows to the LP
lpi | LP interface structure |
nrows | number of rows to be added |
lhs | left hand sides of new rows |
rhs | right hand sides of new rows |
rownames | row names, or NULL |
nnonz | number of nonzero elements to be added to the constraint matrix |
beg | start index of each row in ind- and val-array, or NULL if nnonz == 0 |
ind | column indices of constraint matrix entries, or NULL if nnonz == 0 |
val | values of constraint matrix entries, or NULL if nnonz == 0 |
Definition at line 1648 of file lpi_grb.c.
References addRangeInfo(), CHECK_ZERO, checkRangeInfo(), convertSides(), ensureRngrowmapMem(), ensureSidechgMem(), SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngrowmap, SCIP_LPi::rngrows, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiGetNCols(), SCIPlpiGetNRows(), and SCIP_LPi::senarray.
SCIP_RETCODE SCIPlpiDelRows | ( | SCIP_LPI * | lpi, |
int | firstrow, | ||
int | lastrow | ||
) |
deletes all rows in the given range from LP
lpi | LP interface structure |
firstrow | first row to be deleted |
lastrow | last row to be deleted |
Definition at line 1720 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, checkRangeInfo(), clearRangeInfo(), delRangeVars(), SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngrowmap, SCIP_LPi::rngrows, SCIP_LPi::rngvals, SCIP_LPi::rngvarsadded, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPlpiGetNRows().
SCIP_RETCODE SCIPlpiDelRowset | ( | SCIP_LPI * | lpi, |
int * | dstat | ||
) |
deletes rows from SCIP_LP; the new position of a row must not be greater that its old position
lpi | LP interface structure |
dstat | deletion status of rows input: 1 if row should be deleted, 0 if not output: new position of row, -1 if row was deleted |
Definition at line 1819 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, checkRangeInfo(), clearRangeInfo(), delRangeVars(), SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngrowmap, SCIP_LPi::rngrows, SCIP_LPi::rngvals, SCIP_LPi::rngvarsadded, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPlpiGetNRows().
SCIP_RETCODE SCIPlpiClear | ( | SCIP_LPI * | lpi | ) |
clears the whole LP
lpi | LP interface structure |
Definition at line 1921 of file lpi_grb.c.
References CHECK_ZERO, checkRangeInfo(), clearRangeInfo(), SCIP_LPi::grbenv, SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.
SCIP_RETCODE SCIPlpiChgBounds | ( | SCIP_LPI * | lpi, |
int | ncols, | ||
const int * | ind, | ||
const SCIP_Real * | lb, | ||
const SCIP_Real * | ub | ||
) |
changes lower and upper bounds of columns
lpi | LP interface structure |
ncols | number of columns to change bounds for |
ind | column indices |
lb | values for the new lower bounds |
ub | values for the new upper bounds |
Definition at line 1946 of file lpi_grb.c.
References CHECK_ZERO, checkRangeInfo(), SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_LPERROR, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPdebugPrintf, SCIPerrorMessage, and SCIPlpiIsInfinity().
Referenced by SCIPlpiScaleCol().
SCIP_RETCODE SCIPlpiChgSides | ( | SCIP_LPI * | lpi, |
int | nrows, | ||
const int * | ind, | ||
const SCIP_Real * | lhs, | ||
const SCIP_Real * | rhs | ||
) |
changes left and right hand sides of rows
lpi | LP interface structure |
nrows | number of rows to change sides for |
ind | row indices |
lhs | new values for left hand sides |
rhs | new values for right hand sides |
Definition at line 1991 of file lpi_grb.c.
References CHECK_ZERO, checkRangeInfo(), clearRangeInfo(), convertSides(), delRangeVars(), ensureRngrowmapMem(), ensureRngrowsMem(), ensureSidechgMem(), SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngrowmap, SCIP_LPi::rngrows, SCIP_LPi::rngvals, SCIP_LPi::rngvarsadded, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetNCols(), SCIPlpiGetNRows(), SCIPsortIntReal(), and SCIP_LPi::senarray.
Referenced by SCIPlpiScaleRow().
SCIP_RETCODE SCIPlpiChgCoef | ( | SCIP_LPI * | lpi, |
int | row, | ||
int | col, | ||
SCIP_Real | newval | ||
) |
changes a single coefficient
lpi | LP interface structure |
row | row number of coefficient to change |
col | column number of coefficient to change |
newval | new value of coefficient |
Definition at line 2125 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPlpiScaleCol(), and SCIPlpiScaleRow().
SCIP_RETCODE SCIPlpiChgObjsen | ( | SCIP_LPI * | lpi, |
SCIP_OBJSEN | objsen | ||
) |
changes the objective sense
lpi | LP interface structure |
objsen | new objective sense |
Definition at line 2146 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPlpiCreate().
SCIP_RETCODE SCIPlpiChgObj | ( | SCIP_LPI * | lpi, |
int | ncols, | ||
const int * | ind, | ||
const SCIP_Real * | obj | ||
) |
changes objective values of columns in the LP
lpi | LP interface structure |
ncols | number of columns to change objective value for |
ind | column indices to change objective value for |
obj | new objective values for columns |
Definition at line 2170 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, SCIP_Real, and SCIPdebugMessage.
Referenced by SCIPlpiScaleCol().
SCIP_RETCODE SCIPlpiScaleRow | ( | SCIP_LPI * | lpi, |
int | row, | ||
SCIP_Real | scaleval | ||
) |
multiplies a row with a non-zero scalar; for negative scalars, the row's sense is switched accordingly
lpi | LP interface structure |
row | row number to scale |
scaleval | scaling multiplier |
Definition at line 2189 of file lpi_grb.c.
References checkRangeInfo(), ensureValMem(), SCIP_LPi::grbmodel, SCIP_LPi::indarray, invalidateSolution(), NULL, SCIP_CALL, SCIP_DEFAULT_INFINITY, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiChgCoef(), SCIPlpiChgSides(), SCIPlpiGetNCols(), SCIPlpiGetRows(), and SCIP_LPi::valarray.
SCIP_RETCODE SCIPlpiScaleCol | ( | SCIP_LPI * | lpi, |
int | col, | ||
SCIP_Real | scaleval | ||
) |
multiplies a column with a non-zero scalar; the objective value is multiplied with the scalar, and the bounds are divided by the scalar; for negative scalars, the column's bounds are switched
lpi | LP interface structure |
col | column number to scale |
scaleval | scaling multiplier |
Definition at line 2248 of file lpi_grb.c.
References checkRangeInfo(), ensureValMem(), SCIP_LPi::grbmodel, SCIP_LPi::indarray, invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiGetCols(), SCIPlpiGetNRows(), SCIPlpiGetObj(), and SCIP_LPi::valarray.
SCIP_RETCODE SCIPlpiGetNRows | ( | SCIP_LPI * | lpi, |
int * | nrows | ||
) |
gets the number of rows in the LP
lpi | LP interface structure |
nrows | pointer to store the number of rows |
Definition at line 2325 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by addRangeInfo(), checkRangeInfo(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgSides(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiGetBase(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiGetDualfarkas(), SCIPlpiGetRows(), SCIPlpiGetSol(), SCIPlpiGetState(), SCIPlpiLoadColLP(), SCIPlpiScaleCol(), SCIPlpiSetBase(), SCIPlpiSetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
SCIP_RETCODE SCIPlpiGetNCols | ( | SCIP_LPI * | lpi, |
int * | ncols | ||
) |
gets the number of columns in the LP
lpi | LP interface structure |
ncols | pointer to store the number of cols |
Definition at line 2341 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngvarsadded, SCIP_OKAY, and SCIPdebugMessage.
Referenced by addRangeInfo(), delRangeVars(), SCIPlpiAddRows(), SCIPlpiChgSides(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiGetBase(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvARow(), SCIPlpiGetBounds(), SCIPlpiGetCols(), SCIPlpiGetPrimalRay(), SCIPlpiGetSol(), SCIPlpiGetState(), SCIPlpiLoadColLP(), SCIPlpiScaleRow(), SCIPlpiSetBase(), SCIPlpiSetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().
SCIP_RETCODE SCIPlpiGetNNonz | ( | SCIP_LPI * | lpi, |
int * | nnonz | ||
) |
gets the number of nonzero elements in the LP constraint matrix
lpi | LP interface structure |
nnonz | pointer to store the number of nonzeros |
Definition at line 2361 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPlpiLoadColLP().
SCIP_RETCODE SCIPlpiGetCols | ( | SCIP_LPI * | lpi, |
int | firstcol, | ||
int | lastcol, | ||
SCIP_Real * | lb, | ||
SCIP_Real * | ub, | ||
int * | nnonz, | ||
int * | beg, | ||
int * | ind, | ||
SCIP_Real * | val | ||
) |
gets columns from LP problem object; the arrays have to be large enough to store all values; Either both, lb and ub, have to be NULL, or both have to be non-NULL, either nnonz, beg, ind, and val have to be NULL, or all of them have to be non-NULL.
lpi | LP interface structure |
firstcol | first column to get from LP |
lastcol | last column to get from LP |
lb | buffer to store the lower bound vector, or NULL |
ub | buffer to store the upper bound vector, or NULL |
nnonz | pointer to store the number of nonzero elements returned, or NULL |
beg | buffer to store start index of each column in ind- and val-array, or NULL |
ind | buffer to store column indices of constraint matrix entries, or NULL |
val | buffer to store values of constraint matrix entries, or NULL |
Definition at line 2383 of file lpi_grb.c.
References CHECK_ZERO, GRB_INFBOUND, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_DEFAULT_INFINITY, SCIP_OKAY, SCIPdebugMessage, and SCIPlpiGetNCols().
Referenced by SCIPlpiScaleCol().
SCIP_RETCODE SCIPlpiGetRows | ( | SCIP_LPI * | lpi, |
int | firstrow, | ||
int | lastrow, | ||
SCIP_Real * | lhs, | ||
SCIP_Real * | rhs, | ||
int * | nnonz, | ||
int * | beg, | ||
int * | ind, | ||
SCIP_Real * | val | ||
) |
gets rows from LP problem object; the arrays have to be large enough to store all values. Either both, lhs and rhs, have to be NULL, or both have to be non-NULL, either nnonz, beg, ind, and val have to be NULL, or all of them have to be non-NULL.
lpi | LP interface structure |
firstrow | first row to get from LP |
lastrow | last row to get from LP |
lhs | buffer to store left hand side vector, or NULL |
rhs | buffer to store right hand side vector, or NULL |
nnonz | pointer to store the number of nonzero elements returned, or NULL |
beg | buffer to store start index of each row in ind- and val-array, or NULL |
ind | buffer to store row indices of constraint matrix entries, or NULL |
val | buffer to store values of constraint matrix entries, or NULL |
Definition at line 2451 of file lpi_grb.c.
References CHECK_ZERO, ensureSidechgMem(), SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, reconvertSides(), SCIP_LPi::rhsarray, SCIP_LPi::rngrowmap, SCIP_LPi::rngrows, SCIP_LPi::rngvarsadded, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetNRows(), and SCIP_LPi::senarray.
Referenced by SCIPlpiScaleRow().
SCIP_RETCODE SCIPlpiGetColNames | ( | SCIP_LPI * | lpi, |
int | firstcol, | ||
int | lastcol, | ||
char ** | colnames, | ||
char * | namestorage, | ||
int | namestoragesize, | ||
int * | storageleft | ||
) |
gets column names
lpi | LP interface structure |
firstcol | first column to get name from LP |
lastcol | last column to get name from LP |
colnames | pointers to column names (of size at least lastcol-firstcol+1) |
namestorage | storage for col names |
namestoragesize | size of namestorage (if 0, storageleft returns the storage needed) |
storageleft | amount of storage left (if < 0 the namestorage was not big enough) |
Definition at line 2549 of file lpi_grb.c.
References SCIP_LPERROR, and SCIPerrorMessage.
SCIP_RETCODE SCIPlpiGetRowNames | ( | SCIP_LPI * | lpi, |
int | firstrow, | ||
int | lastrow, | ||
char ** | rownames, | ||
char * | namestorage, | ||
int | namestoragesize, | ||
int * | storageleft | ||
) |
gets row names
lpi | LP interface structure |
firstrow | first row to get name from LP |
lastrow | last row to get name from LP |
rownames | pointers to row names (of size at least lastrow-firstrow+1) |
namestorage | storage for row names |
namestoragesize | size of namestorage (if 0, -storageleft returns the storage needed) |
storageleft | amount of storage left (if < 0 the namestorage was not big enough) |
Definition at line 2564 of file lpi_grb.c.
References SCIP_LPERROR, and SCIPerrorMessage.
SCIP_RETCODE SCIPlpiGetObjsen | ( | SCIP_LPI * | lpi, |
SCIP_OBJSEN * | objsen | ||
) |
gets the objective sense of the LP
lpi | LP interface structure |
objsen | pointer to store objective sense |
Definition at line 2579 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIP_OKAY, and SCIPdebugMessage.
SCIP_RETCODE SCIPlpiGetObj | ( | SCIP_LPI * | lpi, |
int | firstcol, | ||
int | lastcol, | ||
SCIP_Real * | vals | ||
) |
gets objective coefficients from LP problem object
lpi | LP interface structure |
firstcol | first column to get objective coefficient for |
lastcol | last column to get objective coefficient for |
vals | array to store objective coefficients |
Definition at line 2601 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.
Referenced by SCIPlpiScaleCol().
SCIP_RETCODE SCIPlpiGetBounds | ( | SCIP_LPI * | lpi, |
int | firstcol, | ||
int | lastcol, | ||
SCIP_Real * | lbs, | ||
SCIP_Real * | ubs | ||
) |
gets current bounds from LP problem object
lpi | LP interface structure |
firstcol | first column to get bounds for |
lastcol | last column to get bounds for |
lbs | array to store lower bound values, or NULL |
ubs | array to store upper bound values, or NULL |
Definition at line 2621 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPlpiGetNCols().
SCIP_RETCODE SCIPlpiGetSides | ( | SCIP_LPI * | lpi, |
int | firstrow, | ||
int | lastrow, | ||
SCIP_Real * | lhss, | ||
SCIP_Real * | rhss | ||
) |
gets current row sides from LP problem object
lpi | LP interface structure |
firstrow | first row to get sides for |
lastrow | last row to get sides for |
lhss | array to store left hand side values, or NULL |
rhss | array to store right hand side values, or NULL |
Definition at line 2655 of file lpi_grb.c.
References CHECK_ZERO, ensureSidechgMem(), SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, reconvertSides(), SCIP_LPi::rhsarray, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIP_LPi::senarray.
SCIP_RETCODE SCIPlpiGetCoef | ( | SCIP_LPI * | lpi, |
int | row, | ||
int | col, | ||
SCIP_Real * | val | ||
) |
gets a single coefficient
lpi | LP interface structure |
row | row number of coefficient |
col | column number of coefficient |
val | pointer to store the value of the coefficient |
Definition at line 2682 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.
SCIP_RETCODE SCIPlpiSolvePrimal | ( | SCIP_LPI * | lpi | ) |
calls primal simplex to solve the LP
startFinishOptions - bits 1 - do not delete work areas and factorization at end 2 - use old factorization if same number of rows 4 - skip as much initialization of work areas as possible (work in progress)
4 does not seem to work.
Primal algorithm
lpi | LP interface structure |
Definition at line 2715 of file lpi_grb.c.
References addRangeVars(), CHECK_ZERO, checkRangeInfo(), SCIP_LPi::fromscratch, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, SCIP_LPi::grbparam, invalidateSolution(), SCIP_LPi::iterations, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, presolve(), SCIP_LPi::rngvarsadded, SCIP_CALL, SCIP_LPERROR, SCIP_NOMEMORY, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, SCIPlpiGetNCols(), SCIPlpiGetNRows(), SCIPlpiHasPrimalRay(), SCIPlpiIsPrimalInfeasible(), setParameterValues(), SCIP_LPi::solisbasic, SCIP_LPi::solstat, and TRUE.
SCIP_RETCODE SCIPlpiSolveDual | ( | SCIP_LPI * | lpi | ) |
calls dual simplex to solve the LP
startFinishOptions - bits 1 - do not delete work areas and factorization at end 2 - use old factorization if same number of rows 4 - skip as much initialization of work areas as possible (work in progress)
4 does not seem to work.
Dual algorithm
lpi | LP interface structure |
Definition at line 2823 of file lpi_grb.c.
References addRangeVars(), CHECK_ZERO, checkRangeInfo(), SCIP_LPi::fromscratch, getDblParam(), SCIP_LPi::grbenv, SCIP_LPi::grbmodel, SCIP_LPi::grbparam, invalidateSolution(), SCIP_LPi::iterations, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, presolve(), SCIP_LPi::rngvarsadded, SCIP_CALL, SCIP_LPERROR, SCIP_NOMEMORY, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, SCIPlpiGetNCols(), SCIPlpiGetNRows(), setParameterValues(), SCIP_LPi::solisbasic, SCIP_LPi::solstat, and TRUE.
Referenced by lpiStrongbranch().
SCIP_RETCODE SCIPlpiSolveBarrier | ( | SCIP_LPI * | lpi, |
SCIP_Bool | crossover | ||
) |
calls barrier or interior point algorithm to solve the LP with crossover to simplex basis
lpi | LP interface structure |
crossover | perform crossover |
Definition at line 2961 of file lpi_grb.c.
References addRangeVars(), CHECK_ZERO, checkRangeInfo(), SCIP_LPi::fromscratch, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, SCIP_LPi::grbparam, invalidateSolution(), SCIP_LPi::iterations, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, presolve(), SCIP_LPi::rngvarsadded, SCIP_CALL, SCIP_LPERROR, SCIP_NOMEMORY, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, SCIPlpiGetNCols(), SCIPlpiGetNRows(), setParameterValues(), SCIP_LPi::solisbasic, and SCIP_LPi::solstat.
SCIP_RETCODE SCIPlpiStartStrongbranch | ( | SCIP_LPI * | lpi | ) |
SCIP_RETCODE SCIPlpiEndStrongbranch | ( | SCIP_LPI * | lpi | ) |
|
static |
performs strong branching iterations on one candidate
lpi | LP interface structure |
col | column to apply strong branching on |
psol | current primal solution value of column |
itlim | iteration limit for strong branchings |
down | stores dual bound after branching column down |
up | stores dual bound after branching column up |
downvalid | stores whether the returned down value is a valid dual bound; otherwise, it can only be used as an estimate value |
upvalid | stores whether the returned up value is a valid dual bound; otherwise, it can only be used as an estimate value |
iter | stores total number of strong branching iterations, or -1; may be NULL |
Definition at line 3098 of file lpi_grb.c.
References addRangeVars(), CHECK_ZERO, EPSCEIL, EPSFLOOR, FALSE, SCIP_LPi::fromscratch, getBase(), getDblParam(), SCIP_LPi::grbenv, SCIP_LPi::grbmodel, SCIP_LPi::grbparam, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngvarsadded, SCIP_Bool, SCIP_CALL, SCIP_LPERROR, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPerrorMessage, SCIPlpiGetIterations(), SCIPlpiGetObjval(), SCIPlpiIsIterlimExc(), SCIPlpiIsObjlimExc(), SCIPlpiIsOptimal(), SCIPlpiIsPrimalInfeasible(), SCIPlpiSolveDual(), setBase(), setDblParam(), setParameterValues(), and TRUE.
Referenced by SCIPlpiStrongbranchesFrac(), SCIPlpiStrongbranchesInt(), SCIPlpiStrongbranchFrac(), and SCIPlpiStrongbranchInt().
SCIP_RETCODE SCIPlpiStrongbranchFrac | ( | SCIP_LPI * | lpi, |
int | col, | ||
SCIP_Real | psol, | ||
int | itlim, | ||
SCIP_Real * | down, | ||
SCIP_Real * | up, | ||
SCIP_Bool * | downvalid, | ||
SCIP_Bool * | upvalid, | ||
int * | iter | ||
) |
performs strong branching iterations on one fractional candidate
lpi | LP interface structure |
col | column to apply strong branching on |
psol | fractional current primal solution value of column |
itlim | iteration limit for strong branchings |
down | stores dual bound after branching column down |
up | stores dual bound after branching column up |
downvalid | stores whether the returned down value is a valid dual bound; otherwise, it can only be used as an estimate value |
upvalid | stores whether the returned up value is a valid dual bound; otherwise, it can only be used as an estimate value |
iter | stores total number of strong branching iterations, or -1; may be NULL |
Definition at line 3278 of file lpi_grb.c.
References checkRangeInfo(), lpiStrongbranch(), SCIP_CALL, and SCIP_OKAY.
SCIP_RETCODE SCIPlpiStrongbranchesFrac | ( | SCIP_LPI * | lpi, |
int * | cols, | ||
int | ncols, | ||
SCIP_Real * | psols, | ||
int | itlim, | ||
SCIP_Real * | down, | ||
SCIP_Real * | up, | ||
SCIP_Bool * | downvalid, | ||
SCIP_Bool * | upvalid, | ||
int * | iter | ||
) |
performs strong branching iterations on given fractional candidates
lpi | LP interface structure |
cols | columns to apply strong branching on |
ncols | number of columns |
psols | fractional current primal solution values of columns |
itlim | iteration limit for strong branchings |
down | stores dual bounds after branching columns down |
up | stores dual bounds after branching columns up |
downvalid | stores whether the returned down values are valid dual bounds; otherwise, they can only be used as an estimate values |
upvalid | stores whether the returned up values are a valid dual bounds; otherwise, they can only be used as an estimate values |
iter | stores total number of strong branching iterations, or -1; may be NULL |
Definition at line 3301 of file lpi_grb.c.
References checkRangeInfo(), lpiStrongbranch(), NULL, SCIP_CALL, and SCIP_OKAY.
SCIP_RETCODE SCIPlpiStrongbranchInt | ( | SCIP_LPI * | lpi, |
int | col, | ||
SCIP_Real | psol, | ||
int | itlim, | ||
SCIP_Real * | down, | ||
SCIP_Real * | up, | ||
SCIP_Bool * | downvalid, | ||
SCIP_Bool * | upvalid, | ||
int * | iter | ||
) |
performs strong branching iterations on one candidate with integral value
lpi | LP interface structure |
col | column to apply strong branching on |
psol | current integral primal solution value of column |
itlim | iteration limit for strong branchings |
down | stores dual bound after branching column down |
up | stores dual bound after branching column up |
downvalid | stores whether the returned down value is a valid dual bound; otherwise, it can only be used as an estimate value |
upvalid | stores whether the returned up value is a valid dual bound; otherwise, it can only be used as an estimate value |
iter | stores total number of strong branching iterations, or -1; may be NULL |
Definition at line 3341 of file lpi_grb.c.
References checkRangeInfo(), lpiStrongbranch(), SCIP_CALL, and SCIP_OKAY.
SCIP_RETCODE SCIPlpiStrongbranchesInt | ( | SCIP_LPI * | lpi, |
int * | cols, | ||
int | ncols, | ||
SCIP_Real * | psols, | ||
int | itlim, | ||
SCIP_Real * | down, | ||
SCIP_Real * | up, | ||
SCIP_Bool * | downvalid, | ||
SCIP_Bool * | upvalid, | ||
int * | iter | ||
) |
performs strong branching iterations on given candidates with integral values
lpi | LP interface structure |
cols | columns to apply strong branching on |
ncols | number of columns |
psols | current integral primal solution values of columns |
itlim | iteration limit for strong branchings |
down | stores dual bounds after branching columns down |
up | stores dual bounds after branching columns up |
downvalid | stores whether the returned down values are valid dual bounds; otherwise, they can only be used as an estimate values |
upvalid | stores whether the returned up values are a valid dual bounds; otherwise, they can only be used as an estimate values |
iter | stores total number of strong branching iterations, or -1; may be NULL |
Definition at line 3364 of file lpi_grb.c.
References checkRangeInfo(), lpiStrongbranch(), NULL, SCIP_CALL, and SCIP_OKAY.
returns whether a solve method was called after the last modification of the LP
lpi | LP interface structure |
Definition at line 3416 of file lpi_grb.c.
References NULL, and SCIP_LPi::solstat.
SCIP_RETCODE SCIPlpiGetSolFeasibility | ( | SCIP_LPI * | lpi, |
SCIP_Bool * | primalfeasible, | ||
SCIP_Bool * | dualfeasible | ||
) |
gets information about primal and dual feasibility of the current LP solution
lpi | LP interface structure |
primalfeasible | stores primal feasibility status |
dualfeasible | stores dual feasibility status |
Definition at line 3426 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, SCIPdebugMessage, SCIPlpiIsDualFeasible(), SCIPlpiIsPrimalFeasible(), and SCIP_LPi::solstat.
returns TRUE iff LP is proven to have a primal unbounded ray (but not necessary a primal feasible point); this does not necessarily mean, that the solver knows and can return the primal ray
lpi | LP interface structure |
Definition at line 3455 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, and SCIP_LPi::solstat.
returns TRUE iff LP is proven to have a primal unbounded ray (but not necessary a primal feasible point), and the solver knows and can return the primal ray
lpi | LP interface structure |
Definition at line 3469 of file lpi_grb.c.
References FALSE, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, NULL, SCIPABORT, and SCIP_LPi::solstat.
Referenced by SCIPlpiSolvePrimal().
returns TRUE iff LP is proven to be primal unbounded
lpi | LP interface structure |
Definition at line 3492 of file lpi_grb.c.
References FALSE, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, NULL, SCIPABORT, and SCIP_LPi::solstat.
returns TRUE iff LP is proven to be primal infeasible
lpi | LP interface structure |
Definition at line 3515 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, SCIPdebugMessage, and SCIP_LPi::solstat.
Referenced by lpiStrongbranch(), and SCIPlpiSolvePrimal().
returns TRUE iff LP is proven to be primal feasible
lpi | LP interface structure |
Definition at line 3530 of file lpi_grb.c.
References FALSE, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, NULL, SCIPABORT, SCIPdebugMessage, and SCIP_LPi::solstat.
Referenced by SCIPlpiGetSolFeasibility().
returns TRUE iff LP is proven to have a dual unbounded ray (but not necessary a dual feasible point); this does not necessarily mean, that the solver knows and can return the dual ray
lpi | LP interface structure |
Definition at line 3557 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, and SCIP_LPi::solstat.
returns TRUE iff LP is proven to have a dual unbounded ray (but not necessary a dual feasible point), and the solver knows and can return the dual ray
lpi | LP interface structure |
Definition at line 3571 of file lpi_grb.c.
References FALSE, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, NULL, SCIPABORT, and SCIP_LPi::solstat.
returns TRUE iff LP is proven to be dual unbounded
lpi | LP interface structure |
Definition at line 3594 of file lpi_grb.c.
References FALSE, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, NULL, SCIPABORT, SCIPdebugMessage, and SCIP_LPi::solstat.
returns TRUE iff LP is proven to be dual infeasible
lpi | LP interface structure |
Definition at line 3619 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, SCIPdebugMessage, and SCIP_LPi::solstat.
returns TRUE iff LP is proven to be dual feasible
lpi | LP interface structure |
Definition at line 3633 of file lpi_grb.c.
References FALSE, SCIP_LPi::grbenv, SCIP_LPi::grbmodel, NULL, SCIPABORT, SCIPdebugMessage, and SCIP_LPi::solstat.
Referenced by SCIPlpiGetSolFeasibility().
returns TRUE iff LP was solved to optimality
lpi | LP interface structure |
Definition at line 3660 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, and SCIP_LPi::solstat.
Referenced by lpiStrongbranch().
returns TRUE iff current LP basis is stable
lpi | LP interface structure |
Definition at line 3672 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, SCIPdebugMessage, and SCIP_LPi::solstat.
returns TRUE iff the objective limit was reached
lpi | LP interface structure |
Definition at line 3686 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, and SCIP_LPi::solstat.
Referenced by lpiStrongbranch().
returns TRUE iff the iteration limit was reached
lpi | LP interface structure |
Definition at line 3698 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, and SCIP_LPi::solstat.
Referenced by lpiStrongbranch().
returns TRUE iff the time limit was reached
lpi | LP interface structure |
Definition at line 3710 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, and SCIP_LPi::solstat.
int SCIPlpiGetInternalStatus | ( | SCIP_LPI * | lpi | ) |
returns the internal solution status of the solver
lpi | LP interface structure |
Definition at line 3722 of file lpi_grb.c.
References SCIP_LPi::grbmodel, NULL, and SCIP_LPi::solstat.
SCIP_RETCODE SCIPlpiIgnoreInstability | ( | SCIP_LPI * | lpi, |
SCIP_Bool * | success | ||
) |
tries to reset the internal status of the LP solver in order to ignore an instability of the last solving call
lpi | LP interface structure |
success | pointer to store, whether the instability could be ignored |
Definition at line 3733 of file lpi_grb.c.
References FALSE, SCIP_LPi::grbmodel, NULL, and SCIP_OKAY.
SCIP_RETCODE SCIPlpiGetObjval | ( | SCIP_LPI * | lpi, |
SCIP_Real * | objval | ||
) |
gets objective value of solution
lpi | LP interface structure |
objval | stores the objective value |
Definition at line 3751 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, SCIPdebugMessage, and SCIP_LPi::solstat.
Referenced by lpiStrongbranch(), and SCIPlpiGetSol().
SCIP_RETCODE SCIPlpiGetSol | ( | SCIP_LPI * | lpi, |
SCIP_Real * | objval, | ||
SCIP_Real * | primsol, | ||
SCIP_Real * | dualsol, | ||
SCIP_Real * | activity, | ||
SCIP_Real * | redcost | ||
) |
gets primal and dual solution vectors
lpi | LP interface structure |
objval | stores the objective value, may be NULL if not needed |
primsol | primal solution vector, may be NULL if not needed |
dualsol | dual solution vector, may be NULL if not needed |
activity | row activity vector, may be NULL if not needed |
redcost | reduced cost vector, may be NULL if not needed |
Definition at line 3779 of file lpi_grb.c.
References CHECK_ZERO, ensureSidechgMem(), SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngrowmap, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_Real, SCIPABORT, SCIPdebugMessage, SCIPerrorMessage, SCIPlpiGetNCols(), SCIPlpiGetNRows(), SCIPlpiGetObjval(), SCIP_LPi::senarray, and SCIP_LPi::solstat.
SCIP_RETCODE SCIPlpiGetPrimalRay | ( | SCIP_LPI * | lpi, |
SCIP_Real * | ray | ||
) |
gets primal ray for unbounded LPs
Unbounded ray (NULL returned if none/wrong). Up to user to use delete [] on these arrays.
lpi | LP interface structure |
ray | primal ray |
Definition at line 3869 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetNCols(), and SCIP_LPi::solstat.
SCIP_RETCODE SCIPlpiGetDualfarkas | ( | SCIP_LPI * | lpi, |
SCIP_Real * | dualfarkas | ||
) |
gets dual Farkas proof for infeasibility
Infeasibility ray (NULL returned if none/wrong). Up to user to use delete [] on these arrays.
lpi | LP interface structure |
dualfarkas | dual Farkas row multipliers |
Definition at line 3891 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetNRows(), and SCIP_LPi::solstat.
SCIP_RETCODE SCIPlpiGetIterations | ( | SCIP_LPI * | lpi, |
int * | iterations | ||
) |
gets the number of LP iterations of the last solve call
lpi | LP interface structure |
iterations | pointer to store the number of iterations of the last solve call |
Definition at line 3914 of file lpi_grb.c.
References SCIP_LPi::grbmodel, SCIP_LPi::iterations, NULL, and SCIP_OKAY.
Referenced by lpiStrongbranch().
SCIP_RETCODE SCIPlpiGetRealSolQuality | ( | SCIP_LPI * | lpi, |
SCIP_LPSOLQUALITY | qualityindicator, | ||
SCIP_Real * | quality | ||
) |
gets information about the quality of an LP solution
Such information is usually only available, if also a (maybe not optimal) solution is available. The LPI should return SCIP_INVALID for quality
, if the requested quantity is not available.
lpi | LP interface structure |
qualityindicator | indicates which quality should be returned |
quality | pointer to store quality number |
Definition at line 3933 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, and SCIP_OKAY.
SCIP_RETCODE SCIPlpiGetBase | ( | SCIP_LPI * | lpi, |
int * | cstat, | ||
int * | rstat | ||
) |
gets current basis status for columns and rows; arrays must be large enough to store the basis status
lpi | LP interface structure |
cstat | array to store column basis status, or NULL |
rstat | array to store row basis status, or NULL |
Definition at line 3960 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngrowmap, SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPABORT, SCIPdebugMessage, SCIPerrorMessage, SCIPlpiGetNCols(), and SCIPlpiGetNRows().
SCIP_RETCODE SCIPlpiSetBase | ( | SCIP_LPI * | lpi, |
const int * | cstat, | ||
const int * | rstat | ||
) |
sets current basis status for columns and rows
Whats changed since last solve. Is only used when startFinishOptions used in dual or primal. Bit 1 - number of rows/columns has not changed (so work arrays valid) 2 - matrix has not changed 4 - if matrix has changed only by adding rows 8 - if matrix has changed only by adding columns 16 - row lbs not changed 32 - row ubs not changed 64 - column objective not changed 128 - column lbs not changed 256 - column ubs not changed 512 - basis not changed (up to user to set this to 0) top bits may be used internally
lpi | LP interface structure |
cstat | array with column basis status |
rstat | array with row basis status |
Definition at line 4058 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::cstat, ensureCstatMem(), ensureRstatMem(), SCIP_LPi::grbmodel, invalidateSolution(), SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, SCIP_LPi::rngrowmap, SCIP_LPi::rstat, SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPABORT, SCIPdebugMessage, SCIPerrorMessage, SCIPlpiGetNCols(), and SCIPlpiGetNRows().
SCIP_RETCODE SCIPlpiGetBasisInd | ( | SCIP_LPI * | lpi, |
int * | bind | ||
) |
returns the indices of the basic columns and rows; basic column n gives value n, basic row m gives value -1-m
lpi | LP interface structure |
bind | pointer to store basis indices ready to keep number of rows entries |
Definition at line 4164 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_LPi::rngrowmap, SCIP_LPi::rngrows, SCIP_ALLOC, SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetNCols(), and SCIPlpiGetNRows().
SCIP_RETCODE SCIPlpiGetBInvRow | ( | SCIP_LPI * | lpi, |
int | r, | ||
SCIP_Real * | coef, | ||
int * | inds, | ||
int * | ninds | ||
) |
get dense row of inverse basis matrix B^-1
lpi | LP interface structure |
r | row number |
coef | pointer to store the coefficients of the row |
inds | array to store the non-zero indices |
ninds | pointer to store the number of non-zero indices (-1: if we do not store sparsity informations) |
Definition at line 4232 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_ALLOC, SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetNRows(), and SVECTOR.
SCIP_RETCODE SCIPlpiGetBInvCol | ( | SCIP_LPI * | lpi, |
int | c, | ||
SCIP_Real * | coef, | ||
int * | inds, | ||
int * | ninds | ||
) |
get dense column of inverse basis matrix B^-1
lpi | LP interface structure |
c | column number of B^-1; this is NOT the number of the column in the LP; you have to call SCIPlpiGetBasisInd() to get the array which links the B^-1 column numbers to the row and column numbers of the LP! c must be between 0 and nrows-1, since the basis has the size nrows * nrows |
coef | pointer to store the coefficients of the column |
inds | array to store the non-zero indices |
ninds | pointer to store the number of non-zero indices (-1: if we do not store sparsity informations) |
Definition at line 4325 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_ALLOC, SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetNRows(), and SVECTOR.
SCIP_RETCODE SCIPlpiGetBInvARow | ( | SCIP_LPI * | lpi, |
int | r, | ||
const SCIP_Real * | binvrow, | ||
SCIP_Real * | coef, | ||
int * | inds, | ||
int * | ninds | ||
) |
get dense row of inverse basis matrix times constraint matrix B^-1 * A
lpi | LP interface structure |
r | row number |
binvrow | row in (A_B)^-1 from prior call to SCIPlpiGetBInvRow(), or NULL |
coef | vector to return coefficients |
inds | array to store the non-zero indices |
ninds | pointer to store the number of non-zero indices (-1: if we do not store sparsity informations) |
Definition at line 4422 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, SCIP_LPi::nrngrows, NULL, restoreLPData(), SCIP_ALLOC, SCIP_CALL, SCIP_CALL_QUIET, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, SCIPlpiGetNCols(), SCIPlpiGetNRows(), and SVECTOR.
SCIP_RETCODE SCIPlpiGetBInvACol | ( | SCIP_LPI * | lpi, |
int | c, | ||
SCIP_Real * | coef, | ||
int * | inds, | ||
int * | ninds | ||
) |
get dense column of inverse basis matrix times constraint matrix B^-1 * A
lpi | LP interface structure |
c | column number |
coef | vector to return coefficients |
inds | array to store the non-zero indices |
ninds | pointer to store the number of non-zero indices (-1: if we do not store sparsity informations) |
Definition at line 4522 of file lpi_grb.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_ALLOC, SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetNRows(), and SVECTOR.
SCIP_RETCODE SCIPlpiGetState | ( | SCIP_LPI * | lpi, |
BMS_BLKMEM * | blkmem, | ||
SCIP_LPISTATE ** | lpistate | ||
) |
stores LPi state (like basis information) into lpistate object
lpi | LP interface structure |
blkmem | block memory |
lpistate | pointer to LPi state information (like basis information) |
Definition at line 4607 of file lpi_grb.c.
References BMSallocBlockMemory, SCIP_LPi::cstat, getBase(), SCIP_LPi::grbmodel, lpistateCreate(), lpistatePack(), SCIP_LPi::nrngrows, NULL, SCIP_LPi::rstat, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPlpiGetNCols(), SCIPlpiGetNRows(), and SCIP_LPi::solisbasic.
SCIP_RETCODE SCIPlpiSetState | ( | SCIP_LPI * | lpi, |
BMS_BLKMEM * | blkmem, | ||
const SCIP_LPISTATE * | lpistate | ||
) |
loads LPi state (like basis information) into solver; note that the LP might have been extended with additional columns and rows since the state was stored with SCIPlpiGetState()
lpi | LP interface structure |
blkmem | block memory |
lpistate | LPi state information (like basis information) |
Definition at line 4670 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::cstat, ensureCstatMem(), ensureRstatMem(), SCIP_LPi::grbmodel, lpistateUnpack(), SCIP_LPi::messagehdlr, SCIP_LPiState::ncols, SCIP_LPi::nrngrows, SCIP_LPiState::nrngrows, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, REALABS, SCIP_LPi::rstat, SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiGetNCols(), SCIPlpiGetNRows(), SCIPlpiIsInfinity(), and setBase().
SCIP_RETCODE SCIPlpiClearState | ( | SCIP_LPI * | lpi | ) |
clears current LPi state (like basis information) of the solver
lpi | LP interface structure |
Definition at line 4742 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, and SCIP_OKAY.
SCIP_RETCODE SCIPlpiFreeState | ( | SCIP_LPI * | lpi, |
BMS_BLKMEM * | blkmem, | ||
SCIP_LPISTATE ** | lpistate | ||
) |
frees LPi state information
lpi | LP interface structure |
blkmem | block memory |
lpistate | pointer to LPi state information (like basis information) |
Definition at line 4754 of file lpi_grb.c.
References lpistateFree(), NULL, and SCIP_OKAY.
SCIP_Bool SCIPlpiHasStateBasis | ( | SCIP_LPI * | lpi, |
SCIP_LPISTATE * | lpistate | ||
) |
checks, whether the given LP state contains simplex basis information
lpi | LP interface structure |
lpistate | LP state information (like basis information) |
Definition at line 4770 of file lpi_grb.c.
References NULL, and SCIP_LPiState::packcstat.
SCIP_RETCODE SCIPlpiReadState | ( | SCIP_LPI * | lpi, |
const char * | fname | ||
) |
reads LP state (like basis information from a file
Read a basis from the given filename, returns -1 on file error, 0 if no values, 1 if values
lpi | LP interface structure |
fname | file name |
Definition at line 4779 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, and SCIPerrorMessage.
SCIP_RETCODE SCIPlpiWriteState | ( | SCIP_LPI * | lpi, |
const char * | fname | ||
) |
writes LP state (like basis information) to a file
Write the basis in MPS format to the specified file. If writeValues true, writes values of structurals (and adds VALUES to end of NAME card)
parameters:
lpi | LP interface structure |
fname | file name |
Definition at line 4807 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_LPERROR, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPdebugMessage, and SCIPerrorMessage.
SCIP_RETCODE SCIPlpiGetNorms | ( | SCIP_LPI * | lpi, |
BMS_BLKMEM * | blkmem, | ||
SCIP_LPINORMS ** | lpinorms | ||
) |
stores LPi pricing norms information
lpi | LP interface structure |
blkmem | block memory |
lpinorms | pointer to LPi pricing norms information |
Definition at line 4855 of file lpi_grb.c.
References BMSallocBlockMemory, BMSallocBlockMemoryArray, CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIP_LPi::solisbasic.
SCIP_RETCODE SCIPlpiSetNorms | ( | SCIP_LPI * | lpi, |
BMS_BLKMEM * | blkmem, | ||
const SCIP_LPINORMS * | lpinorms | ||
) |
loads LPi pricing norms into solver; note that the LP might have been extended with additional columns and rows since the state was stored with SCIPlpiGetNorms()
lpi | LP interface structure |
blkmem | block memory |
lpinorms | LPi pricing norms information |
Definition at line 4904 of file lpi_grb.c.
References SCIP_LPiNorms::colnorm, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, SCIP_LPiNorms::ncols, SCIP_LPiNorms::nrows, NULL, SCIP_LPiNorms::rownorm, SCIP_OKAY, and SCIPmessagePrintWarning().
SCIP_RETCODE SCIPlpiFreeNorms | ( | SCIP_LPI * | lpi, |
BMS_BLKMEM * | blkmem, | ||
SCIP_LPINORMS ** | lpinorms | ||
) |
frees pricing norms information
lpi | LP interface structure |
blkmem | block memory |
lpinorms | pointer to LPi pricing norms information |
Definition at line 4936 of file lpi_grb.c.
References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, and SCIP_OKAY.
SCIP_RETCODE SCIPlpiGetIntpar | ( | SCIP_LPI * | lpi, |
SCIP_LPPARAM | type, | ||
int * | ival | ||
) |
gets integer parameter of LP
lpi | LP interface structure |
type | parameter number |
ival | buffer to store the parameter value |
Definition at line 4968 of file lpi_grb.c.
References FALSE, SCIP_LPi::fromscratch, getDblParam(), getIntParam(), SCIP_LPi::grbmodel, NULL, SCIP_LPi::pricing, SCIP_CALL, SCIP_LPPAR_FASTMIP, SCIP_LPPAR_FROMSCRATCH, SCIP_LPPAR_LPINFO, SCIP_LPPAR_LPITLIM, SCIP_LPPAR_PRESOLVING, SCIP_LPPAR_PRICING, SCIP_LPPAR_SCALING, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_Real, SCIPdebugMessage, and TRUE.
SCIP_RETCODE SCIPlpiSetIntpar | ( | SCIP_LPI * | lpi, |
SCIP_LPPARAM | type, | ||
int | ival | ||
) |
sets integer parameter of LP
Amount of print out: 0 - none 1 - just final 2 - just factorizations 3 - as 2 plus a bit more 4 - verbose above that 8,16,32 etc just for selective SCIPdebug
lpi | LP interface structure |
type | parameter number |
ival | parameter value |
Definition at line 5025 of file lpi_grb.c.
References FALSE, SCIP_LPi::fromscratch, SCIP_LPi::grbmodel, NULL, SCIP_LPi::pricing, SCIP_Bool, SCIP_CALL, SCIP_LPPAR_FASTMIP, SCIP_LPPAR_FROMSCRATCH, SCIP_LPPAR_LPINFO, SCIP_LPPAR_LPITLIM, SCIP_LPPAR_PRESOLVING, SCIP_LPPAR_PRICING, SCIP_LPPAR_SCALING, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_PRICING_AUTO, SCIP_PRICING_DEVEX, SCIP_PRICING_FULL, SCIP_PRICING_LPIDEFAULT, SCIP_PRICING_PARTIAL, SCIP_PRICING_STEEP, SCIP_PRICING_STEEPQSTART, SCIPdebugMessage, setDblParam(), setIntParam(), and TRUE.
Referenced by SCIPlpiCreate().
SCIP_RETCODE SCIPlpiGetRealpar | ( | SCIP_LPI * | lpi, |
SCIP_LPPARAM | type, | ||
SCIP_Real * | dval | ||
) |
gets floating point parameter of LP
lpi | LP interface structure |
type | parameter number |
dval | buffer to store the parameter value |
Definition at line 5106 of file lpi_grb.c.
References CHECK_ZERO, getDblParam(), SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_LPPAR_BARRIERCONVTOL, SCIP_LPPAR_DUALFEASTOL, SCIP_LPPAR_FEASTOL, SCIP_LPPAR_LOBJLIM, SCIP_LPPAR_LPTILIM, SCIP_LPPAR_MARKOWITZ, SCIP_LPPAR_UOBJLIM, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, and SCIPdebugMessage.
SCIP_RETCODE SCIPlpiSetRealpar | ( | SCIP_LPI * | lpi, |
SCIP_LPPARAM | type, | ||
SCIP_Real | dval | ||
) |
sets floating point parameter of LP
lpi | LP interface structure |
type | parameter number |
dval | parameter value |
Definition at line 5158 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_LPPAR_BARRIERCONVTOL, SCIP_LPPAR_DUALFEASTOL, SCIP_LPPAR_FEASTOL, SCIP_LPPAR_LOBJLIM, SCIP_LPPAR_LPTILIM, SCIP_LPPAR_MARKOWITZ, SCIP_LPPAR_UOBJLIM, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIPdebugMessage, and setDblParam().
checks if given value is treated as infinity in the LP solver
lpi | LP interface structure |
val | value to be checked for infinity |
Definition at line 5231 of file lpi_grb.c.
Referenced by SCIPlpiChgBounds(), and SCIPlpiSetState().
SCIP_RETCODE SCIPlpiReadLP | ( | SCIP_LPI * | lpi, |
const char * | fname | ||
) |
reads LP from a file
read file in MPS format parameters: filename bool keepNames bool ignoreErrors
lpi | LP interface structure |
fname | file name |
Definition at line 5252 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.
SCIP_RETCODE SCIPlpiWriteLP | ( | SCIP_LPI * | lpi, |
const char * | fname | ||
) |
writes LP to a file
write file in MPS format parameters: filename int formatType (0 - normal, 1 - extra accuracy, 2 - IEEE hex) int numberAcross (1 or 2 values should be specified on every data line in the MPS file) double objSense
lpi | LP interface structure |
fname | file name |
Definition at line 5268 of file lpi_grb.c.
References CHECK_ZERO, SCIP_LPi::grbmodel, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.
|
static |
Definition at line 45 of file lpi_grb.c.
Referenced by SCIPlpiCreate().
|
static |
Definition at line 80 of file lpi_grb.c.
Referenced by getIntParam(), getParameterValues(), setIntParam(), and setParameterValues().
|
static |
Definition at line 91 of file lpi_grb.c.
Referenced by getDblParam(), getParameterValues(), setDblParam(), and setParameterValues().
|
static |
default values for double parameters
Definition at line 102 of file lpi_grb.c.
Referenced by checkParameterValues(), and setParameterValues().
|
static |
Gurobi environment (only needed for initialization)
Definition at line 177 of file lpi_grb.c.
Referenced by SCIPlpiCreate(), and SCIPlpiFree().
|
static |
number of open LP objects
Definition at line 178 of file lpi_grb.c.
Referenced by SCIPlpiCreate(), and SCIPlpiFree().
|
static |
Definition at line 1203 of file lpi_grb.c.
Referenced by SCIPlpiGetSolverName().