14#ifndef OR_TOOLS_SAT_IMPLIED_BOUNDS_H_
15#define OR_TOOLS_SAT_IMPLIED_BOUNDS_H_
21#include "absl/container/flat_hash_map.h"
113 return has_implied_bounds_.PositionsSetAtLeastOnce();
119 const auto it = literal_to_var_to_value_.find(
literal.Index());
120 return it != literal_to_var_to_value_.end() ? it->second
121 : empty_var_to_value_;
144 std::vector<IntegerLiteral> tmp_integer_literals_;
152 absl::flat_hash_map<std::pair<LiteralIndex, IntegerVariable>, IntegerValue>
160 std::vector<ImpliedBoundEntry> empty_implied_bounds_;
168 absl::flat_hash_map<LiteralIndex,
169 absl::flat_hash_map<IntegerVariable, IntegerValue>>
170 literal_to_var_to_value_;
171 const absl::flat_hash_map<IntegerVariable, IntegerValue> empty_var_to_value_;
179 int64_t num_deductions_ = 0;
180 int64_t num_enqueued_in_var_to_bounds_ = 0;
ImpliedBounds(Model *model)
bool EnqueueNewDeductions()
const std::vector< ImpliedBoundEntry > & GetImpliedBounds(IntegerVariable var)
void AddLiteralImpliesVarEqValue(Literal literal, IntegerVariable var, IntegerValue value)
void NotifyNewIntegerView(Literal literal)
void Add(Literal literal, IntegerLiteral integer_literal)
const absl::flat_hash_map< IntegerVariable, IntegerValue > & GetImpliedValues(Literal literal) const
const std::vector< IntegerVariable > & VariablesWithImpliedBounds() const
void ProcessIntegerTrail(Literal first_decision)
Class that owns everything related to a particular optimization model.
const IntegerVariable kNoIntegerVariable(-1)
Collection of objects used to extend the Constraint Solver library.
ImpliedBoundEntry(IntegerVariable lit, IntegerValue lb, bool positive)
IntegerVariable literal_view