File tree Expand file tree Collapse file tree 6 files changed +14
-7
lines changed
Expand file tree Collapse file tree 6 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -598,5 +598,6 @@ cc_library(
598598 ":linear_solver_cc_proto" ,
599599 "//ortools/util:lazy_mutable_copy" ,
600600 "//ortools/util:solve_interrupter" ,
601+ "@abseil-cpp//absl/base:nullability" ,
601602 ],
602603)
Original file line number Diff line number Diff line change @@ -516,7 +516,6 @@ absl::string_view ToString(
516516 }
517517 LOG (FATAL) << " Unrecognized solver type: "
518518 << static_cast <int >(optimization_problem_type);
519- return " " ;
520519}
521520
522521bool AbslParseFlag (const absl::string_view text,
Original file line number Diff line number Diff line change 1717#include < string>
1818#include < utility>
1919
20+ #include " absl/base/nullability.h"
2021#include " ortools/linear_solver/linear_solver.h"
2122#include " ortools/linear_solver/linear_solver.pb.h"
2223#include " ortools/util/lazy_mutable_copy.h"
@@ -26,8 +27,9 @@ namespace operations_research {
2627
2728// TODO(b/311704821): this function should not delegate to MPSolver, also true
2829// for the functions below.
29- MPSolutionResponse SolveMPModel (LazyMutableCopy<MPModelRequest> request,
30- const SolveInterrupter* interrupter) {
30+ MPSolutionResponse SolveMPModel (
31+ LazyMutableCopy<MPModelRequest> request,
32+ const SolveInterrupter* absl_nullable interrupter) {
3133 MPSolutionResponse response;
3234 if (interrupter != nullptr ) {
3335 std::atomic<bool > atomic_bool = false ;
Original file line number Diff line number Diff line change 2020
2121#include < string>
2222
23+ #include " absl/base/nullability.h"
2324#include " ortools/linear_solver/linear_solver.pb.h"
2425#include " ortools/util/lazy_mutable_copy.h"
2526#include " ortools/util/solve_interrupter.h"
@@ -41,8 +42,9 @@ namespace operations_research {
4142 * Passing a non-null pointer with any other solver type immediately returns an
4243 * MPSOLVER_INCOMPATIBLE_OPTIONS error.
4344 */
44- MPSolutionResponse SolveMPModel (LazyMutableCopy<MPModelRequest> request,
45- const SolveInterrupter* interrupter = nullptr );
45+ MPSolutionResponse SolveMPModel (
46+ LazyMutableCopy<MPModelRequest> request,
47+ const SolveInterrupter* absl_nullable interrupter = nullptr );
4648
4749bool SolverTypeSupportsInterruption (MPModelRequest::SolverType solver);
4850
Original file line number Diff line number Diff line change 1515
1616#include < optional>
1717
18+ #include " absl/base/nullability.h"
1819#include " ortools/util/python/py_solve_interrupter.h"
1920
2021namespace operations_research {
2122
22- std::optional<bool > IsInterrupted (const PySolveInterrupter* interrupter) {
23+ std::optional<bool > IsInterrupted (
24+ const PySolveInterrupter* absl_nullable interrupter) {
2325 if (interrupter == nullptr ) {
2426 return std::nullopt ;
2527 }
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ namespace operations_research {
3131//
3232// The Clif/pybind11 wrapper will return a `bool | None` value, with None for
3333// nullopt.
34- std::optional<bool > IsInterrupted (const PySolveInterrupter* interrupter);
34+ std::optional<bool > IsInterrupted (
35+ const PySolveInterrupter* absl_nullable interrupter);
3536
3637// Class that keeps a reference on a std::shared_ptr<PySolveInterrupter> to
3738// test that the C++ object survive the cleanup of the Python reference.
You can’t perform that action at this time.
0 commit comments