Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::VarDomainWrapper Class Reference

#include <feasibility_jump.h>

Public Member Functions

 VarDomainWrapper (SharedBoundsManager *shared_bounds)
 
Domain operator[] (int var) const
 
bool HasTwoValues (int var) const
 
size_t size () const
 
void resize (int num_vars)
 
void Set (int var, Domain d)
 
bool UpdateFromSharedBounds ()
 
absl::Span< const DomainAsSpan () const
 
void InitializeObjective (const CpModelProto &cp_model_proto)
 
bool IsFixed (int var) const
 
bool HasBetterObjectiveValue (int var) const
 
void OnValueChange (int var, int64_t value)
 Tricky: this must be called on solution value change or domains update.
 
absl::Span< const int > FixedVariables () const
 

Detailed Description

Accessing Domain can be expensive, so we maintain vector of bool for the hot spots.

Definition at line 114 of file feasibility_jump.h.

Constructor & Destructor Documentation

◆ VarDomainWrapper()

operations_research::sat::VarDomainWrapper::VarDomainWrapper ( SharedBoundsManager * shared_bounds)
inlineexplicit

Definition at line 116 of file feasibility_jump.h.

Member Function Documentation

◆ AsSpan()

absl::Span< const Domain > operations_research::sat::VarDomainWrapper::AsSpan ( ) const
inline

Definition at line 163 of file feasibility_jump.h.

◆ FixedVariables()

absl::Span< const int > operations_research::sat::VarDomainWrapper::FixedVariables ( ) const
inline

Definition at line 189 of file feasibility_jump.h.

◆ HasBetterObjectiveValue()

bool operations_research::sat::VarDomainWrapper::HasBetterObjectiveValue ( int var) const
inline

Definition at line 178 of file feasibility_jump.h.

◆ HasTwoValues()

bool operations_research::sat::VarDomainWrapper::HasTwoValues ( int var) const
inline

Definition at line 122 of file feasibility_jump.h.

◆ InitializeObjective()

void operations_research::sat::VarDomainWrapper::InitializeObjective ( const CpModelProto & cp_model_proto)
inline

Definition at line 165 of file feasibility_jump.h.

◆ IsFixed()

bool operations_research::sat::VarDomainWrapper::IsFixed ( int var) const
inline

Definition at line 176 of file feasibility_jump.h.

◆ OnValueChange()

void operations_research::sat::VarDomainWrapper::OnValueChange ( int var,
int64_t value )
inline

Tricky: this must be called on solution value change or domains update.

Definition at line 183 of file feasibility_jump.h.

◆ operator[]()

Domain operations_research::sat::VarDomainWrapper::operator[] ( int var) const
inline

Definition at line 121 of file feasibility_jump.h.

◆ resize()

void operations_research::sat::VarDomainWrapper::resize ( int num_vars)
inline

Definition at line 125 of file feasibility_jump.h.

◆ Set()

void operations_research::sat::VarDomainWrapper::Set ( int var,
Domain d )
inline

The code here assume that once fixed, a variable stays that way.

Definition at line 134 of file feasibility_jump.h.

◆ size()

size_t operations_research::sat::VarDomainWrapper::size ( ) const
inline

Definition at line 123 of file feasibility_jump.h.

◆ UpdateFromSharedBounds()

bool operations_research::sat::VarDomainWrapper::UpdateFromSharedBounds ( )
inline

Return false if one of the domain becomes empty (UNSAT). This might happen while we are cleaning up all workers at the end of a search.

Definition at line 148 of file feasibility_jump.h.


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