SCIP Doxygen Documentation
 
Loading...
Searching...
No Matches
lpi_cpx.c File Reference

Detailed Description

LP interface for CPLEX >= 8.0.

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

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.

Data Structures

struct  SCIP_CPXParam
 
struct  SCIP_LPi
 
struct  SCIP_LPiState
 
struct  SCIP_LPiNorms
 

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   11
 
#define NUMDBLPARAM   7
 

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)
 
SCIP_RETCODE SCIPlpiSetIntegralityInformation (SCIP_LPI *lpi, int ncols, int *intInfo)
 
SCIP_Bool SCIPlpiHasPrimalSolve (void)
 
SCIP_Bool SCIPlpiHasDualSolve (void)
 
SCIP_Bool SCIPlpiHasBarrierSolve (void)
 
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, const int *ind, const 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, const int *cstat, const int *rstat)
 
SCIP_RETCODE SCIPlpiGetBasisInd (SCIP_LPI *lpi, int *bind)
 
SCIP_RETCODE SCIPlpiGetBInvRow (SCIP_LPI *lpi, int r, SCIP_Real *coef, int *inds, int *ninds)
 
SCIP_RETCODE SCIPlpiGetBInvCol (SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
 
SCIP_RETCODE SCIPlpiGetBInvARow (SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
 
SCIP_RETCODE SCIPlpiGetBInvACol (SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds)
 
LP State Methods
SCIP_RETCODE SCIPlpiGetState (SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate)
 
SCIP_RETCODE SCIPlpiSetState (SCIP_LPI *lpi, BMS_BLKMEM *blkmem, const 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, const 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)
 
SCIP_RETCODE SCIPlpiInterrupt (SCIP_LPI *lpi, SCIP_Bool interrupt)
 
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 const char cpxname []
 

Macro Definition Documentation

◆ CPX_SUBVERSION

#define CPX_SUBVERSION   0

Definition at line 46 of file lpi_cpx.c.

◆ CHECK_ZERO

◆ ABORT_ZERO

#define ABORT_ZERO ( x)
Value:
{ /*lint --e{527}*/ int _restat_; \
if( (_restat_ = (x)) != 0 ) \
{ \
SCIPerrorMessage("LP Error: CPLEX returned %d\n", _restat_); \
SCIPABORT(); \
return FALSE; \
} \
}
#define FALSE
Definition def.h:94

Definition at line 63 of file lpi_cpx.c.

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

◆ CPX_INT_MAX

#define CPX_INT_MAX   2100000000 /* CPLEX doesn't accept larger values in integer parameters */

◆ CPX_REFACTORMAXITERS

#define CPX_REFACTORMAXITERS   50 /* maximal number of iterations allowed for producing a refactorization of the basis */

Definition at line 77 of file lpi_cpx.c.

Referenced by restoreLPData().

◆ CPX_MAGICZEROCONSTANT

#define CPX_MAGICZEROCONSTANT   1e-10

Definition at line 81 of file lpi_cpx.c.

Referenced by SCIPlpiChgBounds().

◆ COLS_PER_PACKET

#define COLS_PER_PACKET   SCIP_DUALPACKETSIZE

Definition at line 84 of file lpi_cpx.c.

◆ ROWS_PER_PACKET

#define ROWS_PER_PACKET   SCIP_DUALPACKETSIZE

Definition at line 86 of file lpi_cpx.c.

◆ NUMINTPARAM

◆ NUMDBLPARAM

Typedef Documentation

◆ SCIP_CPXPARAM

typedef struct SCIP_CPXParam SCIP_CPXPARAM

Definition at line 140 of file lpi_cpx.c.

Function Documentation

◆ ensureBoundchgMem()

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 212 of file lpi_cpx.c.

References assert(), BMSreallocMemoryArray, SCIP_LPi::boundchgsize, i, SCIP_LPi::larray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIP_LPi::uarray.

Referenced by SCIPlpiChgBounds().

◆ ensureSidechgMem()

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 241 of file lpi_cpx.c.

References assert(), 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(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvCol(), SCIPlpiGetRows(), SCIPlpiGetSides(), and SCIPlpiLoadColLP().

◆ ensureValMem()

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 266 of file lpi_cpx.c.

References assert(), BMSreallocMemoryArray, SCIP_LPi::indarray, MAX, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::valarray, and SCIP_LPi::valsize.

Referenced by SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiScaleCol(), and SCIPlpiScaleRow().

◆ ensureCstatMem()

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 289 of file lpi_cpx.c.

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

Referenced by getBase(), and SCIPlpiSetState().

◆ ensureRstatMem()

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 311 of file lpi_cpx.c.

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

Referenced by getBase(), SCIPlpiSetBase(), and SCIPlpiSetState().

◆ getBase()

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 333 of file lpi_cpx.c.

References assert(), 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(), and SCIPlpiGetState().

◆ setBase()

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 360 of file lpi_cpx.c.

References assert(), 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(), and SCIPlpiSetState().

◆ colpacketNum()

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 390 of file lpi_cpx.c.

References COLS_PER_PACKET.

◆ rowpacketNum()

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 399 of file lpi_cpx.c.

References ROWS_PER_PACKET.

◆ lpistatePack()

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 408 of file lpi_cpx.c.

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

Referenced by SCIPlpiGetState().

◆ lpistateUnpack()

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 424 of file lpi_cpx.c.

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

Referenced by SCIPlpiSetState().

◆ lpistateCreate()

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 440 of file lpi_cpx.c.

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

Referenced by SCIPlpiGetState().

◆ lpistateFree()

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 461 of file lpi_cpx.c.

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

Referenced by SCIPlpiFreeState().

◆ getParameterValues()

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 483 of file lpi_cpx.c.

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

Referenced by checkParameterValues(), and SCIPlpiCreate().

◆ checkParameterValues()

static SCIP_RETCODE checkParameterValues ( SCIP_LPI *const lpi)
static

in debug mode, checks validity of CPLEX parameters

Parameters
lpiLP interface structure

Definition at line 509 of file lpi_cpx.c.

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

Referenced by setParameterValues().

◆ setParameterValues()

◆ copyParameterValues()

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 586 of file lpi_cpx.c.

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

Referenced by SCIPlpiCreate().

◆ getIntParam()

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 601 of file lpi_cpx.c.

References assert(), SCIP_LPi::cpxparam, i, intparam, SCIP_CPXParam::intparval, NULL, NUMINTPARAM, SCIPABORT, and SCIPerrorMessage.

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

◆ getDblParam()

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 623 of file lpi_cpx.c.

References assert(), SCIP_LPi::cpxparam, dblparam, SCIP_CPXParam::dblparval, i, NULL, NUMDBLPARAM, SCIP_Real, SCIPABORT, and SCIPerrorMessage.

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

◆ setIntParam()

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

◆ setDblParam()

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 679 of file lpi_cpx.c.

References assert(), SCIP_LPi::cpxparam, dblparam, SCIP_CPXParam::dblparval, i, NULL, NUMDBLPARAM, SCIPABORT, and SCIPerrorMessage.

Referenced by SCIPlpiSetRealpar(), and SCIPlpiSolveDual().

◆ invalidateSolution()

◆ cpxObjsen()

static int cpxObjsen ( SCIP_OBJSEN const objsen)
static

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

Parameters
objsenobjective sense

Definition at line 721 of file lpi_cpx.c.

References SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, SCIPABORT, and SCIPerrorMessage.

Referenced by SCIPlpiChgObjsen(), and SCIPlpiLoadColLP().

◆ convertSides()

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 740 of file lpi_cpx.c.

References assert(), i, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_LPi::rngindarray, SCIP_Real, and SCIP_LPi::senarray.

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

◆ reconvertBothSides()

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 804 of file lpi_cpx.c.

References assert(), i, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_Real, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.

Referenced by reconvertSides().

◆ reconvertLhs()

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 861 of file lpi_cpx.c.

References assert(), i, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_Real, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.

Referenced by reconvertSides().

◆ reconvertRhs()

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 909 of file lpi_cpx.c.

References assert(), i, NULL, SCIP_LPi::rhsarray, SCIP_LPi::rngarray, SCIP_Real, SCIPABORT, SCIPerrorMessage, and SCIP_LPi::senarray.

Referenced by reconvertSides().

◆ 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 957 of file lpi_cpx.c.

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

Referenced by SCIPlpiGetRows(), and SCIPlpiGetSides().

◆ restoreLPData()

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 975 of file lpi_cpx.c.

References assert(), 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().

Variable Documentation

◆ intparam

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,
CPX_PARAM_RANDOMSEED
}

Definition at line 94 of file lpi_cpx.c.

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

◆ dblparam

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 112 of file lpi_cpx.c.

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

◆ dblparammin

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

Definition at line 123 of file lpi_cpx.c.

Referenced by checkParameterValues(), checkParameterValues(), setParameterValues(), and setParameterValues().

◆ cpxname

const char cpxname[]
static
Initial value:
= {'C', 'P', 'L', 'E', 'X', ' ',
(CPX_VERSION / 100) + '0', '.', ((CPX_VERSION % 100) / 10) + '0', '.', (CPX_VERSION % 10) + '0', '.', CPX_SUBVERSION + '0'
, '\0'
}
#define CPX_SUBVERSION
Definition lpi_cpx.c:46

Definition at line 1013 of file lpi_cpx.c.

Referenced by SCIPlpiGetSolverName().