Scippy

SCIP

Solving Constraint Integer Programs

lpi_cpx.c File Reference

Detailed Description

LP interface for CPLEX >= 8.0.

Author
Tobias Achterberg
Timo Berthold
Stefan Heinz
Gerald Gamrath
Ambrox Gleixner
Marc Pfetsch
Stefan Vigerske
Michael Winkler
Kati Wolter

Definition in file lpi_cpx.c.

#include <assert.h>
#include "cplex.h"
#include "scip/bitencode.h"
#include "lpi/lpi.h"
#include "scip/pub_message.h"

Go to the source code of this file.

Macros

#define CPX_SUBVERSION   0
 
#define CHECK_ZERO(messagehdlr, x)
 
#define ABORT_ZERO(x)
 
#define CPX_INT_MAX   2100000000 /* CPLEX doesn't accept larger values in integer parameters */
 
#define CPX_REFACTORMAXITERS   50 /* maximal number of iterations allowed for producing a refactorization of the basis */
 
#define CPX_MAGICZEROCONSTANT   1e-10
 
#define COLS_PER_PACKET   SCIP_DUALPACKETSIZE
 
#define ROWS_PER_PACKET   SCIP_DUALPACKETSIZE
 
#define NUMINTPARAM   10
 
#define NUMDBLPARAM   7
 

Typedefs

typedef SCIP_DUALPACKET COLPACKET
 
typedef SCIP_DUALPACKET ROWPACKET
 
typedef struct SCIP_CPXParam SCIP_CPXPARAM
 

Functions

static SCIP_RETCODE ensureBoundchgMem (SCIP_LPI *lpi, int num)
 
static SCIP_RETCODE ensureSidechgMem (SCIP_LPI *lpi, int num)
 
static SCIP_RETCODE ensureValMem (SCIP_LPI *lpi, int num)
 
static SCIP_RETCODE ensureCstatMem (SCIP_LPI *lpi, int num)
 
static SCIP_RETCODE ensureRstatMem (SCIP_LPI *lpi, int num)
 
static SCIP_RETCODE getBase (SCIP_LPI *lpi)
 
static SCIP_RETCODE setBase (SCIP_LPI *lpi)
 
static int colpacketNum (int ncols)
 
static int rowpacketNum (int nrows)
 
static void lpistatePack (SCIP_LPISTATE *lpistate, const int *cstat, const int *rstat)
 
static void lpistateUnpack (const SCIP_LPISTATE *lpistate, int *cstat, int *rstat)
 
static SCIP_RETCODE lpistateCreate (SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows)
 
static void lpistateFree (SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem)
 
static SCIP_RETCODE getParameterValues (SCIP_LPI *lpi, SCIP_CPXPARAM *cpxparam)
 
static SCIP_RETCODE checkParameterValues (SCIP_LPI *const lpi)
 
static SCIP_RETCODE setParameterValues (SCIP_LPI *const lpi, SCIP_CPXPARAM *const cpxparam)
 
static void copyParameterValues (SCIP_CPXPARAM *dest, SCIP_CPXPARAM *const source)
 
static int getIntParam (SCIP_LPI *lpi, int const param)
 
static double getDblParam (SCIP_LPI *lpi, int const param)
 
static void setIntParam (SCIP_LPI *lpi, int const param, int const parval)
 
static void setDblParam (SCIP_LPI *lpi, int const param, double parval)
 
static void invalidateSolution (SCIP_LPI *const lpi)
 
static int cpxObjsen (SCIP_OBJSEN const objsen)
 
static void convertSides (SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, int indoffset, int *rngcount)
 
static void reconvertBothSides (SCIP_LPI *lpi, int nrows, SCIP_Real *lhs, SCIP_Real *rhs)
 
static void reconvertLhs (SCIP_LPI *lpi, int nrows, SCIP_Real *lhs)
 
static void reconvertRhs (SCIP_LPI *lpi, int nrows, SCIP_Real *rhs)
 
static void reconvertSides (SCIP_LPI *lpi, int nrows, SCIP_Real *lhs, SCIP_Real *rhs)
 
static SCIP_RETCODE restoreLPData (SCIP_LPI *lpi)
 
Miscellaneous Methods
const char * SCIPlpiGetSolverName (void)
 
const char * SCIPlpiGetSolverDesc (void)
 
void * SCIPlpiGetSolverPointer (SCIP_LPI *lpi)
 
LPI Creation and Destruction Methods
SCIP_RETCODE SCIPlpiCreate (SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
 
SCIP_RETCODE SCIPlpiFree (SCIP_LPI **lpi)
 
Modification Methods
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)
 
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)
 
SCIP_RETCODE SCIPlpiDelCols (SCIP_LPI *lpi, int firstcol, int lastcol)
 
SCIP_RETCODE SCIPlpiDelColset (SCIP_LPI *lpi, int *dstat)
 
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)
 
SCIP_RETCODE SCIPlpiDelRows (SCIP_LPI *lpi, int firstrow, int lastrow)
 
SCIP_RETCODE SCIPlpiDelRowset (SCIP_LPI *lpi, int *dstat)
 
SCIP_RETCODE SCIPlpiClear (SCIP_LPI *lpi)
 
SCIP_RETCODE SCIPlpiChgBounds (SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub)
 
SCIP_RETCODE SCIPlpiChgSides (SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs)
 
SCIP_RETCODE SCIPlpiChgCoef (SCIP_LPI *lpi, int row, int col, SCIP_Real newval)
 
SCIP_RETCODE SCIPlpiChgObjsen (SCIP_LPI *lpi, SCIP_OBJSEN objsen)
 
SCIP_RETCODE SCIPlpiChgObj (SCIP_LPI *lpi, int ncols, int *ind, SCIP_Real *obj)
 
SCIP_RETCODE SCIPlpiScaleRow (SCIP_LPI *lpi, int row, SCIP_Real scaleval)
 
SCIP_RETCODE SCIPlpiScaleCol (SCIP_LPI *lpi, int col, SCIP_Real scaleval)
 
Data Accessing Methods
SCIP_RETCODE SCIPlpiGetNRows (SCIP_LPI *lpi, int *nrows)
 
SCIP_RETCODE SCIPlpiGetNCols (SCIP_LPI *lpi, int *ncols)
 
SCIP_RETCODE SCIPlpiGetNNonz (SCIP_LPI *lpi, int *nnonz)
 
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)
 
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)
 
SCIP_RETCODE SCIPlpiGetColNames (SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft)
 
SCIP_RETCODE SCIPlpiGetRowNames (SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft)
 
SCIP_RETCODE SCIPlpiGetObjsen (SCIP_LPI *lpi, SCIP_OBJSEN *objsen)
 
SCIP_RETCODE SCIPlpiGetObj (SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals)
 
SCIP_RETCODE SCIPlpiGetBounds (SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs)
 
SCIP_RETCODE SCIPlpiGetSides (SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss)
 
SCIP_RETCODE SCIPlpiGetCoef (SCIP_LPI *lpi, int row, int col, SCIP_Real *val)
 
Solving Methods
SCIP_RETCODE SCIPlpiSolvePrimal (SCIP_LPI *lpi)
 
SCIP_RETCODE SCIPlpiSolveDual (SCIP_LPI *lpi)
 
SCIP_RETCODE SCIPlpiSolveBarrier (SCIP_LPI *lpi, SCIP_Bool crossover)
 
static SCIP_RETCODE lpiStrongbranchIntegral (SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter)
 
SCIP_RETCODE SCIPlpiStartStrongbranch (SCIP_LPI *lpi)
 
SCIP_RETCODE SCIPlpiEndStrongbranch (SCIP_LPI *lpi)
 
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)
 
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)
 
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)
 
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)
 
Solution Information Methods
SCIP_Bool SCIPlpiWasSolved (SCIP_LPI *lpi)
 
SCIP_RETCODE SCIPlpiGetSolFeasibility (SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible)
 
SCIP_Bool SCIPlpiExistsPrimalRay (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiHasPrimalRay (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsPrimalUnbounded (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsPrimalInfeasible (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsPrimalFeasible (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiExistsDualRay (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiHasDualRay (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsDualUnbounded (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsDualInfeasible (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsDualFeasible (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsOptimal (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsStable (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsObjlimExc (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsIterlimExc (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsTimelimExc (SCIP_LPI *lpi)
 
int SCIPlpiGetInternalStatus (SCIP_LPI *lpi)
 
SCIP_RETCODE SCIPlpiIgnoreInstability (SCIP_LPI *lpi, SCIP_Bool *success)
 
SCIP_RETCODE SCIPlpiGetObjval (SCIP_LPI *lpi, SCIP_Real *objval)
 
SCIP_RETCODE SCIPlpiGetSol (SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
 
SCIP_RETCODE SCIPlpiGetPrimalRay (SCIP_LPI *lpi, SCIP_Real *ray)
 
SCIP_RETCODE SCIPlpiGetDualfarkas (SCIP_LPI *lpi, SCIP_Real *dualfarkas)
 
SCIP_RETCODE SCIPlpiGetIterations (SCIP_LPI *lpi, int *iterations)
 
SCIP_RETCODE SCIPlpiGetRealSolQuality (SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
 
LP Basis Methods
SCIP_RETCODE SCIPlpiGetBase (SCIP_LPI *lpi, int *cstat, int *rstat)
 
SCIP_RETCODE SCIPlpiSetBase (SCIP_LPI *lpi, int *cstat, int *rstat)
 
SCIP_RETCODE SCIPlpiGetBasisInd (SCIP_LPI *lpi, int *bind)
 
SCIP_RETCODE SCIPlpiGetBInvRow (SCIP_LPI *lpi, int r, SCIP_Real *coef)
 
SCIP_RETCODE SCIPlpiGetBInvCol (SCIP_LPI *lpi, int c, SCIP_Real *coef)
 
SCIP_RETCODE SCIPlpiGetBInvARow (SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef)
 
SCIP_RETCODE SCIPlpiGetBInvACol (SCIP_LPI *lpi, int c, SCIP_Real *coef)
 
LP State Methods
SCIP_RETCODE SCIPlpiGetState (SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
 
SCIP_RETCODE SCIPlpiSetState (SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE *lpistate)
 
SCIP_RETCODE SCIPlpiClearState (SCIP_LPI *lpi)
 
SCIP_RETCODE SCIPlpiFreeState (SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
 
SCIP_Bool SCIPlpiHasStateBasis (SCIP_LPI *lpi, SCIP_LPISTATE *lpistate)
 
SCIP_RETCODE SCIPlpiReadState (SCIP_LPI *lpi, const char *fname)
 
SCIP_RETCODE SCIPlpiWriteState (SCIP_LPI *lpi, const char *fname)
 
LP Pricing Norms Methods
SCIP_RETCODE SCIPlpiGetNorms (SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
 
SCIP_RETCODE SCIPlpiSetNorms (SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS *lpinorms)
 
SCIP_RETCODE SCIPlpiFreeNorms (SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms)
 
Parameter Methods
SCIP_RETCODE SCIPlpiGetIntpar (SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival)
 
SCIP_RETCODE SCIPlpiSetIntpar (SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
 
SCIP_RETCODE SCIPlpiGetRealpar (SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval)
 
SCIP_RETCODE SCIPlpiSetRealpar (SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
 
Numerical Methods
SCIP_Real SCIPlpiInfinity (SCIP_LPI *lpi)
 
SCIP_Bool SCIPlpiIsInfinity (SCIP_LPI *lpi, SCIP_Real val)
 
File Interface Methods
SCIP_RETCODE SCIPlpiReadLP (SCIP_LPI *lpi, const char *fname)
 
SCIP_RETCODE SCIPlpiWriteLP (SCIP_LPI *lpi, const char *fname)
 

Variables

static const int intparam [NUMINTPARAM]
 
static const int dblparam [NUMDBLPARAM]
 
static const double dblparammin [NUMDBLPARAM]
 
static char cpxname [100]
 

Macro Definition Documentation

#define CPX_SUBVERSION   0

Definition at line 40 of file lpi_cpx.c.

Referenced by SCIPlpiGetSolverName().

#define ABORT_ZERO (   x)
Value:
{ int _restat_; \
if( (_restat_ = (x)) != 0 ) \
{ \
SCIPerrorMessage("LP Error: CPLEX returned %d\n", _restat_); \
SCIPABORT(); \
return FALSE; \
} \
}

Definition at line 57 of file lpi_cpx.c.

Referenced by SCIPlpiIsDualFeasible(), SCIPlpiIsDualInfeasible(), SCIPlpiIsDualUnbounded(), SCIPlpiIsPrimalFeasible(), SCIPlpiIsPrimalInfeasible(), SCIPlpiIsPrimalUnbounded(), and SCIPlpiIsStable().

#define CPX_INT_MAX   2100000000 /* CPLEX doesn't accept larger values in integer parameters */
#define CPX_REFACTORMAXITERS   50 /* maximal number of iterations allowed for producing a refactorization of the basis */

Definition at line 71 of file lpi_cpx.c.

Referenced by restoreLPData().

#define CPX_MAGICZEROCONSTANT   1e-10

Definition at line 75 of file lpi_cpx.c.

Referenced by SCIPlpiChgBounds().

#define COLS_PER_PACKET   SCIP_DUALPACKETSIZE

Definition at line 78 of file lpi_cpx.c.

Referenced by colpacketNum().

#define ROWS_PER_PACKET   SCIP_DUALPACKETSIZE

Definition at line 80 of file lpi_cpx.c.

Referenced by rowpacketNum().

#define NUMINTPARAM   10
#define NUMDBLPARAM   7

Typedef Documentation

Definition at line 77 of file lpi_cpx.c.

Definition at line 79 of file lpi_cpx.c.

typedef struct SCIP_CPXParam SCIP_CPXPARAM

Definition at line 127 of file lpi_cpx.c.

Function Documentation

static SCIP_RETCODE ensureBoundchgMem ( SCIP_LPI lpi,
int  num 
)
static

resizes larray and uarray to have at least num entries

Parameters
lpiLP interface structure
numminimal number of entries in array

Definition at line 198 of file lpi_cpx.c.

References BMSreallocMemoryArray, SCIP_LPi::boundchgsize, SCIP_LPi::larray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIP_LPi::uarray.

Referenced by SCIPlpiChgBounds().

static SCIP_RETCODE ensureSidechgMem ( SCIP_LPI lpi,
int  num 
)
static

resizes senarray, rngarray, and rngindarray to have at least num entries

Parameters
lpiLP interface structure
numminimal number of entries in array

Definition at line 227 of file lpi_cpx.c.

References BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngindarray, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::senarray, and SCIP_LPi::sidechgsize.

Referenced by SCIPlpiAddRows(), SCIPlpiChgSides(), SCIPlpiGetRows(), SCIPlpiGetSides(), and SCIPlpiLoadColLP().

static SCIP_RETCODE ensureValMem ( SCIP_LPI lpi,
int  num 
)
static

resizes valarray and indarray to have at least num entries

Parameters
lpiLP interface structure
numminimal number of entries in array

Definition at line 252 of file lpi_cpx.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 SCIP_RETCODE ensureCstatMem ( SCIP_LPI lpi,
int  num 
)
static

resizes cstat array to have at least num entries

Parameters
lpiLP interface structure
numminimal number of entries in array

Definition at line 275 of file lpi_cpx.c.

References BMSreallocMemoryArray, SCIP_LPi::cstat, SCIP_LPi::cstatsize, MAX, NULL, SCIP_ALLOC, and SCIP_OKAY.

Referenced by getBase(), and SCIPlpiSetState().

static SCIP_RETCODE ensureRstatMem ( SCIP_LPI lpi,
int  num 
)
static

resizes rstat array to have at least num entries

Parameters
lpiLP interface structure
numminimal number of entries in array

Definition at line 297 of file lpi_cpx.c.

References BMSreallocMemoryArray, MAX, NULL, SCIP_LPi::rstat, SCIP_LPi::rstatsize, SCIP_ALLOC, and SCIP_OKAY.

Referenced by getBase(), and SCIPlpiSetState().

static SCIP_RETCODE getBase ( SCIP_LPI lpi)
static

stores current basis in internal arrays of LPI data structure

Parameters
lpiLP interface structure

Definition at line 319 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cstat, ensureCstatMem(), ensureRstatMem(), SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rstat, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.

Referenced by lpiStrongbranchIntegral(), SCIPlpiGetState(), and SCIPlpiStrongbranchFrac().

static SCIP_RETCODE setBase ( SCIP_LPI lpi)
static

loads basis stored in internal arrays of LPI data structure into CPLEX

Parameters
lpiLP interface structure

Definition at line 346 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cstat, SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rstat, SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_OKAY, and SCIPdebugMessage.

Referenced by lpiStrongbranchIntegral(), SCIPlpiSetState(), and SCIPlpiStrongbranchFrac().

static int colpacketNum ( int  ncols)
static

returns the number of packets needed to store column packet information

Parameters
ncolsnumber of columns to store

Definition at line 376 of file lpi_cpx.c.

References COLS_PER_PACKET.

Referenced by lpistateCreate(), and lpistateFree().

static int rowpacketNum ( int  nrows)
static

returns the number of packets needed to store row packet information

Parameters
nrowsnumber of rows to store

Definition at line 385 of file lpi_cpx.c.

References ROWS_PER_PACKET.

Referenced by lpistateCreate(), and lpistateFree().

static void lpistatePack ( SCIP_LPISTATE lpistate,
const int *  cstat,
const int *  rstat 
)
static

store row and column basis status in a packed LPi state object

Parameters
lpistatepointer to LPi state data
cstatbasis status of columns in unpacked format
rstatbasis status of rows in unpacked format

Definition at line 394 of file lpi_cpx.c.

References SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPencodeDualBit().

Referenced by SCIPlpiGetState().

static void lpistateUnpack ( const SCIP_LPISTATE lpistate,
int *  cstat,
int *  rstat 
)
static

unpacks row and column basis status from a packed LPi state object

Parameters
lpistatepointer to LPi state data
cstatbuffer for storing basis status of columns in unpacked format
rstatbuffer for storing basis status of rows in unpacked format

Definition at line 410 of file lpi_cpx.c.

References SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, SCIP_LPiState::packcstat, SCIP_LPiState::packrstat, and SCIPdecodeDualBit().

Referenced by SCIPlpiSetState().

static SCIP_RETCODE lpistateCreate ( SCIP_LPISTATE **  lpistate,
BMS_BLKMEM blkmem,
int  ncols,
int  nrows 
)
static

creates LPi state information object

Parameters
lpistatepointer to LPi state
blkmemblock memory
ncolsnumber of columns to store
nrowsnumber of rows to store

Definition at line 426 of file lpi_cpx.c.

References BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), NULL, rowpacketNum(), SCIP_ALLOC, and SCIP_OKAY.

Referenced by SCIPlpiGetState().

static void lpistateFree ( SCIP_LPISTATE **  lpistate,
BMS_BLKMEM blkmem 
)
static

frees LPi state information

Parameters
lpistatepointer to LPi state information (like basis information)
blkmemblock memory

Definition at line 447 of file lpi_cpx.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, colpacketNum(), NULL, and rowpacketNum().

Referenced by SCIPlpiFreeState().

static SCIP_RETCODE getParameterValues ( SCIP_LPI lpi,
SCIP_CPXPARAM cpxparam 
)
static

gets all CPLEX parameters used in LPI

Parameters
lpiLP interface structure
cpxparamcurrent parameter values for this LP

Definition at line 469 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, dblparam, SCIP_CPXParam::dblparval, intparam, SCIP_CPXParam::intparval, SCIP_LPi::messagehdlr, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_OKAY, and SCIPdebugMessage.

Referenced by checkParameterValues(), and SCIPlpiCreate().

static SCIP_RETCODE checkParameterValues ( SCIP_LPI *const  lpi)
static

in debug mode, checks validity of CPLEX parameters

Parameters
lpiLP interface structure

Definition at line 495 of file lpi_cpx.c.

References CPX_INT_MAX, SCIP_LPi::cpxenv, SCIP_LPi::curparam, dblparammin, SCIP_CPXParam::dblparval, getParameterValues(), SCIP_CPXParam::intparval, MAX, NULL, NUMDBLPARAM, NUMINTPARAM, SCIP_CALL, and SCIP_OKAY.

Referenced by setParameterValues().

static void copyParameterValues ( SCIP_CPXPARAM dest,
SCIP_CPXPARAM *const  source 
)
static

copies CPLEX parameters from source to dest

Parameters
destCPLEX parameters to copy to
sourceCPLEX parameters which will be copied

Definition at line 560 of file lpi_cpx.c.

References SCIP_CPXParam::dblparval, SCIP_CPXParam::intparval, NUMDBLPARAM, and NUMINTPARAM.

Referenced by SCIPlpiCreate().

static int getIntParam ( SCIP_LPI lpi,
int const  param 
)
static

gets a single integer parameter value

Parameters
lpiLP interface structure
paramparameter to get value for

Definition at line 575 of file lpi_cpx.c.

References SCIP_LPi::cpxparam, intparam, SCIP_CPXParam::intparval, NULL, NUMINTPARAM, SCIPABORT, and SCIPerrorMessage.

Referenced by lpiStrongbranchIntegral(), SCIPlpiGetIntpar(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), and SCIPlpiStrongbranchFrac().

static double getDblParam ( SCIP_LPI lpi,
int const  param 
)
static

gets a single double parameter value

Parameters
lpiLP interface structure
paramparameter to get value for

Definition at line 597 of file lpi_cpx.c.

References SCIP_LPi::cpxparam, dblparam, SCIP_CPXParam::dblparval, NULL, NUMDBLPARAM, SCIP_Real, SCIPABORT, and SCIPerrorMessage.

Referenced by lpiStrongbranchIntegral(), SCIPlpiGetRealpar(), SCIPlpiSolveDual(), and SCIPlpiStrongbranchFrac().

static void setIntParam ( SCIP_LPI lpi,
int const  param,
int const  parval 
)
static
static void setDblParam ( SCIP_LPI lpi,
int const  param,
double  parval 
)
static

sets a single double parameter value

Parameters
lpiLP interface structure
paramparameter to set value
parvalnew value for parameter

Definition at line 653 of file lpi_cpx.c.

References SCIP_LPi::cpxparam, dblparam, SCIP_CPXParam::dblparval, NULL, NUMDBLPARAM, SCIPABORT, and SCIPerrorMessage.

Referenced by SCIPlpiSetRealpar(), and SCIPlpiSolveDual().

static int cpxObjsen ( SCIP_OBJSEN const  objsen)
static

converts SCIP's objective sense into CPLEX's objective sense

Parameters
objsenobjective sense

Definition at line 694 of file lpi_cpx.c.

References SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIPABORT, and SCIPerrorMessage.

Referenced by SCIPlpiChgObjsen(), and SCIPlpiLoadColLP().

static void convertSides ( SCIP_LPI lpi,
int  nrows,
const SCIP_Real lhs,
const SCIP_Real rhs,
int  indoffset,
int *  rngcount 
)
static

converts SCIP's lhs/rhs pairs into CPLEX's sen/rhs/rng

Parameters
lpiLP interface structure
nrowsnumber of rows
lhsleft hand side vector
rhsright hand side vector
indoffsetindex of first row in LP
rngcountpointer to store the number of range rows

Definition at line 713 of file lpi_cpx.c.

References NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngindarray, and SCIP_LPi::senarray.

Referenced by SCIPlpiAddRows(), SCIPlpiChgSides(), and SCIPlpiLoadColLP().

static void reconvertBothSides ( SCIP_LPI lpi,
int  nrows,
SCIP_Real lhs,
SCIP_Real rhs 
)
static

converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs

Parameters
lpiLP interface structure
nrowsnumber of rows
lhsbuffer to store the left hand side vector
rhsbuffer to store the right hand side vector

Definition at line 779 of file lpi_cpx.c.

References NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.

Referenced by reconvertSides().

static void reconvertLhs ( SCIP_LPI lpi,
int  nrows,
SCIP_Real lhs 
)
static

converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs, only storing the left hand side

Parameters
lpiLP interface structure
nrowsnumber of rows
lhsbuffer to store the left hand side vector

Definition at line 836 of file lpi_cpx.c.

References NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.

Referenced by reconvertSides().

static void reconvertRhs ( SCIP_LPI lpi,
int  nrows,
SCIP_Real rhs 
)
static

converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs, only storing the right hand side

Parameters
lpiLP interface structure
nrowsnumber of rows
rhsbuffer to store the right hand side vector

Definition at line 884 of file lpi_cpx.c.

References NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.

Referenced by reconvertSides().

static void reconvertSides ( SCIP_LPI lpi,
int  nrows,
SCIP_Real lhs,
SCIP_Real rhs 
)
static

converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs

Parameters
lpiLP interface structure
nrowsnumber of rows
lhsbuffer to store the left hand side vector, or NULL
rhsbuffer to store the right hand side vector, or NULL

Definition at line 932 of file lpi_cpx.c.

References NULL, reconvertBothSides(), reconvertLhs(), and reconvertRhs().

Referenced by SCIPlpiGetRows(), and SCIPlpiGetSides().

static SCIP_RETCODE restoreLPData ( SCIP_LPI lpi)
static

after restoring the old lp data in CPLEX we need to resolve the lp to be able to retrieve correct information

Parameters
lpiLP interface structure

Definition at line 950 of file lpi_cpx.c.

References CHECK_ZERO, CPX_REFACTORMAXITERS, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPmessagePrintWarning().

Referenced by SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), and SCIPlpiGetBInvRow().

const char* SCIPlpiGetSolverName ( void  )

gets name and version of LP solver

Definition at line 993 of file lpi_cpx.c.

References CPX_SUBVERSION, and cpxname.

const char* SCIPlpiGetSolverDesc ( void  )

gets description of LP solver (developer, webpage, ...)

Definition at line 1006 of file lpi_cpx.c.

void* SCIPlpiGetSolverPointer ( SCIP_LPI lpi)

gets pointer for LP solver - use only with great care

Here we return the pointer to the LP environment.

Parameters
lpipointer to an LP interface structure

Definition at line 1017 of file lpi_cpx.c.

References SCIP_LPi::cpxlp.

SCIP_RETCODE SCIPlpiCreate ( SCIP_LPI **  lpi,
SCIP_MESSAGEHDLR messagehdlr,
const char *  name,
SCIP_OBJSEN  objsen 
)

creates an LP problem object

Parameters
lpipointer to an LP interface structure
messagehdlrmessage handler to use for printing messages, or NULL
nameproblem name
objsenobjective sense

Definition at line 1036 of file lpi_cpx.c.

References BMSallocMemory, CHECK_ZERO, copyParameterValues(), FALSE, getParameterValues(), invalidateSolution(), NULL, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_LPPAR_PRICING, SCIP_OKAY, SCIP_PRICING_LPIDEFAULT, SCIP_Real, SCIPdebugMessage, SCIPlpiChgObjsen(), and SCIPlpiSetIntpar().

SCIP_RETCODE SCIPlpiFree ( SCIP_LPI **  lpi)

deletes an LP problem object

Parameters
lpipointer to an LP interface structure

Definition at line 1116 of file lpi_cpx.c.

References BMSfreeMemory, BMSfreeMemoryArrayNull, CHECK_ZERO, NULL, 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

Parameters
lpiLP interface structure
objsenobjective sense
ncolsnumber of columns
objobjective function values of columns
lblower bounds of columns
ubupper bounds of columns
colnamescolumn names, or NULL
nrowsnumber of rows
lhsleft hand sides of rows
rhsright hand sides of rows
rownamesrow names, or NULL
nnonznumber of nonzero elements in the constraint matrix
begstart index of each column in ind- and val-array
indrow indices of constraint matrix entries
valvalues of constraint matrix entries

Definition at line 1160 of file lpi_cpx.c.

References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, convertSides(), SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, cpxObjsen(), ensureSidechgMem(), invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, 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

Parameters
lpiLP interface structure
ncolsnumber of columns to be added
objobjective function values of new columns
lblower bounds of new columns
ubupper bounds of new columns
colnamescolumn names, or NULL
nnonznumber of nonzero elements to be added to the constraint matrix
begstart index of each column in ind- and val-array, or NULL if nnonz == 0
indrow indices of constraint matrix entries, or NULL if nnonz == 0
valvalues of constraint matrix entries, or NULL if nnonz == 0

Definition at line 1220 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiDelCols ( SCIP_LPI lpi,
int  firstcol,
int  lastcol 
)

deletes all columns in the given range from LP

Parameters
lpiLP interface structure
firstcolfirst column to be deleted
lastcollast column to be deleted

Definition at line 1254 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiDelColset ( SCIP_LPI lpi,
int *  dstat 
)

deletes columns from SCIP_LP; the new position of a column must not be greater that its old position

Parameters
lpiLP interface structure
dstatdeletion 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 1275 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

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

Parameters
lpiLP interface structure
nrowsnumber of rows to be added
lhsleft hand sides of new rows
rhsright hand sides of new rows
rownamesrow names, or NULL
nnonznumber of nonzero elements to be added to the constraint matrix
begstart index of each row in ind- and val-array, or NULL if nnonz == 0
indcolumn indices of constraint matrix entries, or NULL if nnonz == 0
valvalues of constraint matrix entries, or NULL if nnonz == 0

Definition at line 1296 of file lpi_cpx.c.

References CHECK_ZERO, convertSides(), SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, ensureSidechgMem(), FALSE, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngfound, SCIP_LPi::rngindarray, SCIP_CALL, SCIP_LPPAR_SCALING, SCIP_OKAY, SCIPdebugMessage, SCIPlpiSetIntpar(), SCIP_LPi::senarray, and TRUE.

SCIP_RETCODE SCIPlpiDelRows ( SCIP_LPI lpi,
int  firstrow,
int  lastrow 
)

deletes all rows in the given range from LP

Parameters
lpiLP interface structure
firstrowfirst row to be deleted
lastrowlast row to be deleted

Definition at line 1349 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

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

Parameters
lpiLP interface structure
dstatdeletion 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 1370 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiClear ( SCIP_LPI lpi)

clears the whole LP

Parameters
lpiLP interface structure

Definition at line 1391 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, 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

Parameters
lpiLP interface structure
ncolsnumber of columns to change bounds for
indcolumn indices
lbvalues for the new lower bounds
ubvalues for the new upper bounds

Definition at line 1421 of file lpi_cpx.c.

References CHECK_ZERO, CPX_MAGICZEROCONSTANT, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, ensureBoundchgMem(), EPSZ, invalidateSolution(), SCIP_LPi::larray, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPdebugPrintf, and SCIP_LPi::uarray.

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

Parameters
lpiLP interface structure
nrowsnumber of rows to change sides for
indrow indices
lhsnew values for left hand sides
rhsnew values for right hand sides

Definition at line 1471 of file lpi_cpx.c.

References CHECK_ZERO, convertSides(), SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, ensureSidechgMem(), invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngindarray, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIP_LPi::senarray.

SCIP_RETCODE SCIPlpiChgCoef ( SCIP_LPI lpi,
int  row,
int  col,
SCIP_Real  newval 
)

changes a single coefficient

Parameters
lpiLP interface structure
rowrow number of coefficient to change
colcolumn number of coefficient to change
newvalnew value of coefficient

Definition at line 1516 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiChgObjsen ( SCIP_LPI lpi,
SCIP_OBJSEN  objsen 
)

changes the objective sense

Parameters
lpiLP interface structure
objsennew objective sense

Definition at line 1537 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, cpxObjsen(), invalidateSolution(), NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiChgObj ( SCIP_LPI lpi,
int  ncols,
int *  ind,
SCIP_Real obj 
)

changes objective values of columns in the LP

Parameters
lpiLP interface structure
ncolsnumber of columns to change objective value for
indcolumn indices to change objective value for
objnew objective values for columns

Definition at line 1556 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

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

Parameters
lpiLP interface structure
rowrow number to scale
scalevalscaling multiplier

Definition at line 1575 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, ensureValMem(), SCIP_LPi::indarray, invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiChgCoef(), SCIPlpiChgSides(), 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

Parameters
lpiLP interface structure
colcolumn number to scale
scalevalscaling multiplier

Definition at line 1631 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, ensureValMem(), SCIP_LPi::indarray, invalidateSolution(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiGetCols(), SCIPlpiGetObj(), and SCIP_LPi::valarray.

SCIP_RETCODE SCIPlpiGetNRows ( SCIP_LPI lpi,
int *  nrows 
)

gets the number of rows in the LP

Parameters
lpiLP interface structure
nrowspointer to store the number of rows

Definition at line 1705 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiGetNCols ( SCIP_LPI lpi,
int *  ncols 
)

gets the number of columns in the LP

Parameters
lpiLP interface structure
ncolspointer to store the number of cols

Definition at line 1722 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiGetNNonz ( SCIP_LPI lpi,
int *  nnonz 
)

gets the number of nonzero elements in the LP constraint matrix

Parameters
lpiLP interface structure
nnonzpointer to store the number of nonzeros

Definition at line 1739 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIP_OKAY, and SCIPdebugMessage.

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.

Parameters
lpiLP interface structure
firstcolfirst column to get from LP
lastcollast column to get from LP
lbbuffer to store the lower bound vector, or NULL
ubbuffer to store the upper bound vector, or NULL
nnonzpointer to store the number of nonzero elements returned, or NULL
begbuffer to store start index of each column in ind- and val-array, or NULL
indbuffer to store column indices of constraint matrix entries, or NULL
valbuffer to store values of constraint matrix entries, or NULL

Definition at line 1759 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

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.

Parameters
lpiLP interface structure
firstrowfirst row to get from LP
lastrowlast row to get from LP
lhsbuffer to store left hand side vector, or NULL
rhsbuffer to store right hand side vector, or NULL
nnonzpointer to store the number of nonzero elements returned, or NULL
begbuffer to store start index of each row in ind- and val-array, or NULL
indbuffer to store row indices of constraint matrix entries, or NULL
valbuffer to store values of constraint matrix entries, or NULL

Definition at line 1815 of file lpi_cpx.c.

References BMSclearMemoryArray, CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, ensureSidechgMem(), SCIP_LPi::messagehdlr, NULL, reconvertSides(), SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIP_LPi::senarray.

SCIP_RETCODE SCIPlpiGetColNames ( SCIP_LPI lpi,
int  firstcol,
int  lastcol,
char **  colnames,
char *  namestorage,
int  namestoragesize,
int *  storageleft 
)

gets column names

Parameters
lpiLP interface structure
firstcolfirst column to get name from LP
lastcollast column to get name from LP
colnamespointers to column names (of size at least lastcol-firstcol+1)
namestoragestorage for col names
namestoragesizesize of namestorage (if 0, storageleft returns the storage needed)
storageleftamount of storage left (if < 0 the namestorage was not big enough)

Definition at line 1878 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiGetRowNames ( SCIP_LPI lpi,
int  firstrow,
int  lastrow,
char **  rownames,
char *  namestorage,
int  namestoragesize,
int *  storageleft 
)

gets row names

Parameters
lpiLP interface structure
firstrowfirst row to get name from LP
lastrowlast row to get name from LP
rownamespointers to row names (of size at least lastrow-firstrow+1)
namestoragestorage for row names
namestoragesizesize of namestorage (if 0, -storageleft returns the storage needed)
storageleftamount of storage left (if < 0 the namestorage was not big enough)

Definition at line 1912 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiGetObjsen ( SCIP_LPI lpi,
SCIP_OBJSEN objsen 
)

gets objective sense of the LP

Parameters
lpiLP interface structure
objsenpointer to store objective sense

Definition at line 1946 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, 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

Parameters
lpiLP interface structure
firstcolfirst column to get objective coefficient for
lastcollast column to get objective coefficient for
valsarray to store objective coefficients

Definition at line 1963 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiGetBounds ( SCIP_LPI lpi,
int  firstcol,
int  lastcol,
SCIP_Real lbs,
SCIP_Real ubs 
)

gets current bounds from LP problem object

Parameters
lpiLP interface structure
firstcolfirst column to get bounds for
lastcollast column to get bounds for
lbsarray to store lower bound values, or NULL
ubsarray to store upper bound values, or NULL

Definition at line 1984 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiGetSides ( SCIP_LPI lpi,
int  firstrow,
int  lastrow,
SCIP_Real lhss,
SCIP_Real rhss 
)

gets current row sides from LP problem object

Parameters
lpiLP interface structure
firstrowfirst row to get sides for
lastrowlast row to get sides for
lhssarray to store left hand side values, or NULL
rhssarray to store right hand side values, or NULL

Definition at line 2013 of file lpi_cpx.c.

References BMSclearMemoryArray, CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, ensureSidechgMem(), SCIP_LPi::messagehdlr, NULL, reconvertSides(), SCIP_LPi::rhsarray, SCIP_LPi::rngarray, 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

Parameters
lpiLP interface structure
rowrow number of coefficient
colcolumn number of coefficient
valpointer to store the value of the coefficient

Definition at line 2049 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, 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

Parameters
lpiLP interface structure

Definition at line 2080 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::clearstate, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, FALSE, SCIP_LPi::fromscratch, getIntParam(), SCIP_LPi::instabilityignored, invalidateSolution(), SCIP_LPi::iterations, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_LPERROR, SCIP_NOMEMORY, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, setIntParam(), 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

Parameters
lpiLP interface structure

Definition at line 2185 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::clearstate, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, FALSE, SCIP_LPi::fromscratch, getDblParam(), getIntParam(), SCIP_LPi::instabilityignored, invalidateSolution(), SCIP_LPi::iterations, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_LPERROR, SCIP_NOMEMORY, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPerrorMessage, SCIPlpiGetObjval(), SCIPlpiIsObjlimExc(), setDblParam(), setIntParam(), setParameterValues(), SCIP_LPi::solisbasic, SCIP_LPi::solstat, and TRUE.

SCIP_RETCODE SCIPlpiSolveBarrier ( SCIP_LPI lpi,
SCIP_Bool  crossover 
)

calls barrier or interior point algorithm to solve the LP with crossover to simplex basis

Parameters
lpiLP interface structure
crossoverperform crossover

Definition at line 2370 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::clearstate, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, FALSE, SCIP_LPi::fromscratch, SCIP_LPi::instabilityignored, invalidateSolution(), SCIP_LPi::iterations, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_LPERROR, SCIP_NOMEMORY, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, setIntParam(), setParameterValues(), SCIP_LPi::solisbasic, and SCIP_LPi::solstat.

static SCIP_RETCODE lpiStrongbranchIntegral ( SCIP_LPI lpi,
int  col,
SCIP_Real  psol,
int  itlim,
SCIP_Real down,
SCIP_Real up,
SCIP_Bool downvalid,
SCIP_Bool upvalid,
int *  iter 
)
static

manually performs strong branching on one integral variable

Parameters
lpiLP interface structure
colcolumn to apply strong branching on
psolcurrent integral primal solution value of column
itlimiteration limit for strong branchings
downstores dual bound after branching column down
upstores dual bound after branching column up
downvalidstores whether the returned down value is a valid dual bound; otherwise, it can only be used as an estimate value
upvalidstores whether the returned up value is a valid dual bound; otherwise, it can only be used as an estimate value
iterstores total number of strong branching iterations, or -1; may be NULL

Definition at line 2454 of file lpi_cpx.c.

References CHECK_ZERO, CPX_INT_MAX, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, EPSCEIL, EPSFLOOR, EPSISINT, SCIP_LPi::feastol, getBase(), getDblParam(), getIntParam(), SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiGetIterations(), SCIPlpiGetObjval(), SCIPlpiIsIterlimExc(), SCIPlpiIsObjlimExc(), SCIPlpiIsOptimal(), SCIPlpiIsPrimalInfeasible(), SCIPlpiSolveDual(), setBase(), setIntParam(), and TRUE.

Referenced by SCIPlpiStrongbranchesInt(), and SCIPlpiStrongbranchInt().

SCIP_RETCODE SCIPlpiStartStrongbranch ( SCIP_LPI lpi)

start strong branching

Parameters
lpiLP interface structure

Definition at line 2560 of file lpi_cpx.c.

References SCIP_OKAY.

SCIP_RETCODE SCIPlpiEndStrongbranch ( SCIP_LPI lpi)

end strong branching

Parameters
lpiLP interface structure

Definition at line 2568 of file lpi_cpx.c.

References SCIP_OKAY.

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

Parameters
lpiLP interface structure
colcolumn to apply strong branching on
psolfractional current primal solution value of column
itlimiteration limit for strong branchings
downstores dual bound after branching column down
upstores dual bound after branching column up
downvalidstores whether the returned down value is a valid dual bound; otherwise, it can only be used as an estimate value
upvalidstores whether the returned up value is a valid dual bound; otherwise, it can only be used as an estimate value
iterstores total number of strong branching iterations, or -1; may be NULL

Definition at line 2576 of file lpi_cpx.c.

References BMSallocMemoryArray, BMSfreeMemoryArray, CHECK_ZERO, SCIP_LPi::clearstate, CPX_INT_MAX, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, EPSCEIL, EPSFLOOR, EPSISINT, FALSE, SCIP_LPi::feastol, SCIP_LPi::fromscratch, getBase(), getDblParam(), getIntParam(), SCIP_LPi::messagehdlr, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_LPERROR, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiGetIterations(), SCIPlpiGetObjval(), SCIPlpiIsIterlimExc(), SCIPlpiIsObjlimExc(), SCIPlpiIsOptimal(), SCIPlpiIsPrimalInfeasible(), SCIPlpiSolveDual(), setBase(), setIntParam(), setParameterValues(), and TRUE.

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

Parameters
lpiLP interface structure
colscolumns to apply strong branching on
ncolsnumber of columns
psolsfractional current primal solution values of columns
itlimiteration limit for strong branchings
downstores dual bounds after branching columns down
upstores dual bounds after branching columns up
downvalidstores whether the returned down values are valid dual bounds; otherwise, they can only be used as an estimate values
upvalidstores whether the returned up values are a valid dual bounds; otherwise, they can only be used as an estimate values
iterstores total number of strong branching iterations, or -1; may be NULL

Definition at line 2750 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::clearstate, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, EPSISINT, FALSE, SCIP_LPi::feastol, SCIP_LPi::fromscratch, SCIP_LPi::messagehdlr, NULL, SCIP_CALL, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, setIntParam(), setParameterValues(), and TRUE.

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

Parameters
lpiLP interface structure
colcolumn to apply strong branching on
psolcurrent integral primal solution value of column
itlimiteration limit for strong branchings
downstores dual bound after branching column down
upstores dual bound after branching column up
downvalidstores whether the returned down value is a valid dual bound; otherwise, it can only be used as an estimate value
upvalidstores whether the returned up value is a valid dual bound; otherwise, it can only be used as an estimate value
iterstores total number of strong branching iterations, or -1; may be NULL

Definition at line 2816 of file lpi_cpx.c.

References SCIP_LPi::cpxlp, EPSISINT, SCIP_LPi::feastol, lpiStrongbranchIntegral(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.

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

Parameters
lpiLP interface structure
colscolumns to apply strong branching on
ncolsnumber of columns
psolscurrent integral primal solution values of columns
itlimiteration limit for strong branchings
downstores dual bounds after branching columns down
upstores dual bounds after branching columns up
downvalidstores whether the returned down values are valid dual bounds; otherwise, they can only be used as an estimate values
upvalidstores whether the returned up values are a valid dual bounds; otherwise, they can only be used as an estimate values
iterstores total number of strong branching iterations, or -1; may be NULL

Definition at line 2850 of file lpi_cpx.c.

References SCIP_LPi::cpxlp, EPSISINT, SCIP_LPi::feastol, lpiStrongbranchIntegral(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_Bool SCIPlpiWasSolved ( SCIP_LPI lpi)

returns whether a solve method was called after the last modification of the LP

Parameters
lpiLP interface structure

Definition at line 2903 of file lpi_cpx.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

Parameters
lpiLP interface structure
primalfeasiblestores primal feasibility status
dualfeasiblestores dual feasibility status

Definition at line 2913 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_Bool, SCIP_OKAY, and SCIPdebugMessage.

SCIP_Bool SCIPlpiExistsPrimalRay ( SCIP_LPI lpi)

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

Parameters
lpiLP interface structure

Definition at line 2940 of file lpi_cpx.c.

References SCIP_LPi::cpxlp, NULL, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiHasPrimalRay ( SCIP_LPI lpi)

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

Parameters
lpiLP interface structure

Definition at line 2954 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsPrimalUnbounded ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be primal unbounded

Parameters
lpiLP interface structure

Definition at line 2967 of file lpi_cpx.c.

References ABORT_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIPdebugMessage, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsPrimalInfeasible ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be primal infeasible

Parameters
lpiLP interface structure

Definition at line 2991 of file lpi_cpx.c.

References ABORT_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIPdebugMessage, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsPrimalFeasible ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be primal feasible

Parameters
lpiLP interface structure

Definition at line 3010 of file lpi_cpx.c.

References ABORT_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIP_Bool, SCIPdebugMessage, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiExistsDualRay ( SCIP_LPI lpi)

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

Parameters
lpiLP interface structure

Definition at line 3031 of file lpi_cpx.c.

References NULL, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiHasDualRay ( SCIP_LPI lpi)

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

Parameters
lpiLP interface structure

Definition at line 3044 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsDualUnbounded ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be dual unbounded

Parameters
lpiLP interface structure

Definition at line 3057 of file lpi_cpx.c.

References ABORT_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIPdebugMessage, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsDualInfeasible ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be dual infeasible

Parameters
lpiLP interface structure

Definition at line 3076 of file lpi_cpx.c.

References ABORT_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIPdebugMessage, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsDualFeasible ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be dual feasible

Parameters
lpiLP interface structure

Definition at line 3097 of file lpi_cpx.c.

References ABORT_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIP_Bool, SCIPdebugMessage, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsOptimal ( SCIP_LPI lpi)

returns TRUE iff LP was solved to optimality

Parameters
lpiLP interface structure

Definition at line 3116 of file lpi_cpx.c.

References NULL, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsObjlimExc ( SCIP_LPI lpi)

returns TRUE iff the objective limit was reached

Parameters
lpiLP interface structure

Definition at line 3170 of file lpi_cpx.c.

References NULL, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsIterlimExc ( SCIP_LPI lpi)

returns TRUE iff the iteration limit was reached

Parameters
lpiLP interface structure

Definition at line 3183 of file lpi_cpx.c.

References NULL, and SCIP_LPi::solstat.

SCIP_Bool SCIPlpiIsTimelimExc ( SCIP_LPI lpi)

returns TRUE iff the time limit was reached

Parameters
lpiLP interface structure

Definition at line 3194 of file lpi_cpx.c.

References NULL, and SCIP_LPi::solstat.

int SCIPlpiGetInternalStatus ( SCIP_LPI lpi)

returns the internal solution status of the solver

Parameters
lpiLP interface structure

Definition at line 3205 of file lpi_cpx.c.

References SCIP_LPi::cpxlp, 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

Parameters
lpiLP interface structure
successpointer to store, whether the instability could be ignored

Definition at line 3216 of file lpi_cpx.c.

References SCIP_LPi::cpxlp, SCIP_LPi::instabilityignored, NULL, SCIP_OKAY, SCIP_LPi::solstat, and TRUE.

SCIP_RETCODE SCIPlpiGetObjval ( SCIP_LPI lpi,
SCIP_Real objval 
)

gets objective value of solution

Parameters
lpiLP interface structure
objvalstores the objective value

Definition at line 3239 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, SCIPdebugMessage, and SCIPlpiInfinity().

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

Parameters
lpiLP interface structure
objvalstores the objective value, may be NULL if not needed
primsolprimal solution vector, may be NULL if not needed
dualsoldual solution vector, may be NULL if not needed
activityrow activity vector, may be NULL if not needed
redcostreduced cost vector, may be NULL if not needed

Definition at line 3268 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::instabilityignored, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, SCIPdebugMessage, 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.

Parameters
lpiLP interface structure
rayprimal ray

Definition at line 3298 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, SCIPdebugMessage, 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.

Parameters
lpiLP interface structure
dualfarkasdual Farkas row multipliers

Definition at line 3317 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, SCIPdebugMessage, and SCIP_LPi::solstat.

SCIP_RETCODE SCIPlpiGetIterations ( SCIP_LPI lpi,
int *  iterations 
)

gets the number of LP iterations of the last solve call

Parameters
lpiLP interface structure
iterationspointer to store the number of iterations of the last solve call

Definition at line 3337 of file lpi_cpx.c.

References SCIP_LPi::iterations, NULL, and SCIP_OKAY.

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.

Parameters
lpiLP interface structure
qualityindicatorindicates which quality should be returned
qualitypointer to store quality number

Definition at line 3355 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_INVALID, SCIP_INVALIDDATA, SCIP_LPSOLQUALITY_ESTIMCONDITION, SCIP_LPSOLQUALITY_EXACTCONDITION, SCIP_OKAY, SCIPdebugMessage, and SCIPerrorMessage.

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

Parameters
lpiLP interface structure
cstatarray to store column basis status, or NULL
rstatarray to store row basis status, or NULL

Definition at line 3409 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiSetBase ( SCIP_LPI lpi,
int *  cstat,
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

Parameters
lpiLP interface structure
cstatarray with column basis status
rstatarray with row basis status

Definition at line 3449 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, invalidateSolution(), SCIP_LPi::messagehdlr, NULL, SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_OKAY, and SCIPdebugMessage.

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

Parameters
lpiLP interface structure
bindpointer to store basis indices ready to keep number of rows entries

Definition at line 3493 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, SCIPdebugMessage, setIntParam(), and setParameterValues().

SCIP_RETCODE SCIPlpiGetBInvRow ( SCIP_LPI lpi,
int  r,
SCIP_Real coef 
)

get dense row of inverse basis matrix B^-1

Parameters
lpiLP interface structure
rrow number
coefpointer to store the coefficients of the row

Definition at line 3522 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, SCIPdebugMessage, setIntParam(), and setParameterValues().

SCIP_RETCODE SCIPlpiGetBInvCol ( SCIP_LPI lpi,
int  c,
SCIP_Real coef 
)

get dense column of inverse basis matrix B^-1

Parameters
lpiLP interface structure
ccolumn 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
coefpointer to store the coefficients of the column

Definition at line 3552 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, SCIPdebugMessage, setIntParam(), and setParameterValues().

SCIP_RETCODE SCIPlpiGetBInvARow ( SCIP_LPI lpi,
int  r,
const SCIP_Real binvrow,
SCIP_Real coef 
)

get dense row of inverse basis matrix times constraint matrix B^-1 * A

Parameters
lpiLP interface structure
rrow number
binvrowrow in (A_B)^-1 from prior call to SCIPlpiGetBInvRow(), or NULL
coefvector to return coefficients

Definition at line 3586 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, SCIPdebugMessage, setIntParam(), and setParameterValues().

SCIP_RETCODE SCIPlpiGetBInvACol ( SCIP_LPI lpi,
int  c,
SCIP_Real coef 
)

get dense column of inverse basis matrix times constraint matrix B^-1 * A

Parameters
lpiLP interface structure
ccolumn number
coefvector to return coefficients

Definition at line 3617 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cpxparam, SCIP_LPi::messagehdlr, NULL, restoreLPData(), SCIP_CALL, SCIP_CALL_QUIET, SCIP_OKAY, SCIPdebugMessage, setIntParam(), and setParameterValues().

SCIP_RETCODE SCIPlpiGetState ( SCIP_LPI lpi,
BMS_BLKMEM blkmem,
SCIP_LPISTATE **  lpistate 
)

stores LPi state (like basis information) into lpistate object

Parameters
lpiLP interface structure
blkmemblock memory
lpistatepointer to LPi state information (like basis information)

Definition at line 3659 of file lpi_cpx.c.

References SCIP_LPi::clearstate, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cstat, getBase(), lpistateCreate(), lpistatePack(), NULL, SCIP_LPi::rstat, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIP_LPi::solisbasic.

SCIP_RETCODE SCIPlpiSetState ( SCIP_LPI lpi,
BMS_BLKMEM blkmem,
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()

Parameters
lpiLP interface structure
blkmemblock memory
lpistateLPi state information (like basis information)

Definition at line 3707 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::cstat, ensureCstatMem(), ensureRstatMem(), lpistateUnpack(), SCIP_LPi::messagehdlr, SCIP_LPiState::ncols, SCIP_LPiState::nrows, NULL, REALABS, SCIP_LPi::rstat, SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPlpiIsInfinity(), and setBase().

SCIP_RETCODE SCIPlpiClearState ( SCIP_LPI lpi)

clears current LPi state (like basis information) of the solver

Parameters
lpiLP interface structure

Definition at line 3771 of file lpi_cpx.c.

References SCIP_LPi::clearstate, NULL, SCIP_OKAY, and TRUE.

SCIP_RETCODE SCIPlpiFreeState ( SCIP_LPI lpi,
BMS_BLKMEM blkmem,
SCIP_LPISTATE **  lpistate 
)

frees LPi state information

Parameters
lpiLP interface structure
blkmemblock memory
lpistatepointer to LPi state information (like basis information)

Definition at line 3784 of file lpi_cpx.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

Parameters
lpiLP interface structure
lpistateLP state information (like basis information)

Definition at line 3802 of file lpi_cpx.c.

References NULL.

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

Parameters
lpiLP interface structure
fnamefile name

Definition at line 3811 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

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:

  • filename
  • bool writeValues
  • int formatType (0 - normal, 1 - extra accuracy, 2 - IEEE hex)
Parameters
lpiLP interface structure
fnamefile name

Definition at line 3828 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiGetNorms ( SCIP_LPI lpi,
BMS_BLKMEM blkmem,
SCIP_LPINORMS **  lpinorms 
)

stores LPi pricing norms information

Parameters
lpiLP interface structure
blkmemblock memory
lpinormspointer to LPi pricing norms information

Definition at line 3860 of file lpi_cpx.c.

References BMSallocBlockMemory, BMSallocBlockMemoryArray, BMSfreeBlockMemory, BMSfreeBlockMemoryArray, CHECK_ZERO, SCIP_LPi::clearstate, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPi::messagehdlr, NULL, SCIP_ALLOC, SCIP_OKAY, SCIPdebugMessage, and SCIP_LPi::solisbasic.

SCIP_RETCODE SCIPlpiSetNorms ( SCIP_LPI lpi,
BMS_BLKMEM blkmem,
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()

Parameters
lpiLP interface structure
blkmemblock memory
lpinormsLPi pricing norms information

Definition at line 3920 of file lpi_cpx.c.

References CHECK_ZERO, SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, SCIP_LPiNorms::head, SCIP_LPi::messagehdlr, SCIP_LPiNorms::norm, SCIP_LPiNorms::normlen, NULL, SCIP_OKAY, and SCIPdebugMessage.

SCIP_RETCODE SCIPlpiFreeNorms ( SCIP_LPI lpi,
BMS_BLKMEM blkmem,
SCIP_LPINORMS **  lpinorms 
)

frees pricing norms information

Parameters
lpiLP interface structure
blkmemblock memory
lpinormspointer to LPi pricing norms information

Definition at line 3953 of file lpi_cpx.c.

References BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, and SCIP_OKAY.

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

Parameters
lpiLP interface structure
typeparameter number
ivalparameter value

Definition at line 4070 of file lpi_cpx.c.

References CPX_INT_MAX, SCIP_LPi::cpxlp, FALSE, SCIP_LPi::fromscratch, MIN, NULL, SCIP_LPi::pricing, SCIP_LPi::rngfound, SCIP_LPERROR, SCIP_LPPAR_FASTMIP, SCIP_LPPAR_FROMSCRATCH, SCIP_LPPAR_LPINFO, SCIP_LPPAR_LPITLIM, SCIP_LPPAR_PRESOLVING, SCIP_LPPAR_PRICING, SCIP_LPPAR_SCALING, SCIP_LPPAR_THREADS, 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, setIntParam(), and TRUE.

SCIP_RETCODE SCIPlpiGetRealpar ( SCIP_LPI lpi,
SCIP_LPPARAM  type,
SCIP_Real dval 
)

gets floating point parameter of LP

Parameters
lpiLP interface structure
typeparameter number
dvalbuffer to store the parameter value

Definition at line 4170 of file lpi_cpx.c.

References SCIP_LPi::conditionlimit, SCIP_LPi::cpxlp, getDblParam(), NULL, SCIP_LPPAR_BARRIERCONVTOL, SCIP_LPPAR_CONDITIONLIMIT, 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 
)
SCIP_Real SCIPlpiInfinity ( SCIP_LPI lpi)

returns value treated as infinity in the LP solver

Parameters
lpiLP interface structure

Definition at line 4275 of file lpi_cpx.c.

SCIP_Bool SCIPlpiIsInfinity ( SCIP_LPI lpi,
SCIP_Real  val 
)

checks if given value is treated as infinity in the LP solver

Parameters
lpiLP interface structure
valvalue to be checked for infinity

Definition at line 4283 of file lpi_cpx.c.

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

Parameters
lpiLP interface structure
fnamefile name

Definition at line 4304 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIP_OKAY, SCIP_READERROR, SCIPdebugMessage, and SCIPerrorMessage.

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

Parameters
lpiLP interface structure
fnamefile name

Definition at line 4328 of file lpi_cpx.c.

References SCIP_LPi::cpxenv, SCIP_LPi::cpxlp, NULL, SCIP_OKAY, SCIP_READERROR, SCIPdebugMessage, and SCIPerrorMessage.

Variable Documentation

const int intparam[NUMINTPARAM]
static
Initial value:
=
{
CPX_PARAM_ADVIND,
CPX_PARAM_ITLIM,
CPX_PARAM_FASTMIP,
CPX_PARAM_SCAIND,
CPX_PARAM_PREIND,
CPX_PARAM_PPRIIND,
CPX_PARAM_DPRIIND,
CPX_PARAM_SIMDISPLAY,
CPX_PARAM_SCRIND,
CPX_PARAM_THREADS
}

Definition at line 84 of file lpi_cpx.c.

Referenced by getIntParam(), getParameterValues(), setIntParam(), and setParameterValues().

const int dblparam[NUMDBLPARAM]
static
Initial value:
=
{
CPX_PARAM_EPRHS,
CPX_PARAM_EPOPT,
CPX_PARAM_BAREPCOMP,
CPX_PARAM_OBJLLIM,
CPX_PARAM_OBJULIM,
CPX_PARAM_TILIM,
CPX_PARAM_EPMRK
}

Definition at line 99 of file lpi_cpx.c.

Referenced by getDblParam(), getParameterValues(), setDblParam(), and setParameterValues().

const double dblparammin[NUMDBLPARAM]
static
Initial value:
=
{
+1e-09,
+1e-09,
+1e-12,
-1e+99,
-1e+99,
-1e+99,
0.0001
}

Definition at line 110 of file lpi_cpx.c.

Referenced by checkParameterValues(), and setParameterValues().

char cpxname[100]
static

Definition at line 987 of file lpi_cpx.c.

Referenced by SCIPlpiGetSolverName().