14 #ifndef OR_TOOLS_BOP_BOP_SOLUTION_H_
15 #define OR_TOOLS_BOP_BOP_SOLUTION_H_
20 #include "absl/strings/string_view.h"
24 #include "ortools/sat/boolean_problem.pb.h"
38 BopSolution(
const sat::LinearBooleanProblem& problem, absl::string_view
name);
41 recompute_cost_ =
true;
42 recompute_is_feasible_ =
true;
48 const std::string&
name()
const {
return name_; }
55 if (recompute_cost_) {
56 cost_ = ComputeCost();
74 if (recompute_is_feasible_) {
75 is_feasible_ = ComputeIsFeasible();
82 return values_.
begin();
98 bool ComputeIsFeasible()
const;
99 int64_t ComputeCost()
const;
101 const sat::LinearBooleanProblem* problem_;
108 mutable bool recompute_cost_;
109 mutable bool recompute_is_feasible_;
110 mutable int64_t cost_;
111 mutable bool is_feasible_;
ParentType::const_iterator const_iterator
absl::StrongVector< VariableIndex, bool >::const_iterator end() const
void SetValue(VariableIndex var, bool value)
bool operator<(const BopSolution &solution) const
BopSolution(const sat::LinearBooleanProblem &problem, absl::string_view name)
double GetScaledCost() const
bool Value(VariableIndex var) const
const std::string & name() const
absl::StrongVector< VariableIndex, bool >::const_iterator begin() const
void set_name(absl::string_view name)
std::tuple< int64_t, int64_t, const double > Coefficient
double AddOffsetAndScaleObjectiveValue(const LinearBooleanProblem &problem, Coefficient v)
Collection of objects used to extend the Constraint Solver library.