OR-Tools  8.0
bop_interface.cc
Go to the documentation of this file.
1 // Copyright 2010-2018 Google LLC
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 // http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 #include <atomic>
15 #include <string>
16 #include <vector>
17 
18 #include "google/protobuf/text_format.h"
20 #include "ortools/base/file.h"
21 #include "ortools/base/hash.h"
23 #include "ortools/base/logging.h"
27 
28 namespace operations_research {
29 namespace {
30 
31 MPSolver::ResultStatus TranslateProblemStatus(bop::BopSolveStatus status) {
32  switch (status) {
34  return MPSolver::OPTIMAL;
35  case bop::BopSolveStatus::FEASIBLE_SOLUTION_FOUND:
36  return MPSolver::FEASIBLE;
37  case bop::BopSolveStatus::NO_SOLUTION_FOUND:
38  return MPSolver::NOT_SOLVED;
39  case bop::BopSolveStatus::INFEASIBLE_PROBLEM:
40  return MPSolver::INFEASIBLE;
42  return MPSolver::ABNORMAL;
43  }
44  LOG(DFATAL) << "Invalid bop::BopSolveStatus";
45  return MPSolver::ABNORMAL;
46 }
47 
48 } // Anonymous namespace
49 
51  public:
52  explicit BopInterface(MPSolver* const solver);
53  ~BopInterface() override;
54 
55  // ----- Solve -----
56  MPSolver::ResultStatus Solve(const MPSolverParameters& param) override;
57 
58  // ----- Model modifications and extraction -----
59  void Reset() override;
60  void SetOptimizationDirection(bool maximize) override;
61  void SetVariableBounds(int index, double lb, double ub) override;
62  void SetVariableInteger(int index, bool integer) override;
63  void SetConstraintBounds(int index, double lb, double ub) override;
64  void AddRowConstraint(MPConstraint* const ct) override;
65  void AddVariable(MPVariable* const var) override;
66  void SetCoefficient(MPConstraint* const constraint,
67  const MPVariable* const variable, double new_value,
68  double old_value) override;
69  void ClearConstraint(MPConstraint* const constraint) override;
70  void SetObjectiveCoefficient(const MPVariable* const variable,
71  double coefficient) override;
72  void SetObjectiveOffset(double value) override;
73  void ClearObjective() override;
74 
75  // ------ Query statistics on the solution and the solve ------
76  int64 iterations() const override;
77  int64 nodes() const override;
78  double best_objective_bound() const override;
79  MPSolver::BasisStatus row_status(int constraint_index) const override;
80  MPSolver::BasisStatus column_status(int variable_index) const override;
81 
82  // ----- Misc -----
83  bool IsContinuous() const override;
84  bool IsLP() const override;
85  bool IsMIP() const override;
86 
87  std::string SolverVersion() const override;
88  bool InterruptSolve() override;
89  void* underlying_solver() override;
90 
91  void ExtractNewVariables() override;
92  void ExtractNewConstraints() override;
93  void ExtractObjective() override;
94 
95  void SetParameters(const MPSolverParameters& param) override;
96  void SetRelativeMipGap(double value) override;
97  void SetPrimalTolerance(double value) override;
98  void SetDualTolerance(double value) override;
99  void SetPresolveMode(int value) override;
100  void SetScalingMode(int value) override;
101  void SetLpAlgorithm(int value) override;
103  const std::string& parameters) override;
104 
105  private:
106  void NonIncrementalChange();
107 
108  glop::LinearProgram linear_program_;
109  bop::IntegralSolver bop_solver_;
110  std::vector<MPSolver::BasisStatus> column_status_;
111  std::vector<MPSolver::BasisStatus> row_status_;
112  bop::BopParameters parameters_;
113  double best_objective_bound_;
114  std::atomic<bool> interrupt_solver_;
115 };
116 
118  : MPSolverInterface(solver),
119  linear_program_(),
120  bop_solver_(),
121  column_status_(),
122  row_status_(),
123  parameters_(),
124  interrupt_solver_(false) {}
125 
127 
129  // Check whenever the solve has already been stopped by the user.
130  if (interrupt_solver_) {
131  Reset();
132  return MPSolver::NOT_SOLVED;
133  }
134 
135  // Reset extraction as this interface is not incremental yet.
136  Reset();
137  ExtractModel();
138  SetParameters(param);
139 
140  linear_program_.SetMaximizationProblem(maximize_);
141  linear_program_.CleanUp();
142 
143  // Time limit.
144  if (solver_->time_limit()) {
145  VLOG(1) << "Setting time limit = " << solver_->time_limit() << " ms.";
146  parameters_.set_max_time_in_seconds(
147  static_cast<double>(solver_->time_limit()) / 1000.0);
148  }
149  parameters_.set_log_search_progress(!quiet());
150 
151  glop::DenseRow initial_solution;
152  if (!solver_->solution_hint_.empty()) {
153  const int num_vars = solver_->variables_.size();
154  if (solver_->solution_hint_.size() != num_vars) {
155  LOG(WARNING) << "Bop currently doesn't handle partial solution hints. "
156  << "Filling the missing positions with zeros...";
157  }
158  initial_solution.assign(glop::ColIndex(num_vars), glop::Fractional(0.0));
159  for (const std::pair<const MPVariable*, double>& p :
160  solver_->solution_hint_) {
161  initial_solution[glop::ColIndex(p.first->index())] =
162  glop::Fractional(p.second);
163  }
164  }
165 
167  solver_->solver_specific_parameter_string_);
168  bop_solver_.SetParameters(parameters_);
169  std::unique_ptr<TimeLimit> time_limit =
170  TimeLimit::FromParameters(parameters_);
171  time_limit->RegisterExternalBooleanAsLimit(&interrupt_solver_);
172  const bop::BopSolveStatus status =
173  initial_solution.empty()
174  ? bop_solver_.SolveWithTimeLimit(linear_program_, time_limit.get())
175  : bop_solver_.SolveWithTimeLimit(linear_program_, initial_solution,
176  time_limit.get());
177 
178  // The solution must be marked as synchronized even when no solution exists.
180  result_status_ = TranslateProblemStatus(status);
183  // Get the results.
184  objective_value_ = bop_solver_.objective_value();
185  best_objective_bound_ = bop_solver_.best_bound();
186 
187  // TODO(user): Implement the column status.
188  const size_t num_vars = solver_->variables_.size();
189  column_status_.resize(num_vars, MPSolver::FREE);
190  for (int var_id = 0; var_id < num_vars; ++var_id) {
191  MPVariable* const var = solver_->variables_[var_id];
192  const glop::ColIndex lp_solver_var_id(var->index());
193  const glop::Fractional solution_value =
194  bop_solver_.variable_values()[lp_solver_var_id];
195  var->set_solution_value(static_cast<double>(solution_value));
196  }
197 
198  // TODO(user): Implement the row status.
199  const size_t num_constraints = solver_->constraints_.size();
200  row_status_.resize(num_constraints, MPSolver::FREE);
201  }
202 
203  return result_status_;
204 }
205 
208  linear_program_.Clear();
209  interrupt_solver_ = false;
210 }
211 
213  NonIncrementalChange();
214 }
215 
216 void BopInterface::SetVariableBounds(int index, double lb, double ub) {
217  NonIncrementalChange();
218 }
219 
220 void BopInterface::SetVariableInteger(int index, bool integer) {
221  NonIncrementalChange();
222 }
223 
224 void BopInterface::SetConstraintBounds(int index, double lb, double ub) {
225  NonIncrementalChange();
226 }
227 
229  NonIncrementalChange();
230 }
231 
233  NonIncrementalChange();
234 }
235 
237  const MPVariable* const variable,
238  double new_value, double old_value) {
239  NonIncrementalChange();
240 }
241 
243  NonIncrementalChange();
244 }
245 
247  double coefficient) {
248  NonIncrementalChange();
249 }
250 
251 void BopInterface::SetObjectiveOffset(double value) { NonIncrementalChange(); }
252 
253 void BopInterface::ClearObjective() { NonIncrementalChange(); }
254 
256  LOG(DFATAL) << "Number of iterations not available";
258 }
259 
261  LOG(DFATAL) << "Number of nodes not available";
262  return kUnknownNumberOfNodes;
263 }
264 
268  }
269  return best_objective_bound_;
270 }
271 
272 MPSolver::BasisStatus BopInterface::row_status(int constraint_index) const {
273  return row_status_[constraint_index];
274 }
275 
277  return column_status_[variable_index];
278 }
279 
280 bool BopInterface::IsContinuous() const { return false; }
281 bool BopInterface::IsLP() const { return false; }
282 bool BopInterface::IsMIP() const { return true; }
283 
284 std::string BopInterface::SolverVersion() const {
285  // TODO(user): Decide how to version bop.
286  return "Bop-0.0";
287 }
288 
290  interrupt_solver_ = true;
291  return true;
292 }
293 
294 void* BopInterface::underlying_solver() { return &bop_solver_; }
295 
296 // TODO(user): remove duplication with GlopInterface.
298  DCHECK_EQ(0, last_variable_index_);
299  DCHECK_EQ(0, last_constraint_index_);
300 
301  const glop::ColIndex num_cols(solver_->variables_.size());
302  for (glop::ColIndex col(last_variable_index_); col < num_cols; ++col) {
303  MPVariable* const var = solver_->variables_[col.value()];
304  const glop::ColIndex new_col = linear_program_.CreateNewVariable();
305  DCHECK_EQ(new_col, col);
306  set_variable_as_extracted(col.value(), true);
307  linear_program_.SetVariableBounds(col, var->lb(), var->ub());
308  if (var->integer()) {
309  linear_program_.SetVariableType(
311  }
312  }
313 }
314 
315 // TODO(user): remove duplication with GlopInterface.
317  DCHECK_EQ(0, last_constraint_index_);
318 
319  const glop::RowIndex num_rows(solver_->constraints_.size());
320  for (glop::RowIndex row(0); row < num_rows; ++row) {
321  MPConstraint* const ct = solver_->constraints_[row.value()];
322  set_constraint_as_extracted(row.value(), true);
323 
324  const double lb = ct->lb();
325  const double ub = ct->ub();
326  const glop::RowIndex new_row = linear_program_.CreateNewConstraint();
327  DCHECK_EQ(new_row, row);
328  linear_program_.SetConstraintBounds(row, lb, ub);
329 
330  for (const auto& entry : ct->coefficients_) {
331  const int var_index = entry.first->index();
332  DCHECK(variable_is_extracted(var_index));
333  const glop::ColIndex col(var_index);
334  const double coeff = entry.second;
335  linear_program_.SetCoefficient(row, col, coeff);
336  }
337  }
338 }
339 
340 // TODO(user): remove duplication with GlopInterface.
342  linear_program_.SetObjectiveOffset(solver_->Objective().offset());
343  for (const auto& entry : solver_->objective_->coefficients_) {
344  const int var_index = entry.first->index();
345  const glop::ColIndex col(var_index);
346  const double coeff = entry.second;
347  linear_program_.SetObjectiveCoefficient(col, coeff);
348  }
349 }
350 
352  parameters_.Clear();
353  SetCommonParameters(param);
354 }
355 
356 // All these have no effect.
362 
364  switch (value) {
366  // TODO(user): add this to BopParameters.
367  break;
369  // TODO(user): add this to BopParameters.
370  break;
371  default:
374  }
375  }
376 }
377 
379  const std::string& parameters) {
380  const bool ok =
381  google::protobuf::TextFormat::MergeFromString(parameters, &parameters_);
382  bop_solver_.SetParameters(parameters_);
383  return ok;
384 }
385 
386 void BopInterface::NonIncrementalChange() {
387  // The current implementation is not incremental.
389 }
390 
391 // Register BOP in the global linear solver factory.
393  return new BopInterface(solver);
394 }
395 
396 } // namespace operations_research
operations_research::BopInterface::SetCoefficient
void SetCoefficient(MPConstraint *const constraint, const MPVariable *const variable, double new_value, double old_value) override
Definition: bop_interface.cc:236
var
IntVar * var
Definition: expr_array.cc:1858
operations_research::BopInterface::SetVariableInteger
void SetVariableInteger(int index, bool integer) override
Definition: bop_interface.cc:220
operations_research::BopInterface::SetObjectiveOffset
void SetObjectiveOffset(double value) override
Definition: bop_interface.cc:251
operations_research::BopInterface::iterations
int64 iterations() const override
Definition: bop_interface.cc:255
integral_types.h
operations_research::MPSolverParameters::kDefaultIntegerParamValue
static const int kDefaultIntegerParamValue
Definition: linear_solver.h:1429
operations_research::BopInterface::SetRelativeMipGap
void SetRelativeMipGap(double value) override
Definition: bop_interface.cc:361
operations_research::bop::IntegralSolver::SetParameters
void SetParameters(const BopParameters &parameters)
Definition: integral_solver.h:34
operations_research::BopInterface::~BopInterface
~BopInterface() override
Definition: bop_interface.cc:126
operations_research::BopInterface::ExtractNewVariables
void ExtractNewVariables() override
Definition: bop_interface.cc:297
operations_research::BopInterface::SetScalingMode
void SetScalingMode(int value) override
Definition: bop_interface.cc:359
operations_research::glop::LinearProgram::SetVariableType
void SetVariableType(ColIndex col, VariableType type)
Definition: lp_data.cc:234
operations_research::MPSolver::OPTIMAL
@ OPTIMAL
optimal.
Definition: linear_solver.h:427
operations_research::bop::IntegralSolver
Definition: integral_solver.h:27
operations_research::MPSolverInterface::trivial_worst_objective_bound
double trivial_worst_objective_bound() const
Definition: linear_solver.cc:1682
operations_research::MPSolver::Objective
const MPObjective & Objective() const
Returns the objective object.
Definition: linear_solver.h:414
operations_research::BopInterface::SetParameters
void SetParameters(const MPSolverParameters &param) override
Definition: bop_interface.cc:351
operations_research::BopInterface::IsMIP
bool IsMIP() const override
Definition: bop_interface.cc:282
logging.h
operations_research::MPSolverInterface::last_constraint_index_
int last_constraint_index_
Definition: linear_solver.h:1728
operations_research::MPSolver
This mathematical programming (MP) solver class is the main class though which users build and solve ...
Definition: linear_solver.h:177
operations_research::BopInterface::SetPrimalTolerance
void SetPrimalTolerance(double value) override
Definition: bop_interface.cc:357
operations_research::BopInterface::best_objective_bound
double best_objective_bound() const override
Definition: bop_interface.cc:265
operations_research::glop::LinearProgram::SetConstraintBounds
void SetConstraintBounds(RowIndex row, Fractional lower_bound, Fractional upper_bound)
Definition: lp_data.cc:307
operations_research::BopInterface::SolverVersion
std::string SolverVersion() const override
Definition: bop_interface.cc:284
value
int64 value
Definition: demon_profiler.cc:43
operations_research::bop::IntegralSolver::objective_value
glop::Fractional objective_value() const
Definition: integral_solver.h:57
operations_research::BopInterface::AddRowConstraint
void AddRowConstraint(MPConstraint *const ct) override
Definition: bop_interface.cc:228
operations_research::MPSolverInterface::CheckBestObjectiveBoundExists
virtual bool CheckBestObjectiveBoundExists() const
Definition: linear_solver.cc:1672
operations_research
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
Definition: dense_doubly_linked_list.h:21
operations_research::MPObjective::offset
double offset() const
Gets the constant term in the objective.
Definition: linear_solver.h:959
operations_research::BopInterface::IsContinuous
bool IsContinuous() const override
Definition: bop_interface.cc:280
operations_research::BopInterface::InterruptSolve
bool InterruptSolve() override
Definition: bop_interface.cc:289
operations_research::MPSolverInterface
Definition: linear_solver.h:1514
operations_research::TimeLimit::FromParameters
static std::unique_ptr< TimeLimit > FromParameters(const Parameters &parameters)
Creates a time limit object initialized from an object that provides methods max_time_in_seconds() an...
Definition: time_limit.h:159
operations_research::BopInterface
Definition: bop_interface.cc:50
operations_research::MPSolver::ABNORMAL
@ ABNORMAL
abnormal, i.e., error of some kind.
Definition: linear_solver.h:435
int64
int64_t int64
Definition: integral_types.h:34
operations_research::glop::LinearProgram::SetMaximizationProblem
void SetMaximizationProblem(bool maximize)
Definition: lp_data.cc:341
index
int index
Definition: pack.cc:508
operations_research::bop::IntegralSolver::variable_values
const glop::DenseRow & variable_values() const
Definition: integral_solver.h:64
operations_research::MPSolverParameters
This class stores parameter settings for LP and MIP solvers.
Definition: linear_solver.h:1358
operations_research::MPConstraint
The class for constraints of a Mathematical Programming (MP) model.
Definition: linear_solver.h:1175
operations_research::BuildBopInterface
MPSolverInterface * BuildBopInterface(MPSolver *const solver)
Definition: bop_interface.cc:392
gtl::ITIVector::empty
bool empty() const
Definition: int_type_indexed_vector.h:155
operations_research::glop::Fractional
double Fractional
Definition: lp_types.h:77
operations_research::glop::LinearProgram::CreateNewVariable
ColIndex CreateNewVariable()
Definition: lp_data.cc:160
operations_research::glop::LinearProgram::CreateNewConstraint
RowIndex CreateNewConstraint()
Definition: lp_data.cc:189
operations_research::glop::LinearProgram::Clear
void Clear()
Definition: lp_data.cc:132
operations_research::MPSolverParameters::PRESOLVE_ON
@ PRESOLVE_ON
Presolve is on.
Definition: linear_solver.h:1393
operations_research::BopInterface::column_status
MPSolver::BasisStatus column_status(int variable_index) const override
Definition: bop_interface.cc:276
file.h
operations_research::MPSolverInterface::objective_value_
double objective_value_
Definition: linear_solver.h:1733
operations_research::BopInterface::SetPresolveMode
void SetPresolveMode(int value) override
Definition: bop_interface.cc:363
operations_research::BopInterface::SetSolverSpecificParametersAsString
bool SetSolverSpecificParametersAsString(const std::string &parameters) override
Definition: bop_interface.cc:378
operations_research::BopInterface::nodes
int64 nodes() const override
Definition: bop_interface.cc:260
operations_research::glop::StrictITIVector::assign
void assign(IntType size, const T &v)
Definition: lp_types.h:274
integral_solver.h
operations_research::MPSolverInterface::ResetExtractionInformation
void ResetExtractionInformation()
Definition: linear_solver.cc:1640
operations_research::MPSolverInterface::kUnknownNumberOfIterations
static constexpr int64 kUnknownNumberOfIterations
Definition: linear_solver.h:1531
operations_research::MPSolverInterface::solver_
MPSolver *const solver_
Definition: linear_solver.h:1718
operations_research::BopInterface::underlying_solver
void * underlying_solver() override
Definition: bop_interface.cc:294
time_limit
SharedTimeLimit * time_limit
Definition: cp_model_solver.cc:2063
operations_research::MPSolver::NOT_SOLVED
@ NOT_SOLVED
not been solved yet.
Definition: linear_solver.h:439
operations_research::glop::LinearProgram::SetVariableBounds
void SetVariableBounds(ColIndex col, Fractional lower_bound, Fractional upper_bound)
Definition: lp_data.cc:247
operations_research::MPSolverInterface::kUnknownNumberOfNodes
static constexpr int64 kUnknownNumberOfNodes
Definition: linear_solver.h:1534
operations_research::MPSolver::SetSolverSpecificParametersAsString
bool SetSolverSpecificParametersAsString(const std::string &parameters)
Advanced usage: pass solver specific parameters in text format.
Definition: linear_solver.cc:345
operations_research::MPSolverParameters::PRESOLVE
@ PRESOLVE
Advanced usage: presolve mode.
Definition: linear_solver.h:1379
operations_research::MPSolver::FREE
@ FREE
Definition: linear_solver.h:641
operations_research::MPSolverInterface::SOLUTION_SYNCHRONIZED
@ SOLUTION_SYNCHRONIZED
Definition: linear_solver.h:1526
operations_research::glop::StrictITIVector< ColIndex, Fractional >
operations_research::MPSolverInterface::SetIntegerParamToUnsupportedValue
virtual void SetIntegerParamToUnsupportedValue(MPSolverParameters::IntegerParam param, int value)
Definition: linear_solver.cc:1748
operations_research::MPSolver::time_limit
int64 time_limit() const
Definition: linear_solver.h:777
operations_research::MPSolver::BasisStatus
BasisStatus
Advanced usage: possible basis status values for a variable and the slack variable of a linear constr...
Definition: linear_solver.h:640
operations_research::glop::LinearProgram::CleanUp
void CleanUp()
Definition: lp_data.cc:345
ct
const Constraint * ct
Definition: demon_profiler.cc:42
operations_research::glop::LinearProgram::SetCoefficient
void SetCoefficient(RowIndex row, ColIndex col, Fractional value)
Definition: lp_data.cc:315
operations_research::bop::IntegralSolver::SolveWithTimeLimit
ABSL_MUST_USE_RESULT BopSolveStatus SolveWithTimeLimit(const glop::LinearProgram &linear_problem, TimeLimit *time_limit)
operations_research::MPSolverInterface::sync_status_
SynchronizationStatus sync_status_
Definition: linear_solver.h:1720
operations_research::MPSolver::ResultStatus
ResultStatus
The status of solving the problem.
Definition: linear_solver.h:425
operations_research::MPSolverInterface::variable_is_extracted
bool variable_is_extracted(int var_index) const
Definition: linear_solver.h:1658
operations_research::BopInterface::row_status
MPSolver::BasisStatus row_status(int constraint_index) const override
Definition: bop_interface.cc:272
operations_research::MPSolverInterface::ExtractModel
void ExtractModel()
Definition: linear_solver.cc:1612
operations_research::BopInterface::BopInterface
BopInterface(MPSolver *const solver)
Definition: bop_interface.cc:117
operations_research::glop::LinearProgram::SetObjectiveOffset
void SetObjectiveOffset(Fractional objective_offset)
Definition: lp_data.cc:329
operations_research::BopInterface::ExtractObjective
void ExtractObjective() override
Definition: bop_interface.cc:341
operations_research::glop::LinearProgram::VariableType::INTEGER
@ INTEGER
operations_research::BopInterface::SetLpAlgorithm
void SetLpAlgorithm(int value) override
Definition: bop_interface.cc:360
operations_research::MPSolverInterface::set_variable_as_extracted
void set_variable_as_extracted(int var_index, bool extracted)
Definition: linear_solver.h:1661
coefficient
int64 coefficient
Definition: routing_search.cc:973
col
ColIndex col
Definition: markowitz.cc:176
row
RowIndex row
Definition: markowitz.cc:175
operations_research::BopInterface::SetObjectiveCoefficient
void SetObjectiveCoefficient(const MPVariable *const variable, double coefficient) override
Definition: bop_interface.cc:246
operations_research::glop::LinearProgram
Definition: lp_data.h:55
bop_parameters.pb.h
operations_research::MPSolverInterface::last_variable_index_
int last_variable_index_
Definition: linear_solver.h:1730
operations_research::BopInterface::IsLP
bool IsLP() const override
Definition: bop_interface.cc:281
operations_research::glop::LinearProgram::SetObjectiveCoefficient
void SetObjectiveCoefficient(ColIndex col, Fractional value)
Definition: lp_data.cc:324
operations_research::MPSolverInterface::quiet
bool quiet() const
Definition: linear_solver.h:1672
operations_research::MPVariable
The class for variables of a Mathematical Programming (MP) model.
Definition: linear_solver.h:1050
operations_research::BopInterface::SetVariableBounds
void SetVariableBounds(int index, double lb, double ub) override
Definition: bop_interface.cc:216
hash.h
linear_solver.h
A C++ wrapper that provides a simple and unified interface to several linear programming and mixed in...
operations_research::MPSolverInterface::SetCommonParameters
void SetCommonParameters(const MPSolverParameters &param)
Definition: linear_solver.cc:1707
operations_research::BopInterface::SetConstraintBounds
void SetConstraintBounds(int index, double lb, double ub) override
Definition: bop_interface.cc:224
operations_research::MPSolver::INFEASIBLE
@ INFEASIBLE
proven infeasible.
Definition: linear_solver.h:431
operations_research::BopInterface::SetOptimizationDirection
void SetOptimizationDirection(bool maximize) override
Definition: bop_interface.cc:212
operations_research::BopInterface::ClearConstraint
void ClearConstraint(MPConstraint *const constraint) override
Definition: bop_interface.cc:242
operations_research::MPSolverParameters::PRESOLVE_OFF
@ PRESOLVE_OFF
Presolve is off.
Definition: linear_solver.h:1391
operations_research::MPSolverInterface::MUST_RELOAD
@ MUST_RELOAD
Definition: linear_solver.h:1519
operations_research::BopInterface::AddVariable
void AddVariable(MPVariable *const var) override
Definition: bop_interface.cc:232
operations_research::BopInterface::SetDualTolerance
void SetDualTolerance(double value) override
Definition: bop_interface.cc:358
operations_research::MPSolverInterface::CheckSolutionIsSynchronized
bool CheckSolutionIsSynchronized() const
Definition: linear_solver.cc:1648
operations_research::bop::BopSolveStatus
BopSolveStatus
Definition: bop_types.h:31
operations_research::BopInterface::ClearObjective
void ClearObjective() override
Definition: bop_interface.cc:253
operations_research::BopInterface::Reset
void Reset() override
Definition: bop_interface.cc:206
operations_research::MPSolverInterface::result_status_
MPSolver::ResultStatus result_status_
Definition: linear_solver.h:1723
operations_research::MPSolverInterface::maximize_
bool maximize_
Definition: linear_solver.h:1725
commandlineflags.h
operations_research::MPSolverInterface::set_constraint_as_extracted
void set_constraint_as_extracted(int ct_index, bool extracted)
Definition: linear_solver.h:1667
parameters
SatParameters parameters
Definition: cp_model_fz_solver.cc:107
operations_research::BopInterface::ExtractNewConstraints
void ExtractNewConstraints() override
Definition: bop_interface.cc:316
operations_research::BopInterface::Solve
MPSolver::ResultStatus Solve(const MPSolverParameters &param) override
Definition: bop_interface.cc:128
operations_research::bop::BopSolveStatus::OPTIMAL_SOLUTION_FOUND
@ OPTIMAL_SOLUTION_FOUND
operations_research::MPSolver::FEASIBLE
@ FEASIBLE
feasible, or stopped by limit.
Definition: linear_solver.h:429
operations_research::bop::IntegralSolver::best_bound
glop::Fractional best_bound() const
Definition: integral_solver.h:60