namespace change for proto

This commit is contained in:
Laurent Perron
2020-09-03 09:07:51 +02:00
parent 0873c92e36
commit 0b8f2f2b5b
14 changed files with 18 additions and 33 deletions

View File

@@ -23,8 +23,7 @@
namespace operations_research {
namespace bop {
using ::operations_research::sat::LinearBooleanProblem;
using ::operations_research::sat::LinearObjective;
using ::operations_research::LinearBooleanProblem;
BopOptimizerBase::BopOptimizerBase(const std::string& name)
: name_(name), stats_(name) {

View File

@@ -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 sat::LinearBooleanProblem& problem);
explicit ProblemState(const 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 sat::LinearBooleanProblem& original_problem() const {
const LinearBooleanProblem& original_problem() const {
return original_problem_;
}
@@ -220,7 +220,7 @@ class ProblemState {
void SynchronizationDone();
private:
const sat::LinearBooleanProblem& original_problem_;
const 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 sat::LinearBooleanProblem& problem)
explicit LearnedInfo(const LinearBooleanProblem& problem)
: fixed_literals(),
solution(problem, "AllZero"),
lower_bound(kint64min),

View File

@@ -32,8 +32,8 @@
namespace operations_research {
namespace bop {
using ::operations_research::sat::LinearBooleanConstraint;
using ::operations_research::sat::LinearBooleanProblem;
using ::operations_research::LinearBooleanConstraint;
using ::operations_research::LinearBooleanProblem;
using ::operations_research::glop::ColIndex;
using ::operations_research::glop::DenseRow;
using ::operations_research::glop::LinearProgram;

View File

@@ -163,7 +163,7 @@ class ConstraintBasedNeighborhood : public NeighborhoodGenerator {
// if they appear in the same constraint.
class RelationGraphBasedNeighborhood : public NeighborhoodGenerator {
public:
RelationGraphBasedNeighborhood(const sat::LinearBooleanProblem& problem,
RelationGraphBasedNeighborhood(const LinearBooleanProblem& problem,
MTRandom* random);
~RelationGraphBasedNeighborhood() final {}

View File

@@ -21,10 +21,6 @@
namespace operations_research {
namespace bop {
using ::operations_research::sat::LinearBooleanConstraint;
using ::operations_research::sat::LinearBooleanProblem;
using ::operations_research::sat::LinearObjective;
//------------------------------------------------------------------------------
// LocalSearchOptimizer
//------------------------------------------------------------------------------

View File

@@ -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 sat::LinearBooleanProblem& problem);
const 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 sat::LinearBooleanProblem& problem,
const LinearBooleanProblem& problem,
const AssignmentAndConstraintFeasibilityMaintainer& maintainer,
const sat::VariablesAssignment& sat_assignment);

View File

@@ -27,10 +27,6 @@
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);

View File

@@ -75,10 +75,10 @@ class PortfolioOptimizer : public BopOptimizerBase {
private:
BopOptimizerBase::Status SynchronizeIfNeeded(
const ProblemState& problem_state);
void AddOptimizer(const sat::LinearBooleanProblem& problem,
void AddOptimizer(const LinearBooleanProblem& problem,
const BopParameters& parameters,
const BopOptimizerMethod& optimizer_method);
void CreateOptimizers(const sat::LinearBooleanProblem& problem,
void CreateOptimizers(const LinearBooleanProblem& problem,
const BopParameters& parameters,
const BopSolverOptimizerSet& optimizer_set);

View File

@@ -15,9 +15,6 @@
namespace operations_research {
namespace bop {
using ::operations_research::sat::LinearBooleanConstraint;
using ::operations_research::sat::LinearBooleanProblem;
using ::operations_research::sat::LinearObjective;
//------------------------------------------------------------------------------
// BopSolution
//------------------------------------------------------------------------------

View File

@@ -30,7 +30,7 @@ namespace bop {
// the feasibility.
class BopSolution {
public:
BopSolution(const sat::LinearBooleanProblem& problem, const std::string& name);
BopSolution(const 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 sat::LinearBooleanProblem* problem_;
const LinearBooleanProblem* problem_;
std::string name_;
gtl::ITIVector<VariableIndex, bool> values_;

View File

@@ -36,7 +36,7 @@ namespace operations_research {
namespace bop {
namespace {
using ::operations_research::sat::LinearBooleanProblem;
using ::operations_research::LinearBooleanProblem;
using ::operations_research::glop::ColIndex;
using ::operations_research::glop::DenseRow;

View File

@@ -60,7 +60,7 @@ namespace bop {
// Solver of Boolean Optimization Problems based on Local Search.
class BopSolver {
public:
explicit BopSolver(const sat::LinearBooleanProblem& problem);
explicit BopSolver(const LinearBooleanProblem& problem);
virtual ~BopSolver();
// Parameters management.
@@ -93,7 +93,7 @@ class BopSolver {
BopSolveStatus InternalMonothreadSolver(TimeLimit* time_limit);
BopSolveStatus InternalMultithreadSolver(TimeLimit* time_limit);
const sat::LinearBooleanProblem& problem_;
const LinearBooleanProblem& problem_;
ProblemState problem_state_;
BopParameters parameters_;

View File

@@ -23,9 +23,6 @@
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;

View File

@@ -15,7 +15,7 @@
syntax = "proto2";
package operations_research.sat;
package operations_research;
option csharp_namespace = "Google.OrTools.Sat";
option java_package = "com.google.ortools.sat";