diff --git a/examples/cpp/course_scheduling.cc b/examples/cpp/course_scheduling.cc index dbd25a8ed60..264acc52682 100644 --- a/examples/cpp/course_scheduling.cc +++ b/examples/cpp/course_scheduling.cc @@ -22,14 +22,10 @@ #include "absl/container/flat_hash_set.h" #include "absl/status/status.h" -#include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include "absl/strings/str_split.h" #include "absl/types/span.h" #include "ortools/base/logging.h" #include "ortools/base/mathutil.h" -#include "ortools/base/numbers.h" -#include "ortools/base/status_macros.h" #include "ortools/linear_solver/linear_solver.h" #include "ortools/scheduling/course_scheduling.pb.h" diff --git a/examples/cpp/course_scheduling.h b/examples/cpp/course_scheduling.h index 466c120821a..7f20b2b3d14 100644 --- a/examples/cpp/course_scheduling.h +++ b/examples/cpp/course_scheduling.h @@ -14,13 +14,11 @@ #ifndef OR_TOOLS_EXAMPLES_COURSE_SCHEDULING_H_ #define OR_TOOLS_EXAMPLES_COURSE_SCHEDULING_H_ -#include #include #include #include "absl/container/flat_hash_set.h" #include "absl/status/status.h" -#include "absl/strings/str_format.h" #include "absl/types/span.h" #include "ortools/linear_solver/linear_solver.h" #include "ortools/sat/cp_model.pb.h" diff --git a/examples/cpp/course_scheduling_run.cc b/examples/cpp/course_scheduling_run.cc index dccc57dcf87..2aef942952b 100644 --- a/examples/cpp/course_scheduling_run.cc +++ b/examples/cpp/course_scheduling_run.cc @@ -19,9 +19,11 @@ // ./course_scheduling_run --input_file=testdata/my_input_proto.textproto #include +#include +#include "absl/flags/flag.h" +#include "absl/log/log.h" #include "examples/cpp/course_scheduling.h" -#include "ortools/base/commandlineflags.h" #include "ortools/base/helpers.h" #include "ortools/base/init_google.h" #include "ortools/base/options.h" diff --git a/examples/cpp/fap_model_printer.cc b/examples/cpp/fap_model_printer.cc index a71f95e8818..e85878aeea4 100644 --- a/examples/cpp/fap_model_printer.cc +++ b/examples/cpp/fap_model_printer.cc @@ -11,8 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// - #include "examples/cpp/fap_model_printer.h" #include diff --git a/examples/cpp/fap_model_printer.h b/examples/cpp/fap_model_printer.h index 0000f700331..badb8b98da3 100644 --- a/examples/cpp/fap_model_printer.h +++ b/examples/cpp/fap_model_printer.h @@ -11,10 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// // Prints a model of Frequency Assignment Problem. // Format: http://www.inra.fr/mia/T/schiex/Doc/CELAR.shtml#synt -// #ifndef OR_TOOLS_EXAMPLES_FAP_MODEL_PRINTER_H_ #define OR_TOOLS_EXAMPLES_FAP_MODEL_PRINTER_H_ diff --git a/examples/cpp/fap_parser.h b/examples/cpp/fap_parser.h index f25f234013c..53f68054467 100644 --- a/examples/cpp/fap_parser.h +++ b/examples/cpp/fap_parser.h @@ -11,10 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// // Reading and parsing the data of Frequency Assignment Problem // Format: http://www.inra.fr/mia/T/schiex/Doc/CELAR.shtml#synt -// #ifndef OR_TOOLS_EXAMPLES_FAP_PARSER_H_ #define OR_TOOLS_EXAMPLES_FAP_PARSER_H_ diff --git a/examples/cpp/fap_utilities.cc b/examples/cpp/fap_utilities.cc index ab894d31c06..6618278ddd5 100644 --- a/examples/cpp/fap_utilities.cc +++ b/examples/cpp/fap_utilities.cc @@ -11,8 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// - #include "examples/cpp/fap_utilities.h" #include diff --git a/examples/cpp/fap_utilities.h b/examples/cpp/fap_utilities.h index 00aaa85af29..8ac3bfc55d2 100644 --- a/examples/cpp/fap_utilities.h +++ b/examples/cpp/fap_utilities.h @@ -11,9 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// // Utilities used by frequency_assignment_problem.cc. -// #ifndef OR_TOOLS_EXAMPLES_FAP_UTILITIES_H_ #define OR_TOOLS_EXAMPLES_FAP_UTILITIES_H_ diff --git a/examples/cpp/frequency_assignment_problem.cc b/examples/cpp/frequency_assignment_problem.cc index c5a315d7c69..a78e20a4c32 100644 --- a/examples/cpp/frequency_assignment_problem.cc +++ b/examples/cpp/frequency_assignment_problem.cc @@ -11,7 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// // Frequency Assignment Problem // The Radio Link Frequency Assignment Problem consists in assigning frequencies // to a set of radio links defined between pairs of sites in order to avoid diff --git a/examples/cpp/golomb_sat.cc b/examples/cpp/golomb_sat.cc index f64da4d5d6c..b8bfcace464 100644 --- a/examples/cpp/golomb_sat.cc +++ b/examples/cpp/golomb_sat.cc @@ -11,7 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// // Golomb ruler problem // // find minimal ruler so that the differences between ticks are unique. diff --git a/examples/cpp/multi_knapsack_sat.cc b/examples/cpp/multi_knapsack_sat.cc index 476165d8bf2..cd44277e228 100644 --- a/examples/cpp/multi_knapsack_sat.cc +++ b/examples/cpp/multi_knapsack_sat.cc @@ -28,6 +28,7 @@ #include "absl/flags/flag.h" #include "absl/log/globals.h" #include "absl/log/log.h" +#include "absl/strings/string_view.h" #include "ortools/base/init_google.h" #include "ortools/sat/cp_model.h" @@ -50,7 +51,7 @@ static const int kItemsVolumes[] = {281, 307, 206, 111, 275, 79, 23, 65, 261, 40}; static const int kNumItems = 10; -void MultiKnapsackSat(int scaling, const std::string& params) { +void MultiKnapsackSat(int scaling, absl::string_view params) { CpModelBuilder builder; const int num_items = scaling * kNumItems; diff --git a/examples/cpp/nqueens.cc b/examples/cpp/nqueens.cc index a6ec13fa00a..7bc2d45fbd1 100644 --- a/examples/cpp/nqueens.cc +++ b/examples/cpp/nqueens.cc @@ -11,7 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// // N-queens problem // // unique solutions: http://www.research.att.com/~njas/sequences/A000170 diff --git a/examples/cpp/parse_dimacs_assignment.h b/examples/cpp/parse_dimacs_assignment.h index c95fca8e5ef..5ed0336b271 100644 --- a/examples/cpp/parse_dimacs_assignment.h +++ b/examples/cpp/parse_dimacs_assignment.h @@ -11,7 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// // Function for reading and parsing a file in DIMACS format: // http://lpsolve.sourceforge.net/5.5/DIMACS_asn.htm // diff --git a/examples/cpp/pdptw.cc b/examples/cpp/pdptw.cc index 7482286dc40..fde4d38ae8b 100644 --- a/examples/cpp/pdptw.cc +++ b/examples/cpp/pdptw.cc @@ -11,7 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// // Pickup and Delivery Problem with Time Windows. // The overall objective is to minimize the length of the routes delivering // quantities of goods between pickup and delivery locations, taking into diff --git a/examples/cpp/print_dimacs_assignment.h b/examples/cpp/print_dimacs_assignment.h index 93154b3be59..14c57587651 100644 --- a/examples/cpp/print_dimacs_assignment.h +++ b/examples/cpp/print_dimacs_assignment.h @@ -11,7 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// // Function for outputting an assignment problem in DIMACS format: // http://lpsolve.sourceforge.net/5.5/DIMACS_asn.htm // diff --git a/examples/cpp/random_tsp.cc b/examples/cpp/random_tsp.cc index d6f4e05c8eb..510f303feca 100644 --- a/examples/cpp/random_tsp.cc +++ b/examples/cpp/random_tsp.cc @@ -130,8 +130,8 @@ void Tsp() { // Setting the cost function. // Put a permanent callback to the distance accessor here. The callback - // has the following signature: ResultCallback2. - // The two arguments are the from and to node indices. + // is of type `std::function` and the two + // arguments are the from and to node indices. RandomMatrix matrix(absl::GetFlag(FLAGS_tsp_size)); if (absl::GetFlag(FLAGS_tsp_use_random_matrix)) { matrix.Initialize(); diff --git a/examples/java/FlowExample.java b/examples/java/FlowExample.java index e7149c43317..c26ed9b55d3 100644 --- a/examples/java/FlowExample.java +++ b/examples/java/FlowExample.java @@ -19,7 +19,6 @@ /** * Sample showing how to model using the flow solver. - * */ public class FlowExample { private static void solveMinCostFlow() { diff --git a/examples/java/LinearAssignmentAPI.java b/examples/java/LinearAssignmentAPI.java index 350ff71c6b8..fca92c6eb65 100644 --- a/examples/java/LinearAssignmentAPI.java +++ b/examples/java/LinearAssignmentAPI.java @@ -20,7 +20,6 @@ * Test assignment on a 4x4 matrix. Example taken from * http://www.ee.oulu.fi/~mpa/matreng/eem1_2-1.htm with kCost[0][1] * modified so the optimum solution is unique. - * */ public class LinearAssignmentAPI { private static void runAssignmentOn4x4Matrix() { diff --git a/examples/java/LinearProgramming.java b/examples/java/LinearProgramming.java index 8fd06852b59..59e0cbd98e0 100644 --- a/examples/java/LinearProgramming.java +++ b/examples/java/LinearProgramming.java @@ -21,7 +21,6 @@ /** * Linear programming example that shows how to use the API. - * */ public class LinearProgramming { private static void runLinearProgrammingExample(String solverType, boolean printModel) { diff --git a/examples/java/RabbitsPheasants.java b/examples/java/RabbitsPheasants.java index f2b19583c19..24969b0ad33 100644 --- a/examples/java/RabbitsPheasants.java +++ b/examples/java/RabbitsPheasants.java @@ -22,15 +22,13 @@ /** * Sample showing how to model using the constraint programming solver. - * */ public class RabbitsPheasants { private static Logger logger = Logger.getLogger(RabbitsPheasants.class.getName()); /** - * Solves the rabbits + pheasants problem. We are seing 20 heads - * and 56 legs. How many rabbits and how many pheasants are we thus - * seeing? + * Solves the rabbits + pheasants problem. We are seeing 20 heads and 56 legs. How many rabbits + * and how many pheasants are we thus seeing? */ private static void solve(boolean traceSearch) { ConstraintSolverParameters parameters = diff --git a/examples/python/golomb_sat.py b/examples/python/golomb_sat.py index c785649d915..f1451314a46 100644 --- a/examples/python/golomb_sat.py +++ b/examples/python/golomb_sat.py @@ -70,7 +70,7 @@ def solve_golomb_ruler(order: int, params: str) -> None: # Solve the model. solver = cp_model.CpSolver() if params: - solver.parameters.parse_text_format(_PARAMS.value) + solver.parameters.parse_text_format(params) solution_printer = cp_model.ObjectiveSolutionPrinter() print(f"Golomb ruler(order={order})") status = solver.solve(model, solution_printer) diff --git a/ortools/algorithms/python/knapsack_solver_test.py b/ortools/algorithms/python/knapsack_solver_test.py index 95c990183b2..9e124e442b0 100755 --- a/ortools/algorithms/python/knapsack_solver_test.py +++ b/ortools/algorithms/python/knapsack_solver_test.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Copyright 2011 Google Inc. All Rights Reserved. - """knapsack_solver unittest file.""" from absl import app diff --git a/ortools/algorithms/samples/Knapsack.java b/ortools/algorithms/samples/Knapsack.java index cce35e9543d..0ee0779573e 100644 --- a/ortools/algorithms/samples/Knapsack.java +++ b/ortools/algorithms/samples/Knapsack.java @@ -17,11 +17,10 @@ import com.google.ortools.Loader; import com.google.ortools.algorithms.KnapsackSolver; import java.util.ArrayList; + // [END import] -/** - * Sample showing how to model using the knapsack solver. - */ +/** Sample showing how to model using the knapsack solver. */ public class Knapsack { private Knapsack() {} diff --git a/ortools/base/file.cc b/ortools/base/file.cc index 2759af25244..1bb36019853 100644 --- a/ortools/base/file.cc +++ b/ortools/base/file.cc @@ -27,6 +27,9 @@ #include #endif +#include +#include + #include #include #include @@ -38,11 +41,9 @@ #include "absl/status/status.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "bzlib.h" #include "google/protobuf/io/tokenizer.h" #include "google/protobuf/message.h" #include "google/protobuf/text_format.h" -#include "zlib.h" namespace { enum class Format { NORMAL_FILE, GZIP_FILE, BZIP2_FILE }; diff --git a/ortools/base/gzipfile.h b/ortools/base/gzipfile.h index dad2f0852f0..13b2a998a2c 100644 --- a/ortools/base/gzipfile.h +++ b/ortools/base/gzipfile.h @@ -14,9 +14,10 @@ #ifndef OR_TOOLS_BASE_GZIPFILE_H_ #define OR_TOOLS_BASE_GZIPFILE_H_ +#include // for Z_DEFAULT_COMPRESSION + #include "absl/strings/string_view.h" #include "ortools/base/basictypes.h" // for Ownership enum -#include "zlib.h" // for Z_DEFAULT_COMPRESSION class File; diff --git a/ortools/base/gzipstring.h b/ortools/base/gzipstring.h index d8185112ced..f62d9e021ce 100644 --- a/ortools/base/gzipstring.h +++ b/ortools/base/gzipstring.h @@ -14,12 +14,13 @@ #ifndef OR_TOOLS_BASE_GZIPSTRING_H_ #define OR_TOOLS_BASE_GZIPSTRING_H_ +#include +#include + #include #include "absl/log/log.h" #include "absl/strings/string_view.h" -#include "zconf.h" -#include "zlib.h" inline bool GunzipString(absl::string_view str, std::string* out) { z_stream zs; diff --git a/ortools/base/recordio.cc b/ortools/base/recordio.cc index 0f3c1b9e78d..c9e1c899aa7 100644 --- a/ortools/base/recordio.cc +++ b/ortools/base/recordio.cc @@ -13,6 +13,8 @@ #include "ortools/base/recordio.h" +#include + #include #include #include @@ -20,7 +22,6 @@ #include "absl/log/check.h" #include "absl/log/log.h" #include "ortools/base/file.h" -#include "zlib.h" namespace recordio { const int RecordWriter::kMagicNumber = 0x3ed7230a; diff --git a/ortools/constraint_solver/constraint_solver.cc b/ortools/constraint_solver/constraint_solver.cc index 0f4f56dfc00..25ff2af9b96 100644 --- a/ortools/constraint_solver/constraint_solver.cc +++ b/ortools/constraint_solver/constraint_solver.cc @@ -16,6 +16,9 @@ #include "ortools/constraint_solver/constraint_solver.h" +#include +#include + #include #include #include @@ -39,8 +42,6 @@ #include "ortools/base/timer.h" #include "ortools/constraint_solver/constraint_solveri.h" #include "ortools/util/tuple_set.h" -#include "zconf.h" -#include "zlib.h" // These flags are used to set the fields in the DefaultSolverParameters proto. ABSL_FLAG(bool, cp_trace_propagation, false, diff --git a/ortools/constraint_solver/java/constraint_solver.swig b/ortools/constraint_solver/java/constraint_solver.swig index f27f5415ff6..5e4ed136790 100644 --- a/ortools/constraint_solver/java/constraint_solver.swig +++ b/ortools/constraint_solver/java/constraint_solver.swig @@ -737,7 +737,6 @@ import java.util.HashSet; %typemap(javacode) Solver %{ /** * This exceptions signal that a failure has been raised in the C++ world. - * @author lperron@google.com (Laurent Perron) */ public static class FailException extends Exception { public FailException() { diff --git a/ortools/graph/connected_components.cc b/ortools/graph/connected_components.cc index 469b9c2259b..62afd3994c0 100644 --- a/ortools/graph/connected_components.cc +++ b/ortools/graph/connected_components.cc @@ -11,19 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - // The following uses disjoint-sets algorithms, see: // https://en.wikipedia.org/wiki/Disjoint-set_data_structure#Disjoint-set_forests diff --git a/ortools/graph/connected_components.h b/ortools/graph/connected_components.h index 1c584b08ded..c0f530ddd4b 100644 --- a/ortools/graph/connected_components.h +++ b/ortools/graph/connected_components.h @@ -11,19 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - // Finds the connected components in an undirected graph: // https://en.wikipedia.org/wiki/Connected_component_(graph_theory) // diff --git a/ortools/graph/graph.h b/ortools/graph/graph.h index abc6b09279d..caaed8a38b3 100644 --- a/ortools/graph/graph.h +++ b/ortools/graph/graph.h @@ -11,8 +11,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// -// // This file defines a generic graph interface on which most algorithms can be // built and provides a few efficient implementations with a fast construction // time. Its design is based on the experience acquired by the Operations diff --git a/ortools/java/com/google/ortools/constraintsolver/JavaDecisionBuilder.java b/ortools/java/com/google/ortools/constraintsolver/JavaDecisionBuilder.java index 6f943edf808..4d708dbede6 100644 --- a/ortools/java/com/google/ortools/constraintsolver/JavaDecisionBuilder.java +++ b/ortools/java/com/google/ortools/constraintsolver/JavaDecisionBuilder.java @@ -18,7 +18,6 @@ * and a java one. Its main purpose is to catch the java exception launched * when a failure occurs during the Next() call, and to return silently * a FailDecision that will propagate the failure back to the C++ code. - * */ public class JavaDecisionBuilder extends DecisionBuilder { /** This methods wraps the calls to next() and catches fail exceptions. */ diff --git a/ortools/linear_solver/clp_interface.cc b/ortools/linear_solver/clp_interface.cc index d23df0eec51..bce74dbbc97 100644 --- a/ortools/linear_solver/clp_interface.cc +++ b/ortools/linear_solver/clp_interface.cc @@ -20,11 +20,7 @@ #include #include "absl/base/attributes.h" -#include "absl/memory/memory.h" -#include "absl/strings/match.h" #include "absl/strings/str_format.h" -#include "ortools/base/commandlineflags.h" -#include "ortools/base/hash.h" #include "ortools/base/logging.h" #include "ortools/base/timer.h" #include "ortools/linear_solver/linear_solver.h" diff --git a/ortools/linear_solver/gurobi_interface.cc b/ortools/linear_solver/gurobi_interface.cc index 35d5ace103a..26cb42dd4b8 100644 --- a/ortools/linear_solver/gurobi_interface.cc +++ b/ortools/linear_solver/gurobi_interface.cc @@ -38,7 +38,7 @@ // // The above limitations are largely due MPSolver and this file, not Gurobi. // -// Warning(rander): the interactions between callbacks and incrementalism are +// TODO(user): the interactions between callbacks and incrementalism are // poorly tested, proceed with caution. #include diff --git a/ortools/linear_solver/proto_solver/scip_proto_solver.cc b/ortools/linear_solver/proto_solver/scip_proto_solver.cc index 8e36df5dfb2..f40a10d4749 100644 --- a/ortools/linear_solver/proto_solver/scip_proto_solver.cc +++ b/ortools/linear_solver/proto_solver/scip_proto_solver.cc @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -55,10 +54,8 @@ #include "scip/cons_sos1.h" #include "scip/cons_sos2.h" #include "scip/def.h" -#include "scip/pub_event.h" #include "scip/pub_var.h" #include "scip/scip_cons.h" -#include "scip/scip_event.h" #include "scip/scip_general.h" #include "scip/scip_message.h" #include "scip/scip_numerics.h" @@ -72,7 +69,6 @@ #include "scip/type_clock.h" #include "scip/type_cons.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" @@ -587,6 +583,7 @@ absl::Status AddSolutionHint(const MPModelProto& model, SCIP* scip, return absl::OkStatus(); } + } // namespace // Returns "" iff the model seems valid for SCIP, else returns a human-readable @@ -947,9 +944,9 @@ absl::StatusOr ScipSolveProto( return variable_value; }; - // NOTE(user): As of SCIP 7.0.1, getting the pointer to all - // solutions is as fast as getting the pointer to the best solution. - // See scip/src/scip/scip_sol.c?l=2264&rcl=322332899. + // NOTE: As of SCIP 7.0.1, getting the pointer to all solutions is as fast + // as getting the pointer to the best solution. + // See https://github.com/scipopt/scip/blob/v701/src/scip/scip_sol.c#L2264. SCIP_SOL** const scip_solutions = SCIPgetSols(scip); response.set_objective_value(SCIPgetSolOrigObj(scip, scip_solutions[0])); response.set_best_objective_bound(SCIPgetDualbound(scip)); diff --git a/ortools/linear_solver/python/linear_solver.swig b/ortools/linear_solver/python/linear_solver.swig index 028b3dbd96a..5027c78996a 100644 --- a/ortools/linear_solver/python/linear_solver.swig +++ b/ortools/linear_solver/python/linear_solver.swig @@ -12,8 +12,7 @@ // limitations under the License. // This .swig file exposes the linear programming and integer programming -// solver. See the C++/Python codelab: . -// +// solver. // The python API is enriched by custom code defined here, making it // extremely intuitive, like: // solver = pywraplp.Solver( diff --git a/ortools/math_opt/constraints/second_order_cone/validator_test.cc b/ortools/math_opt/constraints/second_order_cone/validator_test.cc index c99580a447f..3d838905f4f 100644 --- a/ortools/math_opt/constraints/second_order_cone/validator_test.cc +++ b/ortools/math_opt/constraints/second_order_cone/validator_test.cc @@ -15,9 +15,6 @@ #include #include -#include -#include -#include #include "absl/status/status.h" #include "absl/types/span.h" diff --git a/ortools/math_opt/constraints/sos/validator_test.cc b/ortools/math_opt/constraints/sos/validator_test.cc index a857dc32782..570310a253a 100644 --- a/ortools/math_opt/constraints/sos/validator_test.cc +++ b/ortools/math_opt/constraints/sos/validator_test.cc @@ -16,8 +16,6 @@ #include #include #include -#include -#include #include "absl/status/status.h" #include "absl/types/span.h" diff --git a/ortools/pdlp/solvers.proto b/ortools/pdlp/solvers.proto index f21869e9a00..2f22b37f376 100644 --- a/ortools/pdlp/solvers.proto +++ b/ortools/pdlp/solvers.proto @@ -46,7 +46,7 @@ enum SchedulerType { // Google ThreadPool with barrier synchronization. SCHEDULER_TYPE_GOOGLE_THREADPOOL = 1; // Eigen non-blocking ThreadPool with barrier synchronization (see - // ). + // ) that uses Google threads. SCHEDULER_TYPE_EIGEN_THREADPOOL = 3; } diff --git a/ortools/routing/docs/ROUTING.md b/ortools/routing/docs/ROUTING.md index 4f517df89f7..ea9cedb4061 100644 --- a/ortools/routing/docs/ROUTING.md +++ b/ortools/routing/docs/ROUTING.md @@ -4,12 +4,12 @@ https://developers.google.com/optimization/routing ## Documentation structure -This document presents modeling recipes for the Vehicle routing solver. -These are grouped by type: +This document presents modeling recipes for the Vehicle routing solver. These +are grouped by type: -* [Travelling Salesman Problem](TSP.md) -* [Vehicle Routing Problem](VRP.md) -* [Pickup and Delivery Problem](PDP.md) +* [Travelling Salesman Problem](TSP.md) +* [Vehicle Routing Problem](VRP.md) +* [Pickup and Delivery Problem](PDP.md) OR-Tools comes with lots of vehicle routing samples given in C++, Python, Java and .Net. Each language have different requirements for the code samples. @@ -98,7 +98,6 @@ int main(int argc, char* argv[]) { ### Python code samples ```python -#!/usr/bin/env python3 # Snippet from ortools/routing/samples/simple_routing_program.py """Vehicle Routing example.""" @@ -303,5 +302,6 @@ public class SimpleRoutingProgram ``` ## Misc + Images have been generated using [routing_svg.py](routing_svg.py) through bash - script [generate_svg.sh](generate_svg.sh). +script [generate_svg.sh](generate_svg.sh). diff --git a/ortools/sat/docs/README.md b/ortools/sat/docs/README.md index 481c23e1443..0bb13b170ae 100644 --- a/ortools/sat/docs/README.md +++ b/ortools/sat/docs/README.md @@ -1,5 +1,5 @@ [home](README.md) | [boolean logic](boolean_logic.md) | [integer arithmetic](integer_arithmetic.md) | [channeling constraints](channeling.md) | [scheduling](scheduling.md) | [Using the CP-SAT solver](solver.md) | [Model manipulation](model.md) | [Troubleshooting](troubleshooting.md) | [Python API](https://or-tools.github.io/docs/pdoc/ortools/sat/python/cp_model.html) ------------------ | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | --------------------------------------------------------------------------------------- +----------------- | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | ----------------------------------------------------------------------------------- # Using the CP-SAT solver https://developers.google.com/optimization/cp/cp_solver diff --git a/ortools/sat/docs/boolean_logic.md b/ortools/sat/docs/boolean_logic.md index c0bcf27e36d..c22ae86ee31 100644 --- a/ortools/sat/docs/boolean_logic.md +++ b/ortools/sat/docs/boolean_logic.md @@ -1,5 +1,5 @@ [home](README.md) | [boolean logic](boolean_logic.md) | [integer arithmetic](integer_arithmetic.md) | [channeling constraints](channeling.md) | [scheduling](scheduling.md) | [Using the CP-SAT solver](solver.md) | [Model manipulation](model.md) | [Troubleshooting](troubleshooting.md) | [Python API](https://or-tools.github.io/docs/pdoc/ortools/sat/python/cp_model.html) ------------------ | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | --------------------------------------------------------------------------------------- +----------------- | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | ----------------------------------------------------------------------------------- # Boolean logic recipes for the CP-SAT solver. https://developers.google.com/optimization/ @@ -8,8 +8,8 @@ https://developers.google.com/optimization/ The CP-SAT solver can express Boolean variables and constraints. A **Boolean variable** is an integer variable constrained to be either 0 or 1. A **literal** -is either a Boolean variable or its negation: 0 negated is 1, and vice versa. -See +is either a Boolean variable or its negation: 0 negated is 1, and 1 negated is +0. See https://en.wikipedia.org/wiki/Boolean_satisfiability_problem#Basic_definitions_and_terminology. ## Boolean variables and literals diff --git a/ortools/sat/docs/channeling.md b/ortools/sat/docs/channeling.md index c36c1e939a7..9582cedbdb8 100644 --- a/ortools/sat/docs/channeling.md +++ b/ortools/sat/docs/channeling.md @@ -1,5 +1,5 @@ [home](README.md) | [boolean logic](boolean_logic.md) | [integer arithmetic](integer_arithmetic.md) | [channeling constraints](channeling.md) | [scheduling](scheduling.md) | [Using the CP-SAT solver](solver.md) | [Model manipulation](model.md) | [Troubleshooting](troubleshooting.md) | [Python API](https://or-tools.github.io/docs/pdoc/ortools/sat/python/cp_model.html) ------------------ | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | --------------------------------------------------------------------------------------- +----------------- | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | ----------------------------------------------------------------------------------- # Channeling constraints https://developers.google.com/optimization/ diff --git a/ortools/sat/docs/integer_arithmetic.md b/ortools/sat/docs/integer_arithmetic.md index fe2dae192b3..f714931b5f6 100644 --- a/ortools/sat/docs/integer_arithmetic.md +++ b/ortools/sat/docs/integer_arithmetic.md @@ -1,5 +1,5 @@ [home](README.md) | [boolean logic](boolean_logic.md) | [integer arithmetic](integer_arithmetic.md) | [channeling constraints](channeling.md) | [scheduling](scheduling.md) | [Using the CP-SAT solver](solver.md) | [Model manipulation](model.md) | [Troubleshooting](troubleshooting.md) | [Python API](https://or-tools.github.io/docs/pdoc/ortools/sat/python/cp_model.html) ------------------ | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | --------------------------------------------------------------------------------------- +----------------- | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | ----------------------------------------------------------------------------------- # Integer arithmetic recipes for the CP-SAT solver. https://developers.google.com/optimization/ @@ -54,9 +54,9 @@ created is constrained to be 1, 2, 4, 5, or 6: ### Boolean variables -To create a Boolean variable, use the `NewBoolVar` method. Please note that -Boolean variables are typed differently than integer variables, and that this -type is not uniform across languages. +To create a Boolean variable, use the `NewBoolVar` method. Note that Boolean +variables are typed differently than integer variables, and that this type is +not uniform across languages. - **C++**: `BoolVar x = model.NewBoolVar().WithName("x");` - **Python**: `x = model.NewBoolVar('x')` @@ -101,14 +101,14 @@ examples below. ### Limitations -- Everything must be linear. Multiplying two variables is not supported - with this API; instead, `model.AddMultiplicationEquality()` must be used. +- Everything must be linear. Multiplying two variables is not supported with + this API; instead, `model.AddMultiplicationEquality()` must be used. - In C++, there is a typing issue when using an array of Boolean variables in a sum or a scalar product. Use the `LinearExpr.BooleanSum()` method instead. -- The Python construct `sum()` is supported, but `min()`, `max()` - or any `numpy` constructs like `np.unique()` are not. +- The Python construct `sum()` is supported, but `min()`, `max()` or any + `numpy` constructs like `np.unique()` are not. ## Rabbits and Pheasants examples diff --git a/ortools/sat/docs/model.md b/ortools/sat/docs/model.md index 02d64598305..10b5b6e67b1 100644 --- a/ortools/sat/docs/model.md +++ b/ortools/sat/docs/model.md @@ -1,5 +1,5 @@ [home](README.md) | [boolean logic](boolean_logic.md) | [integer arithmetic](integer_arithmetic.md) | [channeling constraints](channeling.md) | [scheduling](scheduling.md) | [Using the CP-SAT solver](solver.md) | [Model manipulation](model.md) | [Troubleshooting](troubleshooting.md) | [Python API](https://or-tools.github.io/docs/pdoc/ortools/sat/python/cp_model.html) ------------------ | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | --------------------------------------------------------------------------------------- +----------------- | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | ----------------------------------------------------------------------------------- # Model manipulation https://developers.google.com/optimization/ diff --git a/ortools/sat/docs/scheduling.md b/ortools/sat/docs/scheduling.md index d1c60c7e423..79c1822a0ab 100644 --- a/ortools/sat/docs/scheduling.md +++ b/ortools/sat/docs/scheduling.md @@ -1,5 +1,5 @@ [home](README.md) | [boolean logic](boolean_logic.md) | [integer arithmetic](integer_arithmetic.md) | [channeling constraints](channeling.md) | [scheduling](scheduling.md) | [Using the CP-SAT solver](solver.md) | [Model manipulation](model.md) | [Troubleshooting](troubleshooting.md) | [Python API](https://or-tools.github.io/docs/pdoc/ortools/sat/python/cp_model.html) ------------------ | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | --------------------------------------------------------------------------------------- +----------------- | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | ----------------------------------------------------------------------------------- # Scheduling recipes for the CP-SAT solver. https://developers.google.com/optimization/ diff --git a/ortools/sat/docs/solver.md b/ortools/sat/docs/solver.md index 7eaa5311ec9..d8264d903d9 100644 --- a/ortools/sat/docs/solver.md +++ b/ortools/sat/docs/solver.md @@ -1,5 +1,5 @@ [home](README.md) | [boolean logic](boolean_logic.md) | [integer arithmetic](integer_arithmetic.md) | [channeling constraints](channeling.md) | [scheduling](scheduling.md) | [Using the CP-SAT solver](solver.md) | [Model manipulation](model.md) | [Troubleshooting](troubleshooting.md) | [Python API](https://or-tools.github.io/docs/pdoc/ortools/sat/python/cp_model.html) ------------------ | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | --------------------------------------------------------------------------------------- +----------------- | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | ----------------------------------------------------------------------------------- # Solving a CP-SAT model https://developers.google.com/optimization/ diff --git a/ortools/sat/docs/troubleshooting.md b/ortools/sat/docs/troubleshooting.md index a281557f7b7..3c6d8f729d9 100644 --- a/ortools/sat/docs/troubleshooting.md +++ b/ortools/sat/docs/troubleshooting.md @@ -1,5 +1,5 @@ [home](README.md) | [boolean logic](boolean_logic.md) | [integer arithmetic](integer_arithmetic.md) | [channeling constraints](channeling.md) | [scheduling](scheduling.md) | [Using the CP-SAT solver](solver.md) | [Model manipulation](model.md) | [Troubleshooting](troubleshooting.md) | [Python API](https://or-tools.github.io/docs/pdoc/ortools/sat/python/cp_model.html) ------------------ | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | --------------------------------------------------------------------------------------- +----------------- | --------------------------------- | ------------------------------------------- | --------------------------------------- | --------------------------- | ------------------------------------ | ------------------------------ | ------------------------------------- | ----------------------------------------------------------------------------------- # Troubleshooting ## Enable logging diff --git a/ortools/sat/python/CMakeLists.txt b/ortools/sat/python/CMakeLists.txt index fca07c14216..c42f3e58446 100644 --- a/ortools/sat/python/CMakeLists.txt +++ b/ortools/sat/python/CMakeLists.txt @@ -88,4 +88,3 @@ if(BUILD_TESTING) add_python_test(FILE_NAME ${FILE_NAME}) endforeach() endif() -