Skip to content
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heuristics.h
* @ingroup PUBLICCOREAPI
* @brief methods commonly used by primal heuristics
* @author Gregor Hendel
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEURISTICS_H__
#define __SCIP_HEURISTICS_H__
#include "scip/def.h"
#include "scip/type_scip.h"
#include "scip/type_heur.h"
#include "scip/type_misc.h"
#include "scip/type_retcode.h"
#include "scip/type_sol.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@defgroup PublicSpecialHeuristicMethods Special Methods
* @ingroup PublicHeuristicMethods
* @brief methods commonly used by primal heuristics
*
* @{
*/
/** performs a diving within the limits of the @p diveset parameters
*
* This method performs a diving according to the settings defined by the diving settings @p diveset; Contrary to the
* name, SCIP enters probing mode (not diving mode) and dives along a path into the tree. Domain propagation
* is applied at every node in the tree, whereas probing LPs might be solved less frequently.
*
* Starting from the current LP solution, the algorithm selects candidates which maximize the
* score defined by the @p diveset and whose solution value has not yet been rendered infeasible by propagation,
* and propagates the bound change on this candidate.
*
* The algorithm iteratively selects the the next (unfixed) candidate in the list, until either enough domain changes
* or the resolve frequency of the LP trigger an LP resolve (and hence, the set of potential candidates changes),
* or the last node is proven to be infeasible. It optionally backtracks and tries the
* other branching direction.
*
* After the set of remaining candidates is empty or the targeted depth is reached, the node LP is
* solved, and the old candidates are replaced by the new LP candidates.
*
* @see heur_guideddiving.c for an example implementation of a dive set controlling the diving algorithm.
*
* @note the node from where the algorithm is called is checked for a basic LP solution. If the solution
* is non-basic, e.g., when barrier without crossover is used, the method returns without performing a dive.
*
* @note currently, when multiple diving heuristics call this method and solve an LP at the same node, only the first
* call will be executed, @see SCIPgetLastDiveNode().
*/
SCIP_EXPORT
SCIP_RETCODE SCIPperformGenericDivingAlgorithm(
SCIP* scip, /**< SCIP data structure */
SCIP_DIVESET* diveset, /**< settings for diving */
SCIP_SOL* worksol, /**< non-NULL working solution */
SCIP_HEUR* heur, /**< the calling primal heuristic */
SCIP_RESULT* result, /**< SCIP result pointer */
SCIP_Bool nodeinfeasible, /**< is the current node known to be infeasible? */
SCIP_Longint iterlim, /**< nonnegative iteration limit for the LP solves, or -1 for dynamic setting */
SCIP_DIVECONTEXT divecontext /**< context for diving statistics */
);
/** get a sub-SCIP copy of the transformed problem */
SCIP_EXPORT
SCIP_RETCODE SCIPcopyLargeNeighborhoodSearch(
SCIP* sourcescip, /**< source SCIP data structure */
SCIP* subscip, /**< sub-SCIP used by the heuristic */
SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
* target variables */
const char* suffix, /**< suffix for the problem name */
SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
SCIP_Bool uselprows, /**< should the linear relaxation of the problem defined by LP rows be copied? */
SCIP_Bool copycuts, /**< should cuts be copied (only if uselprows == FALSE) */
SCIP_Bool* success, /**< was the copying successful? */
SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
);
/** adds a trust region neighborhood constraint to the @p targetscip
*
* a trust region constraint measures the deviation from the current incumbent solution \f$x^*\f$ by an auxiliary
* continuous variable \f$v \geq 0\f$:
* \f[
* \sum\limits_{j\in B} |x_j^* - x_j| = v
* \f]
* Only binary variables are taken into account. The deviation is penalized in the objective function using
* a positive \p violpenalty.
*
* @note: the trust region constraint creates an auxiliary variable to penalize the deviation from
* the current incumbent solution. This variable can afterwards be accessed using SCIPfindVar() by its name
* 'trustregion_violationvar'
*/
SCIP_EXPORT
SCIP_RETCODE SCIPaddTrustregionNeighborhoodConstraint(
SCIP* scip, /**< the SCIP data structure */
SCIP* subscip, /**< SCIP data structure of the subproblem */
SCIP_VAR** subvars, /**< variables of the subproblem, NULL entries are ignored */
SCIP_Real violpenalty /**< the penalty for violating the trust region */
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file history.h
* @ingroup INTERNALAPI
* @brief internal methods for branching and inference history
* @author Tobias Achterberg
* @author Timo Berthold
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HISTORY_H__
#define __SCIP_HISTORY_H__
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_history.h"
#ifdef NDEBUG
#include "scip/struct_history.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/** creates an empty history entry */
SCIP_RETCODE SCIPhistoryCreate(
SCIP_HISTORY** history, /**< pointer to store branching and inference history */
BMS_BLKMEM* blkmem /**< block memory */
);
/** frees a history entry */
void SCIPhistoryFree(
SCIP_HISTORY** history, /**< pointer to branching and inference history */
BMS_BLKMEM* blkmem /**< block memory */
);
/** resets history entry to zero */
void SCIPhistoryReset(
SCIP_HISTORY* history /**< branching and inference history */
);
/** unites two history entries by adding the values of the second one to the first one */
void SCIPhistoryUnite(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_HISTORY* addhistory, /**< history values to add to history */
SCIP_Bool switcheddirs /**< should the history entries be united with switched directories */
);
/** updates the pseudo costs for a change of "solvaldelta" in the variable's LP solution value and a change of "objdelta"
* in the LP's objective value
*/
void SCIPhistoryUpdatePseudocost(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Real solvaldelta, /**< difference of variable's new LP value - old LP value */
SCIP_Real objdelta, /**< difference of new LP's objective value - old LP's objective value */
SCIP_Real weight /**< weight of this update in pseudo cost sum (added to pscostcount) */
);
/**@defgroup ValueHistory Value Based History
* @ingroup INTERNALAPI
* @brief Value based history methods
*
* @{
*/
/** creates an empty value history */
SCIP_RETCODE SCIPvaluehistoryCreate(
SCIP_VALUEHISTORY** valuehistory, /**< pointer to store the value based branching and inference histories */
BMS_BLKMEM* blkmem /**< block memory */
);
/** frees a value history */
void SCIPvaluehistoryFree(
SCIP_VALUEHISTORY** valuehistory, /**< pointer to value based history */
BMS_BLKMEM* blkmem /**< block memory */
);
/** finds for the given domain value the history if it does not exist yet it will be created */
SCIP_RETCODE SCIPvaluehistoryFind(
SCIP_VALUEHISTORY* valuehistory, /**< value based history */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Real value, /**< domain value of interest */
SCIP_HISTORY** history /**< pointer to store the history for the given domain value */
);
/** scales the conflict score values with the given scalar for each value history entry */
void SCIPvaluehistoryScaleVSIDS(
SCIP_VALUEHISTORY* valuehistory, /**< value based history */
SCIP_Real scalar /**< scalar to multiply the conflict scores with */
);
/**@} */
/** returns the opposite direction of the given branching direction */
SCIP_BRANCHDIR SCIPbranchdirOpposite(
SCIP_BRANCHDIR dir /**< branching direction */
);
/** returns the expected dual gain for moving the corresponding variable by "solvaldelta" */
SCIP_Real SCIPhistoryGetPseudocost(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
);
/** returns the variance of pseudo costs about the mean. */
SCIP_Real SCIPhistoryGetPseudocostVariance(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR direction /**< direction of variable: 1 for upwards history, 0 for downwards history */
);
/** returns the (possible fractional) number of (partial) pseudo cost updates performed on this pseudo cost entry in
* the given branching direction
*/
SCIP_Real SCIPhistoryGetPseudocostCount(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns whether the pseudo cost entry is empty in the given branching direction (whether no value was added yet) */
SCIP_Bool SCIPhistoryIsPseudocostEmpty(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** increases the conflict score of the history entry by the given weight */
void SCIPhistoryIncVSIDS(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir, /**< branching direction */
SCIP_Real weight /**< weight of this update in conflict score */
);
/** scales the conflict score values with the given scalar */
void SCIPhistoryScaleVSIDS(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_Real scalar /**< scalar to multiply the conflict scores with */
);
/** increases the number of active conflicts by one and the overall length of the history entry by the given weight */
void SCIPhistoryIncNActiveConflicts(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir, /**< branching direction */
SCIP_Real length /**< length of the conflict */
);
/** gets the number of active conflicts of the history entry */
SCIP_Longint SCIPhistoryGetNActiveConflicts(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir /**< branching direction */
);
/** gets the average conflict length of the history entry */
SCIP_Real SCIPhistoryGetAvgConflictlength(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir /**< branching direction */
);
/** increases the number of branchings counter */
void SCIPhistoryIncNBranchings(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
int depth /**< depth at which the bound change took place */
);
/** increases the number of inferences counter */
void SCIPhistoryIncInferenceSum(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
SCIP_Real weight /**< weight of this update in cutoff score */
);
/** increases the number of cutoffs counter */
void SCIPhistoryIncCutoffSum(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
SCIP_Real weight /**< weight of this update in cutoff score */
);
/** get number of branchings counter */
SCIP_Longint SCIPhistoryGetNBranchings(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** get number of inferences counter */
SCIP_Real SCIPhistoryGetInferenceSum(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the average number of inferences per branching */
SCIP_Real SCIPhistoryGetAvgInferences(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the average number of cutoffs per branching */
SCIP_Real SCIPhistoryGetAvgCutoffs(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns the average depth of bound changes due to branching */
SCIP_Real SCIPhistoryGetAvgBranchdepth(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
);
/** returns true if the given history contains a valid ratio */
SCIP_Bool SCIPhistoryIsRatioValid(
SCIP_HISTORY* history /**< branching and inference history */
);
/** returns the most recent ratio computed given the variable history */
SCIP_Real SCIPhistoryGetLastRatio(
SCIP_HISTORY* history /**< branching and inference history */
);
/** returns the most recent value of r/l used to compute this variable's ratio */
SCIP_Real SCIPhistoryGetLastBalance(
SCIP_HISTORY* history /**< branching and inference history */
);
/** sets the ratio history for a particular variable */
void SCIPhistorySetRatioHistory(
SCIP_HISTORY* history, /**< branching and inference history */
SCIP_Bool valid, /**< True iff the ratio computed is valid */
SCIP_Real ratio, /**< Ratio of the characteristic polynomial with gains (1, rightgain/leftgain) */
SCIP_Real balance /**< The value of rightgain/leftgain */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPbranchdirOpposite(dir) \
((dir) == SCIP_BRANCHDIR_DOWNWARDS ? SCIP_BRANCHDIR_UPWARDS \
: ((dir) == SCIP_BRANCHDIR_UPWARDS ? SCIP_BRANCHDIR_DOWNWARDS : SCIP_BRANCHDIR_AUTO))
#define SCIPhistoryGetPseudocost(history,solvaldelta) \
( (solvaldelta) >= 0.0 ? (solvaldelta) * ((history)->pscostcount[1] > 0.0 \
? (history)->pscostweightedmean[1] : 1.0) \
: -(solvaldelta) * ((history)->pscostcount[0] > 0.0 \
? (history)->pscostweightedmean[0] : 1.0) )
#define SCIPhistoryGetPseudocostVariance(history, dir) \
( (history)->pscostcount[dir] >= 1.9 ? 1 / ((history)->pscostcount[dir] - 1) \
* ((history)->pscostvariance[dir]) \
: 0.0)
#define SCIPhistoryGetPseudocostCount(history,dir) ((history)->pscostcount[dir])
#define SCIPhistoryIsPseudocostEmpty(history,dir) ((history)->pscostcount[dir] == 0.0)
#define SCIPhistoryIncVSIDS(history,dir,weight) (history)->vsids[dir] += (weight)
#define SCIPhistoryScaleVSIDS(history,scalar) { (history)->vsids[0] *= (scalar); \
(history)->vsids[1] *= (scalar); }
#define SCIPhistoryIncNActiveConflicts(history,dir,length) { (history)->nactiveconflicts[dir]++; \
(history)->conflengthsum[dir] += length; }
#define SCIPhistoryGetNActiveConflicts(history,dir) ((history)->nactiveconflicts[dir])
#define SCIPhistoryGetAvgConflictlength(history,dir) ((history)->conflengthsum[dir] > 0.0 \
? (SCIP_Real)(history)->nactiveconflicts[dir]/(SCIP_Real)(history)->conflengthsum[dir] : 0.0)
#define SCIPhistoryIncNBranchings(history,dir,depth) { (history)->nbranchings[dir]++; \
(history)->branchdepthsum[dir] += depth; }
#define SCIPhistoryIncInferenceSum(history,dir,weight) (history)->inferencesum[dir] += (weight)
#define SCIPhistoryIncCutoffSum(history,dir,weight) (history)->cutoffsum[dir] += (weight)
#define SCIPhistoryGetNBranchings(history,dir) ((history)->nbranchings[dir])
#define SCIPhistoryGetInferenceSum(history,dir) ((history)->inferencesum[dir])
#define SCIPhistoryGetAvgInferences(history,dir) ((history)->nbranchings[dir] > 0 \
? (SCIP_Real)(history)->inferencesum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 0.0)
#define SCIPhistoryGetAvgCutoffs(history,dir) ((history)->nbranchings[dir] > 0 \
? (SCIP_Real)(history)->cutoffsum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 0.0)
#define SCIPhistoryGetAvgBranchdepth(history,dir) ((history)->nbranchings[dir] > 0 \
? (SCIP_Real)(history)->branchdepthsum[dir]/(SCIP_Real)(history)->nbranchings[dir] : 1.0)
#define SCIPhistoryIsRatioValid(history) ((history)->ratiovalid)
#define SCIPhistoryGetLastRatio(history) ((history)->ratio)
#define SCIPhistorySetRatioHistory(history,newvalid,newratio,newbalance) (history)->ratiovalid = newvalid, \
(history)->ratio = newratio, (history)->balance = newbalance
#define SCIPhistoryGetLastBalance(history) ((history)->balance)
#endif
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file implics.h
* @ingroup INTERNALAPI
* @brief methods for implications, variable bounds, and cliques
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_IMPLICS_H__
#define __SCIP_IMPLICS_H__
#include "blockmemshell/memory.h"
#include "scip/def.h"
#include "scip/type_branch.h"
#include "scip/type_event.h"
#include "scip/type_implics.h"
#include "scip/type_lp.h"
#include "scip/type_prob.h"
#include "scip/type_reopt.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_tree.h"
#include "scip/type_var.h"
#ifdef NDEBUG
#include "scip/pub_implics.h"
#include "scip/struct_implics.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Methods for Variable Bounds
*/
/** frees a variable bounds data structure */
void SCIPvboundsFree(
SCIP_VBOUNDS** vbounds, /**< pointer to store variable bounds data structure */
BMS_BLKMEM* blkmem /**< block memory */
);
/** adds a variable bound to the variable bounds data structure */
SCIP_RETCODE SCIPvboundsAdd(
SCIP_VBOUNDS** vbounds, /**< pointer to variable bounds data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_BOUNDTYPE vboundtype, /**< type of variable bound (LOWER or UPPER) */
SCIP_VAR* var, /**< variable z in x <= b*z + d or x >= b*z + d */
SCIP_Real coef, /**< coefficient b in x <= b*z + d or x >= b*z + d */
SCIP_Real constant, /**< constant d in x <= b*z + d or x >= b*z + d */
SCIP_Bool* added /**< pointer to store whether the variable bound was added */
);
/** removes from variable x a variable bound x >=/<= b*z + d with binary or integer z */
SCIP_RETCODE SCIPvboundsDel(
SCIP_VBOUNDS** vbounds, /**< pointer to variable bounds data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_VAR* vbdvar, /**< variable z in x >=/<= b*z + d */
SCIP_Bool negativecoef /**< is coefficient b negative? */
);
/** reduces the number of variable bounds stored in the given variable bounds data structure */
void SCIPvboundsShrink(
SCIP_VBOUNDS** vbounds, /**< pointer to variable bounds data structure */
BMS_BLKMEM* blkmem, /**< block memory */
int newnvbds /**< new number of variable bounds */
);
/** gets number of variable bounds contained in given variable bounds data structure */
int SCIPvboundsGetNVbds(
SCIP_VBOUNDS* vbounds /**< variable bounds data structure */
);
/** gets array of variables contained in given variable bounds data structure */
SCIP_VAR** SCIPvboundsGetVars(
SCIP_VBOUNDS* vbounds /**< variable bounds data structure */
);
/** gets array of coefficients contained in given variable bounds data structure */
SCIP_Real* SCIPvboundsGetCoefs(
SCIP_VBOUNDS* vbounds /**< variable bounds data structure */
);
/** gets array of constants contained in given variable bounds data structure */
SCIP_Real* SCIPvboundsGetConstants(
SCIP_VBOUNDS* vbounds /**< variable bounds data structure */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPvboundsGetNVbds(vbounds) ((vbounds) != NULL ? (vbounds)->len : 0)
#define SCIPvboundsGetVars(vbounds) ((vbounds) != NULL ? (vbounds)->vars : NULL)
#define SCIPvboundsGetCoefs(vbounds) ((vbounds) != NULL ? (vbounds)->coefs : NULL)
#define SCIPvboundsGetConstants(vbounds) ((vbounds) != NULL ? (vbounds)->constants : NULL)
#endif
/*
* Methods for Implications
*/
/** frees an implications data structure */
void SCIPimplicsFree(
SCIP_IMPLICS** implics, /**< pointer of implications data structure to free */
BMS_BLKMEM* blkmem /**< block memory */
);
/** adds an implication x == 0/1 -> y <= b or y >= b to the implications data structure;
* the implication must be non-redundant
*/
SCIP_RETCODE SCIPimplicsAdd(
SCIP_IMPLICS** implics, /**< pointer to implications data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_Bool varfixing, /**< FALSE if implication for x == 0 has to be added, TRUE for x == 1 */
SCIP_VAR* implvar, /**< variable y in implication y <= b or y >= b */
SCIP_BOUNDTYPE impltype, /**< type of implication y <= b (SCIP_BOUNDTYPE_UPPER) or y >= b (SCIP_BOUNDTYPE_LOWER) */
SCIP_Real implbound, /**< bound b in implication y <= b or y >= b */
SCIP_Bool isshortcut, /**< is the implication a shortcut, i.e., added as part of the transitive closure of another implication? */
SCIP_Bool* conflict, /**< pointer to store whether implication causes a conflict for variable x */
SCIP_Bool* added /**< pointer to store whether the implication was added */
);
/** removes the implication x <= 0 or x >= 1 ==> y <= b or y >= b from the implications data structure */
SCIP_RETCODE SCIPimplicsDel(
SCIP_IMPLICS** implics, /**< pointer to implications data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool varfixing, /**< FALSE if y should be removed from implications for x <= 0, TRUE for x >= 1 */
SCIP_VAR* implvar, /**< variable y in implication y <= b or y >= b */
SCIP_BOUNDTYPE impltype /**< type of implication y <= b (SCIP_BOUNDTYPE_UPPER) or y >= b (SCIP_BOUNDTYPE_LOWER) */
);
/** returns which implications on given variable y are contained in implications for x == 0 or x == 1 */
void SCIPimplicsGetVarImplics(
SCIP_IMPLICS* implics, /**< implications data structure */
SCIP_Bool varfixing, /**< FALSE if y should be searched in implications for x == 0, TRUE for x == 1 */
SCIP_VAR* implvar, /**< variable y to search for */
SCIP_Bool* haslowerimplic, /**< pointer to store whether there exists an implication y >= l */
SCIP_Bool* hasupperimplic /**< pointer to store whether there exists an implication y <= u */
);
/** returns whether an implication y <= b or y >= b is contained in implications for x == 0 or x == 1 */
SCIP_Bool SCIPimplicsContainsImpl(
SCIP_IMPLICS* implics, /**< implications data structure */
SCIP_Bool varfixing, /**< FALSE if y should be searched in implications for x == 0, TRUE for x == 1 */
SCIP_VAR* implvar, /**< variable y to search for */
SCIP_BOUNDTYPE impltype /**< type of implication y <=/>= b to search for */
);
/** gets number of implications for a given binary variable fixing */
int SCIPimplicsGetNImpls(
SCIP_IMPLICS* implics, /**< implication data */
SCIP_Bool varfixing /**< should the implications on var == FALSE or var == TRUE be returned? */
);
/** gets array with implied variables for a given binary variable fixing */
SCIP_VAR** SCIPimplicsGetVars(
SCIP_IMPLICS* implics, /**< implication data */
SCIP_Bool varfixing /**< should the implications on var == FALSE or var == TRUE be returned? */
);
/** gets array with implication types for a given binary variable fixing */
SCIP_BOUNDTYPE* SCIPimplicsGetTypes(
SCIP_IMPLICS* implics, /**< implication data */
SCIP_Bool varfixing /**< should the implications on var == FALSE or var == TRUE be returned? */
);
/** gets array with implication bounds for a given binary variable fixing */
SCIP_Real* SCIPimplicsGetBounds(
SCIP_IMPLICS* implics, /**< implication data */
SCIP_Bool varfixing /**< should the implications on var == FALSE or var == TRUE be returned? */
);
/** Gets array with unique implication identifiers for a given binary variable fixing.
* If an implication is a shortcut, i.e., it was added as part of the transitive closure of another implication,
* its id is negative, otherwise it is nonnegative.
*/
int* SCIPimplicsGetIds(
SCIP_IMPLICS* implics, /**< implication data */
SCIP_Bool varfixing /**< should the implications on var == FALSE or var == TRUE be returned? */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPimplicsGetNImpls(implics, varfixing) ((implics) != NULL ? (implics)->nimpls[varfixing] : 0)
#define SCIPimplicsGetNBinImpls(implics, varfixing) ((implics) != NULL ? (implics)->nbinimpls[varfixing] : 0)
#define SCIPimplicsGetVars(implics, varfixing) ((implics) != NULL ? (implics)->vars[varfixing] : NULL)
#define SCIPimplicsGetTypes(implics, varfixing) ((implics) != NULL ? (implics)->types[varfixing] : NULL)
#define SCIPimplicsGetBounds(implics, varfixing) ((implics) != NULL ? (implics)->bounds[varfixing] : NULL)
#define SCIPimplicsGetIds(implics, varfixing) ((implics) != NULL ? (implics)->ids[varfixing] : NULL)
#endif
/*
* methods for cliques
*/
/** adds a single variable to the given clique */
SCIP_RETCODE SCIPcliqueAddVar(
SCIP_CLIQUE* clique, /**< clique data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< variable to add to the clique */
SCIP_Bool value, /**< value of the variable in the clique */
SCIP_Bool* doubleentry, /**< pointer to store whether the variable and value occurs twice in the clique */
SCIP_Bool* oppositeentry /**< pointer to store whether the variable with opposite value is in the clique */
);
/** removes a single variable from the given clique */
void SCIPcliqueDelVar(
SCIP_CLIQUE* clique, /**< clique data structure */
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
SCIP_VAR* var, /**< variable to remove from the clique */
SCIP_Bool value /**< value of the variable in the clique */
);
/** frees a clique list data structure */
void SCIPcliquelistFree(
SCIP_CLIQUELIST** cliquelist, /**< pointer to the clique list data structure */
BMS_BLKMEM* blkmem /**< block memory */
);
/** adds a clique to the clique list */
SCIP_RETCODE SCIPcliquelistAdd(
SCIP_CLIQUELIST** cliquelist, /**< pointer to the clique list data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool value, /**< value of the variable for which the clique list should be extended */
SCIP_CLIQUE* clique /**< clique that should be added to the clique list */
);
/** removes a clique from the clique list */
SCIP_RETCODE SCIPcliquelistDel(
SCIP_CLIQUELIST** cliquelist, /**< pointer to the clique list data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_Bool value, /**< value of the variable for which the clique list should be reduced */
SCIP_CLIQUE* clique /**< clique that should be deleted from the clique list */
);
/** returns whether the given clique lists have a non-empty intersection, i.e. whether there is a clique that appears
* in both lists
*/
SCIP_Bool SCIPcliquelistsHaveCommonClique(
SCIP_CLIQUELIST* cliquelist1, /**< first clique list data structure */
SCIP_Bool value1, /**< value of first variable */
SCIP_CLIQUELIST* cliquelist2, /**< second clique list data structure */
SCIP_Bool value2 /**< value of second variable */
);
/** removes all listed entries from the cliques */
void SCIPcliquelistRemoveFromCliques(
SCIP_CLIQUELIST* cliquelist, /**< clique list data structure */
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
SCIP_VAR* var, /**< active problem variable the clique list belongs to */
SCIP_Bool irrelevantvar /**< has the variable become irrelevant, meaning that equality
* cliques need to be relaxed? */
);
/** creates a clique table data structure */
SCIP_RETCODE SCIPcliquetableCreate(
SCIP_CLIQUETABLE** cliquetable, /**< pointer to store clique table data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem /**< block memory */
);
/** frees a clique table data structure */
SCIP_RETCODE SCIPcliquetableFree(
SCIP_CLIQUETABLE** cliquetable, /**< pointer to store clique table data structure */
BMS_BLKMEM* blkmem /**< block memory */
);
/** adds a clique to the clique table, using the given values for the given variables;
* performs implications if the clique contains the same variable twice
*/
SCIP_RETCODE SCIPcliquetableAdd(
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branch and bound tree if in solving stage */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< current LP data */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_VAR** vars, /**< binary variables in the clique: at most one can be set to the given value */
SCIP_Bool* values, /**< values of the variables in the clique; NULL to use TRUE for all vars */
int nvars, /**< number of variables in the clique */
SCIP_Bool isequation, /**< is the clique an equation or an inequality? */
SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
int* nbdchgs /**< pointer to count the number of performed bound changes, or NULL */
);
/** removes all empty and single variable cliques from the clique table; removes double entries from the clique table
*
* @note cliques can be processed several times by this method
*/
SCIP_RETCODE SCIPcliquetableCleanup(
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branch and bound tree if in solving stage */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< current LP data */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
int* nchgbds, /**< pointer to store number of fixed variables */
SCIP_Bool* infeasible /**< pointer to store whether an infeasibility was detected */
);
/** computes connected components of the clique graph
*
* use depth-first search similarly to the components presolver/constraint handler, representing a clique as a
* path to reduce memory usage, but leaving the connected components the same
*
* an update becomes necessary if a clique gets added with variables from different components
*/
SCIP_RETCODE SCIPcliquetableComputeCliqueComponents(
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_VAR** vars, /**< array of problem variables, sorted by variable type */
int nbinvars, /**< number of binary variables */
int nintvars, /**< number of integer variables */
int nimplvars /**< number of implicit integer variables */
);
/** returns the index of the connected component of the clique graph that the variable belongs to, or -1 */
int SCIPcliquetableGetVarComponentIdx(
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
SCIP_VAR* var /**< problem variable */
);
/** returns the number of cliques stored in the clique list */
int SCIPcliquelistGetNCliques(
SCIP_CLIQUELIST* cliquelist, /**< clique list data structure */
SCIP_Bool value /**< value of the variable for which the cliques should be returned */
);
/** returns the cliques stored in the clique list, or NULL if the clique list is empty */
SCIP_CLIQUE** SCIPcliquelistGetCliques(
SCIP_CLIQUELIST* cliquelist, /**< clique list data structure */
SCIP_Bool value /**< value of the variable for which the cliques should be returned */
);
/** checks whether variable is contained in all cliques of the cliquelist */
void SCIPcliquelistCheck(
SCIP_CLIQUELIST* cliquelist, /**< clique list data structure */
SCIP_VAR* var /**< variable, the clique list belongs to */
);
/** gets the number of cliques stored in the clique table */
int SCIPcliquetableGetNCliques(
SCIP_CLIQUETABLE* cliquetable /**< clique table data structure */
);
/** gets the number of cliques created so far by the clique table */
int SCIPcliquetableGetNCliquesCreated(
SCIP_CLIQUETABLE* cliquetable /**< clique table data structure */
);
/** gets the array of cliques stored in the clique table */
SCIP_CLIQUE** SCIPcliquetableGetCliques(
SCIP_CLIQUETABLE* cliquetable /**< clique table data structure */
);
/** gets the number of entries in the whole clique table */
SCIP_Longint SCIPcliquetableGetNEntries(
SCIP_CLIQUETABLE* cliquetable /**< clique table data structure */
);
/** returns the number of clique components, or -1 if update is necessary first */
int SCIPcliquetableGetNCliqueComponents(
SCIP_CLIQUETABLE* cliquetable /**< clique table data structure */
);
/** returns TRUE iff the connected clique components need an update (because new cliques were added) */
SCIP_Bool SCIPcliquetableNeedsComponentUpdate(
SCIP_CLIQUETABLE* cliquetable /**< clique table data structure */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPcliquelistGetNCliques(cliquelist, value) ((cliquelist) != NULL ? (cliquelist)->ncliques[value] : 0)
#define SCIPcliquelistGetCliques(cliquelist, value) ((cliquelist) != NULL ? (cliquelist)->cliques[value] : NULL)
#define SCIPcliquelistCheck(cliquelist, var) /**/
#define SCIPcliquetableGetNCliques(cliquetable) ((cliquetable)->ncliques)
#define SCIPcliquetableGetCliques(cliquetable) ((cliquetable)->cliques)
#define SCIPcliquetableGetNEntries(cliquetable) ((cliquetable)->nentries)
#define SCIPcliquetableGetNCliqueComponents(cliquetable) (cliquetable->compsfromscratch ? -1 : cliquetable->ncliquecomponents)
#define SCIPcliquetableNeedsComponentUpdate(cliquetable) (cliquetable->compsfromscratch || cliquetable->djset == NULL)
#endif
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file interrupt.h
* @ingroup INTERNALAPI
* @brief methods for catching the user CTRL-C interrupt
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_INTERRUPT_H__
#define __SCIP_INTERRUPT_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_interrupt.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates a CTRL-C interrupt data */
SCIP_RETCODE SCIPinterruptCreate(
SCIP_INTERRUPT** interrupt /**< pointer to store the CTRL-C interrupt data */
);
/** frees a CTRL-C interrupt data */
void SCIPinterruptFree(
SCIP_INTERRUPT** interrupt /**< pointer to the CTRL-C interrupt data */
);
/** captures the CTRL-C interrupt to call the SCIP's own interrupt handler */
void SCIPinterruptCapture(
SCIP_INTERRUPT* interrupt /**< CTRL-C interrupt data */
);
/** releases the CTRL-C interrupt and restores the old interrupt handler */
void SCIPinterruptRelease(
SCIP_INTERRUPT* interrupt /**< CTRL-C interrupt data */
);
/** returns whether the user interrupted by pressing CTRL-C */
SCIP_Bool SCIPinterrupted(
void
);
/** returns whether the process has received a SIGTERM */
SCIP_Bool SCIPterminated(
void
);
/** send a termination signal to the process so that SCIP tries to terminate as soon as possible */
void SCIPtryTerminate(
void
);
/** resets the number of interrupts to 0 */
void SCIPresetInterrupted(
void
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file scip/intervalarith.h
* @ingroup INTERNALAPI
* @brief interval arithmetics for provable bounds
* @author Tobias Achterberg
* @author Stefan Vigerske
* @author Kati Wolter
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_INTERVALARITH_H__
#define __SCIP_INTERVALARITH_H__
#include "scip/def.h"
#ifdef __cplusplus
extern "C" {
#endif
/** interval given by infimum and supremum */
struct SCIP_Interval
{
SCIP_Real inf; /**< infimum (lower bound) of interval */
SCIP_Real sup; /**< supremum (upper bound) of interval */
};
typedef struct SCIP_Interval SCIP_INTERVAL;
/** rounding mode of floating point operations (upwards, downwards, nearest, ...)
* exact values depend on machine and compiler, so we define a corresponding enum in the header file */
typedef int SCIP_ROUNDMODE;
/*
* Interval arithmetic operations
*/
/** returns whether rounding mode control is available */
SCIP_EXPORT
SCIP_Bool SCIPintervalHasRoundingControl(
void
);
/** sets rounding mode of floating point operations */
SCIP_EXPORT
void SCIPintervalSetRoundingMode(
SCIP_ROUNDMODE roundmode /**< rounding mode to activate */
);
/** gets current rounding mode of floating point operations */
SCIP_EXPORT
SCIP_ROUNDMODE SCIPintervalGetRoundingMode(
void
);
/** sets rounding mode of floating point operations to downwards rounding */
SCIP_EXPORT
void SCIPintervalSetRoundingModeDownwards(
void
);
/** sets rounding mode of floating point operations to upwards rounding */
SCIP_EXPORT
void SCIPintervalSetRoundingModeUpwards(
void
);
/** sets rounding mode of floating point operations to nearest rounding */
SCIP_EXPORT
void SCIPintervalSetRoundingModeToNearest(
void
);
/** sets rounding mode of floating point operations to towards zero rounding */
SCIP_EXPORT
void SCIPintervalSetRoundingModeTowardsZero(
void
);
/** negates a number in a way that the compiler does not optimize it away */
SCIP_EXPORT
SCIP_Real SCIPintervalNegateReal(
SCIP_Real x /**< number to negate */
);
/** returns infimum of interval */
SCIP_EXPORT
SCIP_Real SCIPintervalGetInf(
SCIP_INTERVAL interval /**< interval */
);
/** returns supremum of interval */
SCIP_EXPORT
SCIP_Real SCIPintervalGetSup(
SCIP_INTERVAL interval /**< interval */
);
/** stores given value as interval */
SCIP_EXPORT
void SCIPintervalSet(
SCIP_INTERVAL* resultant, /**< interval to store value into */
SCIP_Real value /**< value to store */
);
/** stores given infimum and supremum as interval */
SCIP_EXPORT
void SCIPintervalSetBounds(
SCIP_INTERVAL* resultant, /**< interval to store value into */
SCIP_Real inf, /**< value to store as infimum */
SCIP_Real sup /**< value to store as supremum */
);
/** sets interval to empty interval, which will be [1.0, -1.0] */
SCIP_EXPORT
void SCIPintervalSetEmpty(
SCIP_INTERVAL* resultant /**< resultant interval of operation */
);
/** indicates whether interval is empty, i.e., whether inf > sup */
SCIP_EXPORT
SCIP_Bool SCIPintervalIsEmpty(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL operand /**< operand of operation */
);
/** sets interval to entire [-infinity, +infinity] */
SCIP_EXPORT
void SCIPintervalSetEntire(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant /**< resultant interval of operation */
);
/** indicates whether interval is entire, i.e., whether inf <= -infinity and sup >= infinity */
SCIP_EXPORT
SCIP_Bool SCIPintervalIsEntire(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL operand /**< operand of operation */
);
/** indicates whether interval is positive infinity, i.e., [infinity, infinity] */
SCIP_EXPORT
SCIP_Bool SCIPintervalIsPositiveInfinity(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL operand /**< operand of operation */
);
/** indicates whether interval is negative infinity, i.e., [-infinity, -infinity] */
SCIP_EXPORT
SCIP_Bool SCIPintervalIsNegativeInfinity(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL operand /**< operand of operation */
);
#ifdef NDEBUG
/* In optimized mode, some function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
* With SCIPintervalSetBounds we need to be a bit careful, since i and s could use resultant->inf and resultant->sup,
* e.g., SCIPintervalSetBounds(&resultant, -resultant->sup, -resultant->inf).
* So we need to make sure that we first evaluate both terms before setting resultant.
*/
#define SCIPintervalGetInf(interval) (interval).inf
#define SCIPintervalGetSup(interval) (interval).sup
#define SCIPintervalSet(resultant, value) do { (resultant)->inf = (value); (resultant)->sup = (resultant)->inf; } while( FALSE )
#define SCIPintervalSetBounds(resultant, i, s) do { SCIP_Real scipintervaltemp; scipintervaltemp = (s); (resultant)->inf = (i); (resultant)->sup = scipintervaltemp; } while( FALSE )
#define SCIPintervalSetEmpty(resultant) do { (resultant)->inf = 1.0; (resultant)->sup = -1.0; } while( FALSE )
#define SCIPintervalSetEntire(infinity, resultant) do { (resultant)->inf = -(infinity); (resultant)->sup = (infinity); } while( FALSE )
#define SCIPintervalIsEmpty(infinity, operand) ( (operand).inf > -(infinity) && (operand).sup < (infinity) && (operand).sup < (operand).inf )
#define SCIPintervalIsEntire(infinity, operand) ( (operand).inf <= -(infinity) && (operand).sup >= (infinity) )
#define SCIPintervalIsPositiveInfinity(infinity, operand) ( (operand).inf >= (infinity) && (operand).sup >= (operand).inf )
#define SCIPintervalIsNegativeInfinity(infinity, operand) ( (operand).sup <= -(infinity) && (operand).sup >= (operand).inf )
#endif
/** indicates whether operand1 is contained in operand2 */
SCIP_EXPORT
SCIP_Bool SCIPintervalIsSubsetEQ(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** indicates whether operand1 and operand2 are disjoint */
SCIP_EXPORT
SCIP_Bool SCIPintervalAreDisjoint(
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** intersection of two intervals */
SCIP_EXPORT
void SCIPintervalIntersect(
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** interval enclosure of the union of two intervals */
SCIP_EXPORT
void SCIPintervalUnify(
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** adds operand1 and operand2 and stores infimum of result in infimum of resultant */
SCIP_EXPORT
void SCIPintervalAddInf(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** adds operand1 and operand2 and stores supremum of result in supremum of resultant */
SCIP_EXPORT
void SCIPintervalAddSup(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** adds operand1 and operand2 and stores result in resultant */
SCIP_EXPORT
void SCIPintervalAdd(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** adds operand1 and scalar operand2 and stores result in resultant */
SCIP_EXPORT
void SCIPintervalAddScalar(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_Real operand2 /**< second operand of operation */
);
/** adds vector operand1 and vector operand2 and stores result in vector resultant */
SCIP_EXPORT
void SCIPintervalAddVectors(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< array of resultant intervals of operation */
int length, /**< length of arrays */
SCIP_INTERVAL* operand1, /**< array of first operands of operation */
SCIP_INTERVAL* operand2 /**< array of second operands of operation */
);
/** subtracts operand2 from operand1 and stores result in resultant */
SCIP_EXPORT
void SCIPintervalSub(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** subtracts scalar operand2 from operand1 and stores result in resultant */
SCIP_EXPORT
void SCIPintervalSubScalar(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_Real operand2 /**< second operand of operation */
);
/** multiplies operand1 with operand2 and stores infimum of result in infimum of resultant */
SCIP_EXPORT
void SCIPintervalMulInf(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation; can be +/-inf */
SCIP_INTERVAL operand2 /**< second operand of operation; can be +/-inf */
);
/** multiplies operand1 with operand2 and stores supremum of result in supremum of resultant */
SCIP_EXPORT
void SCIPintervalMulSup(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation; can be +/-inf */
SCIP_INTERVAL operand2 /**< second operand of operation; can be +/-inf */
);
/** multiplies operand1 with operand2 and stores result in resultant */
SCIP_EXPORT
void SCIPintervalMul(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** multiplies operand1 with scalar operand2 and stores infimum of result in infimum of resultant */
SCIP_EXPORT
void SCIPintervalMulScalarInf(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_Real operand2 /**< second operand of operation; can be +/- inf */
);
/** multiplies operand1 with scalar operand2 and stores supremum of result in supremum of resultant */
SCIP_EXPORT
void SCIPintervalMulScalarSup(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_Real operand2 /**< second operand of operation; can be +/- inf */
);
/** multiplies operand1 with scalar operand2 and stores result in resultant */
SCIP_EXPORT
void SCIPintervalMulScalar(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_Real operand2 /**< second operand of operation */
);
/** divides operand1 by operand2 and stores result in resultant */
SCIP_EXPORT
void SCIPintervalDiv(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** divides operand1 by scalar operand2 and stores result in resultant */
SCIP_EXPORT
void SCIPintervalDivScalar(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_Real operand2 /**< second operand of operation */
);
/** computes the scalar product of two vectors of intervals and stores result in resultant */
SCIP_EXPORT
void SCIPintervalScalprod(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
int length, /**< length of vectors */
SCIP_INTERVAL* operand1, /**< first vector as array of intervals */
SCIP_INTERVAL* operand2 /**< second vector as array of intervals */
);
/** computes the scalar product of a vector of intervals and a vector of scalars and stores infimum of result in infimum
* of resultant
*/
SCIP_EXPORT
void SCIPintervalScalprodScalarsInf(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
int length, /**< length of vectors */
SCIP_INTERVAL* operand1, /**< first vector as array of intervals */
SCIP_Real* operand2 /**< second vector as array of scalars; can have +/-inf entries */
);
/** computes the scalar product of a vector of intervals and a vector of scalars and stores supremum of result in supremum
* of resultant
*/
SCIP_EXPORT
void SCIPintervalScalprodScalarsSup(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
int length, /**< length of vectors */
SCIP_INTERVAL* operand1, /**< first vector as array of intervals */
SCIP_Real* operand2 /**< second vector as array of scalars; can have +/-inf entries */
);
/** computes the scalar product of a vector of intervals and a vector of scalars and stores result in resultant */
SCIP_EXPORT
void SCIPintervalScalprodScalars(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
int length, /**< length of vectors */
SCIP_INTERVAL* operand1, /**< first vector as array of intervals */
SCIP_Real* operand2 /**< second vector as array of scalars; can have +/-inf entries */
);
/** squares operand and stores result in resultant */
SCIP_EXPORT
void SCIPintervalSquare(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand /**< operand of operation */
);
/** stores (positive part of) square root of operand in resultant
* @attention we assume a correctly rounded sqrt(double) function when rounding is to nearest
*/
SCIP_EXPORT
void SCIPintervalSquareRoot(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand /**< operand of operation */
);
/** stores operand1 to the power of operand2 in resultant
*
* uses SCIPintervalPowerScalar if operand2 is a scalar, otherwise computes exp(op2*log(op1))
*/
SCIP_EXPORT
void SCIPintervalPower(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** stores operand1 to the power of the scalar operand2 in resultant */
SCIP_EXPORT
void SCIPintervalPowerScalar(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_Real operand2 /**< second operand of operation */
);
/** stores bounds on the power of a scalar operand1 to a scalar operand2 in resultant
* both operands need to be finite numbers
* need to have operand1 >= 0 or operand2 integer and need to have operand2 >= 0 if operand1 == 0
* @attention we assume a correctly rounded pow(double) function when rounding is to nearest
*/
SCIP_EXPORT
void SCIPintervalPowerScalarScalar(
SCIP_INTERVAL* resultant, /**< resultant of operation */
SCIP_Real operand1, /**< first operand of operation */
SCIP_Real operand2 /**< second operand of operation */
);
/** computes lower bound on power of a scalar operand1 to an integer operand2
* both operands need to be finite numbers
* need to have operand1 >= 0 and need to have operand2 >= 0 if operand1 == 0
*/
SCIP_EXPORT
SCIP_Real SCIPintervalPowerScalarIntegerInf(
SCIP_Real operand1, /**< first operand of operation */
int operand2 /**< second operand of operation */
);
/** computes upper bound on power of a scalar operand1 to an integer operand2
* both operands need to be finite numbers
* need to have operand1 >= 0 and need to have operand2 >= 0 if operand1 == 0
*/
SCIP_EXPORT
SCIP_Real SCIPintervalPowerScalarIntegerSup(
SCIP_Real operand1, /**< first operand of operation */
int operand2 /**< second operand of operation */
);
/** computes bounds on power of a scalar operand1 to an integer operand2
* both operands need to be finite numbers
* need to have operand1 >= 0 and need to have operand2 >= 0 if operand1 == 0
*/
SCIP_EXPORT
void SCIPintervalPowerScalarInteger(
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_Real operand1, /**< first operand of operation */
int operand2 /**< second operand of operation */
);
/** given an interval for the image of a power operation, computes an interval for the origin
* that is, for y = x^p with p = exponent a given scalar and y = image a given interval,
* computes a subinterval x of basedomain such that y in x^p and such that for all z in basedomain less x, z^p not in y
*/
SCIP_EXPORT
void SCIPintervalPowerScalarInverse(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL basedomain, /**< domain of base */
SCIP_Real exponent, /**< exponent */
SCIP_INTERVAL image /**< interval image of power */
);
/** stores operand1 to the signed power of the scalar positive operand2 in resultant
*
* the signed power of x w.r.t. an exponent n >= 0 is given as sign(x) * abs(x)^n
*
* @attention we assume correctly rounded sqrt(double) and pow(double) functions when rounding is to nearest
*/
SCIP_EXPORT
void SCIPintervalSignPowerScalar(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_Real operand2 /**< second operand of operation */
);
/** computes the reciprocal of an interval
*/
SCIP_EXPORT
void SCIPintervalReciprocal(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand /**< operand of operation */
);
/** stores exponential of operand in resultant
* @attention we assume a correctly rounded exp(double) function when rounding is to nearest
*/
SCIP_EXPORT
void SCIPintervalExp(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand /**< operand of operation */
);
/** stores natural logarithm of operand in resultant
* @attention we assume a correctly rounded log(double) function when rounding is to nearest
*/
SCIP_EXPORT
void SCIPintervalLog(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand /**< operand of operation */
);
/** stores minimum of operands in resultant */
SCIP_EXPORT
void SCIPintervalMin(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** stores maximum of operands in resultant */
SCIP_EXPORT
void SCIPintervalMax(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand1, /**< first operand of operation */
SCIP_INTERVAL operand2 /**< second operand of operation */
);
/** stores absolute value of operand in resultant */
SCIP_EXPORT
void SCIPintervalAbs(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand /**< operand of operation */
);
/** stores sine value of operand in resultant
* NOTE: the operations are not applied rounding-safe here
*/
SCIP_EXPORT
void SCIPintervalSin(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand /**< operand of operation */
);
/** stores cosine value of operand in resultant
* NOTE: the operations are not applied rounding-safe here
*/
SCIP_EXPORT
void SCIPintervalCos(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand /**< operand of operation */
);
/** stores sign of operand in resultant */
SCIP_EXPORT
void SCIPintervalSign(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL operand /**< operand of operation */
);
/** computes exact upper bound on \f$ a x^2 + b x \f$ for x in [xlb, xub], b an interval, and a scalar
*
* Uses Algorithm 2.2 from Domes and Neumaier: Constraint propagation on quadratic constraints (2008) */
SCIP_EXPORT
SCIP_Real SCIPintervalQuadUpperBound(
SCIP_Real infinity, /**< value for infinity */
SCIP_Real a, /**< coefficient of x^2 */
SCIP_INTERVAL b_, /**< coefficient of x */
SCIP_INTERVAL x /**< range of x */
);
/** stores range of quadratic term in resultant
*
* given scalar a and intervals b and x, computes interval for \f$ a x^2 + b x \f$ */
SCIP_EXPORT
void SCIPintervalQuad(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_Real sqrcoeff, /**< coefficient of x^2 */
SCIP_INTERVAL lincoeff, /**< coefficient of x */
SCIP_INTERVAL xrng /**< range of x */
);
/** computes interval with positive solutions of a quadratic equation with interval coefficients
*
* Given intervals a, b, and c, this function computes an interval that contains all positive solutions of \f$ a x^2 + b x \in c\f$ within xbnds.
*/
SCIP_EXPORT
void SCIPintervalSolveUnivariateQuadExpressionPositive(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL sqrcoeff, /**< coefficient of x^2 */
SCIP_INTERVAL lincoeff, /**< coefficient of x */
SCIP_INTERVAL rhs, /**< right hand side of equation */
SCIP_INTERVAL xbnds /**< bounds on x */
);
/** computes interval with negative solutions of a quadratic equation with interval coefficients
*
* Given intervals a, b, and c, this function computes an interval that contains all negative solutions of \f$ a x^2 + b x \in c\f$ within xbnds.
*/
SCIP_EXPORT
void SCIPintervalSolveUnivariateQuadExpressionNegative(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL sqrcoeff, /**< coefficient of x^2 */
SCIP_INTERVAL lincoeff, /**< coefficient of x */
SCIP_INTERVAL rhs, /**< right hand side of equation */
SCIP_INTERVAL xbnds /**< bounds on x */
);
/** computes positive solutions of a quadratic equation with scalar coefficients
*
* Given scalar a, b, and c, this function computes an interval that contains all positive solutions of \f$ a x^2 + b x \geq c\f$ within xbnds.
* Implements Algorithm 3.2 from Domes and Neumaier: Constraint propagation on quadratic constraints (2008).
*/
SCIP_EXPORT
void SCIPintervalSolveUnivariateQuadExpressionPositiveAllScalar(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_Real sqrcoeff, /**< coefficient of x^2 */
SCIP_Real lincoeff, /**< coefficient of x */
SCIP_Real rhs, /**< right hand side of equation */
SCIP_INTERVAL xbnds /**< bounds on x */
);
/** solves a quadratic equation with interval coefficients
*
* Given intervals a, b and c, this function computes an interval that contains all solutions of \f$ a x^2 + b x \in c\f$ within xbnds
*/
SCIP_EXPORT
void SCIPintervalSolveUnivariateQuadExpression(
SCIP_Real infinity, /**< value for infinity */
SCIP_INTERVAL* resultant, /**< resultant interval of operation */
SCIP_INTERVAL sqrcoeff, /**< coefficient of x^2 */
SCIP_INTERVAL lincoeff, /**< coefficient of x */
SCIP_INTERVAL rhs, /**< right hand side of equation */
SCIP_INTERVAL xbnds /**< bounds on x */
);
/** stores range of bivariate quadratic term in resultant
* given scalars ax, ay, axy, bx, and by and intervals for x and y, computes interval for \f$ ax x^2 + ay y^2 + axy x y + bx x + by y \f$
* NOTE: the operations are not applied rounding-safe here
*/
SCIP_EXPORT
void SCIPintervalQuadBivar(
SCIP_Real infinity, /**< value for infinity in interval arithmetics */
SCIP_INTERVAL* resultant, /**< buffer where to store result of operation */
SCIP_Real ax, /**< square coefficient of x */
SCIP_Real ay, /**< square coefficient of y */
SCIP_Real axy, /**< bilinear coefficients */
SCIP_Real bx, /**< linear coefficient of x */
SCIP_Real by, /**< linear coefficient of y */
SCIP_INTERVAL xbnds, /**< bounds on x */
SCIP_INTERVAL ybnds /**< bounds on y */
);
/** solves a bivariate quadratic equation for the first variable
* given scalars ax, ay, axy, bx and by, and intervals for x, y, and rhs,
* computes \f$ \{ x \in \mathbf{x} : \exists y \in \mathbf{y} : a_x x^2 + a_y y^2 + a_{xy} x y + b_x x + b_y y \in \mathbf{\mbox{rhs}} \} \f$
* NOTE: the operations are not applied rounding-safe here
*/
SCIP_EXPORT
void SCIPintervalSolveBivariateQuadExpressionAllScalar(
SCIP_Real infinity, /**< value for infinity in interval arithmetics */
SCIP_INTERVAL* resultant, /**< buffer where to store result of operation */
SCIP_Real ax, /**< square coefficient of x */
SCIP_Real ay, /**< square coefficient of y */
SCIP_Real axy, /**< bilinear coefficients */
SCIP_Real bx, /**< linear coefficient of x */
SCIP_Real by, /**< linear coefficient of y */
SCIP_INTERVAL rhs, /**< right-hand-side of equation */
SCIP_INTERVAL xbnds, /**< bounds on x */
SCIP_INTERVAL ybnds /**< bounds on y */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file lp.h
* @ingroup INTERNALAPI
* @brief internal methods for LP management
* @author Tobias Achterberg
* @author Marc Pfetsch
* @author Kati Wolter
* @author Gerald Gamrath
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_LP_H__
#define __SCIP_LP_H__
#include <stdio.h>
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_misc.h"
#include "scip/type_lp.h"
#include "scip/type_var.h"
#include "scip/type_prob.h"
#include "scip/type_sol.h"
#include "scip/type_branch.h"
#include "scip/pub_lp.h"
#include "scip/struct_lp.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Column methods
*/
/** creates an LP column */
SCIP_RETCODE SCIPcolCreate(
SCIP_COL** col, /**< pointer to column data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_VAR* var, /**< variable, this column represents */
int len, /**< number of nonzeros in the column */
SCIP_ROW** rows, /**< array with rows of column entries */
SCIP_Real* vals, /**< array with coefficients of column entries */
SCIP_Bool removable /**< should the column be removed from the LP due to aging or cleanup? */
);
/** frees an LP column */
SCIP_RETCODE SCIPcolFree(
SCIP_COL** col, /**< pointer to LP column */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp /**< current LP data */
);
/** output column to file stream */
void SCIPcolPrint(
SCIP_COL* col, /**< LP column */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file /**< output file (or NULL for standard output) */
);
/** adds a previously non existing coefficient to an LP column */
SCIP_RETCODE SCIPcolAddCoef(
SCIP_COL* col, /**< LP column */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_ROW* row, /**< LP row */
SCIP_Real val /**< value of coefficient */
);
/** deletes coefficient from column */
SCIP_RETCODE SCIPcolDelCoef(
SCIP_COL* col, /**< column to be changed */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_ROW* row /**< coefficient to be deleted */
);
/** changes or adds a coefficient to an LP column */
SCIP_RETCODE SCIPcolChgCoef(
SCIP_COL* col, /**< LP column */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_ROW* row, /**< LP row */
SCIP_Real val /**< value of coefficient */
);
/** increases value of an existing or nonexisting coefficient in an LP column */
SCIP_RETCODE SCIPcolIncCoef(
SCIP_COL* col, /**< LP column */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_ROW* row, /**< LP row */
SCIP_Real incval /**< value to add to the coefficient */
);
/** changes objective value of column */
SCIP_RETCODE SCIPcolChgObj(
SCIP_COL* col, /**< LP column to change */
SCIP_SET* set, /**< global SCIP settings */
SCIP_LP* lp, /**< current LP data */
SCIP_Real newobj /**< new objective value */
);
/** changes lower bound of column */
SCIP_RETCODE SCIPcolChgLb(
SCIP_COL* col, /**< LP column to change */
SCIP_SET* set, /**< global SCIP settings */
SCIP_LP* lp, /**< current LP data */
SCIP_Real newlb /**< new lower bound value */
);
/** changes upper bound of column */
SCIP_RETCODE SCIPcolChgUb(
SCIP_COL* col, /**< LP column to change */
SCIP_SET* set, /**< global SCIP settings */
SCIP_LP* lp, /**< current LP data */
SCIP_Real newub /**< new upper bound value */
);
/** calculates the reduced costs of a column using the given dual solution vector */
SCIP_Real SCIPcolCalcRedcost(
SCIP_COL* col, /**< LP column */
SCIP_Real* dualsol /**< dual solution vector for current LP rows */
);
/** gets the reduced costs of a column in last LP or after recalculation */
SCIP_Real SCIPcolGetRedcost(
SCIP_COL* col, /**< LP column */
SCIP_STAT* stat, /**< problem statistics */
SCIP_LP* lp /**< current LP data */
);
/** gets the feasibility of (the dual row of) a column in last LP or after recalculation */
SCIP_Real SCIPcolGetFeasibility(
SCIP_COL* col, /**< LP column */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_LP* lp /**< current LP data */
);
/** calculates the Farkas coefficient y^T A_i of a column i using the given dual Farkas vector y */
SCIP_Real SCIPcolCalcFarkasCoef(
SCIP_COL* col, /**< LP column */
SCIP_Real* dualfarkas /**< dense dual Farkas vector for current LP rows */
);
/** gets the Farkas coefficient y^T A_i of a column i in last LP (which must be infeasible) */
SCIP_Real SCIPcolGetFarkasCoef(
SCIP_COL* col, /**< LP column */
SCIP_STAT* stat, /**< problem statistics */
SCIP_LP* lp /**< current LP data */
);
/** gets the Farkas value of a column in last LP (which must be infeasible), i.e. the Farkas coefficient y^T A_i times
* the best bound for this coefficient, i.e. max{y^T A_i x_i | lb <= x_i <= ub}
*/
SCIP_Real SCIPcolGetFarkasValue(
SCIP_COL* col, /**< LP column */
SCIP_STAT* stat, /**< problem statistics */
SCIP_LP* lp /**< current LP data */
);
/** start strong branching - call before any strong branching */
SCIP_RETCODE SCIPlpStartStrongbranch(
SCIP_LP* lp /**< LP data */
);
/** end strong branching - call after any strong branching */
SCIP_RETCODE SCIPlpEndStrongbranch(
SCIP_LP* lp /**< LP data */
);
/** sets strong branching information for a column variable */
void SCIPcolSetStrongbranchData(
SCIP_COL* col, /**< LP column */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_LP* lp, /**< LP data */
SCIP_Real lpobjval, /**< objective value of the current LP */
SCIP_Real primsol, /**< primal solution value of the column in the current LP */
SCIP_Real sbdown, /**< dual bound after branching column down */
SCIP_Real sbup, /**< dual bound after branching column up */
SCIP_Bool sbdownvalid, /**< is the returned down value a valid dual bound? */
SCIP_Bool sbupvalid, /**< is the returned up value a valid dual bound? */
SCIP_Longint iter, /**< total number of strong branching iterations */
int itlim /**< iteration limit applied to the strong branching call */
);
/** invalidates strong branching information for a column variable */
void SCIPcolInvalidateStrongbranchData(
SCIP_COL* col, /**< LP column */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_LP* lp /**< LP data */
);
/** gets strong branching information on a column variable */
SCIP_RETCODE SCIPcolGetStrongbranch(
SCIP_COL* col, /**< LP column */
SCIP_Bool integral, /**< should integral strong branching be performed? */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_LP* lp, /**< LP data */
int itlim, /**< iteration limit for strong branchings */
SCIP_Bool updatecol, /**< should col be updated, or should it stay in its current state ? */
SCIP_Bool updatestat, /**< should stat be updated, or should it stay in its current state ? */
SCIP_Real* down, /**< stores dual bound after branching column down */
SCIP_Real* up, /**< stores dual bound after branching column up */
SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
* otherwise, it can only be used as an estimate value */
SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
* otherwise, it can only be used as an estimate value */
SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred */
);
/** gets strong branching information on column variables */
SCIP_RETCODE SCIPcolGetStrongbranches(
SCIP_COL** cols, /**< LP columns */
int ncols, /**< number of columns */
SCIP_Bool integral, /**< should integral strong branching be performed? */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_LP* lp, /**< LP data */
int itlim, /**< iteration limit for strong branchings */
SCIP_Real* down, /**< stores dual bounds after branching columns down */
SCIP_Real* up, /**< stores dual bounds after branching columns up */
SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
* otherwise, they can only be used as an estimate value */
SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
* otherwise, they can only be used as an estimate value */
SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred */
);
/** gets last strong branching information available for a column variable;
* returns values of SCIP_INVALID, if strong branching was not yet called on the given column;
* keep in mind, that the returned old values may have nothing to do with the current LP solution
*/
void SCIPcolGetStrongbranchLast(
SCIP_COL* col, /**< LP column */
SCIP_Real* down, /**< stores dual bound after branching column down, or NULL */
SCIP_Real* up, /**< stores dual bound after branching column up, or NULL */
SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
* otherwise, it can only be used as an estimate value */
SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
* otherwise, it can only be used as an estimate value */
SCIP_Real* solval, /**< stores LP solution value of column at last strong branching call, or NULL */
SCIP_Real* lpobjval /**< stores LP objective value at last strong branching call, or NULL */
);
/** if strong branching was already applied on the column at the current node, returns the number of LPs solved after
* the LP where the strong branching on this column was applied;
* if strong branching was not yet applied on the column at the current node, returns INT_MAX
*/
SCIP_Longint SCIPcolGetStrongbranchLPAge(
SCIP_COL* col, /**< LP column */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** marks a column to be not removable from the LP in the current node because it became obsolete */
void SCIPcolMarkNotRemovableLocal(
SCIP_COL* col, /**< LP column */
SCIP_STAT* stat /**< problem statistics */
);
/*
* Row methods
*/
/** creates and captures an LP row */
SCIP_RETCODE SCIProwCreate(
SCIP_ROW** row, /**< pointer to LP row data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
const char* name, /**< name of row */
int len, /**< number of nonzeros in the row */
SCIP_COL** cols, /**< array with columns of row entries */
SCIP_Real* vals, /**< array with coefficients of row entries */
SCIP_Real lhs, /**< left hand side of row */
SCIP_Real rhs, /**< right hand side of row */
SCIP_ROWORIGINTYPE origintype, /**< type of origin of row */
void* origin, /**< pointer to constraint handler or separator who created the row (NULL if unkown) */
SCIP_Bool local, /**< is row only valid locally? */
SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
);
/** frees an LP row */
SCIP_RETCODE SCIProwFree(
SCIP_ROW** row, /**< pointer to LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_LP* lp /**< current LP data */
);
/** output row to file stream */
void SCIProwPrint(
SCIP_ROW* row, /**< LP row */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file /**< output file (or NULL for standard output) */
);
/** ensures, that column array of row can store at least num entries */
SCIP_RETCODE SCIProwEnsureSize(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
int num /**< minimum number of entries to store */
);
/** increases usage counter of LP row */
void SCIProwCapture(
SCIP_ROW* row /**< LP row */
);
/** decreases usage counter of LP row, and frees memory if necessary */
SCIP_RETCODE SCIProwRelease(
SCIP_ROW** row, /**< pointer to LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_LP* lp /**< current LP data */
);
/** enables delaying of row sorting */
void SCIProwDelaySort(
SCIP_ROW* row /**< LP row */
);
/** disables delaying of row sorting, sorts row and merges coefficients with equal columns */
void SCIProwForceSort(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set /**< global SCIP settings */
);
/** adds a previously non existing coefficient to an LP row */
SCIP_RETCODE SCIProwAddCoef(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_COL* col, /**< LP column */
SCIP_Real val /**< value of coefficient */
);
/** deletes coefficient from row */
SCIP_RETCODE SCIProwDelCoef(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_COL* col /**< coefficient to be deleted */
);
/** changes or adds a coefficient to an LP row */
SCIP_RETCODE SCIProwChgCoef(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_COL* col, /**< LP column */
SCIP_Real val /**< value of coefficient */
);
/** increases value of an existing or nonexisting coefficient in an LP column */
SCIP_RETCODE SCIProwIncCoef(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_COL* col, /**< LP column */
SCIP_Real incval /**< value to add to the coefficient */
);
/** changes constant value of a row */
SCIP_RETCODE SCIProwChgConstant(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_Real constant /**< new constant value */
);
/** add constant value to a row */
SCIP_RETCODE SCIProwAddConstant(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_Real addval /**< constant value to add to the row */
);
/** changes left hand side of LP row */
SCIP_RETCODE SCIProwChgLhs(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_Real lhs /**< new left hand side */
);
/** changes right hand side of LP row */
SCIP_RETCODE SCIProwChgRhs(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< current LP data */
SCIP_Real rhs /**< new right hand side */
);
/** changes the local flag of LP row */
SCIP_RETCODE SCIProwChgLocal(
SCIP_ROW* row, /**< LP row */
SCIP_Bool local /**< new value for local flag */
);
/** tries to find a value, such that all row coefficients, if scaled with this value become integral */
SCIP_RETCODE SCIProwCalcIntegralScalar(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
SCIP_Real maxscale, /**< maximal allowed scalar */
SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral */
SCIP_Bool* success /**< stores whether returned value is valid */
);
/** tries to scale row, s.t. all coefficients become integral */
SCIP_RETCODE SCIProwMakeIntegral(
SCIP_ROW* row, /**< LP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_STAT* stat, /**< problem statistics */
SCIP_LP* lp, /**< current LP data */
SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
SCIP_Real maxscale, /**< maximal value to scale row with */
SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
SCIP_Bool* success /**< stores whether row could be made rational */
);
/** recalculates the current activity of a row */
void SCIProwRecalcLPActivity(
SCIP_ROW* row, /**< LP row */
SCIP_STAT* stat /**< problem statistics */
);
/** returns the activity of a row in the current LP solution */
SCIP_Real SCIProwGetLPActivity(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_LP* lp /**< current LP data */
);
/** returns the feasibility of a row in the current LP solution: negative value means infeasibility */
SCIP_Real SCIProwGetLPFeasibility(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_LP* lp /**< current LP data */
);
/** returns the feasibility of a row in the current relaxed solution: negative value means infeasibility */
SCIP_Real SCIProwGetRelaxFeasibility(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics */
);
/** returns the feasibility of a row in the current NLP solution: negative value means infeasibility */
SCIP_Real SCIProwGetNLPFeasibility(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics */
);
/** calculates the current pseudo activity of a row */
void SCIProwRecalcPseudoActivity(
SCIP_ROW* row, /**< row data */
SCIP_STAT* stat /**< problem statistics */
);
/** returns the pseudo activity of a row in the current pseudo solution */
SCIP_Real SCIProwGetPseudoActivity(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics */
);
/** returns the pseudo feasibility of a row in the current pseudo solution: negative value means infeasibility */
SCIP_Real SCIProwGetPseudoFeasibility(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics */
);
/** returns the activity of a row for a given solution */
SCIP_Real SCIProwGetSolActivity(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_SOL* sol /**< primal CIP solution */
);
/** returns the feasibility of a row for the given solution */
SCIP_Real SCIProwGetSolFeasibility(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_SOL* sol /**< primal CIP solution */
);
/** returns the minimal activity of a row w.r.t. the columns' bounds */
SCIP_Real SCIProwGetMinActivity(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics data */
);
/** returns the maximal activity of a row w.r.t. the columns' bounds */
SCIP_Real SCIProwGetMaxActivity(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics data */
);
/** returns whether the row is unmodifiable and redundant w.r.t. the columns' bounds */
SCIP_Bool SCIProwIsRedundant(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics data */
);
/** gets maximal absolute value of row vector coefficients */
SCIP_Real SCIProwGetMaxval(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set /**< global SCIP settings */
);
/** gets minimal absolute value of row vector's non-zero coefficients */
SCIP_Real SCIProwGetMinval(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set /**< global SCIP settings */
);
/** gets maximal column index of row entries */
int SCIProwGetMaxidx(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set /**< global SCIP settings */
);
/** gets minimal column index of row entries */
int SCIProwGetMinidx(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set /**< global SCIP settings */
);
/** gets number of integral columns in row */
int SCIProwGetNumIntCols(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set /**< global SCIP settings */
);
/** returns row's cutoff distance in the direction of the given primal solution */
SCIP_Real SCIProwGetLPSolCutoffDistance(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_SOL* sol, /**< solution to compute direction for cutoff distance; must not be NULL */
SCIP_LP* lp /**< current LP data */
);
/** returns row's efficacy with respect to the current LP solution: e = -feasibility/norm */
SCIP_Real SCIProwGetLPEfficacy(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_LP* lp /**< current LP data */
);
/** returns whether the row's efficacy with respect to the current LP solution is greater than the minimal cut efficacy */
SCIP_Bool SCIProwIsLPEfficacious(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_LP* lp, /**< current LP data */
SCIP_Bool root /**< should the root's minimal cut efficacy be used? */
);
/** returns row's efficacy with respect to the given primal solution: e = -feasibility/norm */
SCIP_Real SCIProwGetSolEfficacy(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_SOL* sol /**< primal CIP solution */
);
/** returns whether the row's efficacy with respect to the given primal solution is greater than the minimal cut
* efficacy
*/
SCIP_Bool SCIProwIsSolEfficacious(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_SOL* sol, /**< primal CIP solution */
SCIP_Bool root /**< should the root's minimal cut efficacy be used? */
);
/** returns row's efficacy with respect to the relaxed solution: e = -feasibility/norm */
SCIP_Real SCIProwGetRelaxEfficacy(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics data */
);
/** returns row's efficacy with respect to the NLP solution: e = -feasibility/norm */
SCIP_Real SCIProwGetNLPEfficacy(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics data */
);
/** gets parallelism of row with objective function: if the returned value is 1, the row is parallel to the objective
* function, if the value is 0, it is orthogonal to the objective function
*/
SCIP_Real SCIProwGetObjParallelism(
SCIP_ROW* row, /**< LP row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_LP* lp /**< current LP data */
);
/** includes event handler with given data in row's event filter */
SCIP_RETCODE SCIProwCatchEvent(
SCIP_ROW* row, /**< row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTTYPE eventtype, /**< event type to catch */
SCIP_EVENTHDLR* eventhdlr, /**< event handler to call for the event processing */
SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler for the event processing */
int* filterpos /**< pointer to store position of event filter entry, or NULL */
);
/** deletes event handler with given data from row's event filter */
SCIP_RETCODE SCIProwDropEvent(
SCIP_ROW* row, /**< row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
SCIP_EVENTHDLR* eventhdlr, /**< event handler to call for the event processing */
SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler for the event processing */
int filterpos /**< position of event filter entry returned by SCIPvarCatchEvent(), or -1 */
);
/** marks a row to be not removable from the LP in the current node */
void SCIProwMarkNotRemovableLocal(
SCIP_ROW* row, /**< LP row */
SCIP_STAT* stat /**< problem statistics */
);
/*
* LP methods
*/
/** creates empty LP data object */
SCIP_RETCODE SCIPlpCreate(
SCIP_LP** lp, /**< pointer to LP data object */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_STAT* stat, /**< problem statistics */
const char* name /**< problem name */
);
/** frees LP data object */
SCIP_RETCODE SCIPlpFree(
SCIP_LP** lp, /**< pointer to LP data object */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter /**< global event filter */
);
/** resets the LP to the empty LP by removing all columns and rows from LP, releasing all rows, and flushing the
* changes to the LP solver
*/
SCIP_RETCODE SCIPlpReset(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter /**< global event filter */
);
/** adds a column to the LP and captures the variable */
SCIP_RETCODE SCIPlpAddCol(
SCIP_LP* lp, /**< LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_COL* col, /**< LP column */
int depth /**< depth in the tree where the column addition is performed */
);
/** adds a row to the LP and captures it */
SCIP_RETCODE SCIPlpAddRow(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter, /**< global event filter */
SCIP_ROW* row, /**< LP row */
int depth /**< depth in the tree where the row addition is performed */
);
/** removes all columns after the given number of columns from the LP */
SCIP_RETCODE SCIPlpShrinkCols(
SCIP_LP* lp, /**< LP data */
SCIP_SET* set, /**< global SCIP settings */
int newncols /**< new number of columns in the LP */
);
/** removes and releases all rows after the given number of rows from the LP */
SCIP_RETCODE SCIPlpShrinkRows(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter, /**< global event filter */
int newnrows /**< new number of rows in the LP */
);
/** removes all columns and rows from LP, releases all rows */
SCIP_RETCODE SCIPlpClear(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter /**< global event filter */
);
/** remembers number of columns and rows to track the newly added ones */
void SCIPlpMarkSize(
SCIP_LP* lp /**< current LP data */
);
/** sets the remembered number of columns and rows to the given values */
void SCIPlpSetSizeMark(
SCIP_LP* lp, /**< current LP data */
int nrows, /**< number of rows to set the size marker to */
int ncols /**< number of columns to set the size marker to */
);
/** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1 */
SCIP_RETCODE SCIPlpGetBasisInd(
SCIP_LP* lp, /**< LP data */
int* basisind /**< pointer to store basis indices ready to keep number of rows entries */
);
/** gets current basis status for columns and rows; arrays must be large enough to store the basis status */
SCIP_RETCODE SCIPlpGetBase(
SCIP_LP* lp, /**< LP data */
int* cstat, /**< array to store column basis status, or NULL */
int* rstat /**< array to store row basis status, or NULL */
);
/** gets a row from the inverse basis matrix B^-1 */
SCIP_RETCODE SCIPlpGetBInvRow(
SCIP_LP* lp, /**< LP data */
int r, /**< row number */
SCIP_Real* coef, /**< pointer to store the coefficients of the row */
int* inds, /**< array to store the non-zero indices, or NULL */
int* ninds /**< pointer to store the number of non-zero indices, or NULL
* (-1: if we do not store sparsity informations) */
);
/** gets a column from the inverse basis matrix B^-1 */
SCIP_RETCODE SCIPlpGetBInvCol(
SCIP_LP* lp, /**< LP data */
int c, /**< column number of B^-1; this is NOT the number of the column in the LP
* returned by SCIPcolGetLPPos(); you have to call SCIPgetBasisInd()
* to get the array which links the B^-1 column numbers to the row and
* column numbers of the LP! c must be between 0 and nrows-1, since the
* basis has the size nrows * nrows */
SCIP_Real* coef, /**< pointer to store the coefficients of the column */
int* inds, /**< array to store the non-zero indices, or NULL */
int* ninds /**< pointer to store the number of non-zero indices, or NULL
* (-1: if we do not store sparsity informations) */
);
/** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A) */
SCIP_RETCODE SCIPlpGetBInvARow(
SCIP_LP* lp, /**< LP data */
int r, /**< row number */
SCIP_Real* binvrow, /**< row in B^-1 from prior call to SCIPlpGetBInvRow(), or NULL */
SCIP_Real* coef, /**< pointer to store the coefficients of the row */
int* inds, /**< array to store the non-zero indices, or NULL */
int* ninds /**< pointer to store the number of non-zero indices, or NULL
* (-1: if we do not store sparsity informations) */
);
/** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A),
* i.e., it computes B^-1 * A_c with A_c being the c'th column of A
*/
SCIP_RETCODE SCIPlpGetBInvACol(
SCIP_LP* lp, /**< LP data */
int c, /**< column number which can be accessed by SCIPcolGetLPPos() */
SCIP_Real* coef, /**< pointer to store the coefficients of the column */
int* inds, /**< array to store the non-zero indices, or NULL */
int* ninds /**< pointer to store the number of non-zero indices, or NULL
* (-1: if we do not store sparsity informations) */
);
/** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding
* LP row are swapped in the summation
*/
SCIP_RETCODE SCIPlpSumRows(
SCIP_LP* lp, /**< LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob, /**< problem data */
SCIP_Real* weights, /**< row weights in row summation */
SCIP_REALARRAY* sumcoef, /**< array to store sum coefficients indexed by variables' probindex */
SCIP_Real* sumlhs, /**< pointer to store the left hand side of the row summation */
SCIP_Real* sumrhs /**< pointer to store the right hand side of the row summation */
);
/* calculates a MIR cut out of the weighted sum of LP rows; The weights of modifiable rows are set to 0.0, because these
* rows cannot participate in a MIR cut.
*/
SCIP_RETCODE SCIPlpCalcMIR(
SCIP_LP* lp, /**< LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_SOL* sol, /**< the solution that should be separated, or NULL for LP solution */
SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
SCIP_Bool usevbds, /**< should variable bounds be used in bound transformation? */
SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
SCIP_Bool fixintegralrhs, /**< should complementation tried to be adjusted such that rhs gets fractional? */
int* boundsfortrans, /**< bounds that should be used for transformed variables: vlb_idx/vub_idx,
* -1 for global lb/ub, -2 for local lb/ub, or -3 for using closest bound;
* NULL for using closest bound for all variables */
SCIP_BOUNDTYPE* boundtypesfortrans, /**< type of bounds that should be used for transformed variables;
* NULL for using closest bound for all variables */
int maxmksetcoefs, /**< maximal number of nonzeros allowed in aggregated base inequality */
SCIP_Real maxweightrange, /**< maximal valid range max(|weights|)/min(|weights|) of row weights */
SCIP_Real minfrac, /**< minimal fractionality of rhs to produce MIR cut for */
SCIP_Real maxfrac, /**< maximal fractionality of rhs to produce MIR cut for */
SCIP_Real* weights, /**< row weights in row summation */
SCIP_Real maxweight, /**< largest magnitude of weights; set to -1 if sparsity information is unknown */
int* weightinds, /**< sparsity pattern of weights; size nrowinds; NULL if sparsity info is unknown */
int nweightinds, /**< number of nonzeros in weights; -1 if rowinds is NULL */
int rowlensum, /**< total number of non-zeros in used rows (row associated with nonzero weight coefficient); -1 if unknown */
int* sidetypes, /**< specify row side type (-1 = lhs, 0 = unkown, 1 = rhs) or NULL for automatic choices */
SCIP_Real scale, /**< additional scaling factor multiplied to all rows */
SCIP_Real* mksetcoefs, /**< array to store mixed knapsack set coefficients: size nvars; or NULL */
SCIP_Bool* mksetcoefsvalid, /**< pointer to store whether mixed knapsack set coefficients are valid; or NULL */
SCIP_Real* mircoef, /**< array to store MIR coefficients: must be of size nvars */
SCIP_Real* mirrhs, /**< pointer to store the right hand side of the MIR row */
SCIP_Real* cutactivity, /**< pointer to store the activity of the resulting cut */
SCIP_Bool* success, /**< pointer to store whether the returned coefficients are a valid MIR cut */
SCIP_Bool* cutislocal, /**< pointer to store whether the returned cut is only valid locally */
int* cutrank /**< pointer to store the rank of the returned cut; or NULL */
);
/* calculates a strong CG cut out of the weighted sum of LP rows; The weights of modifiable rows are set to 0.0, because
* these rows cannot participate in a strong CG cut.
*/
SCIP_RETCODE SCIPlpCalcStrongCG(
SCIP_LP* lp, /**< LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
SCIP_Bool usevbds, /**< should variable bounds be used in bound transformation? */
SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
int maxmksetcoefs, /**< maximal number of nonzeros allowed in aggregated base inequality */
SCIP_Real maxweightrange, /**< maximal valid range max(|weights|)/min(|weights|) of row weights */
SCIP_Real minfrac, /**< minimal fractionality of rhs to produce strong CG cut for */
SCIP_Real maxfrac, /**< maximal fractionality of rhs to produce strong CG cut for */
SCIP_Real* weights, /**< row weights in row summation */
int* rowinds, /**< array to store indices of non-zero entries of the weights array, or
* NULL */
int nrowinds, /**< number of non-zero entries in weights array, -1 if rowinds is NULL */
SCIP_Real scale, /**< additional scaling factor multiplied to all rows */
SCIP_Real* strongcgcoef, /**< array to store strong CG coefficients: must be of size nvars */
SCIP_Real* strongcgrhs, /**< pointer to store the right hand side of the strong CG row */
SCIP_Real* cutactivity, /**< pointer to store the activity of the resulting cut */
SCIP_Bool* success, /**< pointer to store whether the returned coefficients are a valid strong CG cut */
SCIP_Bool* cutislocal, /**< pointer to store whether the returned cut is only valid locally */
int* cutrank /**< pointer to store the rank of the returned cut; or NULL */
);
/** stores LP state (like basis information) into LP state object */
SCIP_RETCODE SCIPlpGetState(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_LPISTATE** lpistate /**< pointer to LP state information (like basis information) */
);
/** loads LP state (like basis information) into solver */
SCIP_RETCODE SCIPlpSetState(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LPISTATE* lpistate, /**< LP state information (like basis information) */
SCIP_Bool wasprimfeas, /**< primal feasibility when LP state information was stored */
SCIP_Bool wasprimchecked, /**< true if the LP solution has passed the primal feasibility check */
SCIP_Bool wasdualfeas, /**< dual feasibility when LP state information was stored */
SCIP_Bool wasdualchecked /**< true if the LP solution has passed the dual feasibility check */
);
/** frees LP state information */
SCIP_RETCODE SCIPlpFreeState(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_LPISTATE** lpistate /**< pointer to LP state information (like basis information) */
);
/** stores pricing norms into LP norms object */
SCIP_RETCODE SCIPlpGetNorms(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_LPINORMS** lpinorms /**< pointer to LP pricing norms information */
);
/** loads pricing norms from LP norms object into solver */
SCIP_RETCODE SCIPlpSetNorms(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_LPINORMS* lpinorms /**< LP pricing norms information */
);
/** frees pricing norms information */
SCIP_RETCODE SCIPlpFreeNorms(
SCIP_LP* lp, /**< LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_LPINORMS** lpinorms /**< pointer to LP pricing norms information */
);
/** return the current cutoff bound of the lp */
SCIP_Real SCIPlpGetCutoffbound(
SCIP_LP* lp /**< current LP data */
);
/** sets the upper objective limit of the LP solver */
SCIP_RETCODE SCIPlpSetCutoffbound(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob, /**< problem data */
SCIP_Real cutoffbound /**< new upper objective limit */
);
/** gets current primal feasibility tolerance of LP solver */
SCIP_Real SCIPlpGetFeastol(
SCIP_LP* lp /**< current LP data */
);
/** sets primal feasibility tolerance of LP solver */
void SCIPlpSetFeastol(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Real newfeastol /**< new primal feasibility tolerance for LP */
);
/** resets primal feasibility tolerance of LP solver
*
* Sets primal feasibility tolerance to min of numerics/lpfeastolfactor * numerics/feastol and relaxfeastol.
*/
void SCIPlpResetFeastol(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set /**< global SCIP settings */
);
/** applies all cached changes to the LP solver */
SCIP_RETCODE SCIPlpFlush(
SCIP_LP* lp, /**< current LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue /**< event queue */
);
/** marks the LP to be flushed, even if the LP thinks it is not flushed */
SCIP_RETCODE SCIPlpMarkFlushed(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set /**< global SCIP settings */
);
/** solves the LP with simplex algorithm, and copy the solution into the column's data */
SCIP_RETCODE SCIPlpSolveAndEval(
SCIP_LP* lp, /**< LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter, /**< global event filter */
SCIP_PROB* prob, /**< problem data */
SCIP_Longint itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
SCIP_Bool limitresolveiters, /**< should LP iterations for resolving calls be limited?
* (limit is computed within the method w.r.t. the average LP iterations) */
SCIP_Bool aging, /**< should aging and removal of obsolete cols/rows be applied? */
SCIP_Bool keepsol, /**< should the old LP solution be kept if no iterations were performed? */
SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred */
);
/** gets solution status of current LP */
SCIP_LPSOLSTAT SCIPlpGetSolstat(
SCIP_LP* lp /**< current LP data */
);
/** sets whether the root LP is a relaxation of the problem and its optimal objective value is a global lower bound */
void SCIPlpSetRootLPIsRelax(
SCIP_LP* lp, /**< LP data */
SCIP_Bool isrelax /**< is the root lp a relaxation of the problem? */
);
/** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound */
SCIP_Bool SCIPlpIsRootLPRelax(
SCIP_LP* lp /**< LP data */
);
/** gets objective value of current LP
*
* @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible
* if a limit was hit during solving. It must not be used as a dual bound if the LP solution status is
* SCIP_LPSOLSTAT_ITERLIMIT or SCIP_LPSOLSTAT_TIMELIMIT.
*/
SCIP_Real SCIPlpGetObjval(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob /**< problem data */
);
/** gets part of objective value of current LP that results from COLUMN variables only */
SCIP_Real SCIPlpGetColumnObjval(
SCIP_LP* lp /**< current LP data */
);
/** gets part of objective value of current LP that results from LOOSE variables only */
SCIP_Real SCIPlpGetLooseObjval(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob /**< problem data */
);
/** remembers the current LP objective value as root solution value */
void SCIPlpStoreRootObjval(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob /**< problem data */
);
/** invalidates the root LP solution value */
void SCIPlpInvalidateRootObjval(
SCIP_LP* lp /**< current LP data */
);
/** gets the global pseudo objective value; that is all variables set to their best (w.r.t. the objective function)
* global bound
*/
SCIP_Real SCIPlpGetGlobalPseudoObjval(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob /**< problem data */
);
/** recomputes local and global pseudo objective values */
void SCIPlpRecomputeLocalAndGlobalPseudoObjval(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob /**< problem data */
);
/** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
* objective function) local bound
*/
SCIP_Real SCIPlpGetPseudoObjval(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob /**< problem data */
);
/** gets pseudo objective value, if a bound of the given variable would be modified in the given way */
SCIP_Real SCIPlpGetModifiedPseudoObjval(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROB* prob, /**< problem data */
SCIP_VAR* var, /**< problem variable */
SCIP_Real oldbound, /**< old value for bound */
SCIP_Real newbound, /**< new value for bound */
SCIP_BOUNDTYPE boundtype /**< type of bound: lower or upper bound */
);
/** gets pseudo objective value, if a bound of the given variable would be modified in the given way;
* perform calculations with interval arithmetic to get an exact lower bound
*/
SCIP_Real SCIPlpGetModifiedProvedPseudoObjval(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< problem variable */
SCIP_Real oldbound, /**< old value for bound */
SCIP_Real newbound, /**< new value for bound */
SCIP_BOUNDTYPE boundtype /**< type of bound: lower or upper bound */
);
/** updates current pseudo and loose objective value for a change in a variable's objective value */
SCIP_RETCODE SCIPlpUpdateVarObj(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< problem variable that changed */
SCIP_Real oldobj, /**< old objective value of variable */
SCIP_Real newobj /**< new objective value of variable */
);
/** updates current root pseudo objective value for a global change in a variable's lower bound */
SCIP_RETCODE SCIPlpUpdateVarLbGlobal(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< problem variable that changed */
SCIP_Real oldlb, /**< old lower bound of variable */
SCIP_Real newlb /**< new lower bound of variable */
);
/** updates current pseudo and loose objective value for a change in a variable's lower bound */
SCIP_RETCODE SCIPlpUpdateVarLb(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< problem variable that changed */
SCIP_Real oldlb, /**< old lower bound of variable */
SCIP_Real newlb /**< new lower bound of variable */
);
/** updates current root pseudo objective value for a global change in a variable's upper bound */
SCIP_RETCODE SCIPlpUpdateVarUbGlobal(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< problem variable that changed */
SCIP_Real oldub, /**< old upper bound of variable */
SCIP_Real newub /**< new upper bound of variable */
);
/** updates current pseudo objective value for a change in a variable's upper bound */
SCIP_RETCODE SCIPlpUpdateVarUb(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var, /**< problem variable that changed */
SCIP_Real oldub, /**< old upper bound of variable */
SCIP_Real newub /**< new upper bound of variable */
);
/** informs LP, that given variable was added to the problem */
SCIP_RETCODE SCIPlpUpdateAddVar(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var /**< variable that is now a LOOSE problem variable */
);
/** informs LP, that given variable is to be deleted from the problem */
SCIP_RETCODE SCIPlpUpdateDelVar(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var /**< variable that will be deleted from the problem */
);
/** informs LP, that given formerly loose problem variable is now a column variable */
SCIP_RETCODE SCIPlpUpdateVarColumn(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var /**< problem variable that changed from LOOSE to COLUMN */
);
/** informs LP, that given formerly column problem variable is now again a loose variable */
SCIP_RETCODE SCIPlpUpdateVarLoose(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var /**< problem variable that changed from COLUMN to LOOSE */
);
/** decrease the number of loose variables by one */
void SCIPlpDecNLoosevars(
SCIP_LP* lp /**< current LP data */
);
/** stores the LP solution in the columns and rows */
SCIP_RETCODE SCIPlpGetSol(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_Bool* primalfeasible, /**< pointer to store whether the solution is primal feasible, or NULL */
SCIP_Bool* dualfeasible /**< pointer to store whether the solution is dual feasible, or NULL */
);
/** stores LP solution with infinite objective value in the columns and rows */
SCIP_RETCODE SCIPlpGetUnboundedSol(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_Bool* primalfeasible, /**< pointer to store whether the solution is primal feasible, or NULL */
SCIP_Bool* rayfeasible /**< pointer to store whether the primal ray is a feasible unboundedness proof, or NULL */
);
/** returns primal ray proving the unboundedness of the current LP */
SCIP_RETCODE SCIPlpGetPrimalRay(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Real* ray /**< array for storing primal ray values, they are stored w.r.t. the problem index of the variables,
* so the size of this array should be at least number of active variables
* (all entries have to be initialized to 0 before) */
);
/** stores the dual Farkas multipliers for infeasibility proof in rows. besides, the proof is checked for validity if
* lp/checkfarkas = TRUE.
*
* @note the check will not be performed if @p valid is NULL.
*/
SCIP_RETCODE SCIPlpGetDualfarkas(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_Bool* valid /**< pointer to store whether the Farkas proof is valid or NULL */
);
/** get number of iterations used in last LP solve */
SCIP_RETCODE SCIPlpGetIterations(
SCIP_LP* lp, /**< current LP data */
int* iterations /**< pointer to store the iteration count */
);
/** increases age of columns with solution value 0.0 and rows with activity not at its bounds,
* resets age of non-zero columns and sharp rows
*/
SCIP_RETCODE SCIPlpUpdateAges(
SCIP_LP* lp, /**< current LP data */
SCIP_STAT* stat /**< problem statistics */
);
/** removes all non-basic columns and basic rows in the part of the LP created at the current node, that are too old */
SCIP_RETCODE SCIPlpRemoveNewObsoletes(
SCIP_LP* lp, /**< current LP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter /**< global event filter */
);
/** removes all non-basic columns and basic rows in whole LP, that are too old */
SCIP_RETCODE SCIPlpRemoveAllObsoletes(
SCIP_LP* lp, /**< current LP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter /**< global event filter */
);
/** removes all non-basic columns at 0.0 and basic rows in the part of the LP created at the current node */
SCIP_RETCODE SCIPlpCleanupNew(
SCIP_LP* lp, /**< current LP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter, /**< global event filter */
SCIP_Bool root /**< are we at the root node? */
);
/** removes all non-basic columns at 0.0 and basic rows in the whole LP */
SCIP_RETCODE SCIPlpCleanupAll(
SCIP_LP* lp, /**< current LP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter, /**< global event filter */
SCIP_Bool root /**< are we at the root node? */
);
/** removes all redundant rows that were added at the current node */
SCIP_RETCODE SCIPlpRemoveRedundantRows(
SCIP_LP* lp, /**< current LP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter /**< global event filter */
);
/** initiates LP diving */
SCIP_RETCODE SCIPlpStartDive(
SCIP_LP* lp, /**< current LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics */
);
/** quits LP diving and resets bounds and objective values of columns to the current node's values */
SCIP_RETCODE SCIPlpEndDive(
SCIP_LP* lp, /**< current LP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_EVENTFILTER* eventfilter, /**< global event filter */
SCIP_PROB* prob, /**< problem data */
SCIP_VAR** vars, /**< array with all active variables */
int nvars /**< number of active variables */
);
/** records a current row side such that any change will be undone after diving */
SCIP_RETCODE SCIPlpRecordOldRowSideDive(
SCIP_LP* lp, /**< LP data object */
SCIP_ROW* row, /**< row affected by the change */
SCIP_SIDETYPE sidetype /**< side type */
);
/** informs the LP that probing mode was initiated */
SCIP_RETCODE SCIPlpStartProbing(
SCIP_LP* lp /**< current LP data */
);
/** informs the LP that probing mode was finished */
SCIP_RETCODE SCIPlpEndProbing(
SCIP_LP* lp /**< current LP data */
);
/** informs the LP that the probing mode is now used for strongbranching */
void SCIPlpStartStrongbranchProbing(
SCIP_LP* lp /**< current LP data */
);
/** informs the LP that the probing mode is not used for strongbranching anymore */
void SCIPlpEndStrongbranchProbing(
SCIP_LP* lp /**< current LP data */
);
/** gets proven lower (dual) bound of last LP solution */
SCIP_RETCODE SCIPlpGetProvedLowerbound(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Real* bound /**< pointer to store proven dual bound */
);
/** gets proven dual bound of last LP solution */
SCIP_RETCODE SCIPlpIsInfeasibilityProved(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool* proved /**< pointer to store whether infeasibility is proven */
);
/** writes LP to a file */
SCIP_RETCODE SCIPlpWrite(
SCIP_LP* lp, /**< current LP data */
const char* fname /**< file name */
);
/** writes MIP to a file */
SCIP_RETCODE SCIPlpWriteMip(
SCIP_LP* lp, /**< current LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* fname, /**< file name */
SCIP_Bool genericnames, /**< should generic names like x_i and row_j be used in order to avoid
* troubles with reserved symbols? */
SCIP_Bool origobj, /**< should the original objective function be used? */
SCIP_OBJSENSE objsense, /**< objective sense */
SCIP_Real objscale, /**< objective scaling factor */
SCIP_Real objoffset, /**< objective offset, e.g., caused by variable fixings in presolving */
SCIP_Bool lazyconss /**< output removable rows as lazy constraints? */
);
/** recalculates Euclidean norm of objective function vector of column variables if it have gotten unreliable during calculation */
void SCIPlpRecalculateObjSqrNorm(
SCIP_SET* set, /**< global SCIP settings */
SCIP_LP* lp /**< LP data */
);
/** compute relative interior point */
SCIP_RETCODE SCIPlpComputeRelIntPoint(
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_LP* lp, /**< LP data */
SCIP_PROB* prob, /**< problem data */
SCIP_Bool relaxrows, /**< should the rows be relaxed */
SCIP_Bool inclobjcutoff, /**< should a row for the objective cutoff be included */
SCIP_Real timelimit, /**< time limit for LP solver */
int iterlimit, /**< iteration limit for LP solver */
SCIP_Real* point, /**< array to store relative interior point on exit */
SCIP_Bool* success /**< buffer to indicate whether interior point was successfully computed */
);
/** computes the changes to the problem when fixing to the optimal face
*
* returns the degeneracy rate, i.e., the number of nonbasic variables with reduced cost 0
* and the variable constraint ratio, i.e., the number of unfixed variables in relation to the basis size
*/
SCIP_RETCODE SCIPlpGetDegeneracy(
SCIP_LP* lp, /**< LP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_Real* degeneracy, /**< pointer to store degeneracy share */
SCIP_Real* varconsratio /**< pointer to store variable constraint ratio */
);
/** gets array with columns of the LP */
SCIP_COL** SCIPlpGetCols(
SCIP_LP* lp /**< current LP data */
);
/** gets current number of columns in LP */
int SCIPlpGetNCols(
SCIP_LP* lp /**< current LP data */
);
/** gets array with rows of the LP */
SCIP_ROW** SCIPlpGetRows(
SCIP_LP* lp /**< current LP data */
);
/** gets current number of rows in LP */
int SCIPlpGetNRows(
SCIP_LP* lp /**< current LP data */
);
/** gets array with newly added columns after the last mark */
SCIP_COL** SCIPlpGetNewcols(
SCIP_LP* lp /**< current LP data */
);
/** gets number of newly added columns after the last mark */
int SCIPlpGetNNewcols(
SCIP_LP* lp /**< current LP data */
);
/** gets array with newly added rows after the last mark */
SCIP_ROW** SCIPlpGetNewrows(
SCIP_LP* lp /**< current LP data */
);
/** gets number of newly added rows after the last mark */
int SCIPlpGetNNewrows(
SCIP_LP* lp /**< current LP data */
);
/** gets Euclidean norm of objective function vector of column variables, only use this method if
* lp->objsqrnormunreliable == FALSE, so probably you have to call SCIPlpRecalculateObjSqrNorm before */
SCIP_Real SCIPlpGetObjNorm(
SCIP_LP* lp /**< LP data */
);
/** gets the objective value of the root node LP; returns SCIP_INVALID if the root node LP was not (yet) solved */
SCIP_Real SCIPlpGetRootObjval(
SCIP_LP* lp /**< LP data */
);
/** gets part of the objective value of the root node LP that results from COLUMN variables only;
* returns SCIP_INVALID if the root node LP was not (yet) solved
*/
SCIP_Real SCIPlpGetRootColumnObjval(
SCIP_LP* lp /**< LP data */
);
/** gets part of the objective value of the root node LP that results from LOOSE variables only;
* returns SCIP_INVALID if the root node LP was not (yet) solved
*/
SCIP_Real SCIPlpGetRootLooseObjval(
SCIP_LP* lp /**< LP data */
);
/** gets the LP solver interface */
SCIP_LPI* SCIPlpGetLPI(
SCIP_LP* lp /**< current LP data */
);
/** sets whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound */
void SCIPlpSetIsRelax(
SCIP_LP* lp, /**< LP data */
SCIP_Bool relax /**< is the current lp a relaxation? */
);
/** returns whether the current LP is a relaxation of the problem for which it has been solved and its
* solution value a valid local lower bound?
*/
SCIP_Bool SCIPlpIsRelax(
SCIP_LP* lp /**< LP data */
);
/** returns whether the current LP is flushed and solved */
SCIP_Bool SCIPlpIsSolved(
SCIP_LP* lp /**< current LP data */
);
/** return whether the current LP solution passed the primal feasibility check */
SCIP_Bool SCIPlpIsPrimalReliable(
SCIP_LP* lp /**< current LP data */
);
/** return whether the current LP solution passed the dual feasibility check */
SCIP_Bool SCIPlpIsDualReliable(
SCIP_LP* lp /**< current LP data */
);
/** returns whether the current LP solution is a basic solution */
SCIP_Bool SCIPlpIsSolBasic(
SCIP_LP* lp /**< current LP data */
);
/** returns whether the LP is in diving mode */
SCIP_Bool SCIPlpDiving(
SCIP_LP* lp /**< current LP data */
);
/** returns whether the LP is in diving mode and the objective value of at least one column was changed */
SCIP_Bool SCIPlpDivingObjChanged(
SCIP_LP* lp /**< current LP data */
);
/** marks the diving LP to have a changed objective function */
void SCIPlpMarkDivingObjChanged(
SCIP_LP* lp /**< current LP data */
);
/** marks the diving LP to not have a changed objective function anymore */
void SCIPlpUnmarkDivingObjChanged(
SCIP_LP* lp /**< current LP data */
);
/* returns TRUE if at least one left/right hand side of an LP row was changed during diving mode */
SCIP_Bool SCIPlpDivingRowsChanged(
SCIP_LP* lp /**< current LP data */
);
#ifdef NDEBUG
/* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
* speed up the algorithms.
*/
#define SCIPlpGetCols(lp) ((lp)->cols)
#define SCIPlpGetNCols(lp) ((lp)->ncols)
#define SCIPlpGetRows(lp) ((lp)->rows)
#define SCIPlpGetNRows(lp) ((lp)->nrows)
#define SCIPlpGetNewcols(lp) (&((lp)->cols[(lp)->firstnewcol]))
#define SCIPlpGetNNewcols(lp) ((lp)->ncols - (lp)->firstnewcol)
#define SCIPlpGetNewrows(lp) (&((lp)->rows[(lp)->firstnewrow]))
#define SCIPlpGetNNewrows(lp) ((lp)->nrows - (lp)->firstnewrow)
#define SCIPlpGetObjNorm(lp) (SQRT((lp)->objsqrnorm))
#define SCIPlpGetRootObjval(lp) (MIN((lp)->rootlpobjval + (lp)->rootlooseobjval, SCIP_INVALID))
#define SCIPlpGetRootColumnObjval(lp) ((lp)->rootlpobjval)
#define SCIPlpGetRootLooseObjval(lp) ((lp)->rootlooseobjval)
#define SCIPlpGetLPI(lp) (lp)->lpi
#define SCIPlpSetIsRelax(lp,relax) ((lp)->isrelax = relax)
#define SCIPlpIsRelax(lp) (lp)->isrelax
#define SCIPlpIsSolved(lp) ((lp)->flushed && (lp)->solved)
#define SCIPlpIsSolBasic(lp) ((lp)->solisbasic)
#define SCIPlpDiving(lp) (lp)->diving
#define SCIPlpDivingObjChanged(lp) (lp)->divingobjchg
#define SCIPlpMarkDivingObjChanged(lp) ((lp)->divingobjchg = TRUE)
#define SCIPlpUnmarkDivingObjChanged(lp) ((lp)->divingobjchg = FALSE)
#define SCIPlpDivingRowsChanged(lp) ((lp)->ndivechgsides > 0)
#endif
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file mem.h
* @ingroup INTERNALAPI
* @brief methods for block memory pools and memory buffers
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_MEM_H__
#define __SCIP_MEM_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_mem.h"
#include "scip/struct_mem.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates block and buffer memory structures */
SCIP_RETCODE SCIPmemCreate(
SCIP_MEM** mem /**< pointer to block and buffer memory structure */
);
/** frees block and buffer memory structures */
SCIP_RETCODE SCIPmemFree(
SCIP_MEM** mem /**< pointer to block and buffer memory structure */
);
/** returns the total number of bytes used in block and buffer memory */
SCIP_Longint SCIPmemGetUsed(
SCIP_MEM* mem /**< pointer to block and buffer memory structure */
);
/** returns the total number of bytes in block and buffer memory */
SCIP_Longint SCIPmemGetTotal(
SCIP_MEM* mem /**< pointer to block and buffer memory structure */
);
/** returns the maximal number of used bytes in block memory */
SCIP_Longint SCIPmemGetUsedBlockmemoryMax(
SCIP_MEM* mem /**< pointer to block and buffer memory structure */
);
/** returns the maximal number of allocated but not used bytes in block memory */
SCIP_Longint SCIPmemGetUnusedBlockmemoryMax(
SCIP_MEM* mem /**< pointer to block and buffer memory structure */
);
/** returns the maximal number of allocated bytes in block memory */
SCIP_Longint SCIPmemGetAllocatedBlockmemoryMax(
SCIP_MEM* mem /**< pointer to block and buffer memory structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file message.h
* @ingroup INTERNALAPI
* @brief message output methods
* @author Tobias Achterberg
*
* Because the message functions are implemented as defines with more than one
* function call, they shouldn't be used as a single statement like in:
* if( error )
* SCIPerrorMessage("an error occured");
* because this would produce the following macro extension:
* if( error )
* printf(("[%s:%d] ERROR: ", __FILE__, __LINE__);
* printf(("an error occured");
* Instead, they should be protected with brackets:
* if( error )
* {
* SCIPerrorMessage("an error occured");
* }
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_MESSAGE_H__
#define __SCIP_MESSAGE_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file message_default.h
* @ingroup PUBLICMETHODS
* @brief default message handler
* @author Stefan Heinz
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_MESSAGE_DEFAULT_H__
#define __SCIP_MESSAGE_DEFAULT_H__
#include "scip/def.h"
#include "scip/type_message.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Create default message handler. To free the message handler use SCIPmessagehdlrRelease(). */
SCIP_EXPORT
SCIP_RETCODE SCIPcreateMessagehdlrDefault(
SCIP_MESSAGEHDLR** messagehdlr, /**< pointer to store message handler */
SCIP_Bool bufferedoutput, /**< should the output be buffered up to the next newline? */
const char* filename, /**< name of log file, or NULL (stdout) */
SCIP_Bool quiet /**< should screen messages be suppressed? */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file misc.h
* @ingroup INTERNALAPI
* @brief internal miscellaneous methods
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_MISC_H__
#define __SCIP_MISC_H__
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_misc.h"
#include "scip/pub_misc.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Dynamic Arrays
*/
/** creates a dynamic array of real values */
SCIP_RETCODE SCIPrealarrayCreate(
SCIP_REALARRAY** realarray, /**< pointer to store the real array */
BMS_BLKMEM* blkmem /**< block memory */
);
/** creates a copy of a dynamic array of real values */
SCIP_RETCODE SCIPrealarrayCopy(
SCIP_REALARRAY** realarray, /**< pointer to store the copied real array */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_REALARRAY* sourcerealarray /**< dynamic real array to copy */
);
/** frees a dynamic array of real values */
SCIP_RETCODE SCIPrealarrayFree(
SCIP_REALARRAY** realarray /**< pointer to the real array */
);
/** extends dynamic array to be able to store indices from minidx to maxidx */
SCIP_RETCODE SCIPrealarrayExtend(
SCIP_REALARRAY* realarray, /**< dynamic real array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int minidx, /**< smallest index to allocate storage for */
int maxidx /**< largest index to allocate storage for */
);
/** clears a dynamic real array */
SCIP_RETCODE SCIPrealarrayClear(
SCIP_REALARRAY* realarray /**< dynamic real array */
);
/** gets value of entry in dynamic array */
SCIP_Real SCIPrealarrayGetVal(
SCIP_REALARRAY* realarray, /**< dynamic real array */
int idx /**< array index to get value for */
);
/** sets value of entry in dynamic array */
SCIP_RETCODE SCIPrealarraySetVal(
SCIP_REALARRAY* realarray, /**< dynamic real array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int idx, /**< array index to set value for */
SCIP_Real val /**< value to set array index to */
);
/** increases value of entry in dynamic array */
SCIP_RETCODE SCIPrealarrayIncVal(
SCIP_REALARRAY* realarray, /**< dynamic real array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int idx, /**< array index to increase value for */
SCIP_Real incval /**< value to increase array index */
);
/** returns the minimal index of all stored non-zero elements */
int SCIPrealarrayGetMinIdx(
SCIP_REALARRAY* realarray /**< dynamic real array */
);
/** returns the maximal index of all stored non-zero elements */
int SCIPrealarrayGetMaxIdx(
SCIP_REALARRAY* realarray /**< dynamic real array */
);
/** creates a dynamic array of int values */
SCIP_RETCODE SCIPintarrayCreate(
SCIP_INTARRAY** intarray, /**< pointer to store the int array */
BMS_BLKMEM* blkmem /**< block memory */
);
/** creates a copy of a dynamic array of int values */
SCIP_RETCODE SCIPintarrayCopy(
SCIP_INTARRAY** intarray, /**< pointer to store the copied int array */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_INTARRAY* sourceintarray /**< dynamic int array to copy */
);
/** frees a dynamic array of int values */
SCIP_RETCODE SCIPintarrayFree(
SCIP_INTARRAY** intarray /**< pointer to the int array */
);
/** extends dynamic array to be able to store indices from minidx to maxidx */
SCIP_RETCODE SCIPintarrayExtend(
SCIP_INTARRAY* intarray, /**< dynamic int array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int minidx, /**< smallest index to allocate storage for */
int maxidx /**< largest index to allocate storage for */
);
/** clears a dynamic int array */
SCIP_RETCODE SCIPintarrayClear(
SCIP_INTARRAY* intarray /**< dynamic int array */
);
/** gets value of entry in dynamic array */
int SCIPintarrayGetVal(
SCIP_INTARRAY* intarray, /**< dynamic int array */
int idx /**< array index to get value for */
);
/** sets value of entry in dynamic array */
SCIP_RETCODE SCIPintarraySetVal(
SCIP_INTARRAY* intarray, /**< dynamic int array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int idx, /**< array index to set value for */
int val /**< value to set array index to */
);
/** increases value of entry in dynamic array */
SCIP_RETCODE SCIPintarrayIncVal(
SCIP_INTARRAY* intarray, /**< dynamic int array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int idx, /**< array index to increase value for */
int incval /**< value to increase array index */
);
/** returns the minimal index of all stored non-zero elements */
int SCIPintarrayGetMinIdx(
SCIP_INTARRAY* intarray /**< dynamic int array */
);
/** returns the maximal index of all stored non-zero elements */
int SCIPintarrayGetMaxIdx(
SCIP_INTARRAY* intarray /**< dynamic int array */
);
/** creates a dynamic array of bool values */
SCIP_RETCODE SCIPboolarrayCreate(
SCIP_BOOLARRAY** boolarray, /**< pointer to store the bool array */
BMS_BLKMEM* blkmem /**< block memory */
);
/** creates a copy of a dynamic array of bool values */
SCIP_RETCODE SCIPboolarrayCopy(
SCIP_BOOLARRAY** boolarray, /**< pointer to store the copied bool array */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_BOOLARRAY* sourceboolarray /**< dynamic bool array to copy */
);
/** frees a dynamic array of bool values */
SCIP_RETCODE SCIPboolarrayFree(
SCIP_BOOLARRAY** boolarray /**< pointer to the bool array */
);
/** extends dynamic array to be able to store indices from minidx to maxidx */
SCIP_RETCODE SCIPboolarrayExtend(
SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int minidx, /**< smallest index to allocate storage for */
int maxidx /**< largest index to allocate storage for */
);
/** clears a dynamic bool array */
SCIP_RETCODE SCIPboolarrayClear(
SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
);
/** gets value of entry in dynamic array */
SCIP_Bool SCIPboolarrayGetVal(
SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
int idx /**< array index to get value for */
);
/** sets value of entry in dynamic array */
SCIP_RETCODE SCIPboolarraySetVal(
SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int idx, /**< array index to set value for */
SCIP_Bool val /**< value to set array index to */
);
/** returns the minimal index of all stored non-zero elements */
int SCIPboolarrayGetMinIdx(
SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
);
/** returns the maximal index of all stored non-zero elements */
int SCIPboolarrayGetMaxIdx(
SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
);
/** creates a dynamic array of pointer values */
SCIP_RETCODE SCIPptrarrayCreate(
SCIP_PTRARRAY** ptrarray, /**< pointer to store the ptr array */
BMS_BLKMEM* blkmem /**< block memory */
);
/** creates a copy of a dynamic array of pointer values */
SCIP_RETCODE SCIPptrarrayCopy(
SCIP_PTRARRAY** ptrarray, /**< pointer to store the copied ptr array */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_PTRARRAY* sourceptrarray /**< dynamic ptr array to copy */
);
/** frees a dynamic array of pointer values */
SCIP_RETCODE SCIPptrarrayFree(
SCIP_PTRARRAY** ptrarray /**< pointer to the ptr array */
);
/** extends dynamic array to be able to store indices from minidx to maxidx */
SCIP_RETCODE SCIPptrarrayExtend(
SCIP_PTRARRAY* ptrarray, /**< dynamic ptr array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int minidx, /**< smallest index to allocate storage for */
int maxidx /**< largest index to allocate storage for */
);
/** clears a dynamic pointer array */
SCIP_RETCODE SCIPptrarrayClear(
SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
);
/** gets value of entry in dynamic array */
void* SCIPptrarrayGetVal(
SCIP_PTRARRAY* ptrarray, /**< dynamic ptr array */
int idx /**< array index to get value for */
);
/** sets value of entry in dynamic array */
SCIP_RETCODE SCIPptrarraySetVal(
SCIP_PTRARRAY* ptrarray, /**< dynamic ptr array */
int arraygrowinit, /**< initial size of array */
SCIP_Real arraygrowfac, /**< growing factor of array */
int idx, /**< array index to set value for */
void* val /**< value to set array index to */
);
/** returns the minimal index of all stored non-zero elements */
int SCIPptrarrayGetMinIdx(
SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
);
/** returns the maximal index of all stored non-zero elements */
int SCIPptrarrayGetMaxIdx(
SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
);
/* SCIP disjoint set data structure
*
* internal disjoint set functions (see \ref DisjointSet for public methods)
*/
/** creates a disjoint set (union find) structure \p djset for \p ncomponents many components (of size one) */
SCIP_RETCODE SCIPdisjointsetCreate(
SCIP_DISJOINTSET** djset, /**< disjoint set (union find) data structure */
BMS_BLKMEM* blkmem, /**< block memory */
int ncomponents /**< number of components */
);
/** frees the disjoint set (union find) data structure */
void SCIPdisjointsetFree(
SCIP_DISJOINTSET** djset, /**< pointer to disjoint set (union find) data structure */
BMS_BLKMEM* blkmem /**< block memory */
);
/** SCIP digraph functions
*
* internal digraph functions (see \ref DirectedGraph for public digraph methods)
*/
/** creates directed graph structure */
SCIP_RETCODE SCIPdigraphCreate(
SCIP_DIGRAPH** digraph, /**< pointer to store the created directed graph */
BMS_BLKMEM* blkmem, /**< block memory to store the data */
int nnodes /**< number of nodes */
);
/** copies directed graph structure
*
* @note The data in nodedata is copied verbatim. This possibly has to be adapted by the user.
*/
SCIP_RETCODE SCIPdigraphCopy(
SCIP_DIGRAPH** targetdigraph, /**< pointer to store the copied directed graph */
SCIP_DIGRAPH* sourcedigraph, /**< source directed graph */
BMS_BLKMEM* targetblkmem /**< block memory to store the target block memory, or NULL to use the same
* the same block memory as used for the \p sourcedigraph */
);
/*
* Additional math functions
*/
/** negates a number
*
* negation of a number that can be used to avoid that a negation is optimized away by a compiler
*/
SCIP_Real SCIPnegateReal(
SCIP_Real x /**< value to negate */
);
/** internal random number generator methods
*
* see \ref RandomNumbers for public random number generator methods
*/
/** creates and initializes a random number generator */
SCIP_EXPORT
SCIP_RETCODE SCIPrandomCreate(
SCIP_RANDNUMGEN** randnumgen, /**< random number generator */
BMS_BLKMEM* blkmem, /**< block memory */
unsigned int initialseed /**< initial random seed */
);
/** frees a random number generator */
SCIP_EXPORT
void SCIPrandomFree(
SCIP_RANDNUMGEN** randnumgen, /**< random number generator */
BMS_BLKMEM* blkmem /**< block memory */
);
/** initializes a random number generator with a given start seed */
SCIP_EXPORT
void SCIPrandomSetSeed(
SCIP_RANDNUMGEN* randnumgen, /**< random number generator */
unsigned int initseed /**< initial random seed */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nlp.h
* @ingroup INTERNALAPI
* @brief internal methods for NLP management
* @author Thorsten Gellermann
* @author Stefan Vigerske
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NLP_H__
#define __SCIP_NLP_H__
#include <stdio.h>
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_event.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_misc.h"
#include "scip/type_lp.h"
#include "scip/type_var.h"
#include "scip/type_prob.h"
#include "scip/type_sol.h"
#include "scip/type_primal.h"
#include "scip/pub_nlp.h"
#ifdef __cplusplus
extern "C" {
#endif
/**@name Expressions and Expression tree methods */
/**@{ */
/** removes fixed variables from an expression tree, so that at exit all variables are active */
SCIP_RETCODE SCIPexprtreeRemoveFixedVars(
SCIP_EXPRTREE* tree, /**< expression tree */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool* changed, /**< buffer to store whether the tree was changed, i.e., whether there was a fixed variable */
int* varpos, /**< array of length at least tree->nvars to store new indices of previously existing variables in expression tree, or -1 if variable was removed; set to NULL if not of interest */
int* newvarsstart /**< buffer to store index in tree->vars array where new variables begin, or NULL if not of interest */
);
/**@} */
/**@name Nonlinear row methods */
/**@{ */
/** create a new nonlinear row
* the new row is already captured
*/
SCIP_RETCODE SCIPnlrowCreate(
SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
const char* name, /**< name of nonlinear row */
SCIP_Real constant, /**< constant */
int nlinvars, /**< number of linear variables */
SCIP_VAR** linvars, /**< linear variables, or NULL if nlinvars == 0 */
SCIP_Real* lincoefs, /**< linear coefficients, or NULL if nlinvars == 0 */
int nquadvars, /**< number variables in quadratic terms */
SCIP_VAR** quadvars, /**< variables in quadratic terms, or NULL if nquadvars == 0 */
int nquadelems, /**< number of entries in quadratic term matrix */
SCIP_QUADELEM* quadelems, /**< elements of quadratic term matrix, or NULL if nquadelems == 0 */
SCIP_EXPRTREE* exprtree, /**< expression tree, or NULL */
SCIP_Real lhs, /**< left hand side */
SCIP_Real rhs, /**< right hand side */
SCIP_EXPRCURV curvature /**< curvature of the nonlinear row */
);
/** create a nonlinear row that is a copy of a given row
* the new row is already captured
*/
SCIP_RETCODE SCIPnlrowCreateCopy(
SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NLROW* sourcenlrow /**< nonlinear row to copy */
);
/** create a new nonlinear row from a linear row
* the new row is already captured
*/
SCIP_RETCODE SCIPnlrowCreateFromRow(
SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_ROW* row /**< the linear row to copy */
);
/** frees a nonlinear row */
SCIP_RETCODE SCIPnlrowFree(
SCIP_NLROW** nlrow, /**< pointer to NLP row */
BMS_BLKMEM* blkmem /**< block memory */
);
/** output nonlinear row to file stream */
SCIP_RETCODE SCIPnlrowPrint(
SCIP_NLROW* nlrow, /**< NLP row */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file /**< output file (or NULL for standard output) */
);
/** increases usage counter of NLP nonlinear row */
void SCIPnlrowCapture(
SCIP_NLROW* nlrow /**< nonlinear row to capture */
);
/** decreases usage counter of NLP nonlinear row */
SCIP_RETCODE SCIPnlrowRelease(
SCIP_NLROW** nlrow, /**< nonlinear row to free */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set /**< global SCIP settings */
);
/** ensures, that linear coefficient array of nonlinear row can store at least num entries */
SCIP_RETCODE SCIPnlrowEnsureLinearSize(
SCIP_NLROW* nlrow, /**< NLP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
int num /**< minimum number of entries to store */
);
/** adds a previously non existing linear coefficient to an NLP nonlinear row */
SCIP_RETCODE SCIPnlrowAddLinearCoef(
SCIP_NLROW* nlrow, /**< NLP nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_VAR* var, /**< variable */
SCIP_Real val /**< value of coefficient */
);
/** deletes linear coefficient from nonlinear row */
SCIP_RETCODE SCIPnlrowDelLinearCoef(
SCIP_NLROW* nlrow, /**< nonlinear row to be changed */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_VAR* var /**< coefficient to be deleted */
);
/** changes or adds a linear coefficient to a nonlinear row */
SCIP_RETCODE SCIPnlrowChgLinearCoef(
SCIP_NLROW* nlrow, /**< nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_VAR* var, /**< variable */
SCIP_Real coef /**< new value of coefficient */
);
/** ensures, that quadratic variables array of nonlinear row can store at least num entries */
SCIP_RETCODE SCIPnlrowEnsureQuadVarsSize(
SCIP_NLROW* nlrow, /**< NLP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
int num /**< minimum number of entries to store */
);
/** adds variable to quadvars array of row */
SCIP_RETCODE SCIPnlrowAddQuadVar(
SCIP_NLROW* nlrow, /**< nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var /**< variable to search for */
);
/** ensures, that quadratic elements array of nonlinear row can store at least num entries */
SCIP_RETCODE SCIPnlrowEnsureQuadElementsSize(
SCIP_NLROW* nlrow, /**< NLP row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
int num /**< minimum number of entries to store */
);
/** adds a previously non existing quadratic element to an NLP nonlinear row */
SCIP_RETCODE SCIPnlrowAddQuadElement(
SCIP_NLROW* nlrow, /**< NLP nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_QUADELEM elem /**< quadratic element to add */
);
/** deletes quadratic element from nonlinear row */
SCIP_RETCODE SCIPnlrowDelQuadElement(
SCIP_NLROW* nlrow, /**< nonlinear row to be changed */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
int idx1, /**< index of first variable in element */
int idx2 /**< index of second variable in element */
);
/** changes or adds a quadratic element to a nonlinear row */
SCIP_RETCODE SCIPnlrowChgQuadElem(
SCIP_NLROW* nlrow, /**< nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_QUADELEM elem /**< new quadratic element */
);
/** replaces or deletes an expression tree in nonlinear row */
SCIP_RETCODE SCIPnlrowChgExprtree(
SCIP_NLROW* nlrow, /**< nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_EXPRTREE* exprtree /**< new expression tree, or NULL to delete current one */
);
/** changes a parameter in an expression of a nonlinear row */
SCIP_RETCODE SCIPnlrowChgExprtreeParam(
SCIP_NLROW* nlrow, /**< nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
int paramidx, /**< index of parameter in expression tree's parameter array */
SCIP_Real paramval /**< new value of parameter */
);
/** changes all parameters in an expression of a nonlinear row */
SCIP_RETCODE SCIPnlrowChgExprtreeParams(
SCIP_NLROW* nlrow, /**< nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_Real* paramvals /**< new values of parameters */
);
/** changes constant of nonlinear row */
SCIP_RETCODE SCIPnlrowChgConstant(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_Real constant /**< new constant */
);
/** changes left hand side of nonlinear row */
SCIP_RETCODE SCIPnlrowChgLhs(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_Real lhs /**< new left hand side */
);
/** changes right hand side of nonlinear row */
SCIP_RETCODE SCIPnlrowChgRhs(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_Real rhs /**< new right hand side */
);
/** removes (or substitutes) all fixed, negated, aggregated, multi-aggregated variables from the linear, quadratic, and nonquadratic terms of a nonlinear row */
SCIP_RETCODE SCIPnlrowRemoveFixedVars(
SCIP_NLROW* nlrow, /**< nonlinear row */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLP* nlp /**< current NLP data */
);
/** recalculates the current activity of a nonlinear row in the current NLP solution */
SCIP_RETCODE SCIPnlrowRecalcNLPActivity(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_NLP* nlp /**< current NLP data */
);
/** gives the activity of a nonlinear row in the current NLP solution */
SCIP_RETCODE SCIPnlrowGetNLPActivity(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_Real* activity /**< buffer to store activity value */
);
/** gives the feasibility of a nonlinear row in the current NLP solution: negative value means infeasibility */
SCIP_RETCODE SCIPnlrowGetNLPFeasibility(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_NLP* nlp, /**< current NLP data */
SCIP_Real* feasibility /**< buffer to store feasibility value */
);
/** calculates the current pseudo activity of a nonlinear row */
SCIP_RETCODE SCIPnlrowRecalcPseudoActivity(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics */
);
/** returns the pseudo activity of a nonlinear row in the current pseudo solution */
SCIP_RETCODE SCIPnlrowGetPseudoActivity(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_Real* pseudoactivity /**< buffer to store pseudo activity value */
);
/** returns the pseudo feasibility of a nonlinear row in the current pseudo solution: negative value means infeasibility */
SCIP_RETCODE SCIPnlrowGetPseudoFeasibility(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_Real* pseudofeasibility /**< buffer to store pseudo feasibility value */
);
/** returns the activity of a nonlinear row for a given solution */
SCIP_RETCODE SCIPnlrowGetSolActivity(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_SOL* sol, /**< primal CIP solution */
SCIP_Real* activity /**< buffer to store activity value */
);
/** returns the feasibility of a nonlinear row for the given solution */
SCIP_RETCODE SCIPnlrowGetSolFeasibility(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_SOL* sol, /**< primal CIP solution */
SCIP_Real* feasibility /**< buffer to store feasibility value */
);
/** returns the minimal activity of a nonlinear row w.r.t. the variables' bounds */
SCIP_RETCODE SCIPnlrowGetActivityBounds(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_Real* minactivity, /**< buffer to store minimal activity, or NULL */
SCIP_Real* maxactivity /**< buffer to store maximal activity, or NULL */
);
/** returns whether the nonlinear row is redundant w.r.t. the variables' bounds */
SCIP_RETCODE SCIPnlrowIsRedundant(
SCIP_NLROW* nlrow, /**< nonlinear row */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_Bool* isredundant /**< buffer to store whether row is redundant */
);
/**@} */
/**@name NLP methods */
/**@{ */
/** includes event handler that is used by NLP */
SCIP_RETCODE SCIPnlpInclude(
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem /**< block memory */
);
/** construct a new empty NLP */
SCIP_RETCODE SCIPnlpCreate(
SCIP_NLP** nlp, /**< NLP handler, call by reference */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
const char* name, /**< problem name */
int nvars_estimate /**< an estimate on the number of variables that may be added to the NLP later */
);
/** frees NLP data object */
SCIP_RETCODE SCIPnlpFree(
SCIP_NLP** nlp, /**< pointer to NLP data object */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp /**< SCIP LP, needed for releasing variables */
);
/** resets the NLP to the empty NLP by removing all variables and rows from NLP,
* releasing all rows, and flushing the changes to the NLP solver
*/
SCIP_RETCODE SCIPnlpReset(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp /**< SCIP LP, needed for releasing variables */
);
/** currently a dummy function that always returns TRUE */
SCIP_Bool SCIPnlpHasCurrentNodeNLP(
SCIP_NLP* nlp /**< NLP data */
);
/** ensures, that variables array of NLP can store at least num entries */
SCIP_RETCODE SCIPnlpEnsureVarsSize(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
int num /**< minimum number of entries to store */
);
/** adds a variable to the NLP and captures the variable */
SCIP_RETCODE SCIPnlpAddVar(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* var /**< variable */
);
/** adds a set of variables to the NLP and captures the variables */
SCIP_RETCODE SCIPnlpAddVars(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
int nvars, /**< number of variables to add */
SCIP_VAR** vars /**< variables to add */
);
/** deletes a variable from the NLP and releases the variable */
SCIP_RETCODE SCIPnlpDelVar(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_LP* lp, /**< SCIP LP, needed to release variable */
SCIP_VAR* var /**< variable */
);
/** ensures, that nonlinear rows array of NLP can store at least num entries */
SCIP_RETCODE SCIPnlpEnsureNlRowsSize(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
int num /**< minimum number of entries to store */
);
/** adds a nonlinear row to the NLP and captures it
* all variables of the row need to be present in the NLP */
SCIP_RETCODE SCIPnlpAddNlRow(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_NLROW* nlrow /**< nonlinear row */
);
/** adds nonlinear rows to the NLP and captures them
* all variables of the row need to be present in the NLP */
SCIP_RETCODE SCIPnlpAddNlRows(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
int nnlrows, /**< number of rows to add */
SCIP_NLROW** nlrows /**< rows to add */
);
/** deletes a nonlinear row from the NLP
* does nothing if nonlinear row is not in NLP */
SCIP_RETCODE SCIPnlpDelNlRow(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NLROW* nlrow /**< nonlinear row */
);
/** applies all cached changes to the NLP solver */
SCIP_RETCODE SCIPnlpFlush(
SCIP_NLP* nlp, /**< current NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set /**< global SCIP settings */
);
/** solves the NLP */
SCIP_RETCODE SCIPnlpSolve(
SCIP_NLP* nlp, /**< NLP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_STAT* stat /**< problem statistics */
);
/** gets objective value of current NLP */
SCIP_Real SCIPnlpGetObjval(
SCIP_NLP* nlp /**< current NLP data */
);
/** gives current pseudo objective value */
SCIP_RETCODE SCIPnlpGetPseudoObjval(
SCIP_NLP* nlp, /**< current NLP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_Real* pseudoobjval /**< buffer to store pseudo objective value */
);
/** gets fractional variables of last NLP solution along with solution values and fractionalities
*/
SCIP_RETCODE SCIPnlpGetFracVars(
SCIP_NLP* nlp, /**< NLP data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_VAR*** fracvars, /**< pointer to store the array of NLP fractional variables, or NULL */
SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
int* nfracvars, /**< pointer to store the number of NLP fractional variables , or NULL */
int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
);
/** removes all redundant nonlinear rows */
SCIP_RETCODE SCIPnlpRemoveRedundantNlRows(
SCIP_NLP* nlp, /**< current NLP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< problem statistics */
);
/** set initial guess (approximate primal solution) for next solve
*
* array initguess must be NULL or have length at least SCIPnlpGetNVars()
*/
SCIP_RETCODE SCIPnlpSetInitialGuess(
SCIP_NLP* nlp, /**< current NLP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_Real* initguess /**< new initial guess, or NULL to clear previous one */
);
/** writes NLP to a file */
SCIP_RETCODE SCIPnlpWrite(
SCIP_NLP* nlp, /**< current NLP data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
const char* fname /**< file name */
);
/*
* NLP diving methods
*/
/** signals start of diving */
SCIP_RETCODE SCIPnlpStartDive(
SCIP_NLP* nlp, /**< current NLP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set /**< global SCIP settings */
);
/** resets the bound and objective changes made during diving and disables diving mode */
SCIP_RETCODE SCIPnlpEndDive(
SCIP_NLP* nlp, /**< current NLP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set /**< global SCIP settings */
);
/** changes coefficient of variable in diving NLP */
SCIP_RETCODE SCIPnlpChgVarObjDive(
SCIP_NLP* nlp, /**< current NLP data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics data */
SCIP_VAR* var, /**< variable which coefficient to change */
SCIP_Real coef /**< new linear coefficient of variable in objective */
);
/** changes bounds of variable in diving NLP */
SCIP_RETCODE SCIPnlpChgVarBoundsDive(
SCIP_NLP* nlp, /**< current NLP data */
SCIP_VAR* var, /**< variable which bounds to change */
SCIP_Real lb, /**< new lower bound of variable */
SCIP_Real ub /**< new upper bound of variable */
);
/** changes bounds of a set of variables in diving NLP */
SCIP_RETCODE SCIPnlpChgVarsBoundsDive(
SCIP_NLP* nlp, /**< current NLP data */
SCIP_SET* set, /**< global SCIP settings */
int nvars, /**< number of variables which bounds to change */
SCIP_VAR** vars, /**< variables which bounds to change */
SCIP_Real* lbs, /**< new lower bounds of variables */
SCIP_Real* ubs /**< new upper bounds of variables */
);
/** returns whether the objective function has been changed during diving */
SCIP_Bool SCIPnlpIsDivingObjChanged(
SCIP_NLP* nlp /**< current NLP data */
);
/** solves diving NLP */
SCIP_RETCODE SCIPnlpSolveDive(
SCIP_NLP* nlp, /**< current NLP data */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
SCIP_STAT* stat /**< problem statistics */
);
/** gets array with variables of the NLP */
SCIP_VAR** SCIPnlpGetVars(
SCIP_NLP* nlp /**< current NLP data */
);
/** gets current number of variables in NLP */
int SCIPnlpGetNVars(
SCIP_NLP* nlp /**< current NLP data */
);
/** computes for each variables the number of NLP rows in which the variable appears in a nonlinear var */
SCIP_RETCODE SCIPnlpGetVarsNonlinearity(
SCIP_NLP* nlp, /**< current NLP data */
int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
);
/** indicates whether there exists a row that contains a continuous variable in a nonlinear term
*
* @note The method may have to touch every row and nonlinear term to compute its result.
*/
SCIP_Bool SCIPnlpHasContinuousNonlinearity(
SCIP_NLP* nlp /**< current NLP data */
);
/** gives dual solution values associated with lower bounds of NLP variables */
SCIP_Real* SCIPnlpGetVarsLbDualsol(
SCIP_NLP* nlp /**< current NLP data */
);
/** gives dual solution values associated with upper bounds of NLP variables */
SCIP_Real* SCIPnlpGetVarsUbDualsol(
SCIP_NLP* nlp /**< current NLP data */
);
/** gets array with nonlinear rows of the NLP */
SCIP_NLROW** SCIPnlpGetNlRows(
SCIP_NLP* nlp /**< current NLP data */
);
/** gets current number of nonlinear rows in NLP */
int SCIPnlpGetNNlRows(
SCIP_NLP* nlp /**< current NLP data */
);
/** gets the NLP solver interface */
SCIP_NLPI* SCIPnlpGetNLPI(
SCIP_NLP* nlp /**< current NLP data */
);
/** gets the NLP problem in the solver interface */
SCIP_NLPIPROBLEM* SCIPnlpGetNLPIProblem(
SCIP_NLP* nlp /**< current NLP data */
);
/** indicates whether NLP is currently in diving mode */
SCIP_Bool SCIPnlpIsDiving(
SCIP_NLP* nlp /**< current NLP data */
);
/** gets solution status of current NLP */
SCIP_NLPSOLSTAT SCIPnlpGetSolstat(
SCIP_NLP* nlp /**< current NLP data */
);
/** gets termination status of last NLP solve */
SCIP_NLPTERMSTAT SCIPnlpGetTermstat(
SCIP_NLP* nlp /**< current NLP data */
);
/** gives statistics (number of iterations, solving time, ...) of last NLP solve */
SCIP_RETCODE SCIPnlpGetStatistics(
SCIP_NLP* nlp, /**< pointer to NLP datastructure */
SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
);
/** indicates whether a feasible solution for the current NLP is available
* thus, returns whether the solution status <= feasible */
SCIP_Bool SCIPnlpHasSolution(
SCIP_NLP* nlp /**< current NLP data */
);
/** gets integer parameter of NLP */
SCIP_RETCODE SCIPnlpGetIntPar(
SCIP_NLP* nlp, /**< pointer to NLP datastructure */
SCIP_NLPPARAM type, /**< parameter number */
int* ival /**< pointer to store the parameter value */
);
/** sets integer parameter of NLP */
SCIP_RETCODE SCIPnlpSetIntPar(
SCIP_NLP* nlp, /**< pointer to NLP datastructure */
SCIP_NLPPARAM type, /**< parameter number */
int ival /**< parameter value */
);
/** gets floating point parameter of NLP */
SCIP_RETCODE SCIPnlpGetRealPar(
SCIP_NLP* nlp, /**< pointer to NLP datastructure */
SCIP_NLPPARAM type, /**< parameter number */
SCIP_Real* dval /**< pointer to store the parameter value */
);
/** sets floating point parameter of NLP */
SCIP_RETCODE SCIPnlpSetRealPar(
SCIP_NLP* nlp, /**< pointer to NLP datastructure */
SCIP_NLPPARAM type, /**< parameter number */
SCIP_Real dval /**< parameter value */
);
/** gets string parameter of NLP */
SCIP_RETCODE SCIPnlpGetStringPar(
SCIP_NLP* nlp, /**< pointer to NLP datastructure */
SCIP_NLPPARAM type, /**< parameter number */
const char** sval /**< pointer to store the parameter value */
);
/** sets string parameter of NLP */
SCIP_RETCODE SCIPnlpSetStringPar(
SCIP_NLP* nlp, /**< pointer to NLP datastructure */
SCIP_NLPPARAM type, /**< parameter number */
const char* sval /**< parameter value */
);
/**@} */
#ifdef __cplusplus
}
#endif
#endif /* __SCIP_NLP_H__ */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nodesel.h
* @ingroup INTERNALAPI
* @brief internal methods for node selectors and node priority queues
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NODESEL_H__
#define __SCIP_NODESEL_H__
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_event.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_lp.h"
#include "scip/type_tree.h"
#include "scip/type_reopt.h"
#include "scip/pub_nodesel.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* node priority queue methods
*/
/** creates node priority queue */
SCIP_RETCODE SCIPnodepqCreate(
SCIP_NODEPQ** nodepq, /**< pointer to a node priority queue */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NODESEL* nodesel /**< node selector to use for sorting the nodes in the queue */
);
/** frees node priority queue, but not the data nodes themselves */
void SCIPnodepqDestroy(
SCIP_NODEPQ** nodepq /**< pointer to a node priority queue */
);
/** frees node priority queue and all nodes in the queue */
SCIP_RETCODE SCIPnodepqFree(
SCIP_NODEPQ** nodepq, /**< pointer to a node priority queue */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTFILTER* eventfilter, /**< event filter for global (not variable dependent) events */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_LP* lp /**< current LP data */
);
/** deletes all nodes in the node priority queue */
SCIP_RETCODE SCIPnodepqClear(
SCIP_NODEPQ* nodepq, /**< node priority queue */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_EVENTFILTER* eventfilter, /**< event filter for global (not variable dependent) events */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_LP* lp /**< current LP data */
);
/** returns the node selector associated with the given node priority queue */
SCIP_NODESEL* SCIPnodepqGetNodesel(
SCIP_NODEPQ* nodepq /**< node priority queue */
);
/** sets the node selector used for sorting the nodes in the queue, and resorts the queue if necessary */
SCIP_RETCODE SCIPnodepqSetNodesel(
SCIP_NODEPQ** nodepq, /**< pointer to a node priority queue */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NODESEL* nodesel /**< node selector to use for sorting the nodes in the queue */
);
/** compares two nodes; returns -1/0/+1 if node1 better/equal/worse than node2 */
int SCIPnodepqCompare(
SCIP_NODEPQ* nodepq, /**< node priority queue */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NODE* node1, /**< first node to compare */
SCIP_NODE* node2 /**< second node to compare */
);
/** inserts node into node priority queue */
SCIP_RETCODE SCIPnodepqInsert(
SCIP_NODEPQ* nodepq, /**< node priority queue */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NODE* node /**< node to be inserted */
);
/** removes node from the node priority queue */
SCIP_RETCODE SCIPnodepqRemove(
SCIP_NODEPQ* nodepq, /**< node priority queue */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NODE* node /**< node to remove */
);
/** returns the best node of the queue without removing it */
SCIP_NODE* SCIPnodepqFirst(
const SCIP_NODEPQ* nodepq /**< node priority queue */
);
/** returns the nodes array of the queue */
SCIP_NODE** SCIPnodepqNodes(
const SCIP_NODEPQ* nodepq /**< node priority queue */
);
/** returns the number of nodes stored in the node priority queue */
int SCIPnodepqLen(
const SCIP_NODEPQ* nodepq /**< node priority queue */
);
/** gets the minimal lower bound of all nodes in the queue */
SCIP_Real SCIPnodepqGetLowerbound(
SCIP_NODEPQ* nodepq, /**< node priority queue */
SCIP_SET* set /**< global SCIP settings */
);
/** gets the node with minimal lower bound of all nodes in the queue */
SCIP_NODE* SCIPnodepqGetLowerboundNode(
SCIP_NODEPQ* nodepq, /**< node priority queue */
SCIP_SET* set /**< global SCIP settings */
);
/** gets the sum of lower bounds of all nodes in the queue */
SCIP_Real SCIPnodepqGetLowerboundSum(
SCIP_NODEPQ* nodepq /**< node priority queue */
);
/** free all nodes from the queue that are cut off by the given upper bound */
SCIP_RETCODE SCIPnodepqBound(
SCIP_NODEPQ* nodepq, /**< node priority queue */
BMS_BLKMEM* blkmem, /**< block memory buffer */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_EVENTFILTER* eventfilter, /**< event filter for global (not variable dependent) events */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< current LP data */
SCIP_Real cutoffbound /**< cutoff bound: all nodes with lowerbound >= cutoffbound are cut off */
);
/*
* node selector methods
*/
/** copies the given node selector to a new scip */
SCIP_RETCODE SCIPnodeselCopyInclude(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
);
/** creates a node selector */
SCIP_RETCODE SCIPnodeselCreate(
SCIP_NODESEL** nodesel, /**< pointer to store node selector */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
const char* name, /**< name of node selector */
const char* desc, /**< description of node selector */
int stdpriority, /**< priority of the node selector in standard mode */
int memsavepriority, /**< priority of the node selector in memory saving mode */
SCIP_DECL_NODESELCOPY ((*nodeselcopy)), /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
SCIP_DECL_NODESELFREE ((*nodeselfree)), /**< destructor of node selector */
SCIP_DECL_NODESELINIT ((*nodeselinit)), /**< initialize node selector */
SCIP_DECL_NODESELEXIT ((*nodeselexit)), /**< deinitialize node selector */
SCIP_DECL_NODESELINITSOL((*nodeselinitsol)),/**< solving process initialization method of node selector */
SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)),/**< solving process deinitialization method of node selector */
SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
SCIP_NODESELDATA* nodeseldata /**< node selector data */
);
/** frees memory of node selector */
SCIP_RETCODE SCIPnodeselFree(
SCIP_NODESEL** nodesel, /**< pointer to node selector data structure */
SCIP_SET* set /**< global SCIP settings */
);
/** initializes node selector */
SCIP_RETCODE SCIPnodeselInit(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_SET* set /**< global SCIP settings */
);
/** deinitializes node selector */
SCIP_RETCODE SCIPnodeselExit(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_SET* set /**< global SCIP settings */
);
/** informs node selector that the branch and bound process is being started */
SCIP_RETCODE SCIPnodeselInitsol(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_SET* set /**< global SCIP settings */
);
/** informs node selector that the branch and bound process data is being freed */
SCIP_RETCODE SCIPnodeselExitsol(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_SET* set /**< global SCIP settings */
);
/** select next node to be processed */
SCIP_RETCODE SCIPnodeselSelect(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NODE** selnode /**< pointer to store node to be processed next */
);
/** compares two nodes; returns -1/0/+1 if node1 better/equal/worse than node2 */
int SCIPnodeselCompare(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NODE* node1, /**< first node to compare */
SCIP_NODE* node2 /**< second node to compare */
);
/** sets priority of node selector in standard mode */
void SCIPnodeselSetStdPriority(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_SET* set, /**< global SCIP settings */
int priority /**< new priority of the node selector */
);
/** sets priority of node selector in memory saving mode */
void SCIPnodeselSetMemsavePriority(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_SET* set, /**< global SCIP settings */
int priority /**< new priority of the node selector */
);
/** sets copy method of node selector */
void SCIPnodeselSetCopy(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_DECL_NODESELCOPY ((*nodeselcopy)) /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
);
/** sets destructor method of node selector */
void SCIPnodeselSetFree(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_DECL_NODESELFREE ((*nodeselfree)) /**< destructor of node selector */
);
/** sets initialization method of node selector */
void SCIPnodeselSetInit(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_DECL_NODESELINIT ((*nodeselinit)) /**< initialize node selector */
);
/** sets deinitialization method of node selector */
void SCIPnodeselSetExit(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_DECL_NODESELEXIT ((*nodeselexit)) /**< deinitialize node selector */
);
/** sets solving process initialization method of node selector */
void SCIPnodeselSetInitsol(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_DECL_NODESELINITSOL ((*nodeselinitsol))/**< solving process initialization method of node selector */
);
/** sets solving process deinitialization method of node selector */
void SCIPnodeselSetExitsol(
SCIP_NODESEL* nodesel, /**< node selector */
SCIP_DECL_NODESELEXITSOL ((*nodeselexitsol))/**< solving process deinitialization method of node selector */
);
/** enables or disables all clocks of \p nodesel, depending on the value of the flag */
void SCIPnodeselEnableOrDisableClocks(
SCIP_NODESEL* nodesel, /**< the node selector for which all clocks should be enabled or disabled */
SCIP_Bool enable /**< should the clocks of the node selector be enabled? */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nodesel_bfs.h
* @ingroup NODESELECTORS
* @brief node selector for best first search
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NODESEL_BFS_H__
#define __SCIP_NODESEL_BFS_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the node selector for best first search and includes it in SCIP
*
* @ingroup NodeSelectorIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeNodeselBfs(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nodesel_breadthfirst.h
* @ingroup NODESELECTORS
* @brief node selector for breadth-first search
* @author Stefan Heinz
* @author Gregor Hendel
*
* This node selector performs breadth-first search, i.e., it completely evaluates an entire level of the search tree before
* proceeding to the next level. At one level, nodes are processed in the order they were created by the branching rule.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NODESEL_BREADTHFIRST_H__
#define __SCIP_NODESEL_BREADTHFIRST_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the node selector for breadth first search and includes it in SCIP
*
* @ingroup NodeSelectorIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeNodeselBreadthfirst(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nodesel_dfs.h
* @ingroup NODESELECTORS
* @brief node selector for depth first search
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NODESEL_DFS_H__
#define __SCIP_NODESEL_DFS_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the node selector for depth first search and includes it in SCIP
*
* @ingroup NodeSelectorIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeNodeselDfs(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nodesel_estimate.h
* @ingroup NODESELECTORS
* @brief node selector for best estimate search
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NODESEL_ESTIMATE_H__
#define __SCIP_NODESEL_ESTIMATE_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the node selector for best estimate search and includes it in SCIP
*
* @ingroup NodeSelectorIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeNodeselEstimate(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nodesel_hybridestim.h
* @ingroup NODESELECTORS
* @brief node selector for hybrid best estimate / best bound search
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NODESEL_HYBRIDESTIM_H__
#define __SCIP_NODESEL_HYBRIDESTIM_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the node selector for hybrid best estim / best bound search and includes it in SCIP
*
* @ingroup NodeSelectorIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeNodeselHybridestim(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nodesel_restartdfs.h
* @ingroup NODESELECTORS
* @brief node selector for depth first search with periodical selection of the best node
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NODESEL_RESTARTDFS_H__
#define __SCIP_NODESEL_RESTARTDFS_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the node selector for restarting depth first search and includes it in SCIP
*
* @ingroup NodeSelectorIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeNodeselRestartdfs(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nodesel_uct.h
* @ingroup NODESELECTORS
* @brief uct node selector which balances exploration and exploitation by considering node visits
* @author Gregor Hendel
*
* the UCT node selection rule selects the next leaf according to a mixed score of the node's actual lower bound
* and the number of times it has been visited so far compared to its parent node.
*
* The idea of UCT node selection for MIP appeared in:
* Ashish Sabharwal and Horst Samulowitz
* Guiding Combinatorial Optimization with UCT (2011)
*
* The authors adapted a game-tree exploration scheme called UCB to MIP trees. Starting from the root node as current node,
* the algorithm selects the current node's child \f$N_i\f$ which maximizes the UCT score
*
* \f$ \mbox{score}(N_i) := -\mbox{estimate}_{N_i} + \mbox{weight} \cdot \frac{\mbox{visits}(\mbox{parent}(N_i))}{\mbox{visits}(N_i)}
* \f$
*
* where \f$\mbox{estimate}\f$ is the node's lower bound normalized by the root lower bound, and \f$\mbox{visits}\f$
* denotes the number of times a leaf in the subtree rooted at this node has been explored so far.
*
* The selected node in the sense of the SCIP node selection is the leaf reached by the above criterion.
*
* The authors suggest that this node selection rule is particularly useful at the beginning of the solving process, but
* to switch to a different node selection after a number of nodes has been explored to reduce computational overhead.
* Our implementation uses only information available from the original SCIP tree which does not support the
* forward path mechanism needed for the most efficient node selection. Instead, the algorithm selects the next leaf
* by looping over all leaves and comparing the best leaf found so far with the next one. Two leaves l_1, l_2 are compared
* by following their paths back upwards until their deepest common ancestor \f$a\f$ is reached, together with the two
* children of \f$a\f$ representing the two paths to l_1, l_2. The leaf represented by the child of \f$a\f$
* with higher UCT score is a candidate for the next selected leaf.
*
* The node selector features several parameters:
*
* the nodelimit delimits the number of explored nodes before UCT selection is turned off
* the weight parameter changes the relevance of the visits quotient in the UCT score (see above score formula)
* useestimate determines whether the node's estimate or lower bound is taken as estimate
*
* @note It should be avoided to switch to uct node selection after the branch and bound process has begun because
* the central UCT score information how often a path was taken is not collected if UCT is inactive. A safe use of
* UCT is to switch it on before SCIP starts optimization.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NODESEL_UCT_H__
#define __SCIP_NODESEL_UCT_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the uct node selector and includes it in SCIP
*
* @ingroup NodeSelectorIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeNodeselUct(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file nodesel_xyz.h
* @ingroup NODESELECTORS
* @brief xyz node selector
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_NODESEL_XYZ_H__
#define __SCIP_NODESEL_XYZ_H__
#include "scip/scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the xyz node selector and includes it in SCIP
*
* @ingroup NodeSelectorIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeNodeselXyz(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif