539 lines
12 KiB
Python
539 lines
12 KiB
Python
# Copyright 2010-2025 Google LLC
|
|
# 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.
|
|
|
|
load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
|
|
load("@protobuf//bazel:proto_library.bzl", "proto_library")
|
|
load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library")
|
|
load("@rules_cc//cc:cc_library.bzl", "cc_library")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
# OptionalBoolean
|
|
proto_library(
|
|
name = "optional_boolean_proto",
|
|
srcs = ["optional_boolean.proto"],
|
|
)
|
|
|
|
cc_proto_library(
|
|
name = "optional_boolean_cc_proto",
|
|
deps = [":optional_boolean_proto"],
|
|
)
|
|
|
|
py_proto_library(
|
|
name = "optional_boolean_py_pb2",
|
|
visibility = ["//visibility:public"],
|
|
deps = [":optional_boolean_proto"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "affine_relation",
|
|
hdrs = ["affine_relation.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"//ortools/base:iterator_adaptors",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "filelineiter",
|
|
hdrs = ["filelineiter.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"//ortools/base:file",
|
|
"@abseil-cpp//absl/strings",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "bitset",
|
|
srcs = ["bitset.cc"],
|
|
hdrs = ["bitset.h"],
|
|
deps = [
|
|
"@abseil-cpp//absl/flags:flag",
|
|
"@abseil-cpp//absl/log:check",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "cached_log",
|
|
srcs = ["cached_log.cc"],
|
|
hdrs = ["cached_log.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "zvector",
|
|
hdrs = ["zvector.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"@abseil-cpp//absl/log:check",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "permutation",
|
|
hdrs = ["permutation.h"],
|
|
deps = ["//ortools/base"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "saturated_arithmetic",
|
|
hdrs = ["saturated_arithmetic.h"],
|
|
deps = [
|
|
":bitset",
|
|
"//ortools/base:types",
|
|
"@abseil-cpp//absl/base",
|
|
"@abseil-cpp//absl/log:check",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "piecewise_linear_function",
|
|
srcs = ["piecewise_linear_function.cc"],
|
|
hdrs = ["piecewise_linear_function.h"],
|
|
copts = select({
|
|
"@platforms//os:windows": ["/Zc:preprocessor"],
|
|
"//conditions:default": [],
|
|
}),
|
|
deps = [
|
|
":saturated_arithmetic",
|
|
"//ortools/base",
|
|
"//ortools/base:dump_vars",
|
|
"//ortools/base:mathutil",
|
|
"//ortools/base:types",
|
|
"@abseil-cpp//absl/algorithm:container",
|
|
"@abseil-cpp//absl/container:btree",
|
|
"@abseil-cpp//absl/container:inlined_vector",
|
|
"@abseil-cpp//absl/log:check",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
"@abseil-cpp//absl/strings:string_view",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "rational_approximation",
|
|
srcs = ["rational_approximation.cc"],
|
|
hdrs = ["rational_approximation.h"],
|
|
deps = ["//ortools/base"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "sorted_interval_list",
|
|
srcs = ["sorted_interval_list.cc"],
|
|
hdrs = ["sorted_interval_list.h"],
|
|
deps = [
|
|
":saturated_arithmetic",
|
|
"//ortools/base",
|
|
"//ortools/base:types",
|
|
"@abseil-cpp//absl/container:inlined_vector",
|
|
"@abseil-cpp//absl/numeric:int128",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
"@abseil-cpp//absl/types:span",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "string_array",
|
|
hdrs = ["string_array.h"],
|
|
deps = ["@abseil-cpp//absl/strings"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "tuple_set",
|
|
hdrs = ["tuple_set.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"//ortools/base:hash",
|
|
"@abseil-cpp//absl/container:flat_hash_map",
|
|
"@abseil-cpp//absl/container:flat_hash_set",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "stats",
|
|
srcs = ["stats.cc"],
|
|
hdrs = ["stats.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"//ortools/base:timer",
|
|
"//ortools/port:sysinfo",
|
|
"@abseil-cpp//absl/container:flat_hash_map",
|
|
"@abseil-cpp//absl/log:check",
|
|
"@abseil-cpp//absl/strings",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
"@abseil-cpp//absl/time",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "time_limit",
|
|
srcs = ["time_limit.cc"],
|
|
hdrs = ["time_limit.h"],
|
|
deps = [
|
|
":running_stat",
|
|
"//ortools/base:base_export",
|
|
"//ortools/base:timer",
|
|
"//ortools/base:types",
|
|
"@abseil-cpp//absl/base:core_headers",
|
|
"@abseil-cpp//absl/container:flat_hash_map",
|
|
"@abseil-cpp//absl/flags:flag",
|
|
"@abseil-cpp//absl/log",
|
|
"@abseil-cpp//absl/log:check",
|
|
"@abseil-cpp//absl/log:die_if_null",
|
|
"@abseil-cpp//absl/strings",
|
|
"@abseil-cpp//absl/synchronization",
|
|
"@abseil-cpp//absl/time",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "sigint",
|
|
srcs = ["sigint.cc"],
|
|
hdrs = ["sigint.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"//ortools/port:os",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "fp_utils",
|
|
srcs = ["fp_utils.cc"],
|
|
hdrs = ["fp_utils.h"],
|
|
# -frounding-math is needed for code that uses IEEE-754 rounding modes.
|
|
# You must also set this flag if you depend on this target and use
|
|
# its methods related to IEEE-754 rounding modes.
|
|
copts = select({
|
|
"@platforms//os:linux": ["-frounding-math"],
|
|
"@platforms//os:macos": ["-frounding-math"],
|
|
"@platforms//os:windows": [],
|
|
"//conditions:default": ["-frounding-math"],
|
|
}),
|
|
deps = [
|
|
":bitset",
|
|
"@abseil-cpp//absl/base",
|
|
"@abseil-cpp//absl/log:check",
|
|
"@abseil-cpp//absl/types:span",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "monoid_operation_tree",
|
|
hdrs = ["monoid_operation_tree.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "return_macros",
|
|
hdrs = ["return_macros.h"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "running_stat",
|
|
hdrs = ["running_stat.h"],
|
|
deps = ["//ortools/base"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "proto_tools",
|
|
srcs = ["proto_tools.cc"],
|
|
hdrs = ["proto_tools.h"],
|
|
deps = [
|
|
"//ortools/base:murmur",
|
|
"@abseil-cpp//absl/container:flat_hash_map",
|
|
"@abseil-cpp//absl/container:flat_hash_set",
|
|
"@abseil-cpp//absl/numeric:int128",
|
|
"@abseil-cpp//absl/status",
|
|
"@abseil-cpp//absl/status:statusor",
|
|
"@abseil-cpp//absl/strings",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
"@protobuf",
|
|
],
|
|
)
|
|
|
|
proto_library(
|
|
name = "int128_proto",
|
|
srcs = ["int128.proto"],
|
|
)
|
|
|
|
cc_proto_library(
|
|
name = "int128_cc_proto",
|
|
deps = [":int128_proto"],
|
|
)
|
|
|
|
py_proto_library(
|
|
name = "int128_py_pb2",
|
|
deps = [":int128_proto"],
|
|
)
|
|
|
|
# helper library for the swig wrappers.
|
|
|
|
cc_library(
|
|
name = "functions_swig_helpers",
|
|
hdrs = ["functions_swig_helpers.h"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "functions_swig_test_helpers",
|
|
testonly = 1,
|
|
hdrs = ["functions_swig_test_helpers.h"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "range_minimum_query",
|
|
hdrs = ["range_minimum_query.h"],
|
|
deps = [
|
|
":bitset",
|
|
"@abseil-cpp//absl/log:check",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "range_query_function",
|
|
srcs = ["range_query_function.cc"],
|
|
hdrs = ["range_query_function.h"],
|
|
deps = [
|
|
":range_minimum_query",
|
|
"//ortools/base",
|
|
"//ortools/base:types",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "rev",
|
|
hdrs = ["rev.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"//ortools/base:strong_vector",
|
|
"@abseil-cpp//absl/container:flat_hash_map",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "vector_or_function",
|
|
hdrs = ["vector_or_function.h"],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":flat_matrix",
|
|
"//ortools/base",
|
|
],
|
|
)
|
|
|
|
# Parsers and readers.
|
|
|
|
cc_library(
|
|
name = "qap_reader",
|
|
srcs = ["qap_reader.cc"],
|
|
hdrs = ["qap_reader.h"],
|
|
deps = [
|
|
":filelineiter",
|
|
"@abseil-cpp//absl/log:check",
|
|
"@abseil-cpp//absl/strings",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "sort",
|
|
hdrs = ["sort.h"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "file_util",
|
|
srcs = ["file_util.cc"],
|
|
hdrs = ["file_util.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"//ortools/base:file",
|
|
"//ortools/base:gzipstring",
|
|
"//ortools/base:recordio",
|
|
"//ortools/base:status_macros",
|
|
"@abseil-cpp//absl/log",
|
|
"@abseil-cpp//absl/log:check",
|
|
"@abseil-cpp//absl/status",
|
|
"@abseil-cpp//absl/status:statusor",
|
|
"@abseil-cpp//absl/strings",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
"@protobuf",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "random_engine",
|
|
hdrs = ["random_engine.h"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "integer_pq",
|
|
hdrs = ["integer_pq.h"],
|
|
visibility = ["//visibility:public"],
|
|
deps = ["//ortools/base"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "string_util",
|
|
srcs = ["string_util.cc"],
|
|
hdrs = ["string_util.h"],
|
|
deps = [
|
|
"//ortools/base",
|
|
"@abseil-cpp//absl/strings",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "adaptative_parameter_value",
|
|
hdrs = ["adaptative_parameter_value.h"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "lazy_mutable_copy",
|
|
hdrs = ["lazy_mutable_copy.h"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "logging",
|
|
srcs = ["logging.cc"],
|
|
hdrs = ["logging.h"],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":time_limit",
|
|
"//ortools/base:timer",
|
|
"@abseil-cpp//absl/strings",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "testing_utils",
|
|
hdrs = ["testing_utils.h"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "strong_integers",
|
|
hdrs = ["strong_integers.h"],
|
|
deps = [
|
|
"@abseil-cpp//absl/base:core_headers",
|
|
"@abseil-cpp//absl/strings",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "status_macros",
|
|
hdrs = ["status_macros.h"],
|
|
deps = ["//ortools/base:status_macros"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "fp_roundtrip_conv",
|
|
srcs = ["fp_roundtrip_conv.cc"],
|
|
hdrs = ["fp_roundtrip_conv.h"],
|
|
deps = [
|
|
"//ortools/base:logging",
|
|
"//ortools/base:status_macros",
|
|
"@abseil-cpp//absl/base:core_headers",
|
|
"@abseil-cpp//absl/log:check",
|
|
"@abseil-cpp//absl/status:statusor",
|
|
"@abseil-cpp//absl/strings",
|
|
"@abseil-cpp//absl/strings:str_format",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "flat_matrix",
|
|
hdrs = ["flat_matrix.h"],
|
|
deps = ["@abseil-cpp//absl/types:span"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "fp_roundtrip_conv_testing",
|
|
testonly = 1,
|
|
hdrs = ["fp_roundtrip_conv_testing.h"],
|
|
deps = ["@abseil-cpp//absl/strings"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "aligned_memory",
|
|
srcs = ["aligned_memory_internal.h"],
|
|
hdrs = ["aligned_memory.h"],
|
|
deps = ["//ortools/base:mathutil"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "vector_sum",
|
|
srcs = ["vector_sum_internal.h"],
|
|
hdrs = ["vector_sum.h"],
|
|
deps = [
|
|
":aligned_memory",
|
|
"@abseil-cpp//absl/base:core_headers",
|
|
"@abseil-cpp//absl/types:span",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "parse_proto",
|
|
srcs = ["parse_proto.cc"],
|
|
hdrs = ["parse_proto.h"],
|
|
deps = [
|
|
"@abseil-cpp//absl/strings",
|
|
"@protobuf",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "fixed_shape_binary_tree",
|
|
hdrs = ["fixed_shape_binary_tree.h"],
|
|
deps = [
|
|
":strong_integers",
|
|
"@abseil-cpp//absl/log:check",
|
|
"@abseil-cpp//absl/numeric:bits",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "solve_interrupter",
|
|
srcs = ["solve_interrupter.cc"],
|
|
hdrs = ["solve_interrupter.h"],
|
|
deps = [
|
|
"//ortools/base:intops",
|
|
"//ortools/base:linked_hash_map",
|
|
"//ortools/base:logging",
|
|
"@abseil-cpp//absl/base:core_headers",
|
|
"@abseil-cpp//absl/base:nullability",
|
|
"@abseil-cpp//absl/functional:any_invocable",
|
|
"@abseil-cpp//absl/synchronization",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "dense_set",
|
|
hdrs = ["dense_set.h"],
|
|
deps = [
|
|
"@abseil-cpp//absl/log:check",
|
|
"@abseil-cpp//absl/types:span",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "scheduling",
|
|
hdrs = ["scheduling.h"],
|
|
deps = ["@abseil-cpp//absl/log:check"],
|
|
)
|