16#ifndef OR_TOOLS_SAT_LP_UTILS_H_
17#define OR_TOOLS_SAT_LP_UTILS_H_
24#include "absl/types/span.h"
25#include "ortools/linear_solver/linear_solver.pb.h"
27#include "ortools/sat/boolean_problem.pb.h"
28#include "ortools/sat/cp_model.pb.h"
29#include "ortools/sat/sat_parameters.pb.h"
46 double tolerance = 1e-6);
71 absl::Span<const double>
upper_bounds, int64_t max_absolute_activity,
72 double wanted_absolute_activity_precision,
double* relative_coeff_error,
73 double* scaled_sum_error);
90 MPModelProto* mp_model);
95 MPModelProto* mp_model,
96 SolverLogger* logger);
101 SolverLogger* logger);
107 const MPModelProto& mp_model,
108 SolverLogger* logger);
115 SolverLogger* logger);
125 SolverLogger* logger);
133 const MPModelProto& mp_model,
134 CpModelProto* cp_model,
135 SolverLogger* logger);
145 MPModelProto* output);
159 const std::vector<std::pair<int, double>>& objective,
160 double objective_offset,
bool maximize,
161 CpModelProto* cp_model, SolverLogger* logger);
173 const CpModelProto& model_proto_with_floating_point_objective,
174 const CpObjectiveProto& integer_objective,
175 int64_t inner_integer_objective_lower_bound);
182 LinearBooleanProblem* problem);
186 glop::LinearProgram* lp);
absl::Span< const double > coefficients
double FindBestScalingAndComputeErrors(const std::vector< double > &coefficients, absl::Span< const double > lower_bounds, absl::Span< const double > upper_bounds, int64_t max_absolute_activity, double wanted_absolute_activity_precision, double *relative_coeff_error, double *scaled_sum_error)
bool ConvertMPModelProtoToCpModelProto(const SatParameters ¶ms, const MPModelProto &mp_model, CpModelProto *cp_model, SolverLogger *logger)
int64_t FindRationalFactor(double x, int64_t limit, double tolerance)
void ConvertBooleanProblemToLinearProgram(const LinearBooleanProblem &problem, glop::LinearProgram *lp)
Converts a Boolean optimization problem to its lp formulation.
bool ScaleAndSetObjective(const SatParameters ¶ms, const std::vector< std::pair< int, double > > &objective, double objective_offset, bool maximize, CpModelProto *cp_model, SolverLogger *logger)
bool MakeBoundsOfIntegerVariablesInteger(const SatParameters ¶ms, MPModelProto *mp_model, SolverLogger *logger)
void ChangeLargeBoundsToInfinity(double max_magnitude, MPModelProto *mp_model, SolverLogger *logger)
std::vector< double > DetectImpliedIntegers(MPModelProto *mp_model, SolverLogger *logger)
void RemoveNearZeroTerms(const SatParameters ¶ms, MPModelProto *mp_model, SolverLogger *logger)
bool ConvertBinaryMPModelProtoToBooleanProblem(const MPModelProto &mp_model, LinearBooleanProblem *problem)
double ComputeTrueObjectiveLowerBound(const CpModelProto &model_proto_with_floating_point_objective, const CpObjectiveProto &integer_objective, const int64_t inner_integer_objective_lower_bound)
bool ConvertCpModelProtoToMPModelProto(const CpModelProto &input, MPModelProto *output)
std::vector< double > ScaleContinuousVariables(double scaling, double max_bound, MPModelProto *mp_model)
bool MPModelProtoValidationBeforeConversion(const SatParameters ¶ms, const MPModelProto &mp_model, SolverLogger *logger)
In SWIG mode, we don't want anything besides these top-level includes.
static int input(yyscan_t yyscanner)
std::vector< double > lower_bounds
std::vector< double > upper_bounds