18 #ifndef OR_TOOLS_SAT_ENCODING_H_
19 #define OR_TOOLS_SAT_ENCODING_H_
77 int size()
const {
return literals_.size(); }
80 CHECK_LT(i, literals_.size());
87 return depth_ > other.depth_ ||
88 (depth_ == other.depth_ && other.for_sorting_ > for_sorting_);
106 Coefficient
weight()
const {
return weight_; }
108 int depth()
const {
return depth_; }
109 int lb()
const {
return lb_; }
111 int ub()
const {
return ub_; }
119 BooleanVariable for_sorting_;
126 std::vector<Literal> literals_;
131 static_assert(
sizeof(EncodingNode) <= 64,
132 "ERROR_EncodingNode_is_not_well_compacted");
137 EncodingNode
LazyMerge(EncodingNode*
a, EncodingNode*
b, SatSolver* solver);
148 EncodingNode
FullMerge(Coefficient upper_bound, EncodingNode*
a,
149 EncodingNode*
b, SatSolver* solver);
154 const std::vector<EncodingNode*>& nodes,
156 std::deque<EncodingNode>* repository);
162 std::deque<EncodingNode>* repository);
169 const std::vector<Literal>& literals,
170 const std::vector<Coefficient>& coeffs, Coefficient* offset,
171 std::deque<EncodingNode>* repository);
173 const LinearObjective& objective_proto, Coefficient* offset,
174 std::deque<EncodingNode>* repository);
180 Coefficient upper_bound, Coefficient stratified_lower_bound,
181 Coefficient* lower_bound, std::vector<EncodingNode*>* nodes,
187 const std::vector<Literal>& core);
193 Coefficient upper_bound);
197 void ProcessCore(
const std::vector<Literal>& core, Coefficient min_weight,
198 std::deque<EncodingNode>* repository,
199 std::vector<EncodingNode*>* nodes, SatSolver* solver);
204 #endif // OR_TOOLS_SAT_ENCODING_H_