87 if( requiredsize > *
nvars )
118 SCIP_Bool rangedorequality;
123 rowidx = matrix->
nrows;
124 rangedorequality =
FALSE;
129 matrix->
lhs[rowidx] = -rhs;
136 matrix->
lhs[rowidx] = lhs;
137 matrix->
rhs[rowidx] = rhs;
141 rangedorequality =
TRUE;
154 if( rangedorequality )
158 for( j = 0; j <
nvars; j++ )
173 assert(0 <= probindex && probindex < matrix->ncols);
182 for( j = 0; j <
nvars; j++ )
203 assert(0 <= probindex && probindex < matrix->ncols);
233 SCIP_Real* activevals;
234 SCIP_Real activeconstant;
257 activeconstant = 0.0;
269 for( v = 0; v < nactivevars; v++ )
278 lhs -= activeconstant;
280 rhs -= activeconstant;
283 if( nactivevars > 0 )
285 SCIP_CALL(
addRow(
scip, matrix, activevars, activevals, nactivevars, lhs, rhs, maxnnonzsmem, rowadded) );
324 for(
i = 0;
i < matrix->
nrows;
i++ )
328 for( ; rowpnt < rowend; rowpnt++ )
336 for(
i = 0;
i < matrix->
ncols-1;
i++ )
341 for(
i = 0;
i < matrix->
nrows;
i++ )
347 for( ; rowpnt < rowend; rowpnt++, valpnt++ )
349 assert(*rowpnt < matrix->ncols);
379 for( row = 0; row < matrix->
nrows; row++ )
389 rowend = rowpnt + matrix->
rowmatcnt[row];
392 for( ; rowpnt < rowend; rowpnt++, valpnt++ )
457 SCIP_Bool onlyifcomplete,
458 SCIP_Bool* initialized,
460 SCIP_Bool* infeasible,
471 const char* conshdlrname;
495 *initialized =
FALSE;
513 for(
i = 0;
i < nconshdlrs; ++
i )
517 if( nconshdlrconss > 0 )
521 if( (strcmp(conshdlrname,
"linear") == 0) || (strcmp(conshdlrname,
"setppc") == 0)
522 || (strcmp(conshdlrname,
"logicor") == 0) || (strcmp(conshdlrname,
"knapsack") == 0)
523 || (strcmp(conshdlrname,
"varbound") == 0) )
526 nconss += nconshdlrconss;
529#ifdef SCIP_DISABLED_CODE
530 else if( strcmp(conshdlrname,
"linking") == 0 )
533 nconss += 2* nconshdlrconss;
537 nconssall += nconshdlrconss;
545 if( nconss < nconssall )
592 if( conshdlr !=
NULL )
596 for(
i = nconshdlrconss - 1;
i >= 0; --
i )
612 if( conshdlr !=
NULL )
616 for(
i = nconshdlrconss - 1;
i >= 0; --
i )
667 for( v = 0; v < matrix->
ncols; v++ )
695 for(
i = 0;
i < nconshdlrs; ++
i )
709 if( strcmp(conshdlrname,
"linear") == 0 )
713 cons = conshdlrconss[
c];
734 matrix->
cons[cnt] = cons;
739 else if( strcmp(conshdlrname,
"setppc") == 0 )
746 cons = conshdlrconss[
c];
784 matrix->
cons[cnt] = cons;
789 else if( strcmp(conshdlrname,
"logicor") == 0 )
793 cons = conshdlrconss[
c];
813 matrix->
cons[cnt] = cons;
818 else if( strcmp(conshdlrname,
"knapsack") == 0 )
820 if( nconshdlrconss > 0 )
830 SCIP_Longint* weights;
832 cons = conshdlrconss[
c];
849 if(
nvars > valssize )
851 valssize = (int) (1.5 *
nvars);
855 for( v = 0; v <
nvars; v++ )
856 consvals[v] = (SCIP_Real)weights[v];
865 matrix->
cons[cnt] = cons;
873 else if( strcmp(conshdlrname,
"varbound") == 0 )
875 if( nconshdlrconss > 0 )
886 cons = conshdlrconss[
c];
911 matrix->
cons[cnt] = cons;
924#ifdef SCIP_DISABLED_CODE
925 else if( strcmp(conshdlrname,
"linking") == 0 )
927 if( nconshdlrconss > 0 )
943 cons = conshdlrconss[
c];
964 if( nconsvars > valssize )
966 valssize = (int) (1.5 * nconsvars);
972 for( j = 0; j < nconsvars - 1; j++ )
974 consvars[j] = curconsvars[j];
975 consvals[j] = (
SCIP_Real) curconsvals[j];
979 consvars[nconsvars - 1] = SCIPgetIntvarLinking(
scip, cons);
980 consvals[nconsvars - 1] = -1;
988 matrix->
cons[cnt] = cons;
989 matrix->
cons[cnt + 1] = cons;
1006 SCIP_Bool lockmismatch =
FALSE;
1008 for(
i = 0;
i < matrix->
ncols; ++
i )
1012 lockmismatch =
TRUE;
1020 if( onlyifcomplete )
1033 *initialized =
TRUE;
1080 if( (*matrix) !=
NULL )
1124 (*matrix)->nrows = 0;
1125 (*matrix)->ncols = 0;
1126 (*matrix)->nnonzs = 0;
1150 rowend = rowpnt + matrix->
rowmatcnt[row];
1154 for(; (rowpnt < rowend); rowpnt++, valpnt++)
1165 printf(
" <= %.15g ###\n", matrix->
rhs[row]);
1258 classsizes[0] = matrix->
nrows;
1260 for( t = 1; t < matrix->
nrows; ++t )
1261 pcset[pcsetfill++] = t;
1264 for(
c = 0;
c < matrix->
ncols; ++
c )
1274 for( ; (colpnt < colend); colpnt++, valpnt++ )
1279 if( scale[rowidx] == 0.0 )
1280 scale[rowidx] = aij;
1281 assert(scale[rowidx] != 0.0);
1283 rowindices[
i] = rowidx;
1284 values[
i] = aij / scale[rowidx];
1285 pc = pclass[rowidx];
1286 assert(pc < matrix->nrows);
1289 assert(classsizes[pc] > 0);
1291 if( classsizes[pc] == 0 )
1293 assert(pcsetfill < matrix->nrows);
1294 pcset[pcsetfill++] = pc;
1315 while( k <
i && pcs[k] == startpc )
1319 if( k - startk > 1 )
1320 SCIPsortRealInt(&(values[startk]), &(rowindices[startk]), k - startk);
1326 startval = values[startk + t];
1330 while( t < k - startk &&
SCIPisEQ(
scip, startval, values[startk + t]) )
1334 newpclass = pcset[0];
1336 pcset[0] = pcset[--pcsetfill];
1339 for( m = startk + startt; m < startk + t; m++ )
1343 assert(newpclass < matrix->nrows);
1345 pclass[rowindices[m]] = newpclass;
1346 classsizes[newpclass]++;
1349 if( t == k - startk )
1416 classsizes[0] = matrix->
ncols;
1418 for( t = 1; t < matrix->
ncols; ++t )
1419 pcset[pcsetfill++] = t;
1422 for(
r = 0;
r < matrix->
nrows; ++
r )
1432 for( ; (rowpnt < rowend); rowpnt++, valpnt++ )
1438 varineq[colidx] =
TRUE;
1440 if( scale[colidx] == 0.0 )
1441 scale[colidx] = aij;
1442 assert(scale[colidx] != 0.0);
1444 colindices[
i] = colidx;
1445 values[
i] = aij / scale[colidx];
1446 pc = pclass[colidx];
1447 assert(pc < matrix->ncols);
1450 assert(classsizes[pc] > 0);
1452 if( classsizes[pc] == 0 )
1454 assert(pcsetfill < matrix->ncols);
1455 pcset[pcsetfill++] = pc;
1476 while( k <
i && pcs[k] == startpc )
1480 if( k - startk > 1 )
1481 SCIPsortRealInt(&(values[startk]), &(colindices[startk]), k - startk);
1487 startval = values[startk + t];
1491 while( t < k - startk &&
SCIPisEQ(
scip, startval, values[startk + t]) )
1495 newpclass = pcset[0];
1497 pcset[0] = pcset[--pcsetfill];
1500 for( m = startk + startt; m < startk + t; m++ )
1504 assert(newpclass < matrix->ncols);
1506 pclass[colindices[m]] = newpclass;
1507 classsizes[newpclass]++;
1510 if( t == k - startk )
1540#undef SCIPmatrixGetColValPtr
1541#undef SCIPmatrixGetColIdxPtr
1542#undef SCIPmatrixGetColNNonzs
1543#undef SCIPmatrixGetNColumns
1544#undef SCIPmatrixGetColUb
1545#undef SCIPmatrixGetColLb
1546#undef SCIPmatrixGetColNUplocks
1547#undef SCIPmatrixGetColNDownlocks
1548#undef SCIPmatrixGetVar
1549#undef SCIPmatrixGetColName
1550#undef SCIPmatrixGetRowValPtr
1551#undef SCIPmatrixGetRowIdxPtr
1552#undef SCIPmatrixGetRowNNonzs
1553#undef SCIPmatrixGetRowName
1554#undef SCIPmatrixGetNRows
1555#undef SCIPmatrixGetRowLhs
1556#undef SCIPmatrixGetRowRhs
1557#undef SCIPmatrixIsRowRhsInfinity
1558#undef SCIPmatrixGetNNonzs
1559#undef SCIPmatrixGetRowMinActivity
1560#undef SCIPmatrixGetRowMaxActivity
1561#undef SCIPmatrixGetRowNMinActNegInf
1562#undef SCIPmatrixGetRowNMinActPosInf
1563#undef SCIPmatrixGetRowNMaxActNegInf
1564#undef SCIPmatrixGetRowNMaxActPosInf
1565#undef SCIPmatrixGetCons
1574 assert(0 <= col && col < matrix->ncols);
1586 assert(0 <= col && col < matrix->ncols);
1598 assert(0 <= col && col < matrix->ncols);
1610 return matrix->
ncols;
1621 return matrix->
ub[col];
1632 return matrix->
lb[col];
1642 assert(0 <= col && col < matrix->ncols);
1654 assert(0 <= col && col < matrix->ncols);
1666 assert(0 <= col && col < matrix->ncols);
1668 return matrix->
vars[col];
1678 assert(0 <= col && col < matrix->ncols);
1690 assert(0 <= row && row < matrix->nrows);
1702 assert(0 <= row && row < matrix->nrows);
1714 assert(0 <= row && row < matrix->nrows);
1726 assert(0 <= row && row < matrix->nrows);
1738 return matrix->
nrows;
1748 assert(0 <= row && row < matrix->nrows);
1750 return matrix->
lhs[row];
1760 assert(0 <= row && row < matrix->nrows);
1762 return matrix->
rhs[row];
1772 assert(0 <= row && row < matrix->nrows);
1794 assert(0 <= row && row < matrix->nrows);
1806 assert(0 <= row && row < matrix->nrows);
1818 assert(0 <= row && row < matrix->nrows);
1830 assert(0 <= row && row < matrix->nrows);
1842 assert(0 <= row && row < matrix->nrows);
1854 assert(0 <= row && row < matrix->nrows);
1866 assert(0 <= row && row < matrix->nrows);
1868 return matrix->
cons[row];
1878 assert(0 <= col && col < matrix->ncols);
1890 assert(0 <= col && col < matrix->ncols);
Constraint handler for knapsack constraints of the form , x binary and .
Constraint handler for linear constraints in their most general form, .
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
Constraint handler for the set partitioning / packing / covering constraints .
Constraint handler for variable bound constraints .
SCIP_RETCODE SCIPgetBinvarsLinking(SCIP *scip, SCIP_CONS *cons, SCIP_VAR ***binvars, int *nbinvars)
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcleanupConssSetppc(SCIP *scip, SCIP_Bool onlychecked, SCIP_Bool *infeasible, int *naddconss, int *ndelconss, int *nchgcoefs, int *nfixedvars)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetVbdvarVarbound(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcleanupConssKnapsack(SCIP *scip, SCIP_Bool onlychecked, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPcleanupConssVarbound(SCIP *scip, SCIP_Bool onlychecked, SCIP_Bool *infeasible, int *naddconss, int *ndelconss, int *nchgbds)
SCIP_RETCODE SCIPcleanupConssLogicor(SCIP *scip, SCIP_Bool onlychecked, int *naddconss, int *ndelconss, int *nchgcoefs)
SCIP_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetVarVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcleanupConssLinear(SCIP *scip, SCIP_Bool onlychecked, SCIP_Bool *infeasible)
SCIP_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetValsLinking(SCIP *scip, SCIP_CONS *cons)
@ SCIP_SETPPCTYPE_PARTITIONING
@ SCIP_SETPPCTYPE_COVERING
@ SCIP_SETPPCTYPE_PACKING
SCIP_Bool SCIPisStopped(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNConss(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIPconshdlrGetNCheckConss(SCIP_CONSHDLR *conshdlr)
SCIP_CONS ** SCIPconshdlrGetCheckConss(SCIP_CONSHDLR *conshdlr)
int SCIPgetNConshdlrs(SCIP *scip)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_CONSHDLR ** SCIPgetConshdlrs(SCIP *scip)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
#define SCIPfreeBuffer(scip, ptr)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPallocClearMemoryArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPfreeMemoryArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBuffer(scip, ptr)
#define SCIPfreeBufferArrayNull(scip, ptr)
int SCIPgetNActivePricers(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
void SCIPsortRealInt(SCIP_Real *realarray, int *intarray, int len)
void SCIPsortIntIntReal(int *intarray1, int *intarray2, SCIP_Real *realarray, int len)
assert(minobj< SCIPgetCutoffbound(scip))
static const SCIP_Real scalars[]
SCIP_Bool SCIPmatrixUplockConflict(SCIP_MATRIX *matrix, int col)
int SCIPmatrixGetRowNMinActNegInf(SCIP_MATRIX *matrix, int row)
int * SCIPmatrixGetColIdxPtr(SCIP_MATRIX *matrix, int col)
int SCIPmatrixGetNNonzs(SCIP_MATRIX *matrix)
static SCIP_RETCODE setColumnMajorFormat(SCIP *scip, SCIP_MATRIX *matrix)
int SCIPmatrixGetRowNNonzs(SCIP_MATRIX *matrix, int row)
const char * SCIPmatrixGetRowName(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetColNDownlocks(SCIP_MATRIX *matrix, int col)
int SCIPmatrixGetColNNonzs(SCIP_MATRIX *matrix, int col)
SCIP_Bool SCIPmatrixIsRowRhsInfinity(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetColNUplocks(SCIP_MATRIX *matrix, int col)
SCIP_Real SCIPmatrixGetRowMaxActivity(SCIP_MATRIX *matrix, int row)
static SCIP_RETCODE calcActivityBounds(SCIP *scip, SCIP_MATRIX *matrix)
SCIP_Real SCIPmatrixGetColLb(SCIP_MATRIX *matrix, int col)
SCIP_Real SCIPmatrixGetRowLhs(SCIP_MATRIX *matrix, int row)
const char * SCIPmatrixGetColName(SCIP_MATRIX *matrix, int col)
SCIP_Real * SCIPmatrixGetRowValPtr(SCIP_MATRIX *matrix, int row)
SCIP_Bool SCIPmatrixDownlockConflict(SCIP_MATRIX *matrix, int col)
static SCIP_RETCODE addRow(SCIP *scip, SCIP_MATRIX *matrix, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Real lhs, SCIP_Real rhs, int maxnnonzsmem, SCIP_Bool *rowadded)
SCIP_Real SCIPmatrixGetRowRhs(SCIP_MATRIX *matrix, int row)
SCIP_Real * SCIPmatrixGetColValPtr(SCIP_MATRIX *matrix, int col)
int SCIPmatrixGetRowNMinActPosInf(SCIP_MATRIX *matrix, int row)
SCIP_RETCODE SCIPmatrixCreate(SCIP *scip, SCIP_MATRIX **matrixptr, SCIP_Bool onlyifcomplete, SCIP_Bool *initialized, SCIP_Bool *complete, SCIP_Bool *infeasible, int *naddconss, int *ndelconss, int *nchgcoefs, int *nchgbds, int *nfixedvars)
int SCIPmatrixGetNColumns(SCIP_MATRIX *matrix)
SCIP_Real SCIPmatrixGetRowMinActivity(SCIP_MATRIX *matrix, int row)
SCIP_CONS * SCIPmatrixGetCons(SCIP_MATRIX *matrix, int row)
SCIP_RETCODE SCIPmatrixGetParallelRows(SCIP *scip, SCIP_MATRIX *matrix, SCIP_Real *scale, int *pclass)
static SCIP_RETCODE getActiveVariables(SCIP *scip, SCIP_VAR ***vars, SCIP_Real **scalars, int *nvars, SCIP_Real *constant)
void SCIPmatrixFree(SCIP *scip, SCIP_MATRIX **matrix)
int SCIPmatrixGetRowNMaxActPosInf(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetRowNMaxActNegInf(SCIP_MATRIX *matrix, int row)
SCIP_VAR * SCIPmatrixGetVar(SCIP_MATRIX *matrix, int col)
int * SCIPmatrixGetRowIdxPtr(SCIP_MATRIX *matrix, int row)
static SCIP_RETCODE addConstraint(SCIP *scip, SCIP_MATRIX *matrix, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Real lhs, SCIP_Real rhs, int maxnnonzsmem, SCIP_Bool *rowadded)
void SCIPmatrixPrintRow(SCIP *scip, SCIP_MATRIX *matrix, int row)
SCIP_RETCODE SCIPmatrixGetParallelCols(SCIP *scip, SCIP_MATRIX *matrix, SCIP_Real *scale, int *pclass, SCIP_Bool *varineq)
int SCIPmatrixGetNRows(SCIP_MATRIX *matrix)
void SCIPmatrixRemoveColumnBounds(SCIP *scip, SCIP_MATRIX *matrix, int col)
SCIP_Real SCIPmatrixGetColUb(SCIP_MATRIX *matrix, int col)
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
public methods for managing constraints
public methods for matrix
public methods for message output
methods for sorting joint arrays of various types
public methods for problem variables
public methods for constraint handler plugins and constraints
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for variable pricer plugins
public methods for global and local (sub)problems
public methods for SCIP variables
SCIP_Bool * isrhsinfinite
data structure for MIP matrix
enum SCIP_Retcode SCIP_RETCODE