diff --git a/ortools/graph/k_shortest_paths.h b/ortools/graph/k_shortest_paths.h index 27361df6e6..26232eb8fe 100644 --- a/ortools/graph/k_shortest_paths.h +++ b/ortools/graph/k_shortest_paths.h @@ -184,7 +184,7 @@ ComputeShortestPath(const GraphType& graph, } if (std::vector path = - std::move(dijkstra.NodePathTo(destination)); + dijkstra.NodePathTo(destination); !path.empty()) { return {std::move(path), path_length}; } else { diff --git a/ortools/pdlp/BUILD.bazel b/ortools/pdlp/BUILD.bazel index 8a80c26b49..0e76eccfbb 100644 --- a/ortools/pdlp/BUILD.bazel +++ b/ortools/pdlp/BUILD.bazel @@ -440,6 +440,7 @@ cc_test( ":test_util", ":trust_region", "//ortools/base:gmock_main", + "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/strings", "@eigen", ], diff --git a/ortools/pdlp/trust_region_test.cc b/ortools/pdlp/trust_region_test.cc index 9d2e8df346..f4ec57033a 100644 --- a/ortools/pdlp/trust_region_test.cc +++ b/ortools/pdlp/trust_region_test.cc @@ -22,6 +22,7 @@ #include "Eigen/Core" #include "Eigen/SparseCore" +#include "absl/base/optimization.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "gtest/gtest.h" @@ -610,6 +611,7 @@ INSTANTIATE_TEST_SUITE_P( case PrimalDualNorm::kMaxNorm: return absl::StrCat("MaxNorm", "_", suffix); } + ABSL_UNREACHABLE(); }); TEST_P(ComputeLocalizedLagrangianBoundsTest, ZeroGapAtOptimal) { diff --git a/ortools/util/logging.h b/ortools/util/logging.h index 271b833280..4907d1fdb7 100644 --- a/ortools/util/logging.h +++ b/ortools/util/logging.h @@ -115,6 +115,9 @@ class SolverLogger { if ((logger)->LoggingIsEnabled()) \ (logger)->LogInfo(__FILE__, __LINE__, absl::StrCat(__VA_ARGS__)) +#define FORCED_SOLVER_LOG(logger, ...) \ + (logger)->LogInfo(__FILE__, __LINE__, absl::StrCat(__VA_ARGS__)) + // Simple helper class to: // - log in an uniform way a "time-consuming" presolve operation. // - track a deterministic work limit.