Export bop/ from google3

This commit is contained in:
Corentin Le Molgat
2023-05-24 15:31:42 +02:00
parent 9684634e60
commit 7554adcfaf
8 changed files with 15 additions and 15 deletions

View File

@@ -130,7 +130,7 @@ class ProblemState {
void set_assignment_preference(const std::vector<bool>& a) {
assignment_preference_ = a;
}
const std::vector<bool> assignment_preference() const {
std::vector<bool> assignment_preference() const {
return assignment_preference_;
}

View File

@@ -88,7 +88,7 @@ GuidedSatFirstSolutionGenerator::GuidedSatFirstSolutionGenerator(
state_update_stamp_(ProblemState::kInitialStampValue),
sat_solver_() {}
GuidedSatFirstSolutionGenerator::~GuidedSatFirstSolutionGenerator() {}
GuidedSatFirstSolutionGenerator::~GuidedSatFirstSolutionGenerator() = default;
BopOptimizerBase::Status GuidedSatFirstSolutionGenerator::SynchronizeIfNeeded(
const ProblemState& problem_state) {
@@ -221,7 +221,7 @@ BopRandomFirstSolutionGenerator::BopRandomFirstSolutionGenerator(
random_(random),
sat_propagator_(sat_propagator) {}
BopRandomFirstSolutionGenerator::~BopRandomFirstSolutionGenerator() {}
BopRandomFirstSolutionGenerator::~BopRandomFirstSolutionGenerator() = default;
// Only run the RandomFirstSolution when there is an objective to minimize.
bool BopRandomFirstSolutionGenerator::ShouldBeRun(
@@ -359,7 +359,7 @@ LinearRelaxation::LinearRelaxation(const BopParameters& parameters,
problem_already_solved_(false),
scaled_solution_cost_(glop::kInfinity) {}
LinearRelaxation::~LinearRelaxation() {}
LinearRelaxation::~LinearRelaxation() = default;
BopOptimizerBase::Status LinearRelaxation::SynchronizeIfNeeded(
const ProblemState& problem_state) {

View File

@@ -61,7 +61,7 @@ BopCompleteLNSOptimizer::BopCompleteLNSOptimizer(
state_update_stamp_(ProblemState::kInitialStampValue),
objective_terms_(objective_terms) {}
BopCompleteLNSOptimizer::~BopCompleteLNSOptimizer() {}
BopCompleteLNSOptimizer::~BopCompleteLNSOptimizer() = default;
BopOptimizerBase::Status BopCompleteLNSOptimizer::SynchronizeIfNeeded(
const ProblemState& problem_state, int num_relaxed_vars) {
@@ -223,7 +223,7 @@ BopAdaptiveLNSOptimizer::BopAdaptiveLNSOptimizer(
CHECK(sat_propagator != nullptr);
}
BopAdaptiveLNSOptimizer::~BopAdaptiveLNSOptimizer() {}
BopAdaptiveLNSOptimizer::~BopAdaptiveLNSOptimizer() = default;
bool BopAdaptiveLNSOptimizer::ShouldBeRun(
const ProblemState& problem_state) const {

View File

@@ -70,8 +70,8 @@ class BopCompleteLNSOptimizer : public BopOptimizerBase {
// function here and a way to select between which one to call.
class NeighborhoodGenerator {
public:
NeighborhoodGenerator() {}
virtual ~NeighborhoodGenerator() {}
NeighborhoodGenerator() = default;
virtual ~NeighborhoodGenerator() = default;
// Interface for the neighborhood generation.
//
@@ -131,7 +131,7 @@ class ObjectiveBasedNeighborhood : public NeighborhoodGenerator {
ObjectiveBasedNeighborhood(const BopConstraintTerms* objective_terms,
absl::BitGenRef random)
: objective_terms_(*objective_terms), random_(random) {}
~ObjectiveBasedNeighborhood() final {}
~ObjectiveBasedNeighborhood() final = default;
private:
void GenerateNeighborhood(const ProblemState& problem_state,
@@ -149,7 +149,7 @@ class ConstraintBasedNeighborhood : public NeighborhoodGenerator {
ConstraintBasedNeighborhood(const BopConstraintTerms* objective_terms,
absl::BitGenRef random)
: objective_terms_(*objective_terms), random_(random) {}
~ConstraintBasedNeighborhood() final {}
~ConstraintBasedNeighborhood() final = default;
private:
void GenerateNeighborhood(const ProblemState& problem_state,
@@ -166,7 +166,7 @@ class RelationGraphBasedNeighborhood : public NeighborhoodGenerator {
public:
RelationGraphBasedNeighborhood(const sat::LinearBooleanProblem& problem,
absl::BitGenRef random);
~RelationGraphBasedNeighborhood() final {}
~RelationGraphBasedNeighborhood() final = default;
private:
void GenerateNeighborhood(const ProblemState& problem_state,

View File

@@ -51,7 +51,7 @@ LocalSearchOptimizer::LocalSearchOptimizer(absl::string_view name,
assignment_iterator_(),
random_(random) {}
LocalSearchOptimizer::~LocalSearchOptimizer() {}
LocalSearchOptimizer::~LocalSearchOptimizer() = default;
bool LocalSearchOptimizer::ShouldBeRun(
const ProblemState& problem_state) const {

View File

@@ -164,7 +164,7 @@ class LocalSearchOptimizer : public BopOptimizerBase {
template <typename IntType>
class BacktrackableIntegerSet {
public:
BacktrackableIntegerSet() {}
BacktrackableIntegerSet() = default;
// Prepares the class for integers in [0, n) and initializes the set to the
// empty one. Note that this run in O(n). Once resized, it is better to call

View File

@@ -35,7 +35,7 @@ SatCoreBasedOptimizer::SatCoreBasedOptimizer(absl::string_view name)
upper_bound_ = sat::kCoefficientMax;
}
SatCoreBasedOptimizer::~SatCoreBasedOptimizer() {}
SatCoreBasedOptimizer::~SatCoreBasedOptimizer() = default;
BopOptimizerBase::Status SatCoreBasedOptimizer::SynchronizeIfNeeded(
const ProblemState& problem_state) {

View File

@@ -28,7 +28,7 @@ namespace bop {
class IntegralSolver {
public:
IntegralSolver();
~IntegralSolver() {}
~IntegralSolver() = default;
// Sets the solver parameters.
// See the proto for an extensive documentation.