Fix boolean_problem.proto namespace
This commit is contained in:
@@ -23,7 +23,8 @@
|
||||
namespace operations_research {
|
||||
namespace bop {
|
||||
|
||||
using ::operations_research::LinearBooleanProblem;
|
||||
using ::operations_research::sat::LinearBooleanProblem;
|
||||
using ::operations_research::sat::LinearObjective;
|
||||
|
||||
BopOptimizerBase::BopOptimizerBase(const std::string& name)
|
||||
: name_(name), stats_(name) {
|
||||
|
||||
@@ -110,7 +110,7 @@ inline std::ostream& operator<<(std::ostream& os,
|
||||
// information that the solver learned about it at a given time.
|
||||
class ProblemState {
|
||||
public:
|
||||
explicit ProblemState(const LinearBooleanProblem& problem);
|
||||
explicit ProblemState(const sat::LinearBooleanProblem& problem);
|
||||
|
||||
// Sets parameters, used for instance to get the tolerance, the gap limit...
|
||||
void SetParameters(const BopParameters& parameters) {
|
||||
@@ -195,7 +195,7 @@ class ProblemState {
|
||||
// Returns the original problem. Note that the current problem might be
|
||||
// different, e.g. fixed variables, but equivalent, i.e. a solution to one
|
||||
// should be a solution to the other too.
|
||||
const LinearBooleanProblem& original_problem() const {
|
||||
const sat::LinearBooleanProblem& original_problem() const {
|
||||
return original_problem_;
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ class ProblemState {
|
||||
void SynchronizationDone();
|
||||
|
||||
private:
|
||||
const LinearBooleanProblem& original_problem_;
|
||||
const sat::LinearBooleanProblem& original_problem_;
|
||||
BopParameters parameters_;
|
||||
int64 update_stamp_;
|
||||
gtl::ITIVector<VariableIndex, bool> is_fixed_;
|
||||
@@ -243,7 +243,7 @@ class ProblemState {
|
||||
// with the problem state in order to get a more constrained problem to be used
|
||||
// by the next called optimizer.
|
||||
struct LearnedInfo {
|
||||
explicit LearnedInfo(const LinearBooleanProblem& problem)
|
||||
explicit LearnedInfo(const sat::LinearBooleanProblem& problem)
|
||||
: fixed_literals(),
|
||||
solution(problem, "AllZero"),
|
||||
lower_bound(kint64min),
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
namespace operations_research {
|
||||
namespace bop {
|
||||
|
||||
using ::operations_research::LinearBooleanConstraint;
|
||||
using ::operations_research::LinearBooleanProblem;
|
||||
using ::operations_research::sat::LinearBooleanConstraint;
|
||||
using ::operations_research::sat::LinearBooleanProblem;
|
||||
using ::operations_research::glop::ColIndex;
|
||||
using ::operations_research::glop::DenseRow;
|
||||
using ::operations_research::glop::LinearProgram;
|
||||
|
||||
@@ -163,7 +163,7 @@ class ConstraintBasedNeighborhood : public NeighborhoodGenerator {
|
||||
// if they appear in the same constraint.
|
||||
class RelationGraphBasedNeighborhood : public NeighborhoodGenerator {
|
||||
public:
|
||||
RelationGraphBasedNeighborhood(const LinearBooleanProblem& problem,
|
||||
RelationGraphBasedNeighborhood(const sat::LinearBooleanProblem& problem,
|
||||
MTRandom* random);
|
||||
~RelationGraphBasedNeighborhood() final {}
|
||||
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
namespace operations_research {
|
||||
namespace bop {
|
||||
|
||||
using ::operations_research::sat::LinearBooleanConstraint;
|
||||
using ::operations_research::sat::LinearBooleanProblem;
|
||||
using ::operations_research::sat::LinearObjective;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// LocalSearchOptimizer
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -264,7 +264,7 @@ class AssignmentAndConstraintFeasibilityMaintainer {
|
||||
// Note that the constraint indices used in this class are not the same as
|
||||
// the one used in the given LinearBooleanProblem here.
|
||||
explicit AssignmentAndConstraintFeasibilityMaintainer(
|
||||
const LinearBooleanProblem& problem);
|
||||
const sat::LinearBooleanProblem& problem);
|
||||
|
||||
// When we construct the problem, we treat the objective as one constraint.
|
||||
// This is the index of this special "objective" constraint.
|
||||
@@ -435,7 +435,7 @@ class OneFlipConstraintRepairer {
|
||||
// TODO(user): maybe merge the two classes? maintaining this implicit indices
|
||||
// convention between the two classes sounds like a bad idea.
|
||||
OneFlipConstraintRepairer(
|
||||
const LinearBooleanProblem& problem,
|
||||
const sat::LinearBooleanProblem& problem,
|
||||
const AssignmentAndConstraintFeasibilityMaintainer& maintainer,
|
||||
const sat::VariablesAssignment& sat_assignment);
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
namespace operations_research {
|
||||
namespace bop {
|
||||
namespace {
|
||||
|
||||
using ::operations_research::sat::LinearBooleanProblem;
|
||||
using ::operations_research::sat::LinearObjective;
|
||||
|
||||
void BuildObjectiveTerms(const LinearBooleanProblem& problem,
|
||||
BopConstraintTerms* objective_terms) {
|
||||
CHECK(objective_terms != nullptr);
|
||||
|
||||
@@ -75,10 +75,10 @@ class PortfolioOptimizer : public BopOptimizerBase {
|
||||
private:
|
||||
BopOptimizerBase::Status SynchronizeIfNeeded(
|
||||
const ProblemState& problem_state);
|
||||
void AddOptimizer(const LinearBooleanProblem& problem,
|
||||
void AddOptimizer(const sat::LinearBooleanProblem& problem,
|
||||
const BopParameters& parameters,
|
||||
const BopOptimizerMethod& optimizer_method);
|
||||
void CreateOptimizers(const LinearBooleanProblem& problem,
|
||||
void CreateOptimizers(const sat::LinearBooleanProblem& problem,
|
||||
const BopParameters& parameters,
|
||||
const BopSolverOptimizerSet& optimizer_set);
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
|
||||
namespace operations_research {
|
||||
namespace bop {
|
||||
using ::operations_research::sat::LinearBooleanConstraint;
|
||||
using ::operations_research::sat::LinearBooleanProblem;
|
||||
using ::operations_research::sat::LinearObjective;
|
||||
//------------------------------------------------------------------------------
|
||||
// BopSolution
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace bop {
|
||||
// the feasibility.
|
||||
class BopSolution {
|
||||
public:
|
||||
BopSolution(const LinearBooleanProblem& problem, const std::string& name);
|
||||
BopSolution(const sat::LinearBooleanProblem& problem, const std::string& name);
|
||||
|
||||
void SetValue(VariableIndex var, bool value) {
|
||||
recompute_cost_ = true;
|
||||
@@ -93,7 +93,7 @@ class BopSolution {
|
||||
bool ComputeIsFeasible() const;
|
||||
int64 ComputeCost() const;
|
||||
|
||||
const LinearBooleanProblem* problem_;
|
||||
const sat::LinearBooleanProblem* problem_;
|
||||
std::string name_;
|
||||
gtl::ITIVector<VariableIndex, bool> values_;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace operations_research {
|
||||
namespace bop {
|
||||
namespace {
|
||||
|
||||
using ::operations_research::LinearBooleanProblem;
|
||||
using ::operations_research::sat::LinearBooleanProblem;
|
||||
using ::operations_research::glop::ColIndex;
|
||||
using ::operations_research::glop::DenseRow;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace bop {
|
||||
// Solver of Boolean Optimization Problems based on Local Search.
|
||||
class BopSolver {
|
||||
public:
|
||||
explicit BopSolver(const LinearBooleanProblem& problem);
|
||||
explicit BopSolver(const sat::LinearBooleanProblem& problem);
|
||||
virtual ~BopSolver();
|
||||
|
||||
// Parameters management.
|
||||
@@ -93,7 +93,7 @@ class BopSolver {
|
||||
BopSolveStatus InternalMonothreadSolver(TimeLimit* time_limit);
|
||||
BopSolveStatus InternalMultithreadSolver(TimeLimit* time_limit);
|
||||
|
||||
const LinearBooleanProblem& problem_;
|
||||
const sat::LinearBooleanProblem& problem_;
|
||||
ProblemState problem_state_;
|
||||
BopParameters parameters_;
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
namespace operations_research {
|
||||
namespace bop {
|
||||
|
||||
using ::operations_research::sat::LinearBooleanConstraint;
|
||||
using ::operations_research::sat::LinearBooleanProblem;
|
||||
using ::operations_research::sat::LinearObjective;
|
||||
using operations_research::glop::ColIndex;
|
||||
using operations_research::glop::DenseRow;
|
||||
using operations_research::glop::Fractional;
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
|
||||
syntax = "proto2";
|
||||
|
||||
package operations_research;
|
||||
package operations_research.sat;
|
||||
|
||||
option csharp_namespace = "Google.OrTools.Sat";
|
||||
option java_package = "com.google.ortools.sat";
|
||||
option java_multiple_files = true;
|
||||
|
||||
// A linear Boolean constraint which is a bounded sum of linear terms. Each term
|
||||
// beeing a literal times an integer coefficient. If we assume that a literal
|
||||
|
||||
Reference in New Issue
Block a user