diff --git a/ortools/algorithms/radix_sort.h b/ortools/algorithms/radix_sort.h index 419bd930ef..a0c1663252 100644 --- a/ortools/algorithms/radix_sort.h +++ b/ortools/algorithms/radix_sort.h @@ -51,7 +51,7 @@ namespace operations_research { // Sorts an array of int, double, or other numeric types. Up to ~10x faster than -// std::sort() when size ≥ 8k: go/radix-sort-bench. See file-level comment. +// std::sort() when size ≥ 8k. See file-level comment for more details. template void RadixSort( absl::Span values, diff --git a/ortools/base/int_type.h b/ortools/base/int_type.h index 57a990a716..eb5927e64b 100644 --- a/ortools/base/int_type.h +++ b/ortools/base/int_type.h @@ -189,7 +189,6 @@ class IntType { } // Note that this may change from time to time without notice. - // See . struct Hasher { size_t operator()(const IntType& arg) const { return static_cast(arg.value()); diff --git a/ortools/constraint_solver/csharp/IntVarArrayHelper.cs b/ortools/constraint_solver/csharp/IntVarArrayHelper.cs index 1c1711cb7d..bc32203bf9 100644 --- a/ortools/constraint_solver/csharp/IntVarArrayHelper.cs +++ b/ortools/constraint_solver/csharp/IntVarArrayHelper.cs @@ -174,7 +174,7 @@ public static class IntVarArrayHelper } } -// TODO(user): Try to move this code back to the .i with @define macros. +// TODO(user): Try to move this code back to the .swig with @define macros. public partial class IntVarVector : IDisposable, System.Collections.IEnumerable #if !SWIG_DOTNET_1 diff --git a/ortools/constraint_solver/search_limit.proto b/ortools/constraint_solver/search_limit.proto index fc78a2e35b..f1d7fe9d16 100644 --- a/ortools/constraint_solver/search_limit.proto +++ b/ortools/constraint_solver/search_limit.proto @@ -20,7 +20,7 @@ option java_package = "com.google.ortools.constraintsolver"; option java_multiple_files = true; // We set the outer classname to something other than 'SearchLimit', which is // in conflict with the SWIG-generated class in the same directory (see -// java/constraint_solver.i). +// java/constraint_solver.swig). option java_outer_classname = "SearchLimitProtobuf"; option csharp_namespace = "Google.OrTools.ConstraintSolver"; diff --git a/ortools/graph/graph.h b/ortools/graph/graph.h index db3f0e2bcb..abc6b09279 100644 --- a/ortools/graph/graph.h +++ b/ortools/graph/graph.h @@ -638,8 +638,6 @@ struct GraphTraits { // + (ArcIndexType + NodeIndexType) * arc_capacity(). // - Has an efficient Tail() but need an extra NodeIndexType/arc memory for it. // - Never changes the initial arc index returned by AddArc(). -// -// All graphs should be -compatible, but we haven't tested that. template class ListGraph : public BaseGraph { typedef BaseGraph Base; diff --git a/ortools/graph/graph_io.h b/ortools/graph/graph_io.h index 82a2002a5e..36dee1c110 100644 --- a/ortools/graph/graph_io.h +++ b/ortools/graph/graph_io.h @@ -17,7 +17,9 @@ #define UTIL_GRAPH_IO_H_ #include +#include #include +#include #include #include #include @@ -29,10 +31,9 @@ #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" #include "absl/strings/str_join.h" -#include "absl/strings/str_split.h" +#include "absl/strings/string_view.h" #include "absl/types/span.h" #include "ortools/base/numbers.h" -#include "ortools/graph/graph.h" #include "ortools/util/filelineiter.h" namespace util { diff --git a/ortools/graph/topologicalsorter.h b/ortools/graph/topologicalsorter.h index 1297e5bf9f..3189a76d2a 100644 --- a/ortools/graph/topologicalsorter.h +++ b/ortools/graph/topologicalsorter.h @@ -313,8 +313,6 @@ typedef ::util::internal::DenseIntTopologicalSorterTpl< // TopologicalSorter requires that all nodes and edges be added before // traversing the nodes, otherwise it will die with a fatal error. // -// TopologicalSorter is -compatible -// // Note(user): since all the real work is done by // DenseIntTopologicalSorterTpl, and this class is a template, we inline // every function here in the .h. diff --git a/ortools/graph/util.h b/ortools/graph/util.h index 3014f85ad3..26a5449c03 100644 --- a/ortools/graph/util.h +++ b/ortools/graph/util.h @@ -18,18 +18,17 @@ #include #include -#include +#include #include #include -#include #include #include #include "absl/container/btree_map.h" #include "absl/container/flat_hash_map.h" #include "absl/container/inlined_vector.h" +#include "absl/log/check.h" #include "absl/types/span.h" -#include "ortools/base/hash.h" #include "ortools/base/map_util.h" #include "ortools/graph/connected_components.h" #include "ortools/graph/graph.h" diff --git a/ortools/linear_solver/scip_interface.cc b/ortools/linear_solver/scip_interface.cc index cd3b5390d6..5a3c573ea5 100644 --- a/ortools/linear_solver/scip_interface.cc +++ b/ortools/linear_solver/scip_interface.cc @@ -20,20 +20,19 @@ #include #include #include -#include #include #include #include #include "absl/base/attributes.h" #include "absl/cleanup/cleanup.h" +#include "absl/flags/flag.h" #include "absl/status/status.h" #include "absl/strings/str_format.h" -#include "absl/types/optional.h" -#include "ortools/base/commandlineflags.h" -#include "ortools/base/hash.h" +#include "absl/synchronization/mutex.h" +#include "absl/time/time.h" +#include "lpi/lpi.h" #include "ortools/base/logging.h" -#include "ortools/base/status_macros.h" #include "ortools/base/timer.h" #include "ortools/gscip/legacy_scip_params.h" #include "ortools/linear_solver/linear_solver.h" @@ -45,12 +44,29 @@ #include "ortools/linear_solver/scip_helper_macros.h" #include "ortools/util/lazy_mutable_copy.h" #include "scip/cons_indicator.h" -#include "scip/scip.h" +#include "scip/cons_linear.h" +#include "scip/def.h" +#include "scip/scip_cons.h" #include "scip/scip_copy.h" +#include "scip/scip_general.h" +#include "scip/scip_message.h" #include "scip/scip_numerics.h" #include "scip/scip_param.h" #include "scip/scip_prob.h" +#include "scip/scip_sol.h" +#include "scip/scip_solve.h" +#include "scip/scip_solvingstats.h" +#include "scip/scip_var.h" #include "scip/scipdefplugins.h" +#include "scip/type_clock.h" +#include "scip/type_cons.h" +#include "scip/type_paramset.h" +#include "scip/type_prob.h" +#include "scip/type_retcode.h" +#include "scip/type_scip.h" +#include "scip/type_sol.h" +#include "scip/type_stat.h" +#include "scip/type_var.h" ABSL_FLAG(bool, scip_feasibility_emphasis, false, "When true, emphasize search towards feasibility. This may or " @@ -98,11 +114,11 @@ class SCIPInterface : public MPSolverInterface { int64_t iterations() const override; int64_t nodes() const override; - MPSolver::BasisStatus row_status(int constraint_index) const override { + MPSolver::BasisStatus row_status(int) const override { LOG(DFATAL) << "Basis status only available for continuous problems"; return MPSolver::FREE; } - MPSolver::BasisStatus column_status(int variable_index) const override { + MPSolver::BasisStatus column_status(int) const override { LOG(DFATAL) << "Basis status only available for continuous problems"; return MPSolver::FREE; } @@ -445,15 +461,12 @@ void SCIPInterface::ClearConstraint(MPConstraint* constraint) { } // Cached -void SCIPInterface::SetObjectiveCoefficient(const MPVariable* variable, - double coefficient) { +void SCIPInterface::SetObjectiveCoefficient(const MPVariable*, double) { sync_status_ = MUST_RELOAD; } // Cached -void SCIPInterface::SetObjectiveOffset(double value) { - sync_status_ = MUST_RELOAD; -} +void SCIPInterface::SetObjectiveOffset(double) { sync_status_ = MUST_RELOAD; } // Clear objective of all its terms. void SCIPInterface::ClearObjective() { @@ -492,16 +505,16 @@ void SCIPInterface::BranchingPriorityChangedForVariable(int var_index) { } } -void SCIPInterface::AddRowConstraint(MPConstraint* ct) { +void SCIPInterface::AddRowConstraint(MPConstraint*) { sync_status_ = MUST_RELOAD; } -bool SCIPInterface::AddIndicatorConstraint(MPConstraint* ct) { +bool SCIPInterface::AddIndicatorConstraint(MPConstraint*) { sync_status_ = MUST_RELOAD; return true; } -void SCIPInterface::AddVariable(MPVariable* var) { sync_status_ = MUST_RELOAD; } +void SCIPInterface::AddVariable(MPVariable*) { sync_status_ = MUST_RELOAD; } void SCIPInterface::ExtractNewVariables() { RETURN_IF_ALREADY_IN_ERROR_STATE; @@ -882,7 +895,7 @@ bool SCIPInterface::SupportsDirectlySolveProto( } MPSolutionResponse SCIPInterface::DirectlySolveProto( - LazyMutableCopy request, std::atomic* interrupt) { + LazyMutableCopy request, std::atomic*) { const bool log_error = request->enable_internal_solver_output(); return ConvertStatusOrMPSolutionResponse(log_error, ScipSolveProto(std::move(request))); @@ -976,7 +989,7 @@ void SCIPInterface::SetPresolveMode(int presolve) { } } -void SCIPInterface::SetScalingMode(int scaling) { +void SCIPInterface::SetScalingMode(int) { SetUnsupportedIntegerParam(MPSolverParameters::SCALING); } diff --git a/ortools/linear_solver/wrappers/model_builder_helper.h b/ortools/linear_solver/wrappers/model_builder_helper.h index 4f2371da2c..4d5d9579ed 100644 --- a/ortools/linear_solver/wrappers/model_builder_helper.h +++ b/ortools/linear_solver/wrappers/model_builder_helper.h @@ -309,7 +309,7 @@ class BoundedLinearExpression { // to be wrapped by SWIG correctly: // 1) Their types must include the full operations_research:: // namespace. -// 2) Their names must correspond to the ones declared in the .i +// 2) Their names must correspond to the ones declared in the .swig // file (see the java/ and csharp/ subdirectories). // Helper for importing/exporting models and model protobufs. diff --git a/ortools/util/piecewise_linear_function.h b/ortools/util/piecewise_linear_function.h index da473af65f..297e6e9332 100644 --- a/ortools/util/piecewise_linear_function.h +++ b/ortools/util/piecewise_linear_function.h @@ -105,7 +105,7 @@ class PiecewiseLinearFunction { // This API provides a factory for creating different families of Piecewise // Linear Functions based on specific properties of each family. The - // PiecewiseLinearFunction is composed by a set of PiecwiseSegments and upon + // PiecewiseLinearFunction is composed by a set of PiecewiseSegments and upon // creation is not modifiable but with the provided function operations. // The object returned by any of these builders in the factory is owned by // the client code.