diff --git a/CHANGELOG b/CHANGELOG index 73511b19ec..0dfd5ef49c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -185,20 +185,14 @@ Miscellaneous Fixed bugs ---------- -- skip constraint propagation if the residual activity bound cancels the side precision in tightenVarBounds() of cons_linear.c -- use indices of negation counterparts and accept fixings when ordering and-resultants of pseudoboolean constraints +- skip linear constraint propagation if the residual activity bound cancels the side precision - correct bound tracking to make the evaluation of primal-dual-integrals work -- update locks on model variables before removing pseudoboolean constraints in consPresolPseudoboolean() - skip aggregations on fixed variables in milp presolver to avoid errors for earlier versions of PaPILO +- use indices of negation counterparts and accept fixings when ordering and-resultants of pseudoboolean constraints +- update locks on model variables before removing pseudoboolean constraints in presolve - reformulate soft pseudoboolean constraints with linear constraints if the indicator decomposition is disabled -- in lpi_highs set the presolve option in lpiSolve() to not reset the model status directly after solving the LP -- update constraints and hashmap after each multi-aggregation to avoid key error in removeDoubleAndSingletonsAndPerformDualpresolve() of cons_setppc.c - -Unit tests ----------- - -Testing -------- +- add workaround for recent HiGHS versions resetting the model status when changing the presolve option after a solve +- avoid hashmap key error in removal of doubletons and singletons in dual presolve of setppc constraints by updating constraints and corresponding hashmaps after each multi-aggregation Build system ------------ @@ -207,16 +201,11 @@ Build system - attempted to fix detection of CPLEX library on macOS and Windows systems -### Makefile - Miscellaneous ------------- - adjusted Gurobi interface for Gurobi 12 -Known bugs ----------- - @section RN911 SCIP 9.1.1 ************************* diff --git a/applications/Scheduler/src/cons_optcumulative.c b/applications/Scheduler/src/cons_optcumulative.c index 3fe2555dc3..2be91f49fd 100644 --- a/applications/Scheduler/src/cons_optcumulative.c +++ b/applications/Scheduler/src/cons_optcumulative.c @@ -1146,13 +1146,6 @@ SCIP_RETCODE addRelaxation( consdata->relaxadded = TRUE; -#if 0 - if( !conshdlrdata->rowrelax ) - { - SCIP_CALL( SCIPrestartSolve(scip) ); - } -#endif - return SCIP_OKAY; } @@ -1877,75 +1870,6 @@ SCIP_RETCODE enfopsCons( return SCIP_OKAY; } -#if 0 -/** enforce the LP or pseudo solution */ -static -SCIP_RETCODE enfoCons( - SCIP* scip, /**< SCIP data structure */ - SCIP_CONS* cons, /**< constraint to be checked */ - SCIP_Bool* violated, /**< pointer to store if the constraint is violated */ - SCIP_Bool* rowadded /**< pointer to store if a row was added */ - ) -{ - SCIP_CONSDATA* consdata; - SCIP_VAR** binvars; - SCIP_VAR** vars; - int* demands; - int* durations; - SCIP_Bool auxiliary; - SCIP_Bool cutoff; - int nvars; - - assert(scip != NULL); - assert(cons != NULL); - assert(violated != NULL); - - SCIPdebugMessage("check optcumulative constraints <%s>\n", SCIPconsGetName(cons)); - - consdata = SCIPconsGetData(cons); - assert(consdata != NULL); - - SCIP_CALL( SCIPallocBufferArray(scip, &binvars, consdata->nvars) ); - SCIP_CALL( SCIPallocBufferArray(scip, &vars, consdata->nvars) ); - SCIP_CALL( SCIPallocBufferArray(scip, &durations, consdata->nvars) ); - SCIP_CALL( SCIPallocBufferArray(scip, &demands, consdata->nvars) ); - - /* collect information of all activities which are assigned to that machine in the given solution */ - collectSolActivities(scip, consdata, NULL, binvars, vars, durations, demands, &nvars, &auxiliary); - - if( nvars > 0 ) - { - /* check the cumulative condition */ - SCIP_CALL( SCIPcheckCumulativeCondition(scip, NULL, nvars, vars, - durations, demands, consdata->capacity, consdata->hmin, consdata->hmax, violated, cons, FALSE) ); - - if( *violated ) - { -#if 0 - /* create row */ - SCIP_CALL( createRow(scip, SCIPconsGetName(cons), binvars, vars, durations, demands, nvars, - consdata->capacity, TRUE, &cutoff) ); -#endif - /* reset constraint age since it successfully detected infeasibility */ - SCIP_CALL( SCIPresetConsAge(scip, cons) ); - } - else - { - /* increase constraint age since it did not detected infeasibility */ - SCIP_CALL( SCIPincConsAge(scip, cons) ); - } - } - - /* free all buffers */ - SCIPfreeBufferArray(scip, &demands); - SCIPfreeBufferArray(scip, &durations); - SCIPfreeBufferArray(scip, &vars); - SCIPfreeBufferArray(scip, &binvars); - - return SCIP_OKAY; -} -#endif - /** upgrade constraints to an cumulative constraint */ static SCIP_RETCODE upgradeCons( diff --git a/applications/Scheduler/src/heur_optcumulative.c b/applications/Scheduler/src/heur_optcumulative.c index 4e39e6ccb2..cbd495fcf8 100644 --- a/applications/Scheduler/src/heur_optcumulative.c +++ b/applications/Scheduler/src/heur_optcumulative.c @@ -253,9 +253,6 @@ SCIP_RETCODE applyOptcumulative( SCIP_Real upperbound; SCIP_Real pseudoobj; SCIP_Bool infeasible; -#if 0 - int depth; -#endif assert(heur != NULL); assert(heurdata != NULL); @@ -264,9 +261,6 @@ SCIP_RETCODE applyOptcumulative( infeasible = FALSE; *result = SCIP_DIDNOTFIND; -#if 0 - depth = SCIPgetDepth(scip); -#endif /* start probing */ SCIP_CALL( SCIPstartProbing(scip) ); @@ -545,29 +539,6 @@ SCIP_RETCODE applyOptcumulative( if( stored ) *result = SCIP_FOUNDSOL; } -#if 0 - else - { - /* check that code */ - int v; - - SCIP_CALL( SCIPinitConflictAnalysis(scip) ); - - for( v = 0; v < heurdata->machines[m]; ++v ) - { - SCIP_CALL( SCIPaddConflictBinvar(scip, heurdata->binvars[m][v]) ); - SCIP_CALL( SCIPaddConflictLb(scip, heurdata->vars[m][v], NULL) ); - SCIP_CALL( SCIPaddConflictUb(scip, heurdata->vars[m][v], NULL) ); - } - - /* analyze the conflict */ -#if 0 - SCIP_CALL( SCIPanalyzeConflict(scip, depth, NULL) ); -#endif - SCIP_CALL( SCIPanalyzeConflict(scip, 0, NULL) ); - SCIP_CALL( SCIPfreeSol(scip, &sol) ); - } -#endif } /* exit probing mode */ diff --git a/src/scip/cons_cumulative.c b/src/scip/cons_cumulative.c index 27447ac89b..861c07e63c 100644 --- a/src/scip/cons_cumulative.c +++ b/src/scip/cons_cumulative.c @@ -410,7 +410,8 @@ SCIP_RETCODE computeImpliedEst( int* est /**< pointer to store the implied earliest start time */ ) { /*lint --e{715}*/ -#if 0 +#ifdef SCIP_DISABLED_CODE + /* there is a bug below */ SCIP_VAR** vbdvars; SCIP_VAR* vbdvar; SCIP_Real* vbdcoefs; @@ -422,7 +423,7 @@ SCIP_RETCODE computeImpliedEst( (*est) = SCIPconvertRealToInt(scip, SCIPvarGetLbLocal(var)); -#if 0 +#ifdef SCIP_DISABLED_CODE /* the code contains a bug; we need to check if an implication forces that the jobs do not run in parallel */ nvbdvars = SCIPvarGetNVlbs(var); @@ -479,7 +480,8 @@ SCIP_RETCODE computeImpliedLct( int* lct /**< pointer to store the implied latest completion time */ ) { /*lint --e{715}*/ -#if 0 +#ifdef SCIP_DISABLED_CODE + /* there is a bug below */ SCIP_VAR** vbdvars; SCIP_VAR* vbdvar; SCIP_Real* vbdcoefs; @@ -490,7 +492,7 @@ SCIP_RETCODE computeImpliedLct( (*lct) = SCIPconvertRealToInt(scip, SCIPvarGetUbLocal(var)) + duration; -#if 0 +#ifdef SCIP_DISABLED_CODE /* the code contains a bug; we need to check if an implication forces that the jobs do not run in parallel */ nvbdvars = SCIPvarGetNVubs(var); @@ -1442,7 +1444,9 @@ SCIP_DECL_SOLVECUMULATIVE(solveCumulativeViaScipCp) return SCIP_OKAY; } -#if 0 +#ifdef SCIP_DISABLED_CODE +/* The following code should work, but is currently not used. */ + /** solve single cumulative condition using SCIP and the time indexed formulation */ static SCIP_DECL_SOLVECUMULATIVE(solveCumulativeViaScipMip) @@ -2736,112 +2740,6 @@ SCIP_RETCODE resolvePropagationCoretimes( return SCIP_OKAY; } -#if 0 -/** repropagation of edge finding algorithm simplified version from Petr Vilim only a small subset is reported such that - * energy in total and for bound change is enough - */ -static -SCIP_RETCODE resolvePropagationEdgeFinding( - SCIP* scip, /**< SCIP data structure */ - int nvars, /**< number of start time variables (activities) */ - SCIP_VAR** vars, /**< array of start time variables */ - int* durations, /**< array of durations */ - int hmin, /**< left bound of time axis to be considered (including hmin) */ - int hmax, /**< right bound of time axis to be considered (not including hmax) */ - SCIP_VAR* infervar, /**< variable whose bound change is to be explained */ - INFERINFO inferinfo, /**< inference info containing position of correct bdchgids */ - SCIP_BOUNDTYPE boundtype, /**< the type of the changed bound (lower or upper bound) */ - SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */ - SCIP_Bool usebdwidening, /**< should bound widening be used during conflict analysis? */ - SCIP_Bool* explanation /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */ - ) -{ - int est; - int lct; - int j; - - /* ???????????????????? do bound widening */ - - assert(scip != NULL); - assert(nvars > 0); - assert(inferInfoGetProprule(inferinfo) == PROPRULE_2_EDGEFINDING); - - SCIPdebugMsg(scip, "repropagate edge-finding with short reasons for variable <%s>\n", SCIPvarGetName(infervar)); - - if( boundtype == SCIP_BOUNDTYPE_LOWER ) - { - SCIP_CALL( SCIPaddConflictLb(scip, infervar, bdchgidx) ); - } - else - { - SCIP_CALL( SCIPaddConflictUb(scip, infervar, bdchgidx) ); - } - - est = inferInfoGetData1(inferinfo); - lct = inferInfoGetData2(inferinfo); - assert(est < lct); - - /* collect the energies of all variables in [est_omega, lct_omega] */ - for( j = 0; j < nvars; ++j ) - { - SCIP_VAR* var; - SCIP_Bool left; - SCIP_Bool right; - int duration; - int lb; - int ub; - - var = vars[j]; - assert(var != NULL); - - if( var == infervar ) - { - if( explanation != NULL ) - explanation[j] = TRUE; - - continue; - } - - lb = SCIPconvertRealToInt(scip, SCIPgetVarLbAtIndex(scip, var, bdchgidx, FALSE)); - ub = SCIPconvertRealToInt(scip, SCIPgetVarUbAtIndex(scip, var, bdchgidx, FALSE)); - - duration = durations[j]; - assert(duration > 0); - - /* in case the earliest start time is equal to hmin we have to also consider the jobs which run in that region - * since we use adjusted jobs during the propagation - */ - left = (est == hmin && lb + duration > hmin) || lb >= est; - - /* in case the latest completion time is equal to hmax we have to also consider the jobs which run in that region - * since we use adjusted jobs during the propagation - */ - right = (lct == hmax && ub < hmax) || ub + duration <= lct; - - /* store all jobs running in [est_omega; lct_omega] */ - if( left && right ) - { - /* check if bound widening should be used */ - if( usebdwidening ) - { - SCIP_CALL( SCIPaddConflictRelaxedLb(scip, var, bdchgidx, (SCIP_Real)(lct - duration)) ); - SCIP_CALL( SCIPaddConflictRelaxedUb(scip, var, bdchgidx, (SCIP_Real)(est)) ); - } - else - { - SCIP_CALL( SCIPaddConflictLb(scip, var, bdchgidx) ); - SCIP_CALL( SCIPaddConflictUb(scip, var, bdchgidx) ); - } - - if( explanation != NULL ) - explanation[j] = TRUE; - } - } - - return SCIP_OKAY; -} -#endif - /** compute the minimum overlaps w.r.t. the duration of the job and the time window [begin,end) */ static int computeOverlap( @@ -10901,7 +10799,9 @@ SCIP_RETCODE tightenCoefs( return SCIP_OKAY; } -#if 0 +#ifdef SCIP_DISABLED_CODE +/* The following should work, but does not seem to be tested well. */ + /** try to reformulate constraint by replacing certain jobs */ static SCIP_RETCODE reformulateCons( @@ -11084,9 +10984,6 @@ SCIP_RETCODE presolveCons( SCIP_CONSHDLRDATA* conshdlrdata, /**< constraint handler data */ SCIP_PRESOLTIMING presoltiming, /**< timing of presolving call */ int* nfixedvars, /**< pointer to store the number of fixed variables */ -#if 0 - int* naggrvars, /**< pointer to counter which is increased by the number of deduced variable aggregations */ -#endif int* nchgbds, /**< pointer to store the number of changed bounds */ int* ndelconss, /**< pointer to store the number of deleted constraints */ int* naddconss, /**< pointer to store the number of added constraints */ @@ -11154,7 +11051,8 @@ SCIP_RETCODE presolveCons( assert(checkDemands(scip, cons) || *cutoff); -#if 0 +#ifdef SCIP_DISABLED_CODE + /* The following should work, but does not seem to be tested well. */ SCIP_CALL( reformulateCons(scip, cons, naggrvars) ); #endif @@ -11261,30 +11159,6 @@ TCLIQUE_NEWSOL(tcliqueNewsolClique) SCIPdebugMessage("####### max clique %d\n", cliqueweight); } -/** print the tclique graph */ -#if 0 -static -void tcliquePrint( - SCIP* scip, /**< SCIP data structure */ - TCLIQUE_GRAPH* tcliquegraph /**< tclique graph */ - ) -{ - int nnodes; - int i; - int j; - - nnodes = tcliquegraph->nnodes; - - for( i = 0; i < nnodes; ++i ) - { - for( j = 0; j < nnodes; ++j ) - { - SCIPinfoMessage(scip, NULL, "(%d/%d) ", tcliquegraph->precedencematrix[i][j], tcliquegraph->demandmatrix[i][j]); - } - SCIPinfoMessage(scip, NULL, "\n"); - } -} -#endif /** @} */ @@ -11818,14 +11692,6 @@ SCIP_RETCODE findCumulativeConss( demandrow[c] = tcliquegraph->demandmatrix[v][c]; demandcol[c] = tcliquegraph->demandmatrix[c][v]; -#if 0 - if( precedencerow[c] || precedencecol[c] ) - { - tcliquegraph->demandmatrix[v][c] = FALSE; - tcliquegraph->demandmatrix[c][v] = FALSE; - } -#endif - tcliquegraph->precedencematrix[c][v] = FALSE; tcliquegraph->precedencematrix[v][c] = FALSE; } @@ -12735,7 +12601,7 @@ SCIP_DECL_CONSEXITPRE(consExitpreCumulative) { SCIP_CALL( evaluateCumulativeness(scip, conss[c]) ); -#if 0 +#ifdef SCIP_DISABLED_CODE SCIP_CALL( SCIPvisualizeConsCumulative(scip, conss[c]) ); #endif } @@ -13094,9 +12960,6 @@ SCIP_DECL_CONSPROP(consPropCumulative) int nchgbds; int ndelconss; int c; -#if 0 - int naggrvars = 0; -#endif SCIPdebugMsg(scip, "propagate %d of %d useful cumulative constraints\n", nusefulconss, nconss); @@ -13123,13 +12986,9 @@ SCIP_DECL_CONSPROP(consPropCumulative) if( SCIPgetDepth(scip) == 0 ) { -#if 0 - SCIP_CALL( presolveCons(scip, cons, conshdlrdata, SCIP_PRESOLTIMING_ALWAYS, - &nchgbds, &naggrvars, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &cutoff, &cutoff) ); -#else SCIP_CALL( presolveCons(scip, cons, conshdlrdata, SCIP_PRESOLTIMING_ALWAYS, &nchgbds, &nchgbds, &ndelconss, &nchgbds, &nchgbds, &nchgbds, &cutoff, &cutoff) ); -#endif + if( cutoff ) break; @@ -13149,13 +13008,6 @@ SCIP_DECL_CONSPROP(consPropCumulative) } } -#if 0 - if( !cutoff && conshdlrdata->dualpresolve && SCIPallowStrongDualReds(scip) && nconss > 1 ) - { - SCIP_CALL( propagateAllConss(scip, conss, nconss, TRUE, &nchgbds, &cutoff, NULL) ); - } -#endif - if( cutoff ) { SCIPdebugMsg(scip, "detected infeasible\n"); @@ -13223,13 +13075,8 @@ SCIP_DECL_CONSPRESOL(consPresolCumulative) if( presoltiming != SCIP_PRESOLTIMING_MEDIUM ) { -#if 0 - SCIP_CALL( presolveCons(scip, cons, conshdlrdata, presoltiming, - nfixedvars, naggrvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &cutoff, &unbounded) ); -#else SCIP_CALL( presolveCons(scip, cons, conshdlrdata, presoltiming, nfixedvars, nchgbds, ndelconss, naddconss, nchgcoefs, nchgsides, &cutoff, &unbounded) ); -#endif if( cutoff || unbounded ) break; @@ -14297,7 +14144,8 @@ SCIP_RETCODE SCIPvisualizeConsCumulative( } } -#if 0 +#ifdef SCIP_MORE_OUTPUT + /* define to also output variable bounds */ vbdvars = SCIPvarGetVubVars(var); nvbdvars = SCIPvarGetNVubs(var); diff --git a/src/scip/cons_linear.c b/src/scip/cons_linear.c index ad016457e7..6078f06637 100644 --- a/src/scip/cons_linear.c +++ b/src/scip/cons_linear.c @@ -8465,7 +8465,8 @@ SCIP_RETCODE extractCliques( i = nposbinvars + nnegbinvars - 1; j = i - 1; -#if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */ +#ifdef SCIP_DISABLED_CODE + /* assertion should only hold when constraints were fully propagated and boundstightened */ /* check that it is possible to choose binvar[i], otherwise it should have been fixed to zero */ assert(SCIPisFeasGE(scip, binvarvals[i], threshold)); #endif @@ -8625,7 +8626,8 @@ SCIP_RETCODE extractCliques( i = nposbinvars + nnegbinvars - 1; j = i - 1; -#if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */ +#ifdef SCIP_DISABLED_CODE + /* assertion should only hold when constraints were fully propagated and boundstightened */ /* check if the variable should not have already been fixed to one */ assert(!SCIPisFeasGT(scip, binvarvals[i], threshold)); #endif @@ -8784,7 +8786,8 @@ SCIP_RETCODE extractCliques( j = 1; -#if 0 /* assertion should only holds when constraints were fully propagated and boundstightened */ +#ifdef SCIP_DISABLED_CODE + /* assertion should only hold when constraints were fully propagated and boundstightened */ /* check if the variable should not have already been fixed to one */ assert(!SCIPisFeasLT(scip, -binvarvals[0], threshold)); #endif diff --git a/src/scip/cons_linking.c b/src/scip/cons_linking.c index 0ee080052e..d870c01848 100644 --- a/src/scip/cons_linking.c +++ b/src/scip/cons_linking.c @@ -1551,7 +1551,9 @@ SCIP_Bool checkCons( return SCIPisFeasEQ(scip, linksum, linkvarval) && SCIPisFeasEQ(scip, setpartsum, 1.0); } -#if 0 +#ifdef SCIP_DISABLED_CODE +/* The following should work, but does not seem to be tested well. */ + /** transfer aggregated integer variables to the corresponding binary variables */ static SCIP_RETCODE aggregateVariables( @@ -2919,9 +2921,10 @@ SCIP_DECL_CONSPRESOL(consPresolLinking) } } -#if 0 +#ifdef SCIP_DISABLED_CODE + /* The following should work, but does not seem to be tested well. */ + /* transfer aggregated linking variables to the corresponding binary variables */ - assert(conshdlrdata->varmap != NULL); SCIP_CALL( aggregateVariables(scip, conshdlrdata->varmap, conss, nconss, naggrvars, &cutoff) ); #endif @@ -3178,7 +3181,8 @@ SCIP_DECL_CONSDEACTIVE(consDeactiveLinking) static SCIP_DECL_CONSENABLE(consEnableLinking) { /*lint --e{715}*/ -#if 0 +#ifdef SCIP_DISABLED_CODE + /** @todo The following might help, but it would need to be tested whether it speeds up the solution process. */ SCIP_CONSHDLRDATA* conshdlrdata; SCIP_CONSDATA* consdata; diff --git a/src/scip/cons_xor.c b/src/scip/cons_xor.c index a2eb3f9a31..a9979f1512 100644 --- a/src/scip/cons_xor.c +++ b/src/scip/cons_xor.c @@ -3464,7 +3464,8 @@ SCIP_RETCODE cliquePresolve( if( !consdata->deleteintvar ) return SCIP_OKAY; -#if 0 /* try to evaluate if clique presolving should only be done multiple times when the constraint changed */ +#ifdef SCIP_DISABLED_CODE + /* try to evaluate if clique presolving should only be done multiple times when the constraint changed */ if( !consdata->changed ) return SCIP_OKAY; #endif @@ -4468,10 +4469,8 @@ SCIP_RETCODE preprocessConstraintPairs( consdataSort(consdata0); assert(consdata0->sorted); -#if 0 - /* if aggregation in the core of SCIP is not changed we do not need to call applyFixing, this would be the correct - * way - */ +#ifdef SCIP_DISABLED_CODE + /* TODO: consider running applyFixings() on the persistent constraint to detect a cutoff */ /* remove all variables that are fixed to zero and all pairs of variables fixed to one; * merge multiple entries of the same or negated variables */ diff --git a/src/scip/expr_product.c b/src/scip/expr_product.c index 79fc3bec03..71486c509e 100644 --- a/src/scip/expr_product.c +++ b/src/scip/expr_product.c @@ -548,7 +548,8 @@ SCIP_RETCODE mergeProductExprlist( if( !issignpower1 && !issignpower2 ) { /* and both are normal power, then add to unsimplifiedchildren the resulting expr of simplify(base^(expo1 + expo2)) */ -#if 0 /* TODO we should not loose the implicit base >= 0 constraint, if there is one, but then we should look at bounds on base; simplify currently doesn't */ +#ifdef SCIP_DISABLED_CODE + /* TODO we should not loose the implicit base >= 0 constraint, if there is one, but then we should look at bounds on base; simplify currently doesn't */ /* * unless expo1 or expo2 are fractional but expo1+expo2 is not fractional, then we better keep the original * the reason for that is that x^fractional implies a constraint x >= 0 diff --git a/src/scip/heur_bound.c b/src/scip/heur_bound.c index 4364504528..e7686f5a5f 100644 --- a/src/scip/heur_bound.c +++ b/src/scip/heur_bound.c @@ -168,24 +168,10 @@ SCIP_RETCODE applyBoundHeur( SCIP_CALL( SCIPpropagateProbing(scip, maxproprounds, &infeasible, NULL) ); } - /* try to repair probing */ + /* todo: try to backtrack */ + /* stop if infeasible */ if( infeasible ) - { -#if 0 - SCIP_CALL( SCIPbacktrackProbing(scip, SCIPgetProbingDepth(scip) - 1) ); - - /* fix the last variable, which was fixed the reverse bound */ - SCIP_CALL( SCIPfixVarProbing(scip, var, SCIPvarGetUbLocal(var)) ); - - /* propagate fixings */ - SCIP_CALL( SCIPpropagateProbing(scip, maxproprounds, &infeasible, NULL) ); - - SCIPdebugMsg(scip, "backtracking ended with %sfeasible problem\n", (infeasible ? "in" : "")); - - if( infeasible ) -#endif - break; - } + break; } SCIPdebugMsg(scip, "probing ended with %sfeasible problem\n", infeasible ? "in" : ""); diff --git a/src/scip/misc.c b/src/scip/misc.c index 8af5b016b1..fb7ac7e2a6 100644 --- a/src/scip/misc.c +++ b/src/scip/misc.c @@ -8712,7 +8712,7 @@ void btnodeFreeLeaf( assert((*node)->left == NULL); assert((*node)->right == NULL); -#if 0 +#ifdef SCIP_DISABLED_CODE /* remove reference from parent node */ if( (*node)->parent != NULL ) { diff --git a/src/scip/nlhdlr_perspective.c b/src/scip/nlhdlr_perspective.c index b6c993e7a4..ca087128ef 100644 --- a/src/scip/nlhdlr_perspective.c +++ b/src/scip/nlhdlr_perspective.c @@ -1241,7 +1241,6 @@ SCIP_DECL_NLHDLRFREEEXPRDATA(nlhdlrFreeExprDataPerspective) return SCIP_OKAY; } - /** callback to be called in deinitialization */ static SCIP_DECL_NLHDLREXIT(nlhdlrExitPerspective) @@ -1487,7 +1486,6 @@ SCIP_DECL_NLHDLRINITSEPA(nlhdlrInitSepaPerspective) return SCIP_OKAY; } - /** nonlinear handler enforcement callback * * "Perspectivies" cuts produced by other nonlinear handlers. diff --git a/src/scip/presol_gateextraction.c b/src/scip/presol_gateextraction.c index 25b5f42668..6a064522c1 100644 --- a/src/scip/presol_gateextraction.c +++ b/src/scip/presol_gateextraction.c @@ -1291,7 +1291,8 @@ SCIP_DECL_PRESOLEXEC(presolExecGateextraction) *result = SCIP_DIDNOTRUN; -#if 0 /* need to include cons_knapsack on top of this file */ +#ifdef SCIP_DISABLED_CODE + /* need to include cons_knapsack on top of this file */ /* check for possible knapsacks that form with a logicor a weak relaxation of an and-constraint * * the weak relaxation of an and-constraint looks like: diff --git a/src/scip/presolve.c b/src/scip/presolve.c index 5b72e6d009..79e961fa3b 100644 --- a/src/scip/presolve.c +++ b/src/scip/presolve.c @@ -1099,7 +1099,7 @@ SCIP_RETCODE SCIPshrinkDisjunctiveVarSet( */ implbinvarsexist = (SCIPprobGetNImplBinVars(scip->transprob) > 0); -#if 0 +#ifdef SCIP_DISABLED_CODE /* @todo do the cleanup here rather than before calling SCIPshrinkDisjunctiveVarSet()? */ if( usebin ) { diff --git a/src/scip/primal.c b/src/scip/primal.c index 55adf587e9..2bcfae18f2 100644 --- a/src/scip/primal.c +++ b/src/scip/primal.c @@ -699,7 +699,8 @@ SCIP_RETCODE primalAddSol( SCIPdebug( SCIP_CALL( SCIPsolPrint(sol, set, messagehdlr, stat, transprob, NULL, NULL, FALSE, FALSE) ) ); -#if 0 /* this is not a valid debug check, but can be used to track down numerical troubles */ +#ifdef SCIP_DISABLED_CODE + /* this is not a valid debug check, but can be used to track down numerical troubles */ #ifndef NDEBUG /* check solution again completely * it fail for different reasons: diff --git a/src/scip/prop_pseudoobj.c b/src/scip/prop_pseudoobj.c index 103ff296a1..cb8b4796d1 100644 --- a/src/scip/prop_pseudoobj.c +++ b/src/scip/prop_pseudoobj.c @@ -282,13 +282,13 @@ SCIP_DECL_SORTPTRCOMP(varCompObj) assert(SCIPvarGetObj(var1) != 0.0); assert(SCIPvarGetObj(var2) != 0.0); - /* first criteria is the absolute value of objective coefficient */ + /* first criterion is the absolute value of objective coefficient */ if( REALABS(SCIPvarGetObj(var1)) < REALABS(SCIPvarGetObj(var2)) ) return -1; else if( REALABS(SCIPvarGetObj(var1)) > REALABS(SCIPvarGetObj(var2)) ) return +1; - /* second criteria the locks which indicate most effect */ + /* second criterion the locks which indicate most effect */ if( SCIPvarGetObj(var1) > 0.0 ) locks1 = SCIPvarGetNLocksDownType(var1, SCIP_LOCKTYPE_MODEL); else @@ -304,7 +304,7 @@ SCIP_DECL_SORTPTRCOMP(varCompObj) if( locks1 > locks2 ) return 1; - /* third criteria the other locks */ + /* third criterion the other locks */ if( SCIPvarGetObj(var1) > 0.0 ) locks1 = SCIPvarGetNLocksUpType(var1, SCIP_LOCKTYPE_MODEL); else @@ -320,7 +320,7 @@ SCIP_DECL_SORTPTRCOMP(varCompObj) if( locks1 > locks2 ) return 1; - /* forth criteria use the problem index */ + /* forth criterion use the problem index */ return SCIPvarCompare(var1, var2); } @@ -2582,9 +2582,10 @@ SCIP_RETCODE propagateCutoffboundGlobally( return SCIP_OKAY; } -#if 0 /* might fail, but is not a real error, still need to investigate */ +#ifdef SCIP_DISABLED_CODE + /* might fail, but is not a real error, still need to investigate */ #ifndef NDEBUG - /* check that the abort criteria for the binary variables works */ + /* check that the abort criterion for the binary variables works */ for( ; v < nminactvars; ++v ) { assert(cutoffbound - pseudoobjval >= propdata->minactimpls[v]->maxobjchg); @@ -2732,9 +2733,10 @@ SCIP_RETCODE propagateCutoffboundBinvars( return SCIP_OKAY; } -#if 0 /* might fail, but is not a real error, still need to investigate */ +#ifdef SCIP_DISABLED_CODE + /* might fail, but is not a real error, still need to investigate */ #ifndef NDEBUG - /* check that the abort criteria for the binary variables works */ + /* check that the abort criterion for the binary variables works */ for( ; v < nminactvars; ++v ) { var = minactvars[v]; @@ -3336,7 +3338,7 @@ SCIP_RETCODE propagateLowerbound( nchgbds++; } - /* update globally fixed index if abort criteria was applied */ + /* update globally fixed index if abort criterion was applied */ propdata->maxactfirstnonfixed = v; /* check all binary variables which could potentially be fixed */ @@ -3363,9 +3365,10 @@ SCIP_RETCODE propagateLowerbound( } } -#if 0 /* might fail, but is not a real error, still need to investigate */ +#ifdef SCIP_DISABLED_CODE + /* might fail, but is not a real error, still need to investigate */ #ifndef NDEBUG - /* check that the abort criteria for the binary variables works */ + /* check that the abort criterion for the binary variables works */ for( ; v < nmaxactvars && !cutoff; ++v ) { var = maxactvars[v]; diff --git a/src/scip/prop_rootredcost.c b/src/scip/prop_rootredcost.c index 1740e10be9..ac6fe8210b 100644 --- a/src/scip/prop_rootredcost.c +++ b/src/scip/prop_rootredcost.c @@ -153,7 +153,7 @@ SCIP_DECL_SORTPTRCOMP(varCompRedcost) else if( key1 > key2 ) return +1; - /* second criteria use the problem index + /* second criterion: use the problem index * * @note The problem index is unique. That means the resulting sorting is unique. */ @@ -391,7 +391,7 @@ SCIP_RETCODE propagateBinaryBestRootRedcost( assert(!(*cutoff)); /* the binary variables are stored in the beginning of the variable array; these variables are sorted w.r.t. cutoff - * bound which would lead to a fixing; that give us an abort criteria (see below) + * bound which would lead to a fixing; that give us an abort criterion (see below) */ redcostvars = propdata->redcostvars; assert(redcostvars != NULL); @@ -485,12 +485,13 @@ SCIP_RETCODE propagateBinaryBestRootRedcost( /* store the index of the variable which is not globally fixed */ propdata->glbfirstnonfixed = v; -#if 0 /* due to numerics it might be that the abort criteria did not work correctly, because the sorting mechanism may - * have evaluated variables with a really small difference in their reduced cost values but with really huge - * lpobjval as the same - */ +#ifdef SCIP_DISABLED_CODE + /* Due to numerics it might be that the abort criterion did not work correctly, because the sorting mechanism may + * have evaluated variables with a really small difference in their reduced cost values but with really huge + * lpobjval as the same. Thus, we disable the check below for now. + */ #ifndef NDEBUG - /* check that the abort criteria works; that means none of the remaining binary variables can be fixed */ + /* check that the abort criterion works; that means none of the remaining binary variables can be fixed */ for( ; v < propdata->nredcostbinvars && !(*cutoff); ++v ) { SCIP_VAR* var; diff --git a/src/scip/scip_solve.c b/src/scip/scip_solve.c index bb746451c0..c91379d205 100644 --- a/src/scip/scip_solve.c +++ b/src/scip/scip_solve.c @@ -674,7 +674,7 @@ SCIP_RETCODE presolveRound( SCIP_EVENT event; SCIP_Bool aborted; SCIP_Bool lastranpresol; -#if 0 +#ifdef SCIP_DISABLED_CODE int oldpresolstart = 0; int oldpropstart = 0; int oldconsstart = 0; @@ -724,7 +724,7 @@ SCIP_RETCODE presolveRound( i = *presolstart; j = *propstart; k = *consstart; -#if 0 +#ifdef SCIP_DISABLED_CODE oldpresolstart = i; oldpropstart = j; oldconsstart = k; @@ -1079,7 +1079,7 @@ SCIP_RETCODE presolveRound( SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, presolstart, presolend, propstart, propend, consstart, consend) ); } -#if 0 +#ifdef SCIP_DISABLED_CODE /* run remaining exhaustive presolvers (if we did not start from the beginning anyway) */ else if( (oldpresolstart > 0 || oldpropstart > 0 || oldconsstart > 0) && presolend == scip->set->npresols && propend == scip->set->nprops && consend == scip->set->nconshdlrs ) diff --git a/src/scip/tree.c b/src/scip/tree.c index 61841f1962..16b80ab137 100644 --- a/src/scip/tree.c +++ b/src/scip/tree.c @@ -2149,10 +2149,6 @@ SCIP_RETCODE SCIPnodeAddHoleinfer( SCIP_Bool* added /**< pointer to store whether the hole was added, or NULL */ ) { -#if 0 - SCIP_VAR* infervar; -#endif - assert(node != NULL); assert((SCIP_NODETYPE)node->nodetype == SCIP_NODETYPE_FOCUSNODE || (SCIP_NODETYPE)node->nodetype == SCIP_NODETYPE_PROBINGNODE @@ -2195,10 +2191,6 @@ SCIP_RETCODE SCIPnodeAddHoleinfer( left, right, node->depth, SCIPvarGetName(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var), infercons != NULL ? "cons" : "prop", infercons != NULL ? SCIPconsGetName(infercons) : (inferprop != NULL ? SCIPpropGetName(inferprop) : "-"), inferinfo); -#if 0 - /* remember variable as inference variable, and get corresponding active variable, bound and bound type */ - infervar = var; -#endif SCIP_CALL( SCIPvarGetProbvarHole(&var, &left, &right) ); if( SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR ) diff --git a/src/scip/var.c b/src/scip/var.c index 5154f93aca..f2ee119834 100644 --- a/src/scip/var.c +++ b/src/scip/var.c @@ -2710,7 +2710,7 @@ SCIP_RETCODE varFreeParents( parentvar->data.aggregate.var = NULL; break; -#if 0 +#ifdef SCIP_DISABLED_CODE /* The following code is unclear: should the current variable be removed from its parents? */ case SCIP_VARSTATUS_MULTAGGR: assert(parentvar->data.multaggr.vars != NULL); @@ -13558,7 +13558,7 @@ SCIP_Real SCIPvarGetImplRedcost( int probindex = SCIPvarGetProbindex(clqvar) + 1; assert(0 < probindex && probindex < nentries); -#if 0 +#ifdef SCIP_DISABLED_CODE /* check that the variable was not yet visited or does not appear with two contradicting implications, -> * can appear since there is no guarantee that all these infeasible bounds were found */