public methods for SCIP variables
Definition in file scip_var.c.
#include <ctype.h>#include "blockmemshell/memory.h"#include "lpi/lpi.h"#include "scip/branch.h"#include "scip/clock.h"#include "scip/conflict.h"#include "scip/debug.h"#include "scip/rational.h"#include "scip/history.h"#include "scip/implics.h"#include "scip/lp.h"#include "scip/prob.h"#include "scip/pub_cons.h"#include "scip/pub_implics.h"#include "scip/pub_lp.h"#include "scip/pub_message.h"#include "scip/pub_misc.h"#include "scip/pub_tree.h"#include "scip/pub_var.h"#include "scip/relax.h"#include "scip/scip_certificate.h"#include "scip/scip_exact.h"#include "scip/scip_general.h"#include "scip/scip_lp.h"#include "scip/scip_mem.h"#include "scip/scip_message.h"#include "scip/scip_numerics.h"#include "scip/scip_prob.h"#include "scip/scip_probing.h"#include "scip/scip_sol.h"#include "scip/scip_solvingstats.h"#include "scip/scip_tree.h"#include "scip/scip_var.h"#include "scip/set.h"#include "scip/sol.h"#include "scip/solve.h"#include "scip/stat.h"#include "scip/struct_lp.h"#include "scip/struct_mem.h"#include "scip/struct_primal.h"#include "scip/struct_prob.h"#include "scip/struct_scip.h"#include "scip/struct_set.h"#include "scip/struct_stat.h"#include "scip/struct_tree.h"#include "scip/struct_var.h"#include "scip/tree.h"#include "scip/certificate.h"#include "scip/var.h"Go to the source code of this file.
Macros | |
| #define | MAXNUMEARCHCLIQUE 10000 |
| #define MAXNUMEARCHCLIQUE 10000 |
maximal number of cliques of variable for addLargestCliquePart() to search a suitable clique
Definition at line 8909 of file scip_var.c.
Referenced by addLargestCliquePart().
|
static |
analyze the strong branching for the given variable; that includes conflict analysis for infeasible branches and storing of root reduced cost information
| scip | SCIP data structure |
| var | variable to analyze |
| downinf | pointer to store whether the downwards branch is infeasible, or NULL |
| upinf | pointer to store whether the upwards branch is infeasible, or NULL |
| downconflict | pointer to store whether a conflict constraint was created for an infeasible downwards branch, or NULL |
| upconflict | pointer to store whether a conflict constraint was created for an infeasible upwards branch, or NULL |
Definition at line 3583 of file scip_var.c.
References analyzeStrongbranch(), assert(), SCIP_Col::lb, NULL, SCIP_Col::primsol, SCIP_Col::sbdown, SCIP_Col::sbdownvalid, SCIP_Col::sbup, SCIP_Col::sbupvalid, SCIP_Bool, SCIP_CALL, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIPconflictAnalyzeStrongbranch(), SCIPgetLPSolstat(), SCIPisExact(), SCIPlpGetObjval(), SCIPlpIsDualReliable(), SCIPsetFeasCeil(), SCIPsetFeasFloor(), SCIPsetIsGE(), SCIPtreeGetCurrentDepth(), SCIPvarGetCol(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), SCIPvarIsBinary(), SCIPvarUpdateBestRootSol(), SCIP_Col::ub, and var.
Referenced by analyzeStrongbranch(), SCIPgetVarsStrongbranchesFrac(), SCIPgetVarsStrongbranchesInt(), SCIPgetVarStrongbranchFrac(), and SCIPgetVarStrongbranchInt().
|
static |
create, solve, and evaluate a single strong branching child (for strong branching with propagation)
| scip | SCIP data structure |
| var | variable to get strong branching values for |
| down | do we regard the down child? |
| firstchild | is this the first of the two strong branching children? |
| propagate | should domain propagation be performed? |
| newbound | new bound to apply at the strong branching child |
| itlim | iteration limit for strong branchings |
| maxproprounds | maximum number of propagation rounds (-1: no limit, -2: parameter settings) |
| value | stores dual bound for strong branching child |
| valid | stores whether the returned value is a valid dual bound, or NULL; otherwise, it can only be used as an estimate value |
| ndomreductions | pointer to store the number of domain reductions found, or NULL |
| conflict | pointer to store whether a conflict constraint was created for an infeasible strong branching child, or NULL |
| lperror | pointer to store whether an unresolved LP error occurred or the solving process should be stopped (e.g., due to a time limit) |
| vars | active problem variables |
| nvars | number of active problem variables |
| newlbs | array to store valid lower bounds for all active variables, or NULL |
| newubs | array to store valid upper bounds for all active variables, or NULL |
| foundsol | pointer to store whether a primal solution was found during strong branching |
| cutoff | pointer to store whether the strong branching child is infeasible |
Definition at line 3812 of file scip_var.c.
References assert(), cutoff, FALSE, lperror, MAX, MIN, NULL, nvars, objval, performStrongbranchWithPropagation(), propagate, SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_Longint, SCIP_LPSOLSTAT_ERROR, SCIP_LPSOLSTAT_INFEASIBLE, SCIP_LPSOLSTAT_ITERLIMIT, SCIP_LPSOLSTAT_NOTSOLVED, SCIP_LPSOLSTAT_OBJLIMIT, SCIP_LPSOLSTAT_OPTIMAL, SCIP_LPSOLSTAT_TIMELIMIT, SCIP_LPSOLSTAT_UNBOUNDEDRAY, SCIP_MAXTREEDEPTH, SCIP_OKAY, SCIP_Real, SCIPallColsInLP(), SCIPbacktrackProbing(), SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), SCIPclockStart(), SCIPclockStop(), SCIPdebugMsg, SCIPerrorMessage, SCIPgetCutoffbound(), SCIPgetLPI(), SCIPgetLPObjval(), SCIPgetLPSolstat(), SCIPinfinity(), SCIPisGE(), SCIPisGT(), SCIPisInfinity(), SCIPisLE(), SCIPisLPRelax(), SCIPisLT(), SCIPlpGetLooseObjval(), SCIPlpiGetObjval(), SCIPlpiIsDualFeasible(), SCIPlpiIsInfinity(), SCIPlpiWasSolved(), SCIPnewProbingNode(), SCIPpropagateProbing(), SCIPsolveProbingLP(), SCIPstatAdd, SCIPtreeGetProbingDepth(), SCIPtryStrongbranchLPSol(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), TRUE, valid, var, and vars.
Referenced by performStrongbranchWithPropagation(), and SCIPgetVarStrongbranchWithPropagation().
|
static |
exact submethod of SCIPtightenVarLbGlobal(); it does not check for the stage
| scip | SCIP data structure |
| var | variable to change the bound for |
| newbound | new value for bound |
| force | force tightening even if below bound strengthening tolerance |
| infeasible | pointer to store whether the new domain is empty |
| tightened | pointer to store whether the bound was tightened, or NULL |
Definition at line 7901 of file scip_var.c.
References assert(), FALSE, MIN, NULL, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_Real, SCIP_STAGE_PRESOLVING, SCIP_STAGE_PROBLEM, SCIP_STAGE_SOLVING, SCIP_STAGE_TRANSFORMING, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_INTEGER, SCIPbuffer(), SCIPchgVarType(), SCIPcomputeVarLbGlobal(), SCIPerrorMessage, SCIPgetStage(), SCIPinProbing(), SCIPisInfinity(), SCIPnodeAddBoundchgExact(), SCIPrationalCreateBuffer(), SCIPrationalFreeBuffer(), SCIPrationalSetReal(), SCIPsetIsEQ(), SCIPsetIsLbBetter(), SCIPsetIsLE(), SCIPtreeGetCurrentDepth(), SCIPtreeGetCurrentNode(), SCIPvarAdjustLbExactFloat(), SCIPvarChgLbGlobalExact(), SCIPvarChgLbLocalExact(), SCIPvarChgLbOriginalExact(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarIsBinary(), SCIPvarIsTransformed(), SCIPwarningMessage(), tightenVarLbGlobalSafe(), TRUE, var, and SCIP_Var::vartype.
Referenced by SCIPtightenVarLbGlobal(), and tightenVarLbGlobalSafe().
|
static |
| scip | SCIP data structure |
| var | variable to change the bound for |
| newbound | new value for bound |
| force | force tightening even if below bound strengthening tolerance |
| infeasible | pointer to store whether the new domain is empty |
| tightened | pointer to store whether the bound was tightened, or NULL |
Definition at line 8133 of file scip_var.c.
References assert(), FALSE, MAX, NULL, SCIP_Bool, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_Real, SCIP_STAGE_PRESOLVING, SCIP_STAGE_PROBLEM, SCIP_STAGE_SOLVING, SCIP_STAGE_TRANSFORMING, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_INTEGER, SCIPbuffer(), SCIPchgVarType(), SCIPcomputeVarUbGlobal(), SCIPerrorMessage, SCIPgetStage(), SCIPinProbing(), SCIPisInfinity(), SCIPnodeAddBoundchgExact(), SCIPrationalCreateBuffer(), SCIPrationalFreeBuffer(), SCIPrationalSetReal(), SCIPsetIsEQ(), SCIPsetIsLE(), SCIPsetIsUbBetter(), SCIPtreeGetCurrentDepth(), SCIPtreeGetCurrentNode(), SCIPvarAdjustUbExactFloat(), SCIPvarChgUbGlobalExact(), SCIPvarChgUbLocalExact(), SCIPvarChgUbOriginalExact(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIPvarIsBinary(), SCIPvarIsTransformed(), SCIPwarningMessage(), tightenVarUbGlobalSafe(), TRUE, var, and SCIP_Var::vartype.
Referenced by SCIPtightenVarUbGlobal(), and tightenVarUbGlobalSafe().
|
static |
add largest clique containing a given variable to part of clique partitioning
| var | variable to treat |
| value | value of variable |
| varidx | index of variable |
| idx | mapping of problem variable indices to given subset |
| values | values of variables in given subset |
| p | part index |
| nvars | number of variables in the array |
| nbinvars | total number of binary variables |
| cliquepartition | array of length nvars to store the clique partition |
| ncliqueparts | array to store the size of each part |
Definition at line 8913 of file scip_var.c.
References addLargestCliquePart(), assert(), MAXNUMEARCHCLIQUE, NULL, nvars, SCIP_Bool, SCIPcliqueGetNVars(), SCIPcliqueGetValues(), SCIPcliqueGetVars(), SCIPvarGetCliques(), SCIPvarGetNCliques(), SCIPvarGetProbindex(), SCIPvarIsActive(), var, and varidx.
Referenced by addLargestCliquePart(), and calcCliquePartitionGreedy().
|
static |
calculates a partition of the given set of binary variables into cliques
The output array contains one value for each variable, such that two variables have the same value iff they were assigned to the same clique; the first variable is always assigned to clique 0, and a variable can only be assigned to clique i if at least one of the preceding variables was assigned to clique i-1; for each clique at most 1 variables can be set to TRUE in a feasible solution;
The implementation currently runs in O(n^2) time, because we have to clear the counter array nneigh. It could be turned into a linear time algorithm by using a clean buffer.
| scip | SCIP data structure |
| vars | binary variables in the clique from which at most one can be set to 1 |
| values | clique value (TRUE or FALSE) for each variable in the clique |
| nvars | number of variables in the array |
| probtoidxmap | cleared memory array with default values -1 |
| probtoidxmapsize | returns size of probtoidxmap |
| cliquepartition | array of length nvars to store the clique partition |
| ncliques | pointer to store the number of cliques actually contained in the partition |
Definition at line 9079 of file scip_var.c.
References addLargestCliquePart(), assert(), BMSclearMemoryArray, calcCliquePartitionGreedy(), FALSE, i, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPcliqueGetNVars(), SCIPcliqueGetValues(), SCIPcliqueGetVars(), SCIPfreeBufferArray, SCIPgetNContVars(), SCIPgetNVars(), SCIPreallocBlockMemoryArray, SCIPvarGetCliques(), SCIPvarGetNCliques(), SCIPvarGetProbindex(), SCIPvarIsActive(), TRUE, var, and vars.
Referenced by calcCliquePartitionGreedy(), and SCIPcalcCliquePartition().
|
static |
test whether a clique partition is correct
| scip | SCIP data structure |
| vars | binary variables in the clique from which at most one can be set to 1 |
| nvars | number of variables in the clique |
| cliquepartition | array of length nvars to store the clique partition |
| ncliques | pointer to store the number of cliques actually contained in the partition |
Definition at line 9271 of file scip_var.c.
References assert(), FALSE, i, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPtestCliquePartition(), SCIPvarGetProbvarBinary(), SCIPvarsHaveCommonClique(), TRUE, and vars.
Referenced by SCIPcalcCliquePartition(), and SCIPtestCliquePartition().
|
static |
tightens the variable bounds due to a new variable type
| scip | SCIP data structure |
| var | variable to change the bound for |
| integral | did the variable become integral? |
| infeasible | pointer to store whether an infeasibility was detected (, due to integrality condition of the new variable type) |
Definition at line 10039 of file scip_var.c.
References assert(), FALSE, NULL, SCIP_Var::scip, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_PRESOLVING, SCIP_STAGE_PROBLEM, SCIPfeasCeil(), SCIPfeasFloor(), SCIPgetStage(), SCIPisFeasGE(), SCIPisFeasIntegral(), SCIPisFeasLE(), SCIPisIntegral(), SCIPsetIsEQ(), SCIPtightenVarLbGlobal(), SCIPtightenVarUbGlobal(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), SCIPvarIsIntegral(), SCIPvarIsTransformed(), tightenBounds(), TRUE, and var.
Referenced by SCIPchgVarImplType(), SCIPchgVarType(), and tightenBounds().