Scippy

SCIP

Solving Constraint Integer Programs

lpi_clp.cpp File Reference

Detailed Description

LP interface for Clp.

Author
Stefan Heinz
Marc Pfetsch
John Forrest

Notes on this interface:

  • Currently, Clp (Version 1.10) supports two ways of adding rows/columns from arrays: One uses a length array that for each row/column specifies the number of nonzeros to be added. The second uses the beg array that gives the starting index for each row/column. We use the latter variant. Since for LPI there should be no gaps in the corresponding arrays, i.e., every entry in val and ind gives a nonzero entry, one can switch between the two formats. With the current Clp implementation both formats involve an overhead:

    • For the beg variant, Clp gets the end of the array from the last position in beg (i.e., the entry one after the last row/column) and we have to copy and extend beg for this purpose. In the matrix implementation a length information is then again computed.
    • For the length variant, Clp computes the number of elements from this length variant and there exists no matrix implementation that uses the length information, i.e., it is recomputed again.

    Concluding: the implementation of Clp/CoinPackeMatrix could be improved. The functions affected by this are SCIPlpiLoadColLP(), SCIPlpiAddCols(), SCIPlpiAddRows()

  • In former versions Clp used an "auxiliary model" that allows to save time when the model is scaled. This is discarded from version higher than 1.8.2.
  • Clp allows the setting of several special flags. These are now set when the FASTMIP option in SCIP is true. We tried to use the best settings, while still working correctly, see setFastmipClpParameters(). These settings probably have to be adapted to future Clp versions. Maybe more possibilities will appear.
  • At several places this interface corrects the return value of some Clp functions, e.g., isProvenPrimalInfeasible(). Currently (version 1.10) no change in the Clp functions will be made, but this might change in the future.

Definition in file lpi_clp.cpp.

#include <ClpSimplex.hpp>
#include <ClpPrimalColumnSteepest.hpp>
#include <ClpDualRowSteepest.hpp>
#include <CoinIndexedVector.hpp>
#include <ClpConfig.h>
#include <config_clp.h>
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
#include "lpi/lpi.h"
#include "scip/bitencode.h"
#include "scip/pub_message.h"

Go to the source code of this file.

Macros

#define CLP_VERSION   VERSION
 
#define SUMINFEASBOUND   1.0e-3
 
#define COLS_PER_PACKET   SCIP_DUALPACKETSIZE
 
#define ROWS_PER_PACKET   SCIP_DUALPACKETSIZE
 

Typedefs

typedef SCIP_DUALPACKET COLPACKET
 
typedef SCIP_DUALPACKET ROWPACKET
 

Functions

static SCIP_RETCODE ensureCstatMem (SCIP_LPI *lpi, int num)
 
static SCIP_RETCODE ensureRstatMem (SCIP_LPI *lpi, int num)
 
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 void invalidateSolution (SCIP_LPI *lpi)
 
static void setFactorizationFrequency (SCIP_LPI *lpi)
 
static void setFastmipClpParameters (SCIP_LPI *lpi)
 
static void unsetFastmipClpParameters (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)
 
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 SCIPlpiIgnoreInstability (SCIP_LPI *lpi, SCIP_Bool *success)
 
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)
 
SCIP_RETCODE SCIPlpiStartStrongbranch (SCIP_LPI *lpi)
 
SCIP_RETCODE SCIPlpiEndStrongbranch (SCIP_LPI *lpi)
 
static SCIP_RETCODE lpiStrongbranch (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 SCIP_RETCODE lpiStrongbranches (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 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 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 *, 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)
 
Numerical Methods
SCIP_Real SCIPlpiInfinity (SCIP_LPI *)
 
SCIP_Bool SCIPlpiIsInfinity (SCIP_LPI *, SCIP_Real val)
 
File Interface Methods
static SCIP_Bool fileExists (const char *filename)
 
SCIP_RETCODE SCIPlpiReadLP (SCIP_LPI *lpi, const char *fname)
 
SCIP_RETCODE SCIPlpiWriteLP (SCIP_LPI *lpi, const char *fname)
 

Macro Definition Documentation

◆ CLP_VERSION

#define CLP_VERSION   VERSION

Definition at line 66 of file lpi_clp.cpp.

Referenced by SCIPlpiGetSolverName().

◆ SUMINFEASBOUND

#define SUMINFEASBOUND   1.0e-3

Definition at line 90 of file lpi_clp.cpp.

Referenced by SCIPlpiGetSolFeasibility().

◆ COLS_PER_PACKET

#define COLS_PER_PACKET   SCIP_DUALPACKETSIZE

Definition at line 115 of file lpi_clp.cpp.

Referenced by colpacketNum().

◆ ROWS_PER_PACKET

#define ROWS_PER_PACKET   SCIP_DUALPACKETSIZE

Definition at line 117 of file lpi_clp.cpp.

Referenced by rowpacketNum().

Typedef Documentation

◆ COLPACKET

Definitions for storing basis status (copied from lpi_spx.cpp)

Definition at line 114 of file lpi_clp.cpp.

◆ ROWPACKET

Definition at line 116 of file lpi_clp.cpp.

Function Documentation

◆ 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 137 of file lpi_clp.cpp.

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

Referenced by SCIPlpiGetState(), 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 159 of file lpi_clp.cpp.

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

Referenced by SCIPlpiGetState(), 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 188 of file lpi_clp.cpp.

References COLS_PER_PACKET.

Referenced by lpistateCreate(), and lpistateFree().

◆ 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 197 of file lpi_clp.cpp.

References ROWS_PER_PACKET.

Referenced by lpistateCreate(), and lpistateFree().

◆ 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 206 of file lpi_clp.cpp.

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

Referenced by SCIPlpiGetState().

◆ lpistateUnpack()

static 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 222 of file lpi_clp.cpp.

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

Referenced by SCIPlpiSetState().

◆ lpistateCreate()

static 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 238 of file lpi_clp.cpp.

References BMSallocBlockMemory, BMSallocBlockMemoryArray, colpacketNum(), 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 259 of file lpi_clp.cpp.

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

Referenced by SCIPlpiFreeState().

◆ invalidateSolution()

◆ setFactorizationFrequency()

static void setFactorizationFrequency ( SCIP_LPI lpi)
static

set factorization frequency

Parameters
lpiLP interface structure

Definition at line 293 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIP_LPi::setFactorizationFrequency.

◆ setFastmipClpParameters()

static void setFastmipClpParameters ( SCIP_LPI lpi)
static

this methods sets parameters of Clp

Perturbation: 50 - switch on perturbation 100 - auto perturb if takes too long (1.0e-6 largest nonzero) 101 - we are perturbed 102 - don't try perturbing again

  • default is 100
  • others are for playing

for Clp 1.8 stable: 50 seems to be 10% faster than 100

Special options description from ClpModell.hpp: 1 - Don't keep changing infeasibility weight 2 - Keep nonLinearCost round solves 4 - Force outgoing variables to exact bound (primal) 8 - Safe to use dense initial factorization 16 - Just use basic variables for operation if column generation 32 - Create ray even in BAB 64 - Treat problem as feasible until last minute (i.e. minimize infeasibilities) 128 - Switch off all matrix sanity checks 256 - No row copy 512 - If not in values pass, solution guaranteed, skip as much as possible 1024 - In branch and bound 2048 - Don't bother to re-factorize if < 20 iterations 4096 - Skip some optimality checks 8192 - Do Primal when cleaning up primal 16384 - In fast dual (so we can switch off things) 32768 - called from Osi 65536 - keep arrays around as much as possible (also use maximumR/C) 131072 - transposeTimes is -1.0 and can skip basic and fixed 262144 - extra copy of scaled matrix 524288 - Clp fast dual 1048576 - don't need to finish dual (can return 3) NOTE - many applications can call Clp but there may be some short cuts which are taken which are not guaranteed safe from all applications. Vetted applications will have a bit set and the code may test this At present I expect a few such applications - if too many I will have to re-think. It is up to application owner to change the code if she/he needs these short cuts. I will not debug unless in Coin repository. See COIN_CLP_VETTED comments. 0x01000000 is Cbc (and in branch and bound) 0x02000000 is in a different branch and bound

Comments: 2 - nonlinear costs are used in primal for infeasibility weight 4 - in anti-degeneracy operations can move variables just off a bound 8 - means dense nucleus in factorization - normally not safe in first factorization as singularity handling is not useful. Is switched on if going from dual to primal or vv. 16 - Used for "real" column generation 64 - Good idea, since in B&B most problems are feasible. 128 - Assumes user will not create tiny or duplicate elements. 256 - Normally Clp keeps a scaled row copy for speed. For very large problems you might want to turn it off. 512 - Means nonbasic variables should be at bounds and basis will be reasonable. 4096 - Skip some optimality checks 8192 - If the primal has a perturbed problem and needs to clean up, it normally uses dual - but in some cases can be better to use primal. 32768 - Just switches off some messages e.g. empty problem. 131072 - used internally 262144 - Normally Clp has unscaled column copy of matrix - this makes an extra scaled copy. 524288 - used internally 1048576 - only set by fastDual 0x02000000 - main point: does allow use of disaster handler

Cbc seems to use the following special options: lpi->clp->setSpecialOptions(64|128|1024|2048|4096|32768|262144|0x01000000); Sometimes 512+8192 and 8192 or 8 are used as well.

Parameters
lpiLP interface structure

Definition at line 307 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_LPi::fastmip, and TRUE.

Referenced by SCIPlpiSetIntpar().

◆ unsetFastmipClpParameters()

static void unsetFastmipClpParameters ( SCIP_LPI lpi)
static

this methods sets parameters of Clp

Parameters
lpiLP interface structure

Definition at line 402 of file lpi_clp.cpp.

References SCIP_LPi::clp, FALSE, and SCIP_LPi::fastmip.

Referenced by SCIPlpiSetIntpar().

◆ SCIPlpiGetSolverName()

const char* SCIPlpiGetSolverName ( void  )

gets name and version of LP solver

Definition at line 432 of file lpi_clp.cpp.

References CLP_VERSION.

◆ SCIPlpiGetSolverDesc()

const char* SCIPlpiGetSolverDesc ( void  )

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

Definition at line 441 of file lpi_clp.cpp.

◆ SCIPlpiGetSolverPointer()

void* SCIPlpiGetSolverPointer ( SCIP_LPI lpi)

gets pointer for LP solver - use only with great care

Parameters
lpipointer to an LP interface structure

Definition at line 449 of file lpi_clp.cpp.

References SCIP_LPi::clp.

◆ SCIPlpiSetIntegralityInformation()

SCIP_RETCODE SCIPlpiSetIntegralityInformation ( SCIP_LPI lpi,
int  ncols,
int *  intInfo 
)

pass integrality information to LP solver

Parameters
lpipointer to an LP interface structure
ncolslength of integrality array
intInfointegrality array (0: continuous, 1: integer)

Definition at line 457 of file lpi_clp.cpp.

References SCIP_LPERROR, and SCIPerrorMessage.

◆ SCIPlpiCreate()

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 480 of file lpi_clp.cpp.

References BMSallocMemory, FALSE, invalidateSolution(), SCIP_ALLOC, SCIP_CALL, SCIP_LPPAR_PRICING, SCIP_OKAY, SCIP_PRICING_LPIDEFAULT, SCIPdebugMessage, and SCIPlpiSetIntpar().

◆ SCIPlpiFree()

SCIP_RETCODE SCIPlpiFree ( SCIP_LPI **  lpi)

deletes an LP problem object

Parameters
lpipointer to an LP interface structure

Definition at line 549 of file lpi_clp.cpp.

References BMSfreeMemory, BMSfreeMemoryArrayNull, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiLoadColLP()

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 0
nrowsnumber of rows
lhsleft hand sides of rows
rhsright hand sides of rows
rownamesrow names, or 0
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 583 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMScopyMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, invalidateSolution(), SCIP_LPi::ncols, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiAddCols()

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 0
nnonznumber of nonzero elements to be added to the constraint matrix
begstart index of each column in ind- and val-array, or 0 if nnonz == 0
indrow indices of constraint matrix entries, or 0 if nnonz == 0
valvalues of constraint matrix entries, or 0 if nnonz == 0

Definition at line 649 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMScopyMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, invalidateSolution(), SCIP_LPi::ncols, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiDelCols()

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 716 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, invalidateSolution(), NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiDelColset()

SCIP_RETCODE SCIPlpiDelColset ( SCIP_LPI lpi,
int *  dstat 
)

deletes columns from SCIP_LPI; 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 747 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, invalidateSolution(), SCIP_LPi::ncols, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiAddRows()

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 0
nnonznumber of nonzero elements to be added to the constraint matrix
begstart index of each row in ind- and val-array, or 0 if nnonz == 0
indcolumn indices of constraint matrix entries, or 0 if nnonz == 0
valvalues of constraint matrix entries, or 0 if nnonz == 0

Definition at line 793 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMScopyMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, invalidateSolution(), SCIP_LPi::nrows, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiDelRows()

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 855 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, invalidateSolution(), NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiDelRowset()

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 887 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, invalidateSolution(), SCIP_LPi::nrows, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiClear()

SCIP_RETCODE SCIPlpiClear ( SCIP_LPI lpi)

clears the whole LP

Parameters
lpiLP interface structure

Definition at line 933 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiChgBounds()

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 952 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_LPi::ncols, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, and SCIPlpiIsInfinity().

◆ SCIPlpiChgSides()

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 1028 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_LPi::nrows, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiChgCoef()

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 1056 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiChgObjsen()

SCIP_RETCODE SCIPlpiChgObjsen ( SCIP_LPI lpi,
SCIP_OBJSEN  objsen 
)

changes the objective sense

Parameters
lpiLP interface structure
objsennew objective sense

Definition at line 1079 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiChgObj()

SCIP_RETCODE SCIPlpiChgObj ( SCIP_LPI lpi,
int  ncols,
const int *  ind,
const 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 1099 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_LPi::ncols, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiScaleRow()

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 1126 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_OKAY, SCIP_Real, and SCIPdebugMessage.

◆ SCIPlpiScaleCol()

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 1199 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_OKAY, SCIP_Real, and SCIPdebugMessage.

◆ SCIPlpiGetNRows()

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 1276 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetNCols()

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 1294 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetNNonz()

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 1312 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetCols()

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 0, or both have to be non-0, either nnonz, beg, ind, and val have to be 0, or all of them have to be non-0.

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

Definition at line 1333 of file lpi_clp.cpp.

References BMScopyMemoryArray, SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetRows()

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 0, or both have to be non-0, either nnonz, beg, ind, and val have to be 0, or all of them have to be non-0.

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

Definition at line 1400 of file lpi_clp.cpp.

References BMScopyMemoryArray, SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetColNames()

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 1464 of file lpi_clp.cpp.

References SCIP_LPERROR, and SCIPerrorMessage.

◆ SCIPlpiGetRowNames()

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 1480 of file lpi_clp.cpp.

References SCIP_LPERROR, and SCIPerrorMessage.

◆ SCIPlpiIgnoreInstability()

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 1496 of file lpi_clp.cpp.

References SCIP_LPi::clp, FALSE, NULL, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetObjsen()

SCIP_RETCODE SCIPlpiGetObjsen ( SCIP_LPI lpi,
SCIP_OBJSEN objsen 
)

gets the objective sense of the LP

Parameters
lpiLP interface structure
objsenpointer to store objective sense

Definition at line 1514 of file lpi_clp.cpp.

References SCIP_LPi::clp, NULL, SCIP_OBJSEN_MAXIMIZE, SCIP_OBJSEN_MINIMIZE, and SCIP_OKAY.

◆ SCIPlpiGetObj()

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 1534 of file lpi_clp.cpp.

References BMScopyMemoryArray, SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetBounds()

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 objective value for
lastcollast column to get objective value for
lbsarray to store lower bound values, or 0
ubsarray to store upper bound values, or 0

Definition at line 1557 of file lpi_clp.cpp.

References BMScopyMemoryArray, SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetSides()

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 0
rhssarray to store right hand side values, or 0

Definition at line 1588 of file lpi_clp.cpp.

References BMScopyMemoryArray, SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetCoef()

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 1619 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiSolvePrimal()

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 1653 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_CALL, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, SCIPlpiWriteLP(), SCIPlpiWriteState(), SCIP_LPi::setFactorizationFrequency, SCIP_LPi::solved, SCIP_LPi::startscratch, TRUE, and SCIP_LPi::validFactorization.

◆ SCIPlpiSolveDual()

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 1726 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_CALL, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, SCIPlpiWriteLP(), SCIPlpiWriteState(), SCIP_LPi::setFactorizationFrequency, SCIP_LPi::solved, SCIP_LPi::startscratch, TRUE, and SCIP_LPi::validFactorization.

◆ SCIPlpiSolveBarrier()

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 1801 of file lpi_clp.cpp.

References SCIP_LPi::clp, invalidateSolution(), SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, SCIP_LPi::solved, and TRUE.

◆ SCIPlpiStartStrongbranch()

SCIP_RETCODE SCIPlpiStartStrongbranch ( SCIP_LPI lpi)

start strong branching - call before any strongbranching

Parameters
lpiLP interface structure

Definition at line 1842 of file lpi_clp.cpp.

References SCIP_OKAY.

◆ SCIPlpiEndStrongbranch()

SCIP_RETCODE SCIPlpiEndStrongbranch ( SCIP_LPI lpi)

end strong branching - call after any strongbranching

Parameters
lpiLP interface structure

Definition at line 1851 of file lpi_clp.cpp.

References SCIP_OKAY.

◆ lpiStrongbranch()

static SCIP_RETCODE lpiStrongbranch ( 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

performs strong branching iterations on one arbitrary candidate

Clp special options: 1 - Don't keep changing infeasibility weight 2 - Keep nonLinearCost round solves 4 - Force outgoing variables to exact bound (primal) 8 - Safe to use dense initial factorization 16 - Just use basic variables for operation if column generation 32 - Create ray even in BAB 64 - Treat problem as feasible until last minute (i.e. minimize infeasibilities) 128 - Switch off all matrix sanity checks 256 - No row copy 512 - If not in values pass, solution guaranteed, skip as much as possible 1024 - In branch and bound 2048 - Don't bother to re-factorize if < 20 iterations 4096 - Skip some optimality checks 8192 - Do Primal when cleaning up primal 16384 - In fast dual (so we can switch off things) 32768 - called from Osi 65536 - keep arrays around as much as possible (also use maximumR/C) 131072 - transposeTimes is -1.0 and can skip basic and fixed 262144 - extra copy of scaled matrix 524288 - Clp fast dual 1048576 - don't need to finish dual (can return 3) NOTE - many applications can call Clp but there may be some short cuts which are taken which are not guaranteed safe from all applications. Vetted applications will have a bit set and the code may test this At present I expect a few such applications - if too many I will have to re-think. It is up to application owner to change the code if she/he needs these short cuts. I will not debug unless in Coin repository. See COIN_CLP_VETTED comments. 0x01000000 is Cbc (and in branch and bound) 0x02000000 is in a different branch and bound

2048 does not seem to work 262144 does not seem to work

For strong branching. On input lower and upper are new bounds while on output they are change in objective function values (>1.0e50 infeasible). Return code is 0 if nothing interesting, -1 if infeasible both ways and +1 if infeasible one way (check values to see which one(s)) -2 if bad factorization Solutions are filled in as well - even down, odd up - also status and number of iterations

The bools are: bool stopOnFirstInfeasible bool alwaysFinish

At the moment: we need alwaysFinish to get correct bounds.

Parameters
lpiLP interface structure
colcolumn to apply strong branching on
psolcurrent 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 1861 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, EPSCEIL, EPSFLOOR, SCIP_LPi::ncols, NULL, SCIP_ALLOC, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, TRUE, and SCIP_LPi::validFactorization.

Referenced by SCIPlpiStrongbranchFrac(), and SCIPlpiStrongbranchInt().

◆ lpiStrongbranches()

static SCIP_RETCODE lpiStrongbranches ( 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 
)
static

performs strong branching iterations on given arbitrary candidates

Clp special options: 1 - Don't keep changing infeasibility weight 2 - Keep nonLinearCost round solves 4 - Force outgoing variables to exact bound (primal) 8 - Safe to use dense initial factorization 16 - Just use basic variables for operation if column generation 32 - Create ray even in BAB 64 - Treat problem as feasible until last minute (i.e. minimize infeasibilities) 128 - Switch off all matrix sanity checks 256 - No row copy 512 - If not in values pass, solution guaranteed, skip as much as possible 1024 - In branch and bound 2048 - Don't bother to re-factorize if < 20 iterations 4096 - Skip some optimality checks 8192 - Do Primal when cleaning up primal 16384 - In fast dual (so we can switch off things) 32768 - called from Osi 65536 - keep arrays around as much as possible (also use maximumR/C) 131072 - transposeTimes is -1.0 and can skip basic and fixed 262144 - extra copy of scaled matrix 524288 - Clp fast dual 1048576 - don't need to finish dual (can return 3) NOTE - many applications can call Clp but there may be some short cuts which are taken which are not guaranteed safe from all applications. Vetted applications will have a bit set and the code may test this At present I expect a few such applications - if too many I will have to re-think. It is up to application owner to change the code if she/he needs these short cuts. I will not debug unless in Coin repository. See COIN_CLP_VETTED comments. 0x01000000 is Cbc (and in branch and bound) 0x02000000 is in a different branch and bound

2048 does not seem to work 262144 does not seem to work

For strong branching. On input lower and upper are new bounds while on output they are change in objective function values (>1.0e50 infeasible). Return code is 0 if nothing interesting, -1 if infeasible both ways and +1 if infeasible one way (check values to see which one(s)) -2 if bad factorization Solutions are filled in as well - even down, odd up - also status and number of iterations

The bools are: bool stopOnFirstInfeasible bool alwaysFinish

At the moment: we need alwaysFinish to get correct bounds.

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 2020 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, EPSCEIL, EPSFLOOR, SCIP_LPi::ncols, NULL, SCIP_ALLOC, SCIP_LPERROR, SCIP_OKAY, SCIPdebugMessage, TRUE, and SCIP_LPi::validFactorization.

Referenced by SCIPlpiStrongbranchesFrac(), and SCIPlpiStrongbranchesInt().

◆ SCIPlpiStrongbranchFrac()

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
psolcurrent 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 2190 of file lpi_clp.cpp.

References lpiStrongbranch(), SCIP_CALL, and SCIP_OKAY.

◆ SCIPlpiStrongbranchesFrac()

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 2211 of file lpi_clp.cpp.

References lpiStrongbranches(), NULL, SCIP_CALL, and SCIP_OKAY.

◆ SCIPlpiStrongbranchInt()

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 2236 of file lpi_clp.cpp.

References lpiStrongbranch(), SCIP_CALL, and SCIP_OKAY.

◆ SCIPlpiStrongbranchesInt()

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 2257 of file lpi_clp.cpp.

References lpiStrongbranches(), NULL, SCIP_CALL, and SCIP_OKAY.

◆ SCIPlpiWasSolved()

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 2292 of file lpi_clp.cpp.

References NULL, and SCIP_LPi::solved.

◆ SCIPlpiGetSolFeasibility()

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 2302 of file lpi_clp.cpp.

References SCIP_LPi::clp, FALSE, SCIP_OKAY, SCIPdebugMessage, SUMINFEASBOUND, and TRUE.

◆ SCIPlpiExistsPrimalRay()

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 2347 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiHasPrimalRay()

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 2365 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiIsPrimalUnbounded()

SCIP_Bool SCIPlpiIsPrimalUnbounded ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be primal unbounded

Parameters
lpiLP interface structure

Definition at line 2381 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiIsPrimalInfeasible()

SCIP_Bool SCIPlpiIsPrimalInfeasible ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be primal infeasible

Parameters
lpiLP interface structure

Definition at line 2395 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiIsPrimalFeasible()

SCIP_Bool SCIPlpiIsPrimalFeasible ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be primal feasible

Parameters
lpiLP interface structure

Definition at line 2414 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiExistsDualRay()

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 2430 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiHasDualRay()

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 2448 of file lpi_clp.cpp.

References SCIP_LPi::clp, FALSE, SCIPdebugMessage, and TRUE.

◆ SCIPlpiIsDualUnbounded()

SCIP_Bool SCIPlpiIsDualUnbounded ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be dual unbounded

Parameters
lpiLP interface structure

Definition at line 2476 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiIsDualInfeasible()

SCIP_Bool SCIPlpiIsDualInfeasible ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be dual infeasible

Parameters
lpiLP interface structure

Definition at line 2493 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiIsDualFeasible()

SCIP_Bool SCIPlpiIsDualFeasible ( SCIP_LPI lpi)

returns TRUE iff LP is proven to be dual feasible

Parameters
lpiLP interface structure

Definition at line 2507 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiIsOptimal()

SCIP_Bool SCIPlpiIsOptimal ( SCIP_LPI lpi)

returns TRUE iff LP was solved to optimality

Parameters
lpiLP interface structure

Definition at line 2521 of file lpi_clp.cpp.

References SCIP_LPi::clp, FALSE, SCIPdebugMessage, and SCIPlpiIsObjlimExc().

◆ SCIPlpiIsStable()

SCIP_Bool SCIPlpiIsStable ( SCIP_LPI lpi)

returns TRUE iff current LP basis is stable

Parameters
lpiLP interface structure

Definition at line 2539 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiIsObjlimExc()

SCIP_Bool SCIPlpiIsObjlimExc ( SCIP_LPI lpi)

returns TRUE iff the objective limit was reached

Parameters
lpiLP interface structure

Definition at line 2577 of file lpi_clp.cpp.

References SCIP_LPi::clp, FALSE, SCIPdebugMessage, and TRUE.

Referenced by SCIPlpiIsOptimal().

◆ SCIPlpiIsIterlimExc()

SCIP_Bool SCIPlpiIsIterlimExc ( SCIP_LPI lpi)

returns TRUE iff the iteration limit was reached

Parameters
lpiLP interface structure

Definition at line 2607 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiIsTimelimExc()

SCIP_Bool SCIPlpiIsTimelimExc ( SCIP_LPI lpi)

returns TRUE iff the time limit was reached

Parameters
lpiLP interface structure

Definition at line 2623 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiGetInternalStatus()

int SCIPlpiGetInternalStatus ( SCIP_LPI lpi)

returns the internal solution status of the solver

Parameters
lpiLP interface structure

Definition at line 2639 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIPdebugMessage.

◆ SCIPlpiGetObjval()

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 2653 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetSol()

SCIP_RETCODE SCIPlpiGetSol ( SCIP_LPI lpi,
SCIP_Real objval,
SCIP_Real primsol,
SCIP_Real dualsol,
SCIP_Real activity,
SCIP_Real redcost 
)

gets primal and dual solution vectors

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

Definition at line 2671 of file lpi_clp.cpp.

References BMScopyMemoryArray, SCIP_LPi::clp, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetPrimalRay()

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 2715 of file lpi_clp.cpp.

References BMScopyMemoryArray, SCIP_LPi::clp, SCIP_LPERROR, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetDualfarkas()

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 2740 of file lpi_clp.cpp.

References BMScopyMemoryArray, SCIP_LPi::clp, SCIP_LPERROR, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetIterations()

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 2772 of file lpi_clp.cpp.

References SCIP_LPi::clp, and SCIP_OKAY.

◆ SCIPlpiGetRealSolQuality()

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 2790 of file lpi_clp.cpp.

References NULL, SCIP_INVALID, and SCIP_OKAY.

◆ SCIPlpiGetBase()

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 0
rstatarray to store row basis status, or 0

Definition at line 2817 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_INVALIDDATA, SCIP_OKAY, SCIPABORT, SCIPdebugMessage, and SCIPerrorMessage.

Referenced by SCIPlpiGetState().

◆ SCIPlpiSetBase()

SCIP_RETCODE SCIPlpiSetBase ( SCIP_LPI lpi,
const int *  cstat,
const int *  rstat 
)

sets current basis status for columns and rows

Whats changed since last solve. Is only used when startFinishOptions used in dual or primal. Bit 1 - number of rows/columns has not changed (so work arrays valid) 2 - matrix has not changed 4 - if matrix has changed only by adding rows 8 - if matrix has changed only by adding columns 16 - row lbs not changed 32 - row ubs not changed 64 - column objective not changed 128 - column lbs not changed 256 - column ubs not changed 512 - basis not changed (up to user to set this to 0) top bits may be used internally

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

Definition at line 2905 of file lpi_clp.cpp.

References SCIP_LPi::clp, EPSEQ, invalidateSolution(), SCIP_BASESTAT_BASIC, SCIP_BASESTAT_LOWER, SCIP_BASESTAT_UPPER, SCIP_BASESTAT_ZERO, SCIP_INVALIDDATA, SCIP_OKAY, SCIPABORT, SCIPdebugMessage, and SCIPerrorMessage.

Referenced by SCIPlpiSetState().

◆ SCIPlpiGetBasisInd()

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 3021 of file lpi_clp.cpp.

References BMSallocMemoryArray, BMSfreeMemoryArray, SCIP_LPi::clp, SCIP_LPi::ncols, SCIP_LPi::nrows, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetBInvRow()

SCIP_RETCODE SCIPlpiGetBInvRow ( SCIP_LPI lpi,
int  r,
SCIP_Real coef,
int *  inds,
int *  ninds 
)

get dense row of inverse basis matrix B^-1

Note
The LP interface defines slack variables to have coefficient +1. This means that if, internally, the LP solver uses a -1 coefficient, then rows associated with slacks variables whose coefficient is -1, should be negated; see also the explanation in lpi.h.
Parameters
lpiLP interface structure
rrow number
coefpointer to store the coefficients of the row
indsarray to store the non-zero indices
nindspointer to store the number of non-zero indices (-1: if we do not store sparsity informations)

Definition at line 3073 of file lpi_clp.cpp.

References SCIP_LPi::clp, NULL, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetBInvCol()

SCIP_RETCODE SCIPlpiGetBInvCol ( SCIP_LPI lpi,
int  c,
SCIP_Real coef,
int *  inds,
int *  ninds 
)

get dense column of inverse basis matrix B^-1

Note
The LP interface defines slack variables to have coefficient +1. This means that if, internally, the LP solver uses a -1 coefficient, then rows associated with slacks variables whose coefficient is -1, should be negated; see also the explanation in lpi.h.
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
indsarray to store the non-zero indices
nindspointer to store the number of non-zero indices (-1: if we do not store sparsity informations)

Definition at line 3108 of file lpi_clp.cpp.

References SCIP_LPi::clp, NULL, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetBInvARow()

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

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

Note
The LP interface defines slack variables to have coefficient +1. This means that if, internally, the LP solver uses a -1 coefficient, then rows associated with slacks variables whose coefficient is -1, should be negated; see also the explanation in lpi.h.
Parameters
lpiLP interface structure
rrow number
binvrowrow in (A_B)^-1 from prior call to SCIPlpiGetBInvRow(), or 0
coefvector to return coefficients
indsarray to store the non-zero indices
nindspointer to store the number of non-zero indices (-1: if we do not store sparsity informations)

Definition at line 3146 of file lpi_clp.cpp.

References SCIP_LPi::clp, NULL, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetBInvACol()

SCIP_RETCODE SCIPlpiGetBInvACol ( SCIP_LPI lpi,
int  c,
SCIP_Real coef,
int *  inds,
int *  ninds 
)

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

Note
The LP interface defines slack variables to have coefficient +1. This means that if, internally, the LP solver uses a -1 coefficient, then rows associated with slacks variables whose coefficient is -1, should be negated; see also the explanation in lpi.h.
Parameters
lpiLP interface structure
ccolumn number
coefvector to return coefficients
indsarray to store the non-zero indices
nindspointer to store the number of non-zero indices (-1: if we do not store sparsity informations)

Definition at line 3181 of file lpi_clp.cpp.

References SCIP_LPi::clp, NULL, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiGetState()

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 3221 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_LPi::cstat, ensureCstatMem(), ensureRstatMem(), lpistateCreate(), lpistatePack(), SCIP_LPi::ncols, SCIP_LPi::nrows, SCIP_LPi::rstat, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPlpiGetBase().

◆ SCIPlpiSetState()

SCIP_RETCODE SCIPlpiSetState ( SCIP_LPI lpi,
BMS_BLKMEM ,
const SCIP_LPISTATE lpistate 
)

loads LPi state (like basis information) into solver; note that the LP might have been extended with additional columns and rows since the state was stored with SCIPlpiGetState()

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

Definition at line 3261 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_LPi::cstat, ensureCstatMem(), ensureRstatMem(), lpistateUnpack(), SCIP_LPiState::ncols, SCIP_LPiState::nrows, 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 SCIPlpiSetBase().

◆ SCIPlpiClearState()

SCIP_RETCODE SCIPlpiClearState ( SCIP_LPI lpi)

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

Parameters
lpiLP interface structure

Definition at line 3315 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_OKAY, SCIPdebugMessage, and SCIP_LPi::validFactorization.

◆ SCIPlpiFreeState()

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 3331 of file lpi_clp.cpp.

References lpistateFree(), NULL, SCIP_OKAY, and SCIPdebugMessage.

◆ SCIPlpiHasStateBasis()

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 3349 of file lpi_clp.cpp.

References NULL.

◆ SCIPlpiReadState()

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 3358 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_OKAY, SCIP_READERROR, and SCIPdebugMessage.

◆ SCIPlpiWriteState()

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 3375 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_OKAY, SCIP_WRITEERROR, and SCIPdebugMessage.

Referenced by SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().

◆ SCIPlpiGetNorms()

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 3412 of file lpi_clp.cpp.

References NULL, and SCIP_OKAY.

◆ SCIPlpiSetNorms()

SCIP_RETCODE SCIPlpiSetNorms ( SCIP_LPI lpi,
BMS_BLKMEM blkmem,
const SCIP_LPINORMS lpinorms 
)

loads LPi pricing norms into solver; note that the LP might have been extended with additional columns and rows since the state was stored with SCIPlpiGetNorms()

Parameters
lpiLP interface structure
blkmemblock memory
lpinormsLPi pricing norms information

Definition at line 3428 of file lpi_clp.cpp.

References NULL, and SCIP_OKAY.

◆ SCIPlpiFreeNorms()

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 3441 of file lpi_clp.cpp.

References NULL, and SCIP_OKAY.

◆ SCIPlpiGetIntpar()

SCIP_RETCODE SCIPlpiGetIntpar ( SCIP_LPI lpi,
SCIP_LPPARAM  type,
int *  ival 
)

gets integer parameter of LP

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

Definition at line 3466 of file lpi_clp.cpp.

References SCIP_LPi::clp, FALSE, SCIP_LPi::fastmip, SCIP_LPi::pricing, SCIP_LPPAR_FASTMIP, SCIP_LPPAR_FROMSCRATCH, SCIP_LPPAR_LPINFO, SCIP_LPPAR_LPITLIM, SCIP_LPPAR_PRICING, SCIP_LPPAR_SCALING, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIPdebugMessage, SCIP_LPi::startscratch, and TRUE.

◆ SCIPlpiSetIntpar()

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 3510 of file lpi_clp.cpp.

References SCIP_LPi::clp, FALSE, SCIP_LPi::pricing, SCIP_INVALIDDATA, SCIP_LPERROR, SCIP_LPPAR_FASTMIP, SCIP_LPPAR_FROMSCRATCH, SCIP_LPPAR_LPINFO, SCIP_LPPAR_LPITLIM, SCIP_LPPAR_PRICING, SCIP_LPPAR_SCALING, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_PRICING_AUTO, SCIP_PRICING_DEVEX, SCIP_PRICING_FULL, SCIP_PRICING_LPIDEFAULT, SCIP_PRICING_STEEP, SCIP_PRICING_STEEPQSTART, SCIPABORT, SCIPdebugMessage, SCIPerrorMessage, setFastmipClpParameters(), SCIP_LPi::startscratch, TRUE, and unsetFastmipClpParameters().

Referenced by SCIPlpiCreate().

◆ SCIPlpiGetRealpar()

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 3612 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_LPPAR_BARRIERCONVTOL, SCIP_LPPAR_DUALFEASTOL, SCIP_LPPAR_FEASTOL, SCIP_LPPAR_LOBJLIM, SCIP_LPPAR_LPTILIM, SCIP_LPPAR_UOBJLIM, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, and SCIPdebugMessage.

◆ SCIPlpiSetRealpar()

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

sets floating point parameter of LP

Parameters
lpiLP interface structure
typeparameter number
dvalparameter value

Definition at line 3658 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_LPPAR_BARRIERCONVTOL, SCIP_LPPAR_DUALFEASTOL, SCIP_LPPAR_FEASTOL, SCIP_LPPAR_LOBJLIM, SCIP_LPPAR_LPTILIM, SCIP_LPPAR_UOBJLIM, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, and SCIPdebugMessage.

◆ SCIPlpiInfinity()

SCIP_Real SCIPlpiInfinity ( SCIP_LPI )

returns value treated as infinity in the LP solver

Definition at line 3715 of file lpi_clp.cpp.

References SCIPdebugMessage.

◆ SCIPlpiIsInfinity()

SCIP_Bool SCIPlpiIsInfinity ( SCIP_LPI ,
SCIP_Real  val 
)

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

Parameters
valvalue to be checked for infinity

Definition at line 3726 of file lpi_clp.cpp.

References SCIPdebugMessage.

Referenced by SCIPlpiChgBounds(), and SCIPlpiSetState().

◆ fileExists()

static SCIP_Bool fileExists ( const char *  filename)
static

returns, whether the given file exists

Parameters
filenamefile name

Definition at line 3750 of file lpi_clp.cpp.

References FALSE, and TRUE.

Referenced by SCIPlpiReadLP().

◆ SCIPlpiReadLP()

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 3766 of file lpi_clp.cpp.

References SCIP_LPi::clp, fileExists(), SCIP_NOFILE, SCIP_OKAY, SCIP_READERROR, and SCIPdebugMessage.

◆ SCIPlpiWriteLP()

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 3794 of file lpi_clp.cpp.

References SCIP_LPi::clp, SCIP_OKAY, SCIP_WRITEERROR, and SCIPdebugMessage.

Referenced by SCIPlpiSolveDual(), and SCIPlpiSolvePrimal().