Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions examples/cpp/course_scheduling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 0 additions & 2 deletions examples/cpp/course_scheduling.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
#ifndef OR_TOOLS_EXAMPLES_COURSE_SCHEDULING_H_
#define OR_TOOLS_EXAMPLES_COURSE_SCHEDULING_H_

#include <string>
#include <utility>
#include <vector>

#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"
Expand Down
4 changes: 3 additions & 1 deletion examples/cpp/course_scheduling_run.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
// ./course_scheduling_run --input_file=testdata/my_input_proto.textproto

#include <cstdlib>
#include <string>

#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"
Expand Down
2 changes: 0 additions & 2 deletions examples/cpp/fap_model_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>
Expand Down
2 changes: 0 additions & 2 deletions examples/cpp/fap_model_printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
2 changes: 0 additions & 2 deletions examples/cpp/fap_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
2 changes: 0 additions & 2 deletions examples/cpp/fap_utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <algorithm>
Expand Down
2 changes: 0 additions & 2 deletions examples/cpp/fap_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
1 change: 0 additions & 1 deletion examples/cpp/frequency_assignment_problem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion examples/cpp/golomb_sat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion examples/cpp/multi_knapsack_sat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion examples/cpp/nqueens.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion examples/cpp/parse_dimacs_assignment.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
1 change: 0 additions & 1 deletion examples/cpp/pdptw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion examples/cpp/print_dimacs_assignment.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/random_tsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t, int64_t, int64_t>.
// The two arguments are the from and to node indices.
// is of type `std::function<int64_t(int64_t, int64_t)>` 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();
Expand Down
1 change: 0 additions & 1 deletion examples/java/FlowExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

/**
* Sample showing how to model using the flow solver.
*
*/
public class FlowExample {
private static void solveMinCostFlow() {
Expand Down
1 change: 0 additions & 1 deletion examples/java/LinearAssignmentAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 0 additions & 1 deletion examples/java/LinearProgramming.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 2 additions & 4 deletions examples/java/RabbitsPheasants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion examples/python/golomb_sat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions ortools/algorithms/python/knapsack_solver_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions ortools/algorithms/samples/Knapsack.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

Expand Down
5 changes: 3 additions & 2 deletions ortools/base/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#include <unistd.h>
#endif

#include <bzlib.h>
#include <zlib.h>

#include <cstdio>
#include <cstdlib>
#include <cstring>
Expand All @@ -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 };
Expand Down
3 changes: 2 additions & 1 deletion ortools/base/gzipfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
#ifndef OR_TOOLS_BASE_GZIPFILE_H_
#define OR_TOOLS_BASE_GZIPFILE_H_

#include <zlib.h> // 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;

Expand Down
5 changes: 3 additions & 2 deletions ortools/base/gzipstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
#ifndef OR_TOOLS_BASE_GZIPSTRING_H_
#define OR_TOOLS_BASE_GZIPSTRING_H_

#include <zconf.h>
#include <zlib.h>

#include <string>

#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;
Expand Down
3 changes: 2 additions & 1 deletion ortools/base/recordio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

#include "ortools/base/recordio.h"

#include <zlib.h>

#include <cstdint>
#include <memory>
#include <string>

#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;
Expand Down
5 changes: 3 additions & 2 deletions ortools/constraint_solver/constraint_solver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

#include "ortools/constraint_solver/constraint_solver.h"

#include <zconf.h>
#include <zlib.h>

#include <algorithm>
#include <csetjmp>
#include <cstdint>
Expand All @@ -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,
Expand Down
1 change: 0 additions & 1 deletion ortools/constraint_solver/java/constraint_solver.swig
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
13 changes: 0 additions & 13 deletions ortools/graph/connected_components.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 0 additions & 13 deletions ortools/graph/connected_components.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
//
Expand Down
2 changes: 0 additions & 2 deletions ortools/graph/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Loading
Loading