Skip to content

Commit a4b37b6

Browse files
committed
large sync with main
1 parent cf72696 commit a4b37b6

File tree

82 files changed

+3363
-2364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+3363
-2364
lines changed

examples/java/IntegerProgramming.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
import com.google.ortools.linearsolver.MPSolver;
2020
import com.google.ortools.linearsolver.MPVariable;
2121

22-
/**
23-
* Integer programming example that shows how to use the API.
24-
*
25-
*/
22+
/** Integer programming example that shows how to use the API. */
2623
public class IntegerProgramming {
2724
private static void runIntegerProgrammingExample(String solverType) {
2825
MPSolver solver = MPSolver.createSolver(solverType);
@@ -55,7 +52,7 @@ private static void runIntegerProgrammingExample(String solverType) {
5552

5653
// Verify that the solution satisfies all constraints (when using solvers
5754
// others than GLOP_LINEAR_PROGRAMMING, this is highly recommended!).
58-
if (!solver.verifySolution(/*tolerance=*/1e-7, /* log_errors= */ true)) {
55+
if (!solver.verifySolution(/* tolerance= */ 1e-7, /* log_errors= */ true)) {
5956
System.err.println("The solution returned by the solver violated the"
6057
+ " problem constraints by at least 1e-7");
6158
return;

examples/java/LinearProgramming.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private static void runLinearProgrammingExample(String solverType, boolean print
3030
System.out.println("Could not create solver " + solverType);
3131
return;
3232
}
33-
double infinity = java.lang.Double.POSITIVE_INFINITY;
33+
double infinity = Double.POSITIVE_INFINITY;
3434
// x1, x2 and x3 are continuous non-negative variables.
3535
MPVariable x1 = solver.makeNumVar(0.0, infinity, "x1");
3636
MPVariable x2 = solver.makeNumVar(0.0, infinity, "x2");
@@ -65,7 +65,7 @@ private static void runLinearProgrammingExample(String solverType, boolean print
6565
System.out.println("Number of constraints = " + solver.numConstraints());
6666

6767
if (printModel) {
68-
String model = solver.exportModelAsLpFormat(/* obfuscate = */false);
68+
String model = solver.exportModelAsLpFormat(/* obfuscate= */ false);
6969
System.out.println(model);
7070
}
7171

@@ -79,7 +79,7 @@ private static void runLinearProgrammingExample(String solverType, boolean print
7979

8080
// Verify that the solution satisfies all constraints (when using solvers
8181
// others than GLOP_LINEAR_PROGRAMMING, this is highly recommended!).
82-
if (!solver.verifySolution(/*tolerance=*/1e-7, /* log_errors= */ true)) {
82+
if (!solver.verifySolution(/* tolerance= */ 1e-7, /* log_errors= */ true)) {
8383
System.err.println("The solution returned by the solver violated the"
8484
+ " problem constraints by at least 1e-7");
8585
return;

examples/notebook/constraint_solver/cp_is_fun_cp.ipynb

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
"from ortools.constraint_solver import pywrapcp\n",
9292
"\n",
9393
"\n",
94-
"\n",
9594
"def main():\n",
9695
" # Constraint programming engine\n",
9796
" solver = pywrapcp.Solver(\"CP is fun!\")\n",

examples/notebook/constraint_solver/nqueens_cp.ipynb

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
"from ortools.constraint_solver import pywrapcp\n",
8888
"\n",
8989
"\n",
90-
"\n",
9190
"def main(board_size):\n",
9291
" # Creates the solver.\n",
9392
" solver = pywrapcp.Solver(\"n-queens\")\n",

examples/notebook/constraint_solver/simple_cp_program.ipynb

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
"from ortools.constraint_solver import pywrapcp\n",
8787
"\n",
8888
"\n",
89-
"\n",
9089
"def main():\n",
9190
" \"\"\"Entry point of the program.\"\"\"\n",
9291
" # Instantiate the solver.\n",

examples/notebook/examples/shift_scheduling_sat.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"def negated_bounded_span(\n",
9999
" works: list[cp_model.BoolVarT], start: int, length: int\n",
100100
") -> list[cp_model.BoolVarT]:\n",
101-
" \"\"\"Filters an isolated sub-sequence of variables assined to True.\n",
101+
" \"\"\"Filters an isolated sub-sequence of variables assigned to True.\n",
102102
"\n",
103103
" Extract the span of Boolean variables [start, start + length), negate them,\n",
104104
" and if there is variables to the left/right of this span, surround the span by\n",
@@ -342,7 +342,7 @@
342342
" (3, 1, 0),\n",
343343
" ]\n",
344344
"\n",
345-
" # daily demands for work shifts (morning, afternon, night) for each day\n",
345+
" # daily demands for work shifts (morning, afternoon, night) for each day\n",
346346
" # of the week starting on Monday.\n",
347347
" weekly_cover_demands = [\n",
348348
" (2, 3, 1), # Monday\n",

0 commit comments

Comments
 (0)