14#ifndef OR_TOOLS_SAT_BOOLEAN_PROBLEM_H_
15#define OR_TOOLS_SAT_BOOLEAN_PROBLEM_H_
21#include "absl/status/status.h"
22#include "absl/types/span.h"
42 return (
static_cast<double>(v.value()) + problem.
objective().
offset()) *
56 const SatSolver& solver, std::vector<bool>* assignment);
79 Coefficient upper_bound, SatSolver* solver);
84 bool use_lower_bound, Coefficient lower_bound,
85 bool use_upper_bound, Coefficient upper_bound,
90 const std::vector<bool>& assignment);
94 const std::vector<bool>& assignment);
100 const LinearBooleanProblem& problem);
106 BooleanAssignment* output);
110 absl::Span<const int> constraint_indices,
111 LinearBooleanProblem* subproblem);
122 const LinearBooleanProblem& problem,
123 std::vector<std::unique_ptr<SparsePermutation>>* generators);
134 LinearBooleanProblem* problem);
141 LinearBooleanProblem* problem);
const ::operations_research::sat::LinearObjective & objective() const
double scaling_factor() const
bool AddObjectiveConstraint(const LinearBooleanProblem &problem, bool use_lower_bound, Coefficient lower_bound, bool use_upper_bound, Coefficient upper_bound, SatSolver *solver)
bool LoadBooleanProblem(const LinearBooleanProblem &problem, SatSolver *solver)
Loads a BooleanProblem into a given SatSolver instance.
void ApplyLiteralMappingToBooleanProblem(const util_intops::StrongVector< LiteralIndex, LiteralIndex > &mapping, LinearBooleanProblem *problem)
double AddOffsetAndScaleObjectiveValue(const LinearBooleanProblem &problem, Coefficient v)
Adds the offset and returns the scaled version of the given objective value.
std::string LinearBooleanProblemToCnfString(const LinearBooleanProblem &problem)
void StoreAssignment(const VariablesAssignment &assignment, BooleanAssignment *output)
bool LoadAndConsumeBooleanProblem(LinearBooleanProblem *problem, SatSolver *solver)
void ExtractAssignment(const LinearBooleanProblem &problem, const SatSolver &solver, std::vector< bool > *assignment)
void MakeAllLiteralsPositive(LinearBooleanProblem *problem)
bool AddObjectiveUpperBound(const LinearBooleanProblem &problem, Coefficient upper_bound, SatSolver *solver)
Adds the constraint that the objective is smaller than the given upper bound.
void ProbeAndSimplifyProblem(SatPostsolver *postsolver, LinearBooleanProblem *problem)
void ChangeOptimizationDirection(LinearBooleanProblem *problem)
void FindLinearBooleanProblemSymmetries(const LinearBooleanProblem &problem, std::vector< std::unique_ptr< SparsePermutation > > *generators)
CpModelProto BooleanProblemToCpModelproto(const LinearBooleanProblem &problem)
void ExtractSubproblem(const LinearBooleanProblem &problem, absl::Span< const int > constraint_indices, LinearBooleanProblem *subproblem)
Constructs a sub-problem formed by the constraints with given indices.
absl::Status ValidateBooleanProblem(const LinearBooleanProblem &problem)
bool IsAssignmentValid(const LinearBooleanProblem &problem, const std::vector< bool > &assignment)
Checks that an assignment is valid for the given BooleanProblem.
Coefficient ComputeObjectiveValue(const LinearBooleanProblem &problem, const std::vector< bool > &assignment)
Returns the objective value under the current assignment.
void UseObjectiveForSatAssignmentPreference(const LinearBooleanProblem &problem, SatSolver *solver)
In SWIG mode, we don't want anything besides these top-level includes.