All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
prob.c
Go to the documentation of this file.
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
180 * If the problem type requires the use of variable pricers, these pricers should be activated with calls
181 * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
192 SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
212 SCIP_CALL( SCIPprobCreate(prob, blkmem, set, name, NULL, NULL, NULL, NULL, NULL, NULL, NULL, FALSE) );
217 SCIP_CALL( sourceprob->probcopy(set->scip, sourcescip, sourceprob->probdata, varmap, consmap, &targetdata, global, &result) );
246 * If the problem type requires the use of variable pricers, these pricers should be activated with calls
247 * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
255 SCIP_DECL_PROBTRANS ((*probtrans)), /**< creates user data of transformed problem by transforming original user data */
257 SCIP_DECL_PROBINITSOL ((*probinitsol)), /**< solving process initialization method of transformed data */
258 SCIP_DECL_PROBEXITSOL ((*probexitsol)), /**< solving process deinitialization method of transformed data */
259 SCIP_DECL_PROBCOPY ((*probcopy)), /**< copies user data if you want to copy it to a subscip, or NULL */
335 /** sets callback to create user data of transformed problem by transforming original user data */
338 SCIP_DECL_PROBTRANS ((*probtrans)) /**< creates user data of transformed problem by transforming original user data */
360 SCIP_DECL_PROBINITSOL ((*probinitsol)) /**< solving process initialization callback of transformed data */
371 SCIP_DECL_PROBEXITSOL ((*probexitsol)) /**< solving process deinitialization callback of transformed data */
382 SCIP_DECL_PROBCOPY ((*probcopy)) /**< copies user data if you want to copy it to a subscip, or NULL */
511 /* create target problem data (probdelorig and probtrans are not needed, probdata is set later) */
513 SCIP_CALL( SCIPprobCreate(target, blkmem, set, transname, source->probdelorig, source->probtrans, source->probdeltrans,
529 SCIP_CALL( SCIPvarTransform(source->vars[v], blkmem, set, stat, source->objsense, &targetvar) );
530 SCIP_CALL( SCIPprobAddVar(*target, blkmem, set, lp, branchcand, eventfilter, eventqueue, targetvar) );
561 /* objective value is always integral, iff original objective value is always integral and shift is integral */
562 (*target)->objisintegral = source->objisintegral && SCIPsetIsIntegral(set, (*target)->objoffset);
564 /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
567 SCIP_CALL( SCIPprobCheckObjIntegral(*target, source, blkmem, set, stat, primal, tree, lp, eventqueue) );
572 /** resets the global and local bounds of original variables in original problem to their original values */
594 /** (Re)Sort the variables, which appear in the four categories (binary, integer, implicit, continuous) after presolve
595 * with respect to their original index (within their categories). Adjust the problem index afterwards which is
596 * supposed to reflect the position in the variable array. This additional (re)sorting is supposed to get more robust
597 * against the order presolving fixed variables. (We also reobtain a possible block structure induced by the user
647 SCIPdebugMessage("Variable: Problem index <%d>, original index <%d> \n", vars[v]->probindex, vars[v]->index);
688 /* original variables cannot go into transformed problem and transformed variables cannot go into original problem */
742 || (SCIPvarGetType(var) == SCIP_VARTYPE_INTEGER && insertpos == prob->nbinvars + prob->nintvars - 1)
743 || (SCIPvarGetType(var) == SCIP_VARTYPE_IMPLINT && insertpos == prob->nbinvars + prob->nintvars + prob->nimplvars - 1)
804 /* move last binary, last integer, last implicit, and last continuous variable forward to fill the free slot */
844 /* inform the variable that it is no longer in the problem; if necessary, delete it from the implication graph */
900 /* original variables cannot go into transformed problem and transformed variables cannot go into original problem */
931 SCIPdebugMessage("added variable <%s> to problem (%d variables: %d binary, %d integer, %d implicit, %d continuous)\n",
932 SCIPvarGetName(var), prob->nvars, prob->nbinvars, prob->nintvars, prob->nimplvars, prob->ncontvars);
949 /** marks variable to be removed from the problem; however, the variable is NOT removed from the constraints */
956 SCIP_Bool* deleted /**< pointer to store whether marking variable to be deleted was successful */
975 /* don't remove the direct counterpart of an original variable from the transformed problem, because otherwise
983 SCIPdebugMessage("deleting variable <%s> from problem (%d variables: %d binary, %d integer, %d implicit, %d continuous)\n",
984 SCIPvarGetName(var), prob->nvars, prob->nbinvars, prob->nintvars, prob->nimplvars, prob->ncontvars);
1000 /* remember that the variable should be deleted from the problem in SCIPprobPerformVarDeletions() */
1027 * do this only in solving stage, in presolving, it is already handled by the constraint handlers
1159 /* variable switched from unfixed to fixed (if it was fixed before, probindex would have been -1) */
1280 /** releases and removes constraint from the problem; if the user has not captured the constraint for his own use, the
1377 SCIPdebugMessage("adding %g to objective offset %g: new offset = %g\n", addval, prob->objoffset, prob->objoffset + addval);
1392 /** sets limit on objective function, such that only solutions better than this limit are accepted */
1403 /** informs the problem, that its objective value is always integral in every feasible solution */
1413 /** sets integral objective value flag, if all variables with non-zero objective values are integral and have
1414 * integral objective value and also updates the cutoff bound if primal solution is already known
1438 /* if there exist unknown variables, we cannot conclude that the objective value is always integral */
1455 /* if variable's objective value is fractional, the problem's objective value may also be fractional */
1459 /* if variable with non-zero objective value is continuous, the problem's objective value may be fractional */
1470 /* update upper bound and cutoff bound in primal data structure due to new internality information */
1471 SCIP_CALL( SCIPprimalUpdateObjoffset(primal, blkmem, set, stat, eventqueue, transprob, origprob, tree, lp) );
1572 SCIP_CALL( SCIPcalcIntegralScalar(objvals, nints, -SCIPsetEpsilon(set), +SCIPsetEpsilon(set), OBJSCALE_MAXDNOM, OBJSCALE_MAXSCALE,
1597 SCIPdebugMessage("integral objective scalar: gcd=%"SCIP_LONGINT_FORMAT", intscalar=%g\n", gcd, intscalar);
1622 SCIPdebugMessage(" -> var <%s>: newobj = %.6f\n", SCIPvarGetName(transprob->vars[v]), objvals[v]);
1623 SCIP_CALL( SCIPvarChgObj(transprob->vars[v], blkmem, set, transprob, primal, lp, eventqueue, objvals[v]) );
1631 SCIP_CALL( SCIPprimalUpdateObjoffset(primal, blkmem, set, stat, eventqueue, transprob, origprob, tree, lp) );
1667 /** remembers the best solution w.r.t. root reduced cost propagation as root solution in the problem variables */
1757 /* update the current solution as best root solution in the problem variables if it is better */
1762 /** informs problem, that the presolving process was finished, and updates all internal data structures */
1771 /** initializes problem for branch and bound process and resets all constraint's ages and histories of current run */
1806 /** deinitializes problem after branch and bound process, and converts all COLUMN variables back into LOOSE variables */
1840 /* invalided root reduced cost, root reduced solution, and root LP objective value for each variable */
1870 /** returns the number of implicit binary variables, meaning variable of vartype != SCIP_VARTYPE_BINARY and !=
1873 * @note this number needs to be computed, because it cannot be updated like the other counters for binary and integer
1874 * variables, each time the variable type changes(, we would need to update this counter each time a global bound
1875 * changes), even at the end of presolving this cannot be computed, because some variable can change to an
1955 return (SCIP_Real)transprob->objsense * transprob->objscale * (objval + transprob->objoffset) + origprob->objoffset;
1977 return (SCIP_Real)transprob->objsense * (objval - origprob->objoffset)/transprob->objscale - transprob->objoffset;
1991 SCIPerrorMessage("Cannot find variable if variable-names hashtable was disabled (due to parameter <misc/usevartable>)\n");
2010 SCIPerrorMessage("Cannot find constraint if constraint-names hashtable was disabled (due to parameter <misc/useconstable>)\n");
2050 SCIPmessageFPrintInfo(messagehdlr, file, " Variables : %d (%d binary, %d integer, %d implicit integer, %d continuous)\n",
2052 SCIPmessageFPrintInfo(messagehdlr, file, " Constraints : %d initial, %d maximal\n", prob->startnconss, prob->maxnconss);
2054 SCIPmessageFPrintInfo(messagehdlr, file, " Objective sense : %s\n", prob->objsense == SCIP_OBJSENSE_MINIMIZE ? "minimize" : "maximize");
2099 /** returns TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
2100 * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing
2122 return prob->objlim >= SCIP_INVALID ? (SCIP_Real)(prob->objsense) * SCIPsetInfinity(set) : prob->objlim;
|