Export bop/ from google3
This commit is contained in:
@@ -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_;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace bop {
|
||||
class IntegralSolver {
|
||||
public:
|
||||
IntegralSolver();
|
||||
~IntegralSolver() {}
|
||||
~IntegralSolver() = default;
|
||||
|
||||
// Sets the solver parameters.
|
||||
// See the proto for an extensive documentation.
|
||||
|
||||
Reference in New Issue
Block a user