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: 4 additions & 0 deletions ortools/glop/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ cc_library(
"//ortools/lp_data:base",
"//ortools/lp_data:lp_utils",
"//ortools/lp_data:sparse",
"//ortools/lp_data:sparse_column",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
],
)

Expand Down
9 changes: 9 additions & 0 deletions ortools/glop/initial_basis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@
#include <queue>
#include <vector>

#include "absl/base/optimization.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "ortools/glop/markowitz.h"
#include "ortools/lp_data/lp_types.h"
#include "ortools/lp_data/lp_utils.h"
#include "ortools/lp_data/sparse.h"
#include "ortools/lp_data/sparse_column.h"

namespace operations_research {
namespace glop {
Expand Down Expand Up @@ -219,6 +225,8 @@ int InitialBasis::GetMarosPriority(ColIndex col) const {
case VariableType::FIXED_VARIABLE:
return 0;
}
LOG(FATAL) << "Invalid variable type: "
<< static_cast<int>(variable_type_[col]);
}

int InitialBasis::GetMarosPriority(RowIndex row) const {
Expand Down Expand Up @@ -388,6 +396,7 @@ int InitialBasis::GetColumnCategory(ColIndex col) const {
case VariableType::FIXED_VARIABLE:
return 5;
}
ABSL_UNREACHABLE();
}

Fractional InitialBasis::GetColumnPenalty(ColIndex col) const {
Expand Down
2 changes: 2 additions & 0 deletions ortools/glop/primal_edge_norms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "ortools/glop/primal_edge_norms.h"

#include <algorithm>
#include <cmath>
#include <cstdlib>

#include "absl/log/check.h"
Expand Down Expand Up @@ -68,6 +69,7 @@ DenseRow::ConstView PrimalEdgeNorms::GetSquaredNorms() {
case GlopParameters::DEVEX:
return GetDevexWeights().const_view();
}
LOG(FATAL) << "Invalid pricing rule: " << pricing_rule_;
}

const DenseRow& PrimalEdgeNorms::GetEdgeSquaredNorms() {
Expand Down
2 changes: 2 additions & 0 deletions ortools/math_opt/core/math_opt_proto_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <optional>
#include <string>

#include "absl/base/optimization.h"
#include "absl/container/flat_hash_set.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
Expand Down Expand Up @@ -403,6 +404,7 @@ absl::Status ModelIsSupported(const ModelProto& model,
case SupportType::kSupported:
LOG(FATAL) << "Unexpected call with `kSupported`";
}
ABSL_UNREACHABLE();
};
if (const SupportType support = support_menu.integer_variables;
support != SupportType::kSupported) {
Expand Down
1 change: 1 addition & 0 deletions ortools/math_opt/elemental/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ cc_test(
":tagged_id",
"//ortools/base:gmock_main",
"//ortools/math_opt/testing:stream",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/hash:hash_testing",
"@abseil-cpp//absl/strings",
],
Expand Down
2 changes: 2 additions & 0 deletions ortools/math_opt/elemental/tagged_id_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <ostream>
#include <utility>

#include "absl/base/optimization.h"
#include "absl/hash/hash_testing.h"
#include "absl/strings/str_cat.h"
#include "gtest/gtest.h"
Expand All @@ -39,6 +40,7 @@ std::ostream& operator<<(std::ostream& ostr, const TestEnum& e) {
ostr << "kValue0";
return ostr;
}
ABSL_UNREACHABLE();
}

using TestEnumId = TaggedId<TestEnum::kValue0>;
Expand Down
1 change: 1 addition & 0 deletions ortools/math_opt/solver_tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ cc_library(
"//ortools/math_opt/cpp:math_opt",
"//ortools/math_opt/io:mps_converter",
"//ortools/port:proto_utils",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings:string_view",
Expand Down
3 changes: 3 additions & 0 deletions ortools/math_opt/solver_tests/multi_objective_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <ostream>
#include <utility>

#include "absl/base/optimization.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
Expand Down Expand Up @@ -210,6 +211,7 @@ absl::StatusOr<SimpleMultiObjectiveSolveResult> SolveWithObjectiveDegradation(
case ObjectiveType::kAuxiliary:
return model.AddMaximizationObjective(x, /*priority=*/0);
}
ABSL_UNREACHABLE();
}();
const Objective priority_1 = [&]() {
switch (priority_1_type) {
Expand All @@ -220,6 +222,7 @@ absl::StatusOr<SimpleMultiObjectiveSolveResult> SolveWithObjectiveDegradation(
case ObjectiveType::kAuxiliary:
return model.AddMinimizationObjective(x, /*priority=*/1);
}
ABSL_UNREACHABLE();
}();
ModelSolveParameters model_parameters;
switch (tolerance_type) {
Expand Down
7 changes: 6 additions & 1 deletion ortools/math_opt/solvers/gscip/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ cc_library(
"@abseil-cpp//absl/cleanup",
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/container:flat_hash_set",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/memory",
"@abseil-cpp//absl/status",
Expand Down Expand Up @@ -215,6 +216,7 @@ cc_library(
deps = [
"//ortools/base:logging",
"//ortools/linear_solver:scip_helper_macros",
"@abseil-cpp//absl/log:die_if_null",
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings",
"@scip",
Expand All @@ -225,7 +227,10 @@ cc_library(
name = "gscip_callback_result",
srcs = ["gscip_callback_result.cc"],
hdrs = ["gscip_callback_result.h"],
deps = ["@scip"],
deps = [
"@abseil-cpp//absl/base:core_headers",
"@scip",
],
)

cc_library(
Expand Down
19 changes: 11 additions & 8 deletions ortools/math_opt/solvers/gscip/gscip.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
#include <utility>
#include <vector>

#include "absl/base/optimization.h"
#include "absl/cleanup/cleanup.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
Expand All @@ -35,14 +37,6 @@
#include "absl/synchronization/mutex.h"
#include "absl/types/span.h"
#include "lpi/lpi.h"
#include "ortools/base/logging.h"
#include "ortools/base/status_macros.h"
#include "ortools/linear_solver/scip_helper_macros.h"
#include "ortools/math_opt/solvers/gscip/gscip.pb.h"
#include "ortools/math_opt/solvers/gscip/gscip_event_handler.h"
#include "ortools/math_opt/solvers/gscip/gscip_parameters.h"
#include "ortools/port/proto_utils.h"
#include "ortools/util/status_macros.h"
#include "scip/cons_and.h"
#include "scip/cons_indicator.h"
#include "scip/cons_linear.h"
Expand All @@ -53,6 +47,13 @@
#else
#include "scip/cons_quadratic.h"
#endif // SCIP_VERSION_MAJOR >= 10
#include "ortools/base/status_macros.h"
#include "ortools/linear_solver/scip_helper_macros.h"
#include "ortools/math_opt/solvers/gscip/gscip.pb.h"
#include "ortools/math_opt/solvers/gscip/gscip_event_handler.h"
#include "ortools/math_opt/solvers/gscip/gscip_parameters.h"
#include "ortools/port/proto_utils.h"
#include "ortools/util/status_macros.h"
#include "scip/cons_sos1.h"
#include "scip/cons_sos2.h"
#include "scip/def.h"
Expand Down Expand Up @@ -102,6 +103,7 @@ SCIP_VARTYPE ConvertVarType(const GScipVarType var_type) {
case GScipVarType::kInteger:
return SCIP_VARTYPE_INTEGER;
}
ABSL_UNREACHABLE();
}

GScipVarType ConvertVarType(const SCIP_VARTYPE var_type) {
Expand All @@ -115,6 +117,7 @@ GScipVarType ConvertVarType(const SCIP_VARTYPE var_type) {
case SCIP_VARTYPE_BINARY:
return GScipVarType::kBinary;
}
LOG(FATAL) << "Unrecognized SCIP_VARTYPE: " << var_type;
}

GScipOutput::Status ConvertStatus(const SCIP_STATUS scip_status) {
Expand Down
2 changes: 2 additions & 0 deletions ortools/math_opt/solvers/gscip/gscip_callback_result.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "ortools/math_opt/solvers/gscip/gscip_callback_result.h"

#include "absl/base/optimization.h"
#include "scip/type_result.h"

namespace operations_research {
Expand Down Expand Up @@ -56,6 +57,7 @@ SCIP_RESULT ConvertGScipCallbackResult(const GScipCallbackResult result) {
case GScipCallbackResult::kDelayNode:
return SCIP_DELAYNODE;
}
ABSL_UNREACHABLE();
}

} // namespace operations_research
2 changes: 2 additions & 0 deletions ortools/math_opt/tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ cc_binary(
"//ortools/util:sigint",
"//ortools/util:status_macros",
"@abseil-cpp//absl/base:no_destructor",
"@abseil-cpp//absl/base:nullability",
"@abseil-cpp//absl/flags:flag",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/status",
Expand Down Expand Up @@ -81,6 +82,7 @@ cc_library(
"//ortools/math_opt/io:mps_converter",
"//ortools/math_opt/io:proto_converter",
"@abseil-cpp//absl/algorithm:container",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/status",
Expand Down
4 changes: 4 additions & 0 deletions ortools/math_opt/tools/file_format_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <vector>

#include "absl/algorithm/container.h"
#include "absl/base/optimization.h"
#include "absl/container/flat_hash_map.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
Expand Down Expand Up @@ -69,6 +70,7 @@ std::string AbslUnparseFlag(const FileFormat f) {
case FileFormat::kLP:
return "lp";
}
ABSL_UNREACHABLE();
}

std::ostream& operator<<(std::ostream& out, const FileFormat f) {
Expand Down Expand Up @@ -232,6 +234,7 @@ ReadModel(const absl::string_view file_path, const FileFormat format) {
return std::make_pair(std::move(model), std::nullopt);
}
}
ABSL_UNREACHABLE();
}

absl::Status WriteModel(const absl::string_view file_path,
Expand Down Expand Up @@ -267,6 +270,7 @@ absl::Status WriteModel(const absl::string_view file_path,
return file::SetContents(file_path, lp_data, file::Defaults());
}
}
ABSL_UNREACHABLE();
}

} // namespace operations_research::math_opt
1 change: 1 addition & 0 deletions ortools/pdlp/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ cc_library(
"//ortools/lp_data:proto_utils",
"//ortools/util:logging",
"@abseil-cpp//absl/algorithm:container",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/base:nullability",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
Expand Down
2 changes: 2 additions & 0 deletions ortools/pdlp/primal_dual_hybrid_gradient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "Eigen/SparseCore"
#include "absl/algorithm/container.h"
#include "absl/base/nullability.h"
#include "absl/base/optimization.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
Expand Down Expand Up @@ -250,6 +251,7 @@ void LogIterationStats(int verbosity_level, bool use_feasibility_polishing,
case IterationType::kPresolveTermination:
return "t ";
}
ABSL_UNREACHABLE();
} else {
return "";
}
Expand Down
1 change: 1 addition & 0 deletions ortools/routing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ cc_library(
deps = [
":enums_cc_proto",
":ils_cc_proto",
"@abseil-cpp//absl/base:core_headers",
],
)

Expand Down
2 changes: 2 additions & 0 deletions ortools/routing/ils_parameters_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <string>
#include <vector>

#include "absl/base/optimization.h"
#include "ortools/routing/enums.pb.h"
#include "ortools/routing/ils.pb.h"

Expand Down Expand Up @@ -60,6 +61,7 @@ std::string GetRecreateParametersName(
case RecreateParameters::PARAMETERS_NOT_SET:
return "PARAMETERS_NOT_SET";
}
ABSL_UNREACHABLE();
}

} // namespace operations_research::routing
4 changes: 3 additions & 1 deletion ortools/routing/parsers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ cc_library(
deps = [
":simple_graph",
"//ortools/base:file",
"//ortools/base:logging",
"@abseil-cpp//absl/base:core_headers",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:str_format",
"@abseil-cpp//absl/time",
Expand Down
11 changes: 10 additions & 1 deletion ortools/routing/parsers/solution_serializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,25 @@
#include "ortools/routing/parsers/solution_serializer.h"

#include <algorithm>
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <vector>

#include "absl/base/attributes.h"
#include "absl/log/check.h"
#include "absl/log/log.h"
#include "absl/strings/ascii.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/time/clock.h"
#include "absl/time/time.h"
#include "absl/types/span.h"
#include "ortools/base/logging.h"
#include "ortools/base/file.h"
#include "ortools/base/helpers.h"
#include "ortools/base/options.h"
#include "ortools/routing/parsers/simple_graph.h"

namespace operations_research::routing {

Expand Down
Loading
Loading