diff --git a/ortools/constraint_solver/constraint_solver.cc b/ortools/constraint_solver/constraint_solver.cc index 1e3b2f511ff..340d58be17f 100644 --- a/ortools/constraint_solver/constraint_solver.cc +++ b/ortools/constraint_solver/constraint_solver.cc @@ -171,12 +171,12 @@ ConstraintSolverParameters Solver::DefaultSolverParameters() { } // ----- Forward Declarations and Profiling Support ----- +extern void InstallDemonProfiler(DemonProfiler* monitor); extern DemonProfiler* BuildDemonProfiler(Solver* solver); extern void DeleteDemonProfiler(DemonProfiler* monitor); -extern void InstallDemonProfiler(DemonProfiler* monitor); +extern void InstallLocalSearchProfiler(LocalSearchProfiler* monitor); extern LocalSearchProfiler* BuildLocalSearchProfiler(Solver* solver); extern void DeleteLocalSearchProfiler(LocalSearchProfiler* monitor); -extern void InstallLocalSearchProfiler(LocalSearchProfiler* monitor); // TODO(user): remove this complex logic. // We need the double test because parameters are set too late when using @@ -1372,18 +1372,18 @@ void Search::Accept(ModelVisitor* const visitor) const { #undef CALL_EVENT_LISTENERS -bool LocalOptimumReached(Search* const search) { +bool LocalOptimumReached(Search* search) { return search->LocalOptimum(); } -bool AcceptDelta(Search* const search, Assignment* delta, +bool AcceptDelta(Search* search, Assignment* delta, Assignment* deltadelta) { return search->AcceptDelta(delta, deltadelta); } -void AcceptNeighbor(Search* const search) { search->AcceptNeighbor(); } +void AcceptNeighbor(Search* search) { search->AcceptNeighbor(); } -void AcceptUncheckedNeighbor(Search* const search) { +void AcceptUncheckedNeighbor(Search* search) { search->AcceptUncheckedNeighbor(); } diff --git a/ortools/constraint_solver/demon_profiler.cc b/ortools/constraint_solver/demon_profiler.cc index 087c5c0a429..bc3dc06a656 100644 --- a/ortools/constraint_solver/demon_profiler.cc +++ b/ortools/constraint_solver/demon_profiler.cc @@ -439,9 +439,9 @@ void Solver::ExportProfilingOverview(const std::string& filename) { // ----- Exported Functions ----- -void InstallDemonProfiler(DemonProfiler* const monitor) { monitor->Install(); } +void InstallDemonProfiler(DemonProfiler* monitor) { monitor->Install(); } -DemonProfiler* BuildDemonProfiler(Solver* const solver) { +DemonProfiler* BuildDemonProfiler(Solver* solver) { if (solver->IsProfilingEnabled()) { return new DemonProfiler(solver); } else { @@ -449,7 +449,7 @@ DemonProfiler* BuildDemonProfiler(Solver* const solver) { } } -void DeleteDemonProfiler(DemonProfiler* const monitor) { delete monitor; } +void DeleteDemonProfiler(DemonProfiler* monitor) { delete monitor; } Demon* Solver::RegisterDemon(Demon* const demon) { CHECK(demon != nullptr); diff --git a/ortools/constraint_solver/expressions.cc b/ortools/constraint_solver/expressions.cc index b0123ee1dbc..6cf0bc3515f 100644 --- a/ortools/constraint_solver/expressions.cc +++ b/ortools/constraint_solver/expressions.cc @@ -6378,7 +6378,7 @@ IntVarIterator* BooleanVar::MakeDomainIterator(bool reversible) const { // ----- API ----- -void CleanVariableOnFail(IntVar* const var) { +void CleanVariableOnFail(IntVar* var) { DCHECK_EQ(DOMAIN_INT_VAR, var->VarType()); DomainIntVar* const dvar = reinterpret_cast(var); dvar->CleanInProcess(); @@ -6399,7 +6399,7 @@ Constraint* SetIsGreaterOrEqual(IntVar* const var, return dvar->SetIsGreaterOrEqual(values, vars); } -void RestoreBoolValue(IntVar* const var) { +void RestoreBoolValue(IntVar* var) { DCHECK_EQ(BOOLEAN_VAR, var->VarType()); BooleanVar* const boolean_var = reinterpret_cast(var); boolean_var->RestoreValue(); @@ -7448,7 +7448,7 @@ void IntVar::SetValues(const std::vector& values) { } // ---------- BaseIntExpr --------- -void LinkVarExpr(Solver* const s, IntExpr* const expr, IntVar* const var) { +void LinkVarExpr(Solver* s, IntExpr* expr, IntVar* var) { if (!var->Bound()) { if (var->VarType() == DOMAIN_INT_VAR) { DomainIntVar* dvar = reinterpret_cast(var); diff --git a/ortools/constraint_solver/model_cache.cc b/ortools/constraint_solver/model_cache.cc index cac9e34984f..ba8382ff955 100644 --- a/ortools/constraint_solver/model_cache.cc +++ b/ortools/constraint_solver/model_cache.cc @@ -843,7 +843,7 @@ class NonReversibleCache : public ModelCache { }; } // namespace -ModelCache* BuildModelCache(Solver* const solver) { +ModelCache* BuildModelCache(Solver* solver) { return new NonReversibleCache(solver); } diff --git a/ortools/constraint_solver/trace.cc b/ortools/constraint_solver/trace.cc index 49501228e89..6ecf78d7a6c 100644 --- a/ortools/constraint_solver/trace.cc +++ b/ortools/constraint_solver/trace.cc @@ -876,7 +876,7 @@ IntervalVar* Solver::RegisterIntervalVar(IntervalVar* const var) { } } -PropagationMonitor* BuildPrintTrace(Solver* const s) { +PropagationMonitor* BuildPrintTrace(Solver* s) { return s->RevAlloc(new PrintTrace(s)); } } // namespace operations_research