Backport trivial changes

This commit is contained in:
Guillaume Chatelet
2025-07-18 08:11:03 +00:00
committed by Corentin Le Molgat
parent 959bb0d51c
commit 46f73b3d35
47 changed files with 54 additions and 117 deletions

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"

View File

@@ -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>

View File

@@ -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_

View File

@@ -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_

View File

@@ -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>

View File

@@ -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_

View File

@@ -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

View File

@@ -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.

View File

@@ -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;

View File

@@ -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

View File

@@ -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
//

View File

@@ -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

View File

@@ -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
//

View File

@@ -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();