55 const char* conshdlrname;
69 if( strcmp(conshdlrname,
"linear") == 0 )
73 else if( strcmp(conshdlrname,
"setppc") == 0 )
87 else if( strcmp(conshdlrname,
"logicor") == 0 )
91 else if( strcmp(conshdlrname,
"knapsack") == 0 )
95 else if( strcmp(conshdlrname,
"varbound") == 0 )
119 const char* conshdlrname;
133 if( strcmp(conshdlrname,
"linear") == 0 )
137 else if( strcmp(conshdlrname,
"setppc") == 0 )
151 else if( strcmp(conshdlrname,
"logicor") == 0 )
155 else if( strcmp(conshdlrname,
"knapsack") == 0 )
159 else if( strcmp(conshdlrname,
"varbound") == 0 )
188 const char* conshdlrname;
212 if( varssize <
nvars )
214 SCIPwarningMessage(
scip,
"Cannot return value array for constraint of type <%s> (insufficient memory provided)\n", conshdlrname);
219 if( strcmp(conshdlrname,
"linear") == 0 )
228 vals[
i] = linvals[
i];
231 else if( strcmp(conshdlrname,
"setppc") == 0 )
238 else if( strcmp(conshdlrname,
"logicor") == 0 )
245 else if( strcmp(conshdlrname,
"knapsack") == 0 )
257 else if( strcmp(conshdlrname,
"varbound") == 0 )
264 else if( strcmp(conshdlrname,
"SOS1") == 0 )
273 vals[
i] = weights[
i];
276 else if( strcmp(conshdlrname,
"SOS2") == 0 )
285 vals[
i] = weights[
i];
309 const char* conshdlrname;
320 if( strcmp(conshdlrname,
"linear") == 0 )
324 else if( strcmp(conshdlrname,
"setppc") == 0 )
328 else if( strcmp(conshdlrname,
"logicor") == 0 )
332 else if( strcmp(conshdlrname,
"knapsack") == 0 )
336 else if( strcmp(conshdlrname,
"varbound") == 0 )
341 else if( strcmp(conshdlrname,
"origbranch") == 0 || strcmp(conshdlrname,
"masterbranch") == 0 )
347 SCIPwarningMessage(
scip,
"Cannot return dual farkas solution for constraint of type <%s>\n", conshdlrname);
365 const char* conshdlrname;
376 if( strcmp(conshdlrname,
"linear") == 0 )
380 else if( strcmp(conshdlrname,
"setppc") == 0 )
384 else if( strcmp(conshdlrname,
"logicor") == 0 )
388 else if( strcmp(conshdlrname,
"knapsack") == 0 )
392 else if( strcmp(conshdlrname,
"varbound") == 0 )
397 else if( strcmp(conshdlrname,
"origbranch") == 0 || strcmp(conshdlrname,
"masterbranch") == 0 )
418 const char* conshdlrname;
427 if( strcmp(conshdlrname,
"linear") == 0 )
431 else if( strcmp(conshdlrname,
"setppc") == 0 )
435 else if( strcmp(conshdlrname,
"logicor") == 0 )
439 else if( strcmp(conshdlrname,
"knapsack") == 0 )
443 else if( strcmp(conshdlrname,
"varbound") == 0 )
464 const char* conshdlrname;
474 if( strcmp(conshdlrname,
"linear") == 0 )
478 else if( strcmp(conshdlrname,
"setppc") == 0 )
482 else if( strcmp(conshdlrname,
"logicor") == 0 )
486 else if( strcmp(conshdlrname,
"knapsack") == 0 )
491 "The coefficient for a knapsack constraint must be integer.\n", val);
497 else if( strcmp(conshdlrname,
"varbound") == 0 )
499 SCIPerrorMessage(
"Sorry, can't add coefficient for constraint of type <%s>\n", conshdlrname);
504 SCIPerrorMessage(
"Sorry, can't add coefficient for constraint of type <%s>\n", conshdlrname);
Constraint handler for the set partitioning / packing / covering constraints .
common defines and data types used in all packages of SCIP
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualfarkasVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetWeightsSOS2(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPaddCoefKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Longint weight)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_ROW * SCIPgetRowSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_ROW * SCIPgetRowVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_ROW * SCIPgetRowLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_ROW * SCIPgetRowLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetWeightsSOS1(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualfarkasLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddCoefSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
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_Real SCIPgetRhsVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualfarkasLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualfarkasKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_ROW * SCIPgetRowKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualfarkasSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddCoefLogicor(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
@ SCIP_SETPPCTYPE_PARTITIONING
@ SCIP_SETPPCTYPE_COVERING
@ SCIP_SETPPCTYPE_PACKING
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
assert(minobj< SCIPgetCutoffbound(scip))
SCIP_Real SCIPconsGetLhs(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
void SCIPconsGetDualfarkas(SCIP *scip, SCIP_CONS *cons, SCIP_Real *dualfarkas, SCIP_Bool *success)
SCIP_RETCODE SCIPconsAddCoef(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPgetConsVals(SCIP *scip, SCIP_CONS *cons, SCIP_Real *vals, int varssize, SCIP_Bool *success)
SCIP_Real SCIPconsGetRhs(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
void SCIPconsGetDualsol(SCIP *scip, SCIP_CONS *cons, SCIP_Real *dualsol, SCIP_Bool *success)
SCIP_ROW * SCIPconsGetRow(SCIP *scip, SCIP_CONS *cons)
internal miscellaneous methods for linear constraints
struct SCIP_Cons SCIP_CONS
struct SCIP_Conshdlr SCIP_CONSHDLR
enum SCIP_Retcode SCIP_RETCODE