21#include "absl/log/check.h"
32#define ADD_LP_PREPROCESSOR(name) \
33 names.push_back(#name); \
34 lp_preprocessors.push_back(std::make_unique<name>(&glop_params));
38 std::vector<std::unique_ptr<glop::Preprocessor>>* for_postsolve,
40 CHECK(model !=
nullptr);
63 if (!hint_is_present) {
64 const std::string header =
65 "Running basic LP presolve, initial problem dimensions: ";
68 std::vector<std::string> names;
69 std::vector<std::unique_ptr<glop::Preprocessor>> lp_preprocessors;
81 for (
int i = 0; i < lp_preprocessors.size(); ++i) {
83 auto& preprocessor = lp_preprocessors[i];
85 preprocessor->UseInMipContext();
86 const bool need_postsolve = preprocessor->Run(&lp);
87 names[i].resize(header.size(),
' ');
91 if (need_postsolve) for_postsolve->push_back(std::move(preprocessor));
96 if (!hint_is_present) {
98 std::make_unique<glop::ShiftVariableBoundsPreprocessor>(&glop_params);
99 shift_bounds->UseInMipContext();
100 const bool need_postsolve = shift_bounds->Run(&lp);
102 return shift_bounds->status();
104 if (need_postsolve) {
105 for_postsolve->push_back(std::move(shift_bounds));
113 if (hint_is_present) {
120#undef ADD_LP_PREPROCESSOR
const ::operations_research::MPGeneralConstraintProto & general_constraint(int index) const
::operations_research::PartialVariableAssignment *PROTOBUF_NONNULL mutable_solution_hint()
const ::operations_research::PartialVariableAssignment & solution_hint() const
bool has_solution_hint() const
optional .operations_research.PartialVariableAssignment solution_hint = 6;
static std::unique_ptr< TimeLimit > FromParameters(const Parameters ¶meters)
Removes the fixed variables from the problem.
Removes the constraints with no bounds from the problem.
std::string GetDimensionString() const
A short string with the problem dimension.
void LinearProgramToMPModelProto(const LinearProgram &input, MPModelProto *output)
Converts a LinearProgram to a MPModelProto.
ProblemStatus
Different statuses for a given problem.
@ INIT
The solver didn't had a chance to prove anything.
void MPModelProtoToLinearProgram(const MPModelProto &input, LinearProgram *output)
Converts a MPModelProto to a LinearProgram.
In SWIG mode, we don't want anything besides these top-level includes.
glop::ProblemStatus ApplyMipPresolveSteps(const glop::GlopParameters &glop_params, MPModelProto *model, std::vector< std::unique_ptr< glop::Preprocessor > > *for_postsolve, SolverLogger *logger)
#define ADD_LP_PREPROCESSOR(name)
#define SOLVER_LOG(logger,...)