Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData > Class Template Reference

#include <gscip_constraint_handler.h>

Inheritance diagram for operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData >:
operations_research::internal::UntypedGScipConstraintHandler operations_research::GScipConstraintHandler< void * >

Public Member Functions

 UntypedGScipConstraintHandlerImpl (GScipConstraintHandler< ConstraintData > *constraint_handler)
 
absl::StatusOr< GScipCallbackResultEnforceLp (GScipConstraintHandlerContext context, void *const &constraint_data, bool solution_infeasible) override
 Default callback implementations.
 
absl::StatusOr< GScipCallbackResultEnforcePseudoSolution (GScipConstraintHandlerContext context, void *const &constraint_data, bool solution_infeasible, bool objective_infeasible) override
 
absl::StatusOr< bool > CheckIsFeasible (GScipConstraintHandlerContext context, void *const &constraint_data, bool check_integrality, bool check_lp_rows, bool print_reason, bool completely) override
 
std::vector< std::pair< SCIP_VAR *, RoundingLockDirection > > RoundingLock (GScip *gscip, void *const &constraint_data, bool lock_type_is_model) override
 
absl::StatusOr< GScipCallbackResultSeparateLp (GScipConstraintHandlerContext context, void *const &constraint_data) override
 
absl::StatusOr< GScipCallbackResultSeparateSolution (GScipConstraintHandlerContext context, void *const &constraint_data) override
 
- Public Member Functions inherited from operations_research::internal::UntypedGScipConstraintHandler
 UntypedGScipConstraintHandler (const GScipConstraintHandlerProperties &properties)
 
- Public Member Functions inherited from operations_research::GScipConstraintHandler< void * >
 GScipConstraintHandler (const GScipConstraintHandlerProperties &properties)
 
virtual ~GScipConstraintHandler ()=default
 
const GScipConstraintHandlerPropertiesproperties () const
 
absl::Status Register (GScip *gscip)
 Template implementations.
 
absl::StatusOr< SCIP_CONS * > AddCallbackConstraint (GScip *gscip, const std::string &constraint_name, const void **constraint_data, const GScipConstraintOptions &options=DefaultGScipConstraintOptions())
 
GScipCallbackResult CallEnforceLp (GScipConstraintHandlerContext context, const void *&constraint_data, bool solution_infeasible)
 The functions below wrap each callback function to manage status.
 
GScipCallbackResult CallEnforcePseudoSolution (GScipConstraintHandlerContext context, const void *&constraint_data, bool solution_infeasible, bool objective_infeasible)
 
GScipCallbackResult CallCheckIsFeasible (GScipConstraintHandlerContext context, const void *&constraint_data, bool check_integrality, bool check_lp_rows, bool print_reason, bool check_completely)
 
GScipCallbackResult CallSeparateLp (GScipConstraintHandlerContext context, const void *&constraint_data)
 
GScipCallbackResult CallSeparateSolution (GScipConstraintHandlerContext context, const void *&constraint_data)
 

Detailed Description

template<typename ConstraintData>
class operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData >

Definition at line 504 of file gscip_constraint_handler.h.

Constructor & Destructor Documentation

◆ UntypedGScipConstraintHandlerImpl()

template<typename ConstraintData >
operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData >::UntypedGScipConstraintHandlerImpl ( GScipConstraintHandler< ConstraintData > * constraint_handler)
inlineexplicit

Definition at line 506 of file gscip_constraint_handler.h.

Member Function Documentation

◆ CheckIsFeasible()

template<typename ConstraintData >
absl::StatusOr< bool > operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData >::CheckIsFeasible ( GScipConstraintHandlerContext context,
void *const & constraint_data,
bool check_integrality,
bool check_lp_rows,
bool print_reason,
bool check_completely )
inlineoverridevirtual

Callback function called at SCIP's CONSCHECK. Must return true if the current solution stored in the context satisfies all constraints of the constraint handler, or false otherwise. If properties_.feasibility_check_priority < 0, then this only acts on integer solutions.

SCIP CONSCHECK callback arguments:

  • check_integrality: checkintegrality in SCIP, indicates if integrality must be checked. Used to avoid redundant checks in cases where integrality is already checked or implicit.
  • check_lp_rows: checklprows in SCIP, indicates if the constraints represented by rows in the current LP must be checked. Used to avoid redundant checks in cases where row feasibility is already checked or implicit.
  • print_reason: printreason in SCIP, indicates if the reason for the violation should be printed.
  • check_completely: completely in SCIP, indicates if all violations should be checked.

Reimplemented from operations_research::GScipConstraintHandler< void * >.

Definition at line 527 of file gscip_constraint_handler.h.

◆ EnforceLp()

template<typename ConstraintData >
absl::StatusOr< GScipCallbackResult > operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData >::EnforceLp ( GScipConstraintHandlerContext context,
void *const & constraint_data,
bool solution_infeasible )
inlineoverridevirtual

Default callback implementations.

Callback function called at SCIP's CONSENFOLP. Must check if an LP solution at a node is feasible, and if not, resolve the infeasibility if possible by branching, reducing variable domains, or separating the solution with a cutting plane. If properties_.enforcement_priority < 0, then this only acts on integer solutions.

SCIP CONSENFOLP callback arguments:

  • solution_infeasible: solinfeasible in SCIP, indicates if the solution was already declared infeasible by a constraint handler.

It is the user's responsibility to return a valid result for CONSENFOLP; see SCIP's documentation (e.g. type_cons.h).

Reimplemented from operations_research::GScipConstraintHandler< void * >.

Definition at line 511 of file gscip_constraint_handler.h.

◆ EnforcePseudoSolution()

template<typename ConstraintData >
absl::StatusOr< GScipCallbackResult > operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData >::EnforcePseudoSolution ( GScipConstraintHandlerContext context,
void *const & constraint_data,
bool solution_infeasible,
bool objective_infeasible )
inlineoverridevirtual

Callback function called at SCIP's CONSENFOPS. Must check if a pseudosolution is feasible, and if not, resolve the infeasibility if possible by branching, reducing variable domains, or adding an additional constraint. Separating with a cutting plane is not possible since there is no corresponding LP (i.e. kSeparated cannot be returned). If properties_.enforcement_priority < 0, then this only acts on integer solutions.

SCIP CONSENFOPS callback arguments:

  • solution_infeasible: solinfeasible in SCIP, indicates if the solution was already declared infeasible by a constraint handler.
  • objective_infeasible: objinfeasible in SCIP, indicates if the solution is infeasible due to violating objective bound.

It is the user's responsibility to return a valid result for CONSENFOPS; see SCIP's documentation (e.g. type_cons.h).

Reimplemented from operations_research::GScipConstraintHandler< void * >.

Definition at line 519 of file gscip_constraint_handler.h.

◆ RoundingLock()

template<typename ConstraintData >
std::vector< std::pair< SCIP_VAR *, RoundingLockDirection > > operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData >::RoundingLock ( GScip * gscip,
void *const & constraint_data,
bool lock_type_is_model )
inlineoverridevirtual

Callback function called at SCIP's CONSLOCK. Must return, for each variable, whether the constraint may be violated by decreasing and/or increasing the variable value. It is always safe to claim that both directions can violate the constraint, which is the default implementation, but it may affect SCIP's capabilities.

SCIP CONSLOCK callback arguments:

  • lock_type_is_model: if locktype == SCIP_LOCKTYPE_MODEL in SCIP. If true, this callback is called for model constraints, otherwise it is called for conflict constraints.

It is the user's responsibility to return a valid result for CONSLOCK; see SCIP's documentation (e.g. type_cons.h).

Reimplemented from operations_research::GScipConstraintHandler< void * >.

Definition at line 537 of file gscip_constraint_handler.h.

◆ SeparateLp()

template<typename ConstraintData >
absl::StatusOr< GScipCallbackResult > operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData >::SeparateLp ( GScipConstraintHandlerContext context,
void *const & constraint_data )
inlineoverridevirtual

Callback function called at SCIP's CONSSEPALP. Separates all constraints of the constraint handler for LP solutions.

It is the user's responsibility to return a valid result for CONSSEPALP; see SCIP's documentation (e.g. type_cons.h).

Reimplemented from operations_research::GScipConstraintHandler< void * >.

Definition at line 545 of file gscip_constraint_handler.h.

◆ SeparateSolution()

template<typename ConstraintData >
absl::StatusOr< GScipCallbackResult > operations_research::internal::UntypedGScipConstraintHandlerImpl< ConstraintData >::SeparateSolution ( GScipConstraintHandlerContext context,
void *const & constraint_data )
inlineoverridevirtual

Callback function called at SCIP's CONSSEPASOL. Separates all constraints of the constraint handler for solutions that do not come from LP (e.g. relaxators and primal heuristics).

It is the user's responsibility to return a valid result for CONSSEPASOL; see SCIP's documentation (e.g. type_cons.h).

Reimplemented from operations_research::GScipConstraintHandler< void * >.

Definition at line 552 of file gscip_constraint_handler.h.


The documentation for this class was generated from the following file: