pub_var.h
Go to the documentation of this file.
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
123 /** compares the index of two variables, only active or negated variables are allowed, if a variable
124 * is negated then the index of the corresponding active variable is taken, returns -1 if first is
125 * smaller than, and +1 if first is greater than second variable index; returns 0 if both indices
134 /** comparison method for sorting active and negated variables by non-decreasing index, active and negated
140 /** compares the index of two variables, returns -1 if first is smaller than, and +1 if first is greater than second
185 /** gets corresponding active, fixed, or multi-aggregated problem variables of binary variables and
195 /** gets corresponding active, fixed, or multi-aggregated problem variable of a binary variable and
204 /** transforms given variable, boundtype and bound to the corresponding active, fixed, or multi-aggregated variable
214 /** transforms given variable and domain hole to the corresponding active, fixed, or multi-aggregated variable
224 /** retransforms given variable, scalar and constant to the corresponding original variable, scalar
225 * and constant, if possible; if the retransformation is impossible, NULL is returned as variable
234 /** returns whether the given variable is the direct counterpart of an original problem variable */
240 /** returns the number of times, a bound of the variable was changed in given direction due to branching */
247 /** returns the number of times, a bound of the variable was changed in given direction due to branching
279 /** returns the number of cutoffs branching on this variable in given direction produced in the current run */
286 /** returns the average depth of bound changes in given direction due to branching on the variable */
293 /** returns the average depth of bound changes in given direction due to branching on the variable
302 /** returns whether there is an implication x == varfixing -> y <= b or y >= b in the implication graph;
303 * implications that are represented as cliques in the clique table are not regarded (use SCIPvarsHaveCommonClique());
309 SCIP_Bool varfixing, /**< FALSE if y should be searched in implications for x == 0, TRUE for x == 1 */
314 /** returns whether there is an implication x == varfixing -> y == implvarfixing in the implication graph;
315 * implications that are represented as cliques in the clique table are not regarded (use SCIPvarsHaveCommonClique());
321 SCIP_Bool varfixing, /**< FALSE if y should be searched in implications for x == 0, TRUE for x == 1 */
326 /** gets the values of b in implications x == varfixing -> y <= b or y >= b in the implication graph;
332 SCIP_Bool varfixing, /**< FALSE if y should be searched in implications for x == 0, TRUE for x == 1 */
341 * if regardimplics is TRUE, both the cliques and the implications of the implication graph are regarded
352 /** gets corresponding objective value of active, fixed, or multi-aggregated problem variable of given variable
414 SCIP_DECL_VARTRANS ((*vartrans)) /**< creates transformed user data by transforming original user data */
497 * method can only be called before the variable is added to the problem by SCIPaddVar() or SCIPaddPricedVar()
518 * @note: this is not equivalent to marking the variable itself for deletion, this is done by using SCIPvarMarkDeletable()
579 /** gets number n of aggregation variables of a multi aggregated variable x = a0*y0 + ... + a(n-1)*y(n-1) + c */
585 /** gets vector of aggregation variables y of a multi aggregated variable x = a0*y0 + ... + a(n-1)*y(n-1) + c */
591 /** gets vector of aggregation scalars a of a multi aggregated variable x = a0*y0 + ... + a(n-1)*y(n-1) + c */
597 /** gets aggregation constant c of a multi aggregated variable x = a0*y0 + ... + a(n-1)*y(n-1) + c */
627 /** gets the unchanged objective function value of variable (ignoring temproray changes performed in probing mode) */
633 /** gets original lower bound of original problem variable (i.e. the bound set in problem creation) */
639 /** gets original upper bound of original problem variable (i.e. the bound set in problem creation) */
711 /** gets type (lower or upper) of best bound of variable with respect to the objective function */
717 /** gets type (lower or upper) of worst bound of variable with respect to the objective function */
735 /** gets the branch factor of the variable; this value can be used in the branching methods to scale the score
736 * values of the variables; higher factor leads to a higher probability that this variable is chosen for branching
743 /** gets the branch priority of the variable; variables with higher priority should always be preferred to variables
763 /** gets array with bounding variables z_i in variable lower bounds x >= b_i*z_i + d_i of given variable x;
764 * the variable bounds are sorted by increasing variable index of the bounding variable z_i (see SCIPvarGetIndex())
771 /** gets array with bounding coefficients b_i in variable lower bounds x >= b_i*z_i + d_i of given variable x */
777 /** gets array with bounding constants d_i in variable lower bounds x >= b_i*z_i + d_i of given variable x */
789 /** gets array with bounding variables z_i in variable upper bounds x <= b_i*z_i + d_i of given variable x;
790 * the variable bounds are sorted by increasing variable index of the bounding variable z_i (see SCIPvarGetIndex())
797 /** gets array with bounding coefficients b_i in variable upper bounds x <= b_i*z_i + d_i of given variable x */
803 /** gets array with bounding constants d_i in variable upper bounds x <= b_i*z_i + d_i of given variable x */
809 /** gets number of implications y <= b or y >= b for x == 0 or x == 1 of given active problem variable x,
818 /** gets array with implication variables y of implications y <= b or y >= b for x == 0 or x == 1 of given active
820 * the implications are sorted such that implications with binary implied variables precede the ones with non-binary
821 * implied variables, and as a second criteria, the implied variables are sorted by increasing variable index
830 /** gets array with implication types of implications y <= b or y >= b for x == 0 or x == 1 of given active problem
840 /** gets array with implication bounds b of implications y <= b or y >= b for x == 0 or x == 1 of given active problem
849 /** Gets array with unique ids of implications y <= b or y >= b for x == 0 or x == 1 of given active problem variable x,
851 * If an implication is a shortcut, i.e., it was added as part of the transitive closure of another implication,
951 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
964 || ((var)->varstatus == SCIP_VARSTATUS_NEGATED && (var)->negatedvar->varstatus == SCIP_VARSTATUS_ORIGINAL))
966 && ((var)->varstatus != SCIP_VARSTATUS_NEGATED || (var)->negatedvar->varstatus != SCIP_VARSTATUS_ORIGINAL))
970 ((var)->vartype != SCIP_VARTYPE_CONTINUOUS && (var)->glbdom.lb >= 0.0 && (var)->glbdom.ub <= 1.0))
983 #define SCIPvarIsInLP(var) ((var)->varstatus == SCIP_VARSTATUS_COLUMN && SCIPcolIsInLP((var)->data.col))
1008 #define SCIPvarGetBestBoundGlobal(var) ((var)->obj >= 0.0 ? (var)->glbdom.lb : (var)->glbdom.ub)
1009 #define SCIPvarGetWorstBoundGlobal(var) ((var)->obj >= 0.0 ? (var)->glbdom.ub : (var)->glbdom.lb)
1013 #define SCIPvarGetBestBoundLocal(var) ((var)->obj >= 0.0 ? (var)->locdom.lb : (var)->locdom.ub)
1014 #define SCIPvarGetWorstBoundLocal(var) ((var)->obj >= 0.0 ? (var)->locdom.ub : (var)->locdom.lb)
1015 #define SCIPvarGetBestBoundType(var) ((var)->obj >= 0.0 ? SCIP_BOUNDTYPE_LOWER : SCIP_BOUNDTYPE_UPPER)
1016 #define SCIPvarGetWorstBoundType(var) ((var)->obj >= 0.0 ? SCIP_BOUNDTYPE_UPPER : SCIP_BOUNDTYPE_LOWER)
1037 #define SCIPvarGetLPSol(var) ((var)->varstatus == SCIP_VARSTATUS_COLUMN ? SCIPcolGetPrimsol((var)->data.col) : SCIPvarGetLPSol_rec(var))
1038 #define SCIPvarGetNLPSol(var) (((var)->varstatus == SCIP_VARSTATUS_COLUMN || ((var)->varstatus == SCIP_VARSTATUS_LOOSE)) ? (var)->nlpsol : SCIPvarGetNLPSol_rec(var))
1075 /** returns the solution of the variable in the last root node's relaxation, if the root relaxation is not yet
1083 /** returns the best solution (w.r.t. root reduced cost propagation) of the variable in the root node's relaxation, if
1091 /** returns the best reduced costs (w.r.t. root reduced cost propagation) of the variable in the root node's relaxation,
1092 * if the root relaxation is not yet completely solved, or the variable was no column of the root LP, SCIP_INVALID is
1100 /** returns the best objective value (w.r.t. root reduced cost propagation) of the root LP which belongs the root
1101 * reduced cost which is accessible via SCIPvarGetRootRedcost() or the variable was no column of the root LP,
1109 /** set the given solution as the best root solution w.r.t. root reduced cost propagation in the variables */
1118 /** returns a weighted average solution value of the variable in all feasible primal solutions found so far */
1124 /** returns the bound change information for the last lower bound change on given active problem variable before or
1135 /** returns the bound change information for the last upper bound change on given active problem variable before or
1146 /** returns the bound change information for the last lower or upper bound change on given active problem variable
1158 /** returns lower bound of variable directly before or after the bound change given by the bound change index
1170 /** returns upper bound of variable directly before or after the bound change given by the bound change index
1182 /** returns lower or upper bound of variable directly before or after the bound change given by the bound change index
1206 /** returns the last bound change index, at which the bounds of the given variable were tightened */
1222 * returns FALSE, if the first variable is not fixed, and returns TRUE, if the first variable is fixed, but the
1237 /** returns whether first bound change index belongs to an earlier applied bound change than second one;
1238 * if a bound change index is NULL, the bound change index represents the current time, i.e. the time after the
1247 /** returns whether first bound change index belongs to an earlier applied bound change than second one */
1280 /** returns whether the bound change information belongs to a branching decision or a deduction */
1322 /** returns inference propagator of given bound change information, or NULL if no propagator was responsible */
1346 /** returns whether the bound change has an inference reason (constraint or propagator), that can be resolved */
1352 /** for two bound change informations belonging to the same variable and bound, returns whether the first bound change
1393 /** returns whether the bound change is redundant due to a more global bound that is at least as strong */
1450 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1455 ((idx1)->depth < (idx2)->depth || ((idx1)->depth == (idx2)->depth && (idx1)->pos < (idx2)->pos))
1470 #define SCIPbdchginfoGetInferBoundtype(bdchginfo) (SCIP_BOUNDTYPE)((bdchginfo)->inferboundtype)
1474 || ((bdchginfo)->boundchgtype == SCIP_BOUNDCHGTYPE_PROPINFER && (bdchginfo)->inferencedata.reason.prop != NULL))
1475 #define SCIPbdchginfoIsTighter(bdchginfo1,bdchginfo2) ((bdchginfo1)->boundtype == SCIP_BOUNDTYPE_LOWER \
1476 ? (bdchginfo1)->newbound > bdchginfo2->newbound : (bdchginfo1)->newbound < bdchginfo2->newbound)
1482 #define SCIPdomchgGetNBoundchgs(domchg) ((domchg) != NULL ? (domchg)->domchgbound.nboundchgs : 0)
Definition: struct_var.h:108
SCIP_BOUNDTYPE SCIPvarGetWorstBoundType(SCIP_VAR *var)
Definition: var.c:18044
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
Definition: var.c:11483
SCIP_Real SCIPvarGetBdAtIndex(SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:16791
SCIP_PROP * SCIPbdchginfoGetInferProp(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18605
int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
Definition: var.c:3298
SCIP_BDCHGINFO * SCIPvarGetBdchgInfoLb(SCIP_VAR *var, int pos)
Definition: var.c:18319
SCIP_Real * SCIPvarGetMultaggrScalars(SCIP_VAR *var)
Definition: var.c:17711
type definitions for miscellaneous datastructures
type definitions for implications, variable bounds, and cliques
SCIP_Real SCIPbdchginfoGetOldbound(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18501
SCIP_BRANCHDIR SCIPvarGetBranchDirection(SCIP_VAR *var)
Definition: var.c:18101
SCIP_Real SCIPvarGetWorstBoundGlobal(SCIP_VAR *var)
Definition: var.c:17962
methods for implications, variable bounds, and cliques
SCIP_Real SCIPvarGetAvgBranchdepth(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15795
SCIP_RETCODE SCIPvarGetProbvarBinary(SCIP_VAR **var, SCIP_Bool *negated)
Definition: var.c:12318
Definition: struct_var.h:160
int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
Definition: var.c:3356
SCIP_CLIQUE ** SCIPvarGetCliques(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:18282
SCIP_VALUEHISTORY * SCIPvarGetValuehistory(SCIP_VAR *var)
Definition: var.c:18361
void SCIPvarSetTransData(SCIP_VAR *var, SCIP_DECL_VARTRANS((*vartrans)))
Definition: var.c:17313
Definition: struct_var.h:207
Definition: struct_var.h:91
SCIP_Bool SCIPbdchgidxIsEarlier(SCIP_BDCHGIDX *bdchgidx1, SCIP_BDCHGIDX *bdchgidx2)
Definition: var.c:18481
SCIP_Bool SCIPvarWasFixedAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:16811
SCIP_BOUNDTYPE SCIPboundchgGetBoundtype(SCIP_BOUNDCHG *boundchg)
Definition: var.c:17187
SCIP_HOLELIST * SCIPholelistGetNext(SCIP_HOLELIST *holelist)
Definition: var.c:17247
SCIP_Bool SCIPvarHasImplic(SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype)
Definition: var.c:11116
SCIP_Real SCIPvarGetNegationConstant(SCIP_VAR *var)
Definition: var.c:17756
int SCIPbdchginfoGetInferInfo(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18616
SCIP_Real SCIPvarGetInferenceSum(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15987
type definitions for return codes for SCIP methods
SCIP_Longint SCIPvarGetNBranchingsCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15752
Definition: struct_history.h:63
SCIP_BDCHGIDX * SCIPvarGetLastBdchgIndex(SCIP_VAR *var)
Definition: var.c:16834
internal methods for branching and inference history
SCIP_Real SCIPvarGetCutoffSumCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:16230
SCIP_HOLELIST * SCIPvarGetHolelistOriginal(SCIP_VAR *var)
Definition: var.c:17905
Definition: struct_lp.h:135
type definitions for LP management
SCIP_Bool SCIPbdchginfoIsTighter(SCIP_BDCHGINFO *bdchginfo1, SCIP_BDCHGINFO *bdchginfo2)
Definition: var.c:18674
SCIP_Real SCIPvarGetBestRootLPObjval(SCIP_VAR *var)
Definition: var.c:13824
void SCIPvarSetDelorigData(SCIP_VAR *var, SCIP_DECL_VARDELORIG((*vardelorig)))
Definition: var.c:17301
void SCIPvarSetDeltransData(SCIP_VAR *var, SCIP_DECL_VARDELTRANS((*vardeltrans)))
Definition: var.c:17325
Definition: struct_cons.h:46
SCIP_Bool SCIPboundchgIsRedundant(SCIP_BOUNDCHG *boundchg)
Definition: var.c:17197
SCIP_Bool SCIPbdchgidxIsEarlierNonNull(SCIP_BDCHGIDX *bdchgidx1, SCIP_BDCHGIDX *bdchgidx2)
Definition: var.c:18461
int SCIPvarCompareActiveAndNegated(SCIP_VAR *var1, SCIP_VAR *var2)
Definition: var.c:11912
SCIP_Real SCIPvarGetAvgBranchdepthCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15840
SCIP_Bool SCIPvarIsTransformedOrigvar(SCIP_VAR *var)
Definition: var.c:12869
type definitions for SCIP's main datastructure
SCIP_Real SCIPvarGetUbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:16670
SCIP_Bool SCIPvarHasBinaryImplic(SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_Bool implvarfixing)
Definition: var.c:11136
SCIP_Real SCIPboundchgGetNewbound(SCIP_BOUNDCHG *boundchg)
Definition: var.c:17157
SCIP_HOLELIST * SCIPvarGetHolelistGlobal(SCIP_VAR *var)
Definition: var.c:17939
SCIP_RETCODE SCIPvarGetAggregatedObj(SCIP_VAR *var, SCIP_Real *aggrobj)
Definition: var.c:17789
SCIP_Bool SCIPbdchginfoHasInferenceReason(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18660
SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var)
Definition: var.c:17723
type definitions for problem variables
SCIP_Real SCIPvarGetCutoffSum(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:16187
SCIP_Bool SCIPbdchginfoIsRedundant(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18649
SCIP_BDCHGIDX * SCIPbdchginfoGetIdx(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18571
Definition: struct_prop.h:46
void SCIPvarSetBestRootSol(SCIP_VAR *var, SCIP_Real rootsol, SCIP_Real rootredcost, SCIP_Real rootlpobjval)
Definition: var.c:13855
Definition: struct_var.h:115
SCIP_BOUNDTYPE * SCIPvarGetImplTypes(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:18229
SCIP_BOUNDCHGTYPE SCIPboundchgGetBoundchgtype(SCIP_BOUNDCHG *boundchg)
Definition: var.c:17177
Definition: struct_var.h:58
SCIP_Bool SCIPvarWasFixedEarlier(SCIP_VAR *var1, SCIP_VAR *var2)
Definition: var.c:16959
SCIP_Real SCIPvarGetInferenceSumCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:16032
SCIP_Real SCIPvarGetLbAtIndex(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:16551
SCIP_BOUNDCHG * SCIPdomchgGetBoundchg(SCIP_DOMCHG *domchg, int pos)
Definition: var.c:17215
public methods for LP management
SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18511
SCIP_Real * SCIPvarGetImplBounds(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:18243
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
Definition: var.c:12782
SCIP_BDCHGINFO * SCIPvarGetLbchgInfo(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:16418
SCIP_BOUNDTYPE SCIPbdchginfoGetInferBoundtype(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18628
SCIP_BDCHGINFO * SCIPvarGetUbchgInfo(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:16474
SCIP_RETCODE SCIPvarGetProbvarBound(SCIP_VAR **var, SCIP_Real *bound, SCIP_BOUNDTYPE *boundtype)
Definition: var.c:12477
SCIP_BDCHGINFO * SCIPvarGetBdchgInfoUb(SCIP_VAR *var, int pos)
Definition: var.c:18339
SCIP_BDCHGINFO * SCIPvarGetBdchgInfo(SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:16530
type definitions for propagators
SCIP_VAR ** SCIPvarGetImplVars(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:18214
void SCIPvarSetCopyData(SCIP_VAR *var, SCIP_DECL_VARCOPY((*varcopy)))
Definition: var.c:17336
datastructures for problem variables
result codes for SCIP callback methods
type definitions for branching and inference history
SCIP_Longint SCIPvarGetNBranchings(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15707
SCIP_RETCODE SCIPvarsGetProbvarBinary(SCIP_VAR ***vars, SCIP_Bool **negatedarr, int nvars)
Definition: var.c:12286
SCIP_VAR * SCIPbdchginfoGetInferVar(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18581
Definition: struct_implics.h:75
SCIP_RETCODE SCIPvarSetInitial(SCIP_VAR *var, SCIP_Bool initial)
Definition: var.c:17347
SCIP_RETCODE SCIPvarGetProbvarHole(SCIP_VAR **var, SCIP_Real *left, SCIP_Real *right)
Definition: var.c:12570
SCIP_CONS * SCIPbdchginfoGetInferCons(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18593
SCIP_HOLELIST * SCIPvarGetHolelistLocal(SCIP_VAR *var)
Definition: var.c:17995
SCIP_BOUNDTYPE SCIPbdchginfoGetBoundtype(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18541
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPvarSetRemovable(SCIP_VAR *var, SCIP_Bool removable)
Definition: var.c:17363
void SCIPvarGetImplicVarBounds(SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_Real *lb, SCIP_Real *ub)
Definition: var.c:11151
type definitions for constraints and constraint handlers
void SCIPvarMarkDeleteGlobalStructures(SCIP_VAR *var)
Definition: var.c:17517
SCIP_BOUNDCHGTYPE SCIPbdchginfoGetChgtype(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:18531