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 )
183 const char* conshdlrname;
196 if( strcmp(conshdlrname,
"exactlinear") == 0 )
220 const char* conshdlrname;
233 if( strcmp(conshdlrname,
"exactlinear") == 0 )
262 const char* conshdlrname;
286 if( varssize <
nvars )
288 SCIPwarningMessage(
scip,
"Cannot return value array for constraint of type <%s> (insufficient memory provided)\n", conshdlrname);
293 if( strcmp(conshdlrname,
"linear") == 0 )
302 vals[
i] = linvals[
i];
305 else if( strcmp(conshdlrname,
"setppc") == 0 )
312 else if( strcmp(conshdlrname,
"logicor") == 0 )
319 else if( strcmp(conshdlrname,
"knapsack") == 0 )
331 else if( strcmp(conshdlrname,
"varbound") == 0 )
338 else if( strcmp(conshdlrname,
"SOS1") == 0 )
347 vals[
i] = weights[
i];
350 else if( strcmp(conshdlrname,
"SOS2") == 0 )
359 vals[
i] = weights[
i];
387 const char* conshdlrname;
411 if( varssize <
nvars )
413 SCIPwarningMessage(
scip,
"Cannot return exact value array for constraint of type <%s> (insufficient memory provided)\n", conshdlrname);
418 if( strcmp(conshdlrname,
"exactlinear") == 0 )
446 const char* conshdlrname;
457 if( strcmp(conshdlrname,
"linear") == 0 )
461 else if( strcmp(conshdlrname,
"setppc") == 0 )
465 else if( strcmp(conshdlrname,
"logicor") == 0 )
469 else if( strcmp(conshdlrname,
"knapsack") == 0 )
473 else if( strcmp(conshdlrname,
"varbound") == 0 )
478 else if( strcmp(conshdlrname,
"origbranch") == 0 || strcmp(conshdlrname,
"masterbranch") == 0 )
484 SCIPwarningMessage(
scip,
"Cannot return dual farkas solution for constraint of type <%s>\n", conshdlrname);
502 const char* conshdlrname;
513 if( strcmp(conshdlrname,
"linear") == 0 )
517 else if( strcmp(conshdlrname,
"setppc") == 0 )
521 else if( strcmp(conshdlrname,
"logicor") == 0 )
525 else if( strcmp(conshdlrname,
"knapsack") == 0 )
529 else if( strcmp(conshdlrname,
"varbound") == 0 )
534 else if( strcmp(conshdlrname,
"origbranch") == 0 || strcmp(conshdlrname,
"masterbranch") == 0 )
555 const char* conshdlrname;
564 if( strcmp(conshdlrname,
"linear") == 0 )
568 else if( strcmp(conshdlrname,
"setppc") == 0 )
572 else if( strcmp(conshdlrname,
"logicor") == 0 )
576 else if( strcmp(conshdlrname,
"knapsack") == 0 )
580 else if( strcmp(conshdlrname,
"varbound") == 0 )
584 else if( strcmp(conshdlrname,
"exactlinear") == 0 )
591 SCIPdebugMsg(
scip,
"Cannot return row for constraint of type <%s>\n", conshdlrname);
606 const char* conshdlrname;
621 if( strcmp(conshdlrname,
"linear") == 0 )
630 else if( strcmp(conshdlrname,
"setppc") == 0 )
639 else if( strcmp(conshdlrname,
"logicor") == 0 )
648 else if( strcmp(conshdlrname,
"knapsack") == 0 )
657 else if( strcmp(conshdlrname,
"varbound") == 0 )
683 const char* conshdlrname;
693 if( strcmp(conshdlrname,
"linear") == 0 )
697 else if( strcmp(conshdlrname,
"setppc") == 0 )
701 else if( strcmp(conshdlrname,
"logicor") == 0 )
705 else if( strcmp(conshdlrname,
"knapsack") == 0 )
710 "The coefficient for a knapsack constraint must be integer.\n", val);
716 else if( strcmp(conshdlrname,
"varbound") == 0 )
718 SCIPerrorMessage(
"Sorry, can't add coefficient for constraint of type <%s>\n", conshdlrname);
723 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_RETCODE SCIPcreateRowLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetVbdcoefVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_RATIONAL * SCIPgetLhsExactLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateRowKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RATIONAL * SCIPgetRhsExactLinear(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_RETCODE SCIPcreateRowLogicor(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_RETCODE SCIPcreateRowVarbound(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateRowSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RATIONAL ** SCIPgetValsExactLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualfarkasSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_ROW * SCIPgetRowExactLinear(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
SCIP_STAGE SCIPgetStage(SCIP *scip)
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)
void SCIPrationalSetRational(SCIP_RATIONAL *res, SCIP_RATIONAL *src)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
assert(minobj< SCIPgetCutoffbound(scip))
SCIP_RATIONAL * SCIPconsGetRhsExact(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
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 SCIPgetConsValsExact(SCIP *scip, SCIP_CONS *cons, SCIP_RATIONAL **vals, int varssize, 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_RATIONAL * SCIPconsGetLhsExact(SCIP *scip, SCIP_CONS *cons, 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_RETCODE SCIPconsCreateRow(SCIP *scip, SCIP_CONS *cons, SCIP_ROW **row)
SCIP_ROW * SCIPconsGetRow(SCIP *scip, SCIP_CONS *cons)
internal miscellaneous methods for linear constraints
struct SCIP_Cons SCIP_CONS
struct SCIP_Conshdlr SCIP_CONSHDLR
struct SCIP_Rational SCIP_RATIONAL
enum SCIP_Retcode SCIP_RETCODE