Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <gscip_constraint_handler.h>
Public Member Functions | |
GScipConstraintHandlerContext (GScip *gscip, const GScipCallbackStats *stats, SCIP_CONSHDLR *current_handler, SCIP_SOL *current_solution) | |
GScip * | gscip () |
double | VariableValue (SCIP_VAR *variable) const |
absl::StatusOr< GScipCallbackResult > | AddCut (const GScipLinearRange &range, const std::string &name, const GScipCutOptions &options=GScipCutOptions()) |
absl::Status | AddLazyLinearConstraint (const GScipLinearRange &range, const std::string &name, const GScipLazyConstraintOptions &options=GScipLazyConstraintOptions()) |
absl::Status | SetLocalVarLb (SCIP_VAR *var, double value) |
absl::Status | SetLocalVarUb (SCIP_VAR *var, double value) |
absl::Status | SetGlobalVarLb (SCIP_VAR *var, double value) |
absl::Status | SetGlobalVarUb (SCIP_VAR *var, double value) |
double | LocalVarLb (SCIP_VAR *var) const |
double | LocalVarUb (SCIP_VAR *var) const |
double | GlobalVarLb (SCIP_VAR *var) const |
double | GlobalVarUb (SCIP_VAR *var) const |
const GScipCallbackStats & | stats () const |
Interface to the callback context and underlying problem. Supports adding cuts and lazy constraints, and setting bounds. Prefer to use this context to query information instead of a raw SCIP pointer. Passed by value.
Definition at line 176 of file gscip_constraint_handler.h.
|
inline |
Construct the context for the given handler. Following SCIP convention, if SCIP_SOL is nullptr, then the current solution from the LP is used.
Definition at line 180 of file gscip_constraint_handler.h.
absl::StatusOr< GScipCallbackResult > operations_research::GScipConstraintHandlerContext::AddCut | ( | const GScipLinearRange & | range, |
const std::string & | name, | ||
const GScipCutOptions & | options = GScipCutOptions() ) |
Adds a cut (row) to the SCIP separation storage.
If this is called and succeeds, the callback result must be the one returned or a higher priority result. The result returned is either kCutOff (SCIP_CUTOFF) if SCIP determined that the cut results in infeasibility based on local bounds, or kSeparated (SCIP_SEPARATED) otherwise.
Definition at line 311 of file gscip_constraint_handler.cc.
absl::Status operations_research::GScipConstraintHandlerContext::AddLazyLinearConstraint | ( | const GScipLinearRange & | range, |
const std::string & | name, | ||
const GScipLazyConstraintOptions & | options = GScipLazyConstraintOptions() ) |
Adds a lazy constraint as a SCIP linear constraint. This is similar to adding it as a row (and it would be valid to add a lazy constraint with AddCut and proper options), but it is treated as a higher-level object and may affect other portions of SCIP such as propagation. This is a thin wrapper on GScip::AddLinearConstraint() with different defaults.
If this is called and succeeds, the callback result must be kConsAdded (equivalent to SCIP_CONSADDED) or a higher priority result.
Definition at line 336 of file gscip_constraint_handler.cc.
double operations_research::GScipConstraintHandlerContext::GlobalVarLb | ( | SCIP_VAR * | var | ) | const |
Definition at line 352 of file gscip_constraint_handler.cc.
double operations_research::GScipConstraintHandlerContext::GlobalVarUb | ( | SCIP_VAR * | var | ) | const |
Definition at line 355 of file gscip_constraint_handler.cc.
|
inline |
Definition at line 188 of file gscip_constraint_handler.h.
double operations_research::GScipConstraintHandlerContext::LocalVarLb | ( | SCIP_VAR * | var | ) | const |
Definition at line 346 of file gscip_constraint_handler.cc.
double operations_research::GScipConstraintHandlerContext::LocalVarUb | ( | SCIP_VAR * | var | ) | const |
Definition at line 349 of file gscip_constraint_handler.cc.
absl::Status operations_research::GScipConstraintHandlerContext::SetGlobalVarLb | ( | SCIP_VAR * | var, |
double | value ) |
Definition at line 369 of file gscip_constraint_handler.cc.
absl::Status operations_research::GScipConstraintHandlerContext::SetGlobalVarUb | ( | SCIP_VAR * | var, |
double | value ) |
Definition at line 373 of file gscip_constraint_handler.cc.
absl::Status operations_research::GScipConstraintHandlerContext::SetLocalVarLb | ( | SCIP_VAR * | var, |
double | value ) |
The functions below set variable bounds. If they are used to cut off a solution, then the callback result must be kReducedDomain (SCIP_REDUCEDDOM) or a higher priority result.
Definition at line 359 of file gscip_constraint_handler.cc.
absl::Status operations_research::GScipConstraintHandlerContext::SetLocalVarUb | ( | SCIP_VAR * | var, |
double | value ) |
Definition at line 364 of file gscip_constraint_handler.cc.
|
inline |
Definition at line 231 of file gscip_constraint_handler.h.
double operations_research::GScipConstraintHandlerContext::VariableValue | ( | SCIP_VAR * | variable | ) | const |
Returns the current solution value of a variable. This may be for a given solution (e.g. in CONS_SEPASOL) or the current LP/pseudosolution (e.g. in CONS_SEPALP). Equivalent to calling SCIPgetSolVal.
Definition at line 307 of file gscip_constraint_handler.cc.