14#ifndef OR_TOOLS_BOP_BOP_SOLUTION_H_
15#define OR_TOOLS_BOP_BOP_SOLUTION_H_
22#include "absl/strings/string_view.h"
26#include "ortools/sat/boolean_problem.pb.h"
41 BopSolution(
const sat::LinearBooleanProblem& problem, absl::string_view
name);
44 recompute_cost_ =
true;
45 recompute_is_feasible_ =
true;
49 size_t Size()
const {
return values_.size(); }
51 const std::string&
name()
const {
return name_; }
58 if (recompute_cost_) {
59 cost_ = ComputeCost();
77 if (recompute_is_feasible_) {
78 is_feasible_ = ComputeIsFeasible();
85 return values_.begin();
101 bool ComputeIsFeasible()
const;
102 int64_t ComputeCost()
const;
104 const sat::LinearBooleanProblem* problem_;
111 mutable bool recompute_cost_;
112 mutable bool recompute_is_feasible_;
113 mutable int64_t cost_;
114 mutable bool is_feasible_;
bool operator<(const BopSolution &solution) const
double GetScaledCost() const
util_intops::StrongVector< VariableIndex, bool >::const_iterator end() const
bool Value(VariableIndex var) const
const std::string & name() const
void SetValue(VariableIndex var, bool value)
void set_name(absl::string_view name)
BopSolution(const sat::LinearBooleanProblem &problem, absl::string_view name)
util_intops::StrongVector< VariableIndex, bool >::const_iterator begin() const
For range based iteration, i.e. for (const bool value : solution) {...}.
ParentType::const_iterator const_iterator
double AddOffsetAndScaleObjectiveValue(const LinearBooleanProblem &problem, Coefficient v)
Adds the offset and returns the scaled version of the given objective value.
In SWIG mode, we don't want anything besides these top-level includes.