Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
scip_callback.cc File Reference
#include "ortools/linear_solver/scip_callback.h"
#include <algorithm>
#include <cstdint>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/str_cat.h"
#include "absl/types/span.h"
#include "ortools/base/logging.h"
#include "ortools/linear_solver/scip_helper_macros.h"
#include "scip/cons_linear.h"
#include "scip/def.h"
#include "scip/pub_cons.h"
#include "scip/scip.h"
#include "scip/scip_cons.h"
#include "scip/scip_cut.h"
#include "scip/scip_general.h"
#include "scip/scip_lp.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_sol.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_tree.h"
#include "scip/scipdefplugins.h"
#include "scip/struct_cons.h"
#include "scip/struct_tree.h"
#include "scip/struct_var.h"
#include "scip/type_cons.h"
#include "scip/type_lp.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_sol.h"
#include "scip/type_tree.h"
#include "scip/type_var.h"

Go to the source code of this file.

Classes

struct  SCIP_ConshdlrData
 
struct  SCIP_ConsData
 
struct  operations_research::CallbackSetup
 

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 
namespace  operations_research::internal
 End of the interface. Below is the implementation.
 

Enumerations

enum class  operations_research::ScipSeparationResult { operations_research::kLazyConstraintAdded , operations_research::kCuttingPlaneAdded , operations_research::kDidNotFind }
 

Functions

bool operations_research::LinearConstraintIsViolated (const ScipConstraintHandlerContext &context, const LinearRange &constraint)
 
ScipSeparationResult operations_research::RunSeparation (internal::ScipCallbackRunner *runner, const ScipConstraintHandlerContext &context, absl::Span< SCIP_CONS * > constraints, bool is_integral)
 
static SCIP_DECL_CONSFREE (ConstraintHandlerFreeC)
 
static SCIP_DECL_CONSDELETE (ConstraintHandlerDeleteC)
 
static SCIP_DECL_CONSENFOLP (EnforceLpC)
 
static SCIP_DECL_CONSSEPALP (SeparateLpC)
 
static SCIP_DECL_CONSSEPASOL (SeparatePrimalSolutionC)
 
static SCIP_DECL_CONSCHECK (CheckFeasibilityC)
 
static SCIP_DECL_CONSENFOPS (EnforcePseudoSolutionC)
 
static SCIP_DECL_CONSLOCK (VariableRoundingLockC)
 
void operations_research::internal::AddConstraintHandlerImpl (const ScipConstraintHandlerDescription &description, std::unique_ptr< ScipCallbackRunner > runner, SCIP *scip)
 
void operations_research::internal::AddCallbackConstraintImpl (SCIP *scip, const std::string &handler_name, const std::string &constraint_name, void *constraint_data, const ScipCallbackConstraintOptions &options)
 

Function Documentation

◆ SCIP_DECL_CONSCHECK()

static SCIP_DECL_CONSCHECK ( CheckFeasibilityC )
static

All constraints are "useful" for this callback.

Definition at line 346 of file scip_callback.cc.

◆ SCIP_DECL_CONSDELETE()

static SCIP_DECL_CONSDELETE ( ConstraintHandlerDeleteC )
static

Definition at line 251 of file scip_callback.cc.

◆ SCIP_DECL_CONSENFOLP()

static SCIP_DECL_CONSENFOLP ( EnforceLpC )
static

Definition at line 260 of file scip_callback.cc.

◆ SCIP_DECL_CONSENFOPS()

static SCIP_DECL_CONSENFOPS ( EnforcePseudoSolutionC )
static
Todo
(user): are we sure the pseudo solution is LP feasible? It seems like it doesn't need to be. The code in RunSeparation might assume this?

Definition at line 363 of file scip_callback.cc.

◆ SCIP_DECL_CONSFREE()

static SCIP_DECL_CONSFREE ( ConstraintHandlerFreeC )
static

destructor of constraint handler to free user data (called when SCIP is exiting)

Definition at line 241 of file scip_callback.cc.

◆ SCIP_DECL_CONSLOCK()

static SCIP_DECL_CONSLOCK ( VariableRoundingLockC )
static

In this callback, we need to say, for a constraint class and an instance of the constraint, for which variables could an {increase,decrease,either} affect feasibility. As a conservative overestimate, we say that any change in any variable could cause an infeasibility for any instance of any callback constraint.

Todo
(user): this could be a little better, but we would need to add another method to override on ScipConstraintHandler<ConstraintData>.

Definition at line 394 of file scip_callback.cc.

◆ SCIP_DECL_CONSSEPALP()

static SCIP_DECL_CONSSEPALP ( SeparateLpC )
static

Definition at line 288 of file scip_callback.cc.

◆ SCIP_DECL_CONSSEPASOL()

static SCIP_DECL_CONSSEPASOL ( SeparatePrimalSolutionC )
static

Definition at line 316 of file scip_callback.cc.