diff --git a/makefiles/Makefile.cpp.mk b/makefiles/Makefile.cpp.mk index 3f6057187b..b0950179f8 100644 --- a/makefiles/Makefile.cpp.mk +++ b/makefiles/Makefile.cpp.mk @@ -345,7 +345,7 @@ endif ################################## ## Course scheduling example ## ################################## -# TODO(mizux) Port it to CMake +# TODO(user) Port it to CMake # examples/cpp/course_scheduling.proto: ; # # $(SRC_DIR)/examples/cpp/course_scheduling.pb.cc: \ @@ -497,7 +497,7 @@ test_cc_cpp: \ rcpp_strawberry_fields_with_column_generation \ rcpp_uncapacitated_facility_location \ # rcpp_weighted_tardiness_sat # need input file -# TODO(mizux) how to build cvrptwlib and depends on it +# TODO(user) how to build cvrptwlib and depends on it # rcpp_cvrp_disjoint_tw \ # rcpp_cvrptw \ # rcpp_cvrptw_with_breaks \ diff --git a/ortools/algorithms/knapsack_solver.cc b/ortools/algorithms/knapsack_solver.cc index bcc84798ae..cd5d6d3ab8 100644 --- a/ortools/algorithms/knapsack_solver.cc +++ b/ortools/algorithms/knapsack_solver.cc @@ -21,7 +21,6 @@ #include #include -#include "absl/memory/memory.h" #include "ortools/base/stl_util.h" #include "ortools/linear_solver/linear_solver.h" #include "ortools/util/bitset.h" diff --git a/ortools/base/int_type.h b/ortools/base/int_type.h index b7f9088cfb..a9bcd50d46 100644 --- a/ortools/base/int_type.h +++ b/ortools/base/int_type.h @@ -174,9 +174,9 @@ class IntType; // operators. // // The template parameter IntTypeName defines the name for the int type and must -// be unique within a binary (the convenient DEFINE_INT_TYPE macro at the -// end of the file generates a unique IntTypeName). The parameter ValueType -// defines the integer type value (see supported list above). +// be unique within a binary (the convenient DEFINE_INT_TYPE macro at the end of +// the file generates a unique IntTypeName). The parameter ValueType defines +// the integer type value (see supported list above). // // This class is NOT thread-safe. template diff --git a/ortools/bop/bop_parameters.proto b/ortools/bop/bop_parameters.proto index a5870606af..cc634f2018 100644 --- a/ortools/bop/bop_parameters.proto +++ b/ortools/bop/bop_parameters.proto @@ -18,7 +18,6 @@ package operations_research.bop; option java_package = "com.google.ortools.bop"; option java_multiple_files = true; option csharp_namespace = "Google.OrTools.Bop"; - // Method used to optimize a solution in Bop. // // NEXT TAG: 16 @@ -135,7 +134,6 @@ message BopParameters { // Use Large Neighborhood Search based on the LP relaxation. optional bool use_lp_lns = 12 [default = true]; - // Whether we use sat propagation to choose the lns neighbourhood. optional bool use_sat_to_choose_lns_neighbourhood = 15 [default = true]; @@ -275,7 +273,6 @@ message BopParameters { // overhead can be "absorbed" by the other threads. optional double decomposed_problem_min_time_in_seconds = 36 [default = 0.0]; - // The first solutions based on guided SAT will work in chunk of that many // conflicts at the time. This allows to simulate parallelism between the // different guiding strategy on a single core. diff --git a/ortools/constraint_solver/README.md b/ortools/constraint_solver/README.md index 33f432b406..11054eb0b3 100644 --- a/ortools/constraint_solver/README.md +++ b/ortools/constraint_solver/README.md @@ -25,10 +25,11 @@ important for performance. ### Solution -* [assignment.proto](../constraint_solver/assignment.proto): -Holds the solution of a CP problem. -* [demon_profiler.proto](../constraint_solver/demon_profiler.proto): -Holds the timeline and execution profile of constraints and demons (daemons). +* [assignment.proto](../constraint_solver/assignment.proto): + Holds the solution of a CP problem. +* [demon_profiler.proto](../constraint_solver/demon_profiler.proto): + Holds the timeline and execution profile of constraints and demons + (daemons). ## Routing solver diff --git a/ortools/constraint_solver/assignment.proto b/ortools/constraint_solver/assignment.proto index cdd5e4b1c8..da1b2c29f1 100644 --- a/ortools/constraint_solver/assignment.proto +++ b/ortools/constraint_solver/assignment.proto @@ -14,7 +14,6 @@ syntax = "proto3"; - package operations_research; // Storage for IntVars. @@ -63,4 +62,3 @@ message AssignmentProto { WorkerInfo worker_info = 4; bool is_valid = 5; } - diff --git a/ortools/constraint_solver/constraint_solveri.h b/ortools/constraint_solver/constraint_solveri.h index b89ec245f7..c9ed757e5e 100644 --- a/ortools/constraint_solver/constraint_solveri.h +++ b/ortools/constraint_solver/constraint_solveri.h @@ -1009,7 +1009,6 @@ class IntVarLocalSearchHandler { IntVarLocalSearchHandler>::OnStart; // clang-format on #endif // SWIGPYTHON - // clang-format off %rename(IntVarLocalSearchOperatorTemplate) VarLocalSearchOperator; diff --git a/ortools/constraint_solver/expressions.cc b/ortools/constraint_solver/expressions.cc index 8be4b2ac75..9d475ac21b 100644 --- a/ortools/constraint_solver/expressions.cc +++ b/ortools/constraint_solver/expressions.cc @@ -7385,7 +7385,7 @@ void IntVar::SetValues(const std::vector& values) { // that uses a global, static shared (and locked) storage. // TODO(user): [optional] consider porting // STLSortAndRemoveDuplicates from ortools/base/stl_util.h to the - // existing open_source/base/stl_util.h and using it here. + // existing base/stl_util.h and using it here. // TODO(user): We could filter out values not in the var. std::vector& tmp = solver()->tmp_vector_; tmp.clear(); diff --git a/ortools/constraint_solver/java/constraint_solver.i b/ortools/constraint_solver/java/constraint_solver.i index 2b78a93920..29e90f2745 100644 --- a/ortools/constraint_solver/java/constraint_solver.i +++ b/ortools/constraint_solver/java/constraint_solver.i @@ -1656,7 +1656,7 @@ PROTO2_RETURN(operations_research::RegularLimitParameters, namespace operations_research { // Globals -// IMPORTANT(corentinl): Globals will be placed in main.java +// IMPORTANT(user): Globals will be placed in main.java // i.e. use `import com.[...].constraintsolver.main` %ignore FillValues; %rename (areAllBooleans) AreAllBooleans; diff --git a/ortools/constraint_solver/java/routing.i b/ortools/constraint_solver/java/routing.i index 08d7f08af1..2b674151d1 100644 --- a/ortools/constraint_solver/java/routing.i +++ b/ortools/constraint_solver/java/routing.i @@ -365,7 +365,7 @@ PROTO2_RETURN(operations_research::RoutingModelParameters, %unignore RoutingIndexPairs; namespace operations_research { -// IMPORTANT(viger): These functions from routing_parameters.h are global, so in +// IMPORTANT(user): These functions from routing_parameters.h are global, so in // java they are in the main.java (import com.[...].constraintsolver.main). %rename (defaultRoutingSearchParameters) DefaultRoutingSearchParameters; %rename (defaultRoutingModelParameters) DefaultRoutingModelParameters; diff --git a/ortools/constraint_solver/local_search.cc b/ortools/constraint_solver/local_search.cc index c29c1626a8..84dbda4b1b 100644 --- a/ortools/constraint_solver/local_search.cc +++ b/ortools/constraint_solver/local_search.cc @@ -2760,7 +2760,7 @@ class PathStateFilter : public LocalSearchFilter { // Selection-based algorithm in O(n^2), to use for small change sets. void MakeChainsFromChangedPathsAndArcsWithSelectionAlgorithm(); // From changed_paths_ and changed_arcs_, fill chains_ and paths_. - // Generic algorithm in O(std::sort(n)+n), to use for larger change sets. + // Generic algorithm in O(sort(n)+n), to use for larger change sets. void MakeChainsFromChangedPathsAndArcsWithGenericAlgorithm(); const std::unique_ptr path_state_; diff --git a/ortools/constraint_solver/python/routing.i b/ortools/constraint_solver/python/routing.i index 853a64b661..14f32906c1 100644 --- a/ortools/constraint_solver/python/routing.i +++ b/ortools/constraint_solver/python/routing.i @@ -52,7 +52,6 @@ DEFINE_INDEX_TYPE_TYPEDEF( operations_research::RoutingVehicleClassIndex, operations_research::RoutingModel::VehicleClassIndex); - %ignore operations_research::RoutingModel::RegisterStateDependentTransitCallback; %ignore operations_research::RoutingModel::StateDependentTransitCallback; %ignore operations_research::RoutingModel::MakeStateDependentTransit; @@ -80,7 +79,7 @@ PY_PROTO_TYPEMAP(ortools.constraint_solver.routing_parameters_pb2, %include "ortools/constraint_solver/routing_parameters.h" %unignoreall -// %including a .proto.h is frowned upon (for good general reasons), so we +// %including a .pb.h is frowned upon (for good general reasons), so we // have to duplicate the OptionalBoolean enum here to give it to python users. namespace operations_research { enum OptionalBoolean { diff --git a/ortools/constraint_solver/samples/code_samples.bzl b/ortools/constraint_solver/samples/code_samples.bzl index 1a777634d5..00ff27bc75 100644 --- a/ortools/constraint_solver/samples/code_samples.bzl +++ b/ortools/constraint_solver/samples/code_samples.bzl @@ -14,29 +14,28 @@ """Helper macro to compile and test code samples.""" def code_sample_cc(name): - native.cc_binary( - name = name, - srcs = [name + ".cc"], - deps = [ - "//ortools/base", - "//ortools/constraint_solver:cp", - "//ortools/constraint_solver:routing", - "//ortools/constraint_solver:routing_enums_cc_proto", - "//ortools/constraint_solver:routing_flags", - ], - ) - - native.cc_test( - name = name+"_test", - size = "small", - srcs = [name + ".cc"], - deps = [ - ":"+name, - "//ortools/base", - "//ortools/constraint_solver:cp", - "//ortools/constraint_solver:routing", - "//ortools/constraint_solver:routing_enums_cc_proto", - "//ortools/constraint_solver:routing_flags", - ], - ) + native.cc_binary( + name = name, + srcs = [name + ".cc"], + deps = [ + "//ortools/base", + "//ortools/constraint_solver:cp", + "//ortools/constraint_solver:routing", + "//ortools/constraint_solver:routing_enums_cc_proto", + "//ortools/constraint_solver:routing_flags", + ], + ) + native.cc_test( + name = name + "_test", + size = "small", + srcs = [name + ".cc"], + deps = [ + ":" + name, + "//ortools/base", + "//ortools/constraint_solver:cp", + "//ortools/constraint_solver:routing", + "//ortools/constraint_solver:routing_enums_cc_proto", + "//ortools/constraint_solver:routing_flags", + ], + ) diff --git a/ortools/constraint_solver/search_limit.proto b/ortools/constraint_solver/search_limit.proto index e8f43aac98..a14daa3179 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.swig). +// java/constraint_solver.i). option java_outer_classname = "SearchLimitProtobuf"; option csharp_namespace = "Google.OrTools.ConstraintSolver"; diff --git a/ortools/dotnet/README.md b/ortools/dotnet/README.md index ae19eb37d0..a94e19218f 100644 --- a/ortools/dotnet/README.md +++ b/ortools/dotnet/README.md @@ -25,24 +25,29 @@ and osx-x64) nuget package using `dotnet` and few `.csproj`. ## Requirement -The library is compiled against `netcoreapp3.1` and 'net6.0', so you'll only need: +The library is compiled against `netcoreapp3.1` and `net6.0`, so you'll only +need: * .Net Core 3.1 LTS SDK * .Net 6.0 LTS SDK -note: We won't/can't rely on VS 2019 since we want a portable cross-platform [`dotnet/cli`](https://github.com/dotnet/cli) pipeline. +note: We won't/can't rely on VS 2019 since we want a portable cross-platform +[`dotnet/cli`](https://github.com/dotnet/cli) pipeline. -## Directory Layout +## Project Layout -* [`Google.OrTools.runtime.linux-x64`](Google.OrTools.runtime.linux-x64) - Contains the .Net Standard 2.1 native project for the rid linux-x64. -* [`Google.OrTools.runtime.osx-x64`](Google.OrTools.runtime.osx-x64) - Contains the .Net Standard 2.1 native project for the rid osx-x64. -* [`Google.OrTools.runtime.win-x64`](Google.OrTools.runtime.win-x64) - Contains the .Net Standard 2.1 native project for the rid win-x64. -* [`Google.OrTools`](Google.OrTools) Is the .Net Standard 2.1 meta-package which - should depends on all previous available packages and contains the Reference - Assembly. +* `Google.OrTools.runtime.linux-x64`: Contains the .Net Standard 2.1 native + project for the rid linux-x64. +* `Google.OrTools.runtime.linux-arm64`: Contains the .Net Standard 2.1 native + project for the rid linux-arm64. +* `Google.OrTools.runtime.osx-x64`: Contains the .Net Standard 2.1 native + project for the rid osx-x64. +* `Google.OrTools.runtime.osx-arm64`: Contains the .Net Standard 2.1 native + project for the rid osx-arm64. +* `Google.OrTools.runtime.win-x64`: Contains the .Net Standard 2.1 native + project for the rid win-x64. +* `Google.OrTools` Is the .Net Standard 2.1 meta-package which should depends on + all previous available packages and contains the Reference Assembly. note: While Microsoft use `runtime-.Company.Project` for native libraries naming, it is very difficult to get ownership on it, so you should prefer to use @@ -63,11 +68,11 @@ To Create a native dependent package we will split it in two parts: * A bunch of `Google.OrTools.runtime.{rid}.nupkg` packages for each [Runtime Identifier (RId)](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog) targeted. -* A generic package `Google.OrTools.nupkg` depending on each runtime packages and -containing the managed .Net code. +* A generic package `Google.OrTools.nupkg` depending on each runtime packages + and containing the managed .Net code. -Actually, You don't need a specific variant of .Net Standard wrapper, simply omit the library extension and .Net magic will pick -the correct native library. +Actually, You don't need a specific variant of .Net Standard wrapper, simply +omit the library extension and .Net magic will pick the correct native library. ref: https://www.mono-project.com/docs/advanced/pinvoke/#library-names note: [`Microsoft.NetCore.App` packages](https://www.nuget.org/packages?q=Microsoft.NETCore.App) @@ -112,7 +117,7 @@ Here some dev-note concerning this `Google.OrTools.runtime.{rid}.csproj`. * `AssemblyName` must be `Google.OrTools.dll` i.e. all {rid} projects **must** generate an assembly with the **same** name (i.e. no {rid} in the name). On the other hand package identifier will contain the {rid}... - ```xml + ```csproj {rid} Google.OrTools Google.OrTools.runtime.{rid} @@ -123,12 +128,12 @@ Here some dev-note concerning this `Google.OrTools.runtime.{rid}.csproj`. * It is [recommended](https://docs.microsoft.com/en-us/nuget/create-packages/native-packages) to add the tag `native` to the [nuget package tags](https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#packagetags) - ```xml + ```csproj native ``` * Specify the output target folder for having the assembly output in `runtimes/{rid}/lib/netstandard2.0` in the nupkg - ```xml + ```csproj runtimes/$(RuntimeIdentifier)/lib ``` note: Every files with an extension different from `.dll` will be filter out @@ -137,7 +142,7 @@ Here some dev-note concerning this `Google.OrTools.runtime.{rid}.csproj`. `netstandard2.0`) to the output path. * Add the native shared library to the nuget package in the repository `runtimes/{rib}/native`. e.g. for linux-x64: - ```xml + ```csproj runtimes/linux-x64/native/%(Filename)%(Extension) true @@ -146,12 +151,12 @@ Here some dev-note concerning this `Google.OrTools.runtime.{rid}.csproj`. ``` * Generate the runtime package to a defined directory (i.e. so later in `Google.OrTools` package we will be able to locate it) - ```xml + ```csproj {...}/packages ``` * Generate the Reference Assembly (but don't include it to this runtime nupkg !, see below for explanation) using: - ```xml + ```csproj true ``` @@ -186,14 +191,17 @@ depend on our previous runtime package. Here some dev-note concerning this `Google.OrTools.csproj`. -* This package is a meta-package so we don't want to ship an empty assembly file - : `xml false` -* Add the previous package directory: `xml {...}/packages; - $(RestoreSources)` +* Add the previous package directory: + ```csproj + {...}/packages;$(RestoreSources) + ``` * Add dependency (i.e. `PackageReference`) on each runtime package(s) available: - `xml - - ` Thanks to the `RestoreSource` we can work locally with our just + ```csproj + + + + ``` + Thanks to the `RestoreSource` we can work locally with our just builded package without the need to upload it on [nuget.org](https://www.nuget.org/). * To expose the .Net Surface API the `Google.OrTools.csproj` must contains at @@ -250,7 +258,8 @@ Simply run on each platform: dotnet build /dotnet/Google.OrTools.runtime.{rid} dotnet pack /dotnet/Google.OrTools.runtime.{rid} ``` -note: replace `{rid}` by the Runtime Identifier associated to the current OS platform. +note: replace `{rid}` by the Runtime Identifier associated to the current OS +platform. Then on one machine used, you copy all other packages in the `{...}/packages` so when building `Google.OrTools.csproj` we can have access to all package... @@ -317,6 +326,7 @@ Some issue related to this process Image has been generated using [plantuml](http://plantuml.com/): ```bash -plantuml -Tsvg docs/{file}.dot +plantuml -Tpng docs/{file}.dot ``` + So you can find the dot source files in [docs](docs). diff --git a/ortools/glop/lp_solver.cc b/ortools/glop/lp_solver.cc index 56d743367b..7df41bdeed 100644 --- a/ortools/glop/lp_solver.cc +++ b/ortools/glop/lp_solver.cc @@ -23,6 +23,7 @@ #include "absl/memory/memory.h" #include "absl/strings/match.h" #include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" #include "ortools/base/commandlineflags.h" #include "ortools/base/integral_types.h" #include "ortools/base/timer.h" diff --git a/ortools/glop/samples/code_samples.bzl b/ortools/glop/samples/code_samples.bzl index 3f9a15b506..90c55ac1d0 100644 --- a/ortools/glop/samples/code_samples.bzl +++ b/ortools/glop/samples/code_samples.bzl @@ -14,24 +14,24 @@ """Helper macro to compile and test code samples.""" def code_sample_cc(name): - native.cc_binary( - name = name, - srcs = [name + ".cc"], - deps = [ - "//ortools/base", - "//ortools/glop:lp_solver", - "//ortools/lp_data", - ], - ) + native.cc_binary( + name = name, + srcs = [name + ".cc"], + deps = [ + "//ortools/base", + "//ortools/glop:lp_solver", + "//ortools/lp_data", + ], + ) - native.cc_test( - name = name+"_test", - size = "small", - srcs = [name + ".cc"], - deps = [ - ":"+name, - "//ortools/base", - "//ortools/glop:lp_solver", - "//ortools/lp_data", - ], - ) + native.cc_test( + name = name + "_test", + size = "small", + srcs = [name + ".cc"], + deps = [ + ":" + name, + "//ortools/base", + "//ortools/glop:lp_solver", + "//ortools/lp_data", + ], + ) diff --git a/ortools/glop/status.h b/ortools/glop/status.h index 695158f61d..97adc12121 100644 --- a/ortools/glop/status.h +++ b/ortools/glop/status.h @@ -41,7 +41,6 @@ class Status { // The linear program is invalid or it does not have the required format. ERROR_INVALID_PROBLEM = 4, - }; // Creates a "successful" status. diff --git a/ortools/glop/variables_info.cc b/ortools/glop/variables_info.cc index 9819156488..cf04f611b0 100644 --- a/ortools/glop/variables_info.cc +++ b/ortools/glop/variables_info.cc @@ -396,7 +396,7 @@ void VariablesInfo::TransformToDualPhaseIProblem( const ColIndex num_cols = matrix_.num_cols(); for (ColIndex col(0); col < num_cols; ++col) { switch (variable_type_[col]) { - case VariableType::FIXED_VARIABLE: // ABSL_FALLTHROUGH_INTENDED + case VariableType::FIXED_VARIABLE: // FALLTHROUGH_INTENDED case VariableType::UPPER_AND_LOWER_BOUNDED: lower_bounds_[col] = 0.0; upper_bounds_[col] = 0.0; diff --git a/ortools/graph/graph.h b/ortools/graph/graph.h index 67ac4677a0..32e3461576 100644 --- a/ortools/graph/graph.h +++ b/ortools/graph/graph.h @@ -296,6 +296,7 @@ class BaseGraph { // - 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/topologicalsorter.h b/ortools/graph/topologicalsorter.h index d708446c34..1f4db19e5c 100644 --- a/ortools/graph/topologicalsorter.h +++ b/ortools/graph/topologicalsorter.h @@ -253,6 +253,7 @@ 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 diff --git a/ortools/linear_solver/gurobi_interface.cc b/ortools/linear_solver/gurobi_interface.cc index 26c3295e8f..42d559a966 100644 --- a/ortools/linear_solver/gurobi_interface.cc +++ b/ortools/linear_solver/gurobi_interface.cc @@ -42,6 +42,7 @@ // poorly tested, proceed with caution. // +#include #include #include #include diff --git a/ortools/linear_solver/gurobi_proto_solver.h b/ortools/linear_solver/gurobi_proto_solver.h index be6a6720f6..005b319fb1 100644 --- a/ortools/linear_solver/gurobi_proto_solver.h +++ b/ortools/linear_solver/gurobi_proto_solver.h @@ -25,7 +25,7 @@ namespace operations_research { // Solves the input request. // -// By default this function creates a new master Gurobi environment, but an +// By default this function creates a new primary Gurobi environment, but an // existing one can be passed as parameter. This can be useful with single-use // Gurobi licenses since it is not possible to create a second environment if // one already exists with those licenses. diff --git a/ortools/linear_solver/linear_solver.cc b/ortools/linear_solver/linear_solver.cc index dbc68b9bc5..e3d45994c9 100644 --- a/ortools/linear_solver/linear_solver.cc +++ b/ortools/linear_solver/linear_solver.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/ortools/lp_data/BUILD.bazel b/ortools/lp_data/BUILD.bazel index b3d7637217..06b85f8091 100644 --- a/ortools/lp_data/BUILD.bazel +++ b/ortools/lp_data/BUILD.bazel @@ -240,6 +240,7 @@ cc_library( srcs = ["lp_parser.cc"], hdrs = ["lp_parser.h"], copts = SAFE_FP_CODE, + defines = ["USE_LP_PARSER"], deps = [ ":base", ":lp_data", @@ -252,7 +253,6 @@ cc_library( "@com_google_absl//absl/strings", "@com_google_re2//:re2", ], - defines = ["USE_LP_PARSER"], ) #cc_library( diff --git a/ortools/lp_data/matrix_scaler.cc b/ortools/lp_data/matrix_scaler.cc index d42075500d..e3bce7a307 100644 --- a/ortools/lp_data/matrix_scaler.cc +++ b/ortools/lp_data/matrix_scaler.cc @@ -408,12 +408,14 @@ Status SparseMatrixScaler::LPScale() { row, linear_program.get(), &row_scale_var_indices); linear_program->SetVariableBounds(row_scale, -kInfinity, kInfinity); + // clang-format off // This is derived from the formulation in // min β // Subject to: // ∀ c∈C, v∈V, p_{c,v} ≠ 0.0, w_{c,v} + s^{var}_v + s^{comb}_c + β ≥ 0.0 // ∀ c∈C, v∈V, p_{c,v} ≠ 0.0, w_{c,v} + s^{var}_v + s^{comb}_c ≤ β // If a variable is integer, its scale factor is zero. + // clang-format on // Start with the constraint w_cv + s_c + s_v + beta >= 0. const RowIndex positive_constraint = diff --git a/ortools/lp_data/sparse.cc b/ortools/lp_data/sparse.cc index 5d49d7ea75..ccd20d9420 100644 --- a/ortools/lp_data/sparse.cc +++ b/ortools/lp_data/sparse.cc @@ -19,6 +19,7 @@ #include #include "absl/strings/str_format.h" +#include "absl/strings/str_join.h" #include "ortools/base/logging.h" #include "ortools/lp_data/lp_types.h" #include "ortools/lp_data/permutation.h" diff --git a/ortools/math_opt/constraints/sos/BUILD.bazel b/ortools/math_opt/constraints/sos/BUILD.bazel index 06c97f8e2b..381436cd4d 100644 --- a/ortools/math_opt/constraints/sos/BUILD.bazel +++ b/ortools/math_opt/constraints/sos/BUILD.bazel @@ -31,11 +31,11 @@ cc_library( srcs = ["validator.cc"], hdrs = ["validator.h"], deps = [ - "@com_google_absl//absl/status", "//ortools/math_opt:model_cc_proto", "//ortools/math_opt:sparse_containers_cc_proto", "//ortools/math_opt/core:model_summary", "//ortools/math_opt/validators:linear_expression_validator", "//ortools/math_opt/validators:scalar_validator", + "@com_google_absl//absl/status", ], ) diff --git a/ortools/math_opt/constraints/sos/validator.cc b/ortools/math_opt/constraints/sos/validator.cc index 9fbb9c5910..edff92d22c 100644 --- a/ortools/math_opt/constraints/sos/validator.cc +++ b/ortools/math_opt/constraints/sos/validator.cc @@ -14,12 +14,12 @@ #include "ortools/math_opt/constraints/sos/validator.h" #include "absl/status/status.h" +#include "ortools/base/status_macros.h" #include "ortools/math_opt/core/model_summary.h" #include "ortools/math_opt/model.pb.h" #include "ortools/math_opt/sparse_containers.pb.h" #include "ortools/math_opt/validators/linear_expression_validator.h" #include "ortools/math_opt/validators/scalar_validator.h" -#include "ortools/base/status_macros.h" namespace operations_research::math_opt { diff --git a/ortools/math_opt/cpp/matchers.cc b/ortools/math_opt/cpp/matchers.cc index 6609822613..d7402ab76f 100644 --- a/ortools/math_opt/cpp/matchers.cc +++ b/ortools/math_opt/cpp/matchers.cc @@ -583,8 +583,10 @@ std::string MatcherToString(const Matcher& matcher, bool negate) { return MatcherToStringImpl(matcher, negate); } -// Polymorphic matchers do not always define DescribeTo, see +// clang-format off +// Polymorphic matchers do not always define DescribeTo, // The type may not be a matcher, but it will implement DescribeTo. +// clang-format on template std::string MatcherToString(const ::testing::PolymorphicMatcher& matcher, bool negate) { diff --git a/ortools/math_opt/model_parameters.proto b/ortools/math_opt/model_parameters.proto index 5c5fe9a0e7..5ae274974b 100644 --- a/ortools/math_opt/model_parameters.proto +++ b/ortools/math_opt/model_parameters.proto @@ -82,7 +82,7 @@ message ModelSolveParametersProto { // Optional branching priorities. Variables with higher values will be // branched on first. Variables for which priorities are not set get the - // solver's default priority (usualy zero). + // solver's default priority (usually zero). // // Requirements: // * branching_priorities.values must be finite. diff --git a/ortools/math_opt/storage/BUILD.bazel b/ortools/math_opt/storage/BUILD.bazel index 01ace57df9..010621ed99 100644 --- a/ortools/math_opt/storage/BUILD.bazel +++ b/ortools/math_opt/storage/BUILD.bazel @@ -16,7 +16,7 @@ package(default_visibility = ["//ortools/math_opt:__subpackages__"]) cc_library( name = "model_storage_types", hdrs = ["model_storage_types.h"], - deps = ["//ortools/base:intops",], + deps = ["//ortools/base:intops"], ) cc_library( diff --git a/ortools/model_builder/samples/BUILD.bazel b/ortools/model_builder/samples/BUILD.bazel index 986490e821..391179ce1d 100644 --- a/ortools/model_builder/samples/BUILD.bazel +++ b/ortools/model_builder/samples/BUILD.bazel @@ -21,4 +21,4 @@ code_sample_py(name = "bin_packing_mb") code_sample_py(name = "simple_lp_program_mb") -code_sample_py(name = "simple_mip_program_mb") \ No newline at end of file +code_sample_py(name = "simple_mip_program_mb") diff --git a/ortools/model_builder/samples/code_samples.bzl b/ortools/model_builder/samples/code_samples.bzl index f6d53769bc..b49029f537 100644 --- a/ortools/model_builder/samples/code_samples.bzl +++ b/ortools/model_builder/samples/code_samples.bzl @@ -17,27 +17,27 @@ load("@ortools_deps//:requirements.bzl", "requirement") load("@rules_python//python:defs.bzl", "py_binary") def code_sample_cc(name): - native.cc_binary( - name = name, - srcs = [name + ".cc"], - deps = [ - "//ortools/base", - "//ortools/model_builder", - "//ortools/model_builder:linear_solver_cc_proto", - ], - ) + native.cc_binary( + name = name, + srcs = [name + ".cc"], + deps = [ + "//ortools/base", + "//ortools/model_builder", + "//ortools/model_builder:linear_solver_cc_proto", + ], + ) - native.cc_test( - name = name+"_test", - size = "small", - srcs = [name + ".cc"], - deps = [ - ":"+name, - "//ortools/base", - "//ortools/linear_solver", - "//ortools/linear_solver:linear_solver_cc_proto", - ], - ) + native.cc_test( + name = name + "_test", + size = "small", + srcs = [name + ".cc"], + deps = [ + ":" + name, + "//ortools/base", + "//ortools/linear_solver", + "//ortools/linear_solver:linear_solver_cc_proto", + ], + ) def code_sample_py(name): py_binary( @@ -61,4 +61,3 @@ def code_sample_py(name): ":" + name + "_py3", ], ) - diff --git a/ortools/pdlp/sharder_test.cc b/ortools/pdlp/sharder_test.cc index 5fde00c259..03488a8c26 100644 --- a/ortools/pdlp/sharder_test.cc +++ b/ortools/pdlp/sharder_test.cc @@ -179,9 +179,6 @@ TEST(SharderTest, UniformSharderZeroElementVector) { }); } -// MOE:begin_strip -// Regression test for b/214330472. -// MOE:end_strip TEST(SharderTest, UniformSharderFromOtherZeroElementSharder) { Sharder empty_sharder(/*num_elements=*/0, /*num_shards=*/3, nullptr); EXPECT_THAT(empty_sharder.ShardStartsForTesting(), ElementsAre(0));