OR-Tools  8.1
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  MPSolver::BasisStatus row_status(int constraint_index) const override;
79  MPSolver::BasisStatus column_status(int variable_index) const override;
80 
81  // ----- Misc -----
82  bool IsContinuous() const override;
83  bool IsLP() const override;
84  bool IsMIP() const override;
85 
86  std::string SolverVersion() const override;
87  bool InterruptSolve() override;
88  void* underlying_solver() override;
89 
90  void ExtractNewVariables() override;
91  void ExtractNewConstraints() override;
92  void ExtractObjective() override;
93 
94  void SetParameters(const MPSolverParameters& param) override;
95  void SetRelativeMipGap(double value) override;
96  void SetPrimalTolerance(double value) override;
97  void SetDualTolerance(double value) override;
98  void SetPresolveMode(int value) override;
99  void SetScalingMode(int value) override;
100  void SetLpAlgorithm(int value) override;
102  const std::string& parameters) override;
103 
104  private:
105  void NonIncrementalChange();
106 
107  glop::LinearProgram linear_program_;
108  bop::IntegralSolver bop_solver_;
109  std::vector<MPSolver::BasisStatus> column_status_;
110  std::vector<MPSolver::BasisStatus> row_status_;
111  bop::BopParameters parameters_;
112  std::atomic<bool> interrupt_solver_;
113 };
114 
116  : MPSolverInterface(solver),
117  linear_program_(),
118  bop_solver_(),
119  column_status_(),
120  row_status_(),
121  parameters_(),
122  interrupt_solver_(false) {}
123 
125 
127  // Check whenever the solve has already been stopped by the user.
128  if (interrupt_solver_) {
129  Reset();
130  return MPSolver::NOT_SOLVED;
131  }
132 
133  // Reset extraction as this interface is not incremental yet.
134  Reset();
135  ExtractModel();
136  SetParameters(param);
137 
138  linear_program_.SetMaximizationProblem(maximize_);
139  linear_program_.CleanUp();
140 
141  // Time limit.
142  if (solver_->time_limit()) {
143  VLOG(1) << "Setting time limit = " << solver_->time_limit() << " ms.";
144  parameters_.set_max_time_in_seconds(
145  static_cast<double>(solver_->time_limit()) / 1000.0);
146  }
147  parameters_.set_log_search_progress(!quiet());
148 
149  glop::DenseRow initial_solution;
150  if (!solver_->solution_hint_.empty()) {
151  const int num_vars = solver_->variables_.size();
152  if (solver_->solution_hint_.size() != num_vars) {
153  LOG(WARNING) << "Bop currently doesn't handle partial solution hints. "
154  << "Filling the missing positions with zeros...";
155  }
156  initial_solution.assign(glop::ColIndex(num_vars), glop::Fractional(0.0));
157  for (const std::pair<const MPVariable*, double>& p :
158  solver_->solution_hint_) {
159  initial_solution[glop::ColIndex(p.first->index())] =
160  glop::Fractional(p.second);
161  }
162  }
163 
165  solver_->solver_specific_parameter_string_);
166  bop_solver_.SetParameters(parameters_);
167  std::unique_ptr<TimeLimit> time_limit =
168  TimeLimit::FromParameters(parameters_);
169  time_limit->RegisterExternalBooleanAsLimit(&interrupt_solver_);
170  const bop::BopSolveStatus status =
171  initial_solution.empty()
172  ? bop_solver_.SolveWithTimeLimit(linear_program_, time_limit.get())
173  : bop_solver_.SolveWithTimeLimit(linear_program_, initial_solution,
174  time_limit.get());
175 
176  // The solution must be marked as synchronized even when no solution exists.
178  result_status_ = TranslateProblemStatus(status);
181  // Get the results.
182  objective_value_ = bop_solver_.objective_value();
183  best_objective_bound_ = bop_solver_.best_bound();
184 
185  // TODO(user): Implement the column status.
186  const size_t num_vars = solver_->variables_.size();
187  column_status_.resize(num_vars, MPSolver::FREE);
188  for (int var_id = 0; var_id < num_vars; ++var_id) {
189  MPVariable* const var = solver_->variables_[var_id];
190  const glop::ColIndex lp_solver_var_id(var->index());
191  const glop::Fractional solution_value =
192  bop_solver_.variable_values()[lp_solver_var_id];
193  var->set_solution_value(static_cast<double>(solution_value));
194  }
195 
196  // TODO(user): Implement the row status.
197  const size_t num_constraints = solver_->constraints_.size();
198  row_status_.resize(num_constraints, MPSolver::FREE);
199  }
200 
201  return result_status_;
202 }
203 
206  linear_program_.Clear();
207  interrupt_solver_ = false;
208 }
209 
211  NonIncrementalChange();
212 }
213 
214 void BopInterface::SetVariableBounds(int index, double lb, double ub) {
215  NonIncrementalChange();
216 }
217 
218 void BopInterface::SetVariableInteger(int index, bool integer) {
219  NonIncrementalChange();
220 }
221 
222 void BopInterface::SetConstraintBounds(int index, double lb, double ub) {
223  NonIncrementalChange();
224 }
225 
227  NonIncrementalChange();
228 }
229 
231  NonIncrementalChange();
232 }
233 
235  const MPVariable* const variable,
236  double new_value, double old_value) {
237  NonIncrementalChange();
238 }
239 
241  NonIncrementalChange();
242 }
243 
245  double coefficient) {
246  NonIncrementalChange();
247 }
248 
249 void BopInterface::SetObjectiveOffset(double value) { NonIncrementalChange(); }
250 
251 void BopInterface::ClearObjective() { NonIncrementalChange(); }
252 
254  LOG(DFATAL) << "Number of iterations not available";
256 }
257 
259  LOG(DFATAL) << "Number of nodes not available";
260  return kUnknownNumberOfNodes;
261 }
262 
263 MPSolver::BasisStatus BopInterface::row_status(int constraint_index) const {
264  return row_status_[constraint_index];
265 }
266 
268  return column_status_[variable_index];
269 }
270 
271 bool BopInterface::IsContinuous() const { return false; }
272 bool BopInterface::IsLP() const { return false; }
273 bool BopInterface::IsMIP() const { return true; }
274 
275 std::string BopInterface::SolverVersion() const {
276  // TODO(user): Decide how to version bop.
277  return "Bop-0.0";
278 }
279 
281  interrupt_solver_ = true;
282  return true;
283 }
284 
285 void* BopInterface::underlying_solver() { return &bop_solver_; }
286 
287 // TODO(user): remove duplication with GlopInterface.
291 
292  const glop::ColIndex num_cols(solver_->variables_.size());
293  for (glop::ColIndex col(last_variable_index_); col < num_cols; ++col) {
294  MPVariable* const var = solver_->variables_[col.value()];
295  const glop::ColIndex new_col = linear_program_.CreateNewVariable();
296  DCHECK_EQ(new_col, col);
297  set_variable_as_extracted(col.value(), true);
298  linear_program_.SetVariableBounds(col, var->lb(), var->ub());
299  if (var->integer()) {
300  linear_program_.SetVariableType(
302  }
303  }
304 }
305 
306 // TODO(user): remove duplication with GlopInterface.
309 
310  const glop::RowIndex num_rows(solver_->constraints_.size());
311  for (glop::RowIndex row(0); row < num_rows; ++row) {
312  MPConstraint* const ct = solver_->constraints_[row.value()];
313  set_constraint_as_extracted(row.value(), true);
314 
315  const double lb = ct->lb();
316  const double ub = ct->ub();
317  const glop::RowIndex new_row = linear_program_.CreateNewConstraint();
318  DCHECK_EQ(new_row, row);
319  linear_program_.SetConstraintBounds(row, lb, ub);
320 
321  for (const auto& entry : ct->coefficients_) {
322  const int var_index = entry.first->index();
323  DCHECK(variable_is_extracted(var_index));
324  const glop::ColIndex col(var_index);
325  const double coeff = entry.second;
326  linear_program_.SetCoefficient(row, col, coeff);
327  }
328  }
329 }
330 
331 // TODO(user): remove duplication with GlopInterface.
333  linear_program_.SetObjectiveOffset(solver_->Objective().offset());
334  for (const auto& entry : solver_->objective_->coefficients_) {
335  const int var_index = entry.first->index();
336  const glop::ColIndex col(var_index);
337  const double coeff = entry.second;
338  linear_program_.SetObjectiveCoefficient(col, coeff);
339  }
340 }
341 
343  parameters_.Clear();
344  SetCommonParameters(param);
345 }
346 
347 // All these have no effect.
353 
355  switch (value) {
357  // TODO(user): add this to BopParameters.
358  break;
360  // TODO(user): add this to BopParameters.
361  break;
362  default:
365  }
366  }
367 }
368 
370  const std::string& parameters) {
371  const bool ok =
372  google::protobuf::TextFormat::MergeFromString(parameters, &parameters_);
373  bop_solver_.SetParameters(parameters_);
374  return ok;
375 }
376 
377 void BopInterface::NonIncrementalChange() {
378  // The current implementation is not incremental.
380 }
381 
382 // Register BOP in the global linear solver factory.
384  return new BopInterface(solver);
385 }
386 
387 } // 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:234
var
IntVar * var
Definition: expr_array.cc:1858
operations_research::BopInterface::SetVariableInteger
void SetVariableInteger(int index, bool integer) override
Definition: bop_interface.cc:218
operations_research::BopInterface::SetObjectiveOffset
void SetObjectiveOffset(double value) override
Definition: bop_interface.cc:249
operations_research::BopInterface::iterations
int64 iterations() const override
Definition: bop_interface.cc:253
integral_types.h
operations_research::MPSolverParameters::kDefaultIntegerParamValue
static const int kDefaultIntegerParamValue
Definition: linear_solver.h:1431
VLOG
#define VLOG(verboselevel)
Definition: base/logging.h:978
operations_research::BopInterface::SetRelativeMipGap
void SetRelativeMipGap(double value) override
Definition: bop_interface.cc:352
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:124
operations_research::BopInterface::ExtractNewVariables
void ExtractNewVariables() override
Definition: bop_interface.cc:288
LOG
#define LOG(severity)
Definition: base/logging.h:420
operations_research::BopInterface::SetScalingMode
void SetScalingMode(int value) override
Definition: bop_interface.cc:350
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:429
operations_research::bop::IntegralSolver
Definition: integral_solver.h:27
operations_research::MPSolver::Objective
const MPObjective & Objective() const
Returns the objective object.
Definition: linear_solver.h:416
operations_research::BopInterface::SetParameters
void SetParameters(const MPSolverParameters &param) override
Definition: bop_interface.cc:342
operations_research::BopInterface::IsMIP
bool IsMIP() const override
Definition: bop_interface.cc:273
logging.h
operations_research::MPSolverInterface::last_constraint_index_
int last_constraint_index_
Definition: linear_solver.h:1724
operations_research::MPSolver
This mathematical programming (MP) solver class is the main class though which users build and solve ...
Definition: linear_solver.h:179
operations_research::BopInterface::SetPrimalTolerance
void SetPrimalTolerance(double value) override
Definition: bop_interface.cc:348
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:275
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:226
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:961
operations_research::BopInterface::IsContinuous
bool IsContinuous() const override
Definition: bop_interface.cc:271
WARNING
const int WARNING
Definition: log_severity.h:31
operations_research::BopInterface::InterruptSolve
bool InterruptSolve() override
Definition: bop_interface.cc:280
operations_research::MPSolverInterface
Definition: linear_solver.h:1516
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:437
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:1360
operations_research::MPConstraint
The class for constraints of a Mathematical Programming (MP) model.
Definition: linear_solver.h:1177
operations_research::BuildBopInterface
MPSolverInterface * BuildBopInterface(MPSolver *const solver)
Definition: bop_interface.cc:383
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:1395
operations_research::BopInterface::column_status
MPSolver::BasisStatus column_status(int variable_index) const override
Definition: bop_interface.cc:267
file.h
operations_research::MPSolverInterface::objective_value_
double objective_value_
Definition: linear_solver.h:1729
operations_research::BopInterface::SetPresolveMode
void SetPresolveMode(int value) override
Definition: bop_interface.cc:354
operations_research::BopInterface::SetSolverSpecificParametersAsString
bool SetSolverSpecificParametersAsString(const std::string &parameters) override
Definition: bop_interface.cc:369
operations_research::BopInterface::nodes
int64 nodes() const override
Definition: bop_interface.cc:258
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:1665
operations_research::MPSolverInterface::kUnknownNumberOfIterations
static constexpr int64 kUnknownNumberOfIterations
Definition: linear_solver.h:1533
operations_research::MPSolverInterface::solver_
MPSolver *const solver_
Definition: linear_solver.h:1714
operations_research::BopInterface::underlying_solver
void * underlying_solver() override
Definition: bop_interface.cc:285
time_limit
SharedTimeLimit * time_limit
Definition: cp_model_solver.cc:2103
operations_research::MPSolver::NOT_SOLVED
@ NOT_SOLVED
not been solved yet.
Definition: linear_solver.h:441
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:1536
operations_research::MPSolver::SetSolverSpecificParametersAsString
bool SetSolverSpecificParametersAsString(const std::string &parameters)
Advanced usage: pass solver specific parameters in text format.
Definition: linear_solver.cc:346
operations_research::MPSolverParameters::PRESOLVE
@ PRESOLVE
Advanced usage: presolve mode.
Definition: linear_solver.h:1381
operations_research::MPSolver::FREE
@ FREE
Definition: linear_solver.h:643
operations_research::MPSolverInterface::SOLUTION_SYNCHRONIZED
@ SOLUTION_SYNCHRONIZED
Definition: linear_solver.h:1528
operations_research::glop::StrictITIVector< ColIndex, Fractional >
operations_research::MPSolverInterface::SetIntegerParamToUnsupportedValue
virtual void SetIntegerParamToUnsupportedValue(MPSolverParameters::IntegerParam param, int value)
Definition: linear_solver.cc:1774
operations_research::MPSolver::time_limit
int64 time_limit() const
Definition: linear_solver.h:779
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:642
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:1716
DCHECK
#define DCHECK(condition)
Definition: base/logging.h:884
operations_research::MPSolver::ResultStatus
ResultStatus
The status of solving the problem.
Definition: linear_solver.h:427
operations_research::MPSolverInterface::variable_is_extracted
bool variable_is_extracted(int var_index) const
Definition: linear_solver.h:1654
operations_research::BopInterface::row_status
MPSolver::BasisStatus row_status(int constraint_index) const override
Definition: bop_interface.cc:263
operations_research::MPSolverInterface::ExtractModel
void ExtractModel()
Definition: linear_solver.cc:1637
operations_research::BopInterface::BopInterface
BopInterface(MPSolver *const solver)
Definition: bop_interface.cc:115
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:332
operations_research::glop::LinearProgram::VariableType::INTEGER
@ INTEGER
operations_research::BopInterface::SetLpAlgorithm
void SetLpAlgorithm(int value) override
Definition: bop_interface.cc:351
operations_research::MPSolverInterface::set_variable_as_extracted
void set_variable_as_extracted(int var_index, bool extracted)
Definition: linear_solver.h:1657
coefficient
int64 coefficient
Definition: routing_search.cc:972
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:244
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:1726
operations_research::BopInterface::IsLP
bool IsLP() const override
Definition: bop_interface.cc:272
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:1668
operations_research::MPVariable
The class for variables of a Mathematical Programming (MP) model.
Definition: linear_solver.h:1052
operations_research::BopInterface::SetVariableBounds
void SetVariableBounds(int index, double lb, double ub) override
Definition: bop_interface.cc:214
DCHECK_EQ
#define DCHECK_EQ(val1, val2)
Definition: base/logging.h:885
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:1733
operations_research::BopInterface::SetConstraintBounds
void SetConstraintBounds(int index, double lb, double ub) override
Definition: bop_interface.cc:222
operations_research::MPSolver::INFEASIBLE
@ INFEASIBLE
proven infeasible.
Definition: linear_solver.h:433
operations_research::BopInterface::SetOptimizationDirection
void SetOptimizationDirection(bool maximize) override
Definition: bop_interface.cc:210
operations_research::BopInterface::ClearConstraint
void ClearConstraint(MPConstraint *const constraint) override
Definition: bop_interface.cc:240
operations_research::MPSolverParameters::PRESOLVE_OFF
@ PRESOLVE_OFF
Presolve is off.
Definition: linear_solver.h:1393
operations_research::MPSolverInterface::MUST_RELOAD
@ MUST_RELOAD
Definition: linear_solver.h:1521
absl::StrongVector::empty
bool empty() const
Definition: strong_vector.h:156
operations_research::BopInterface::AddVariable
void AddVariable(MPVariable *const var) override
Definition: bop_interface.cc:230
operations_research::BopInterface::SetDualTolerance
void SetDualTolerance(double value) override
Definition: bop_interface.cc:349
operations_research::bop::BopSolveStatus
BopSolveStatus
Definition: bop_types.h:31
operations_research::BopInterface::ClearObjective
void ClearObjective() override
Definition: bop_interface.cc:251
operations_research::BopInterface::Reset
void Reset() override
Definition: bop_interface.cc:204
operations_research::MPSolverInterface::result_status_
MPSolver::ResultStatus result_status_
Definition: linear_solver.h:1719
operations_research::MPSolverInterface::maximize_
bool maximize_
Definition: linear_solver.h:1721
commandlineflags.h
operations_research::MPSolverInterface::set_constraint_as_extracted
void set_constraint_as_extracted(int ct_index, bool extracted)
Definition: linear_solver.h:1663
parameters
SatParameters parameters
Definition: cp_model_fz_solver.cc:108
operations_research::BopInterface::ExtractNewConstraints
void ExtractNewConstraints() override
Definition: bop_interface.cc:307
operations_research::BopInterface::Solve
MPSolver::ResultStatus Solve(const MPSolverParameters &param) override
Definition: bop_interface.cc:126
operations_research::bop::BopSolveStatus::OPTIMAL_SOLUTION_FOUND
@ OPTIMAL_SOLUTION_FOUND
operations_research::MPSolver::FEASIBLE
@ FEASIBLE
feasible, or stopped by limit.
Definition: linear_solver.h:431
operations_research::bop::IntegralSolver::best_bound
glop::Fractional best_bound() const
Definition: integral_solver.h:60
operations_research::MPSolverInterface::best_objective_bound_
double best_objective_bound_
Definition: linear_solver.h:1732