Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
empty_bounds.cc
Go to the documentation of this file.
1// Copyright 2010-2025 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
15
16#include <limits>
17
18#include "absl/strings/str_cat.h"
21
23
24constexpr double kInf = std::numeric_limits<double>::infinity();
25
27 const int64_t bad_variable_id,
28 const double lb, const double ub) {
29 SolveResultProto result;
32 absl::StrCat("Problem had one or more integer variables with no integers "
33 "in domain, e.g. integer variable with id: ",
34 bad_variable_id, " had bounds: [", RoundTripDoubleFormat(lb),
35 ", ", RoundTripDoubleFormat(ub), "]."));
40 const double objective_value = is_maximize ? -kInf : kInf;
41 result.mutable_solve_stats()->set_best_primal_bound(objective_value);
42 result.mutable_solve_stats()->set_best_dual_bound(-objective_value);
43 return result;
44}
45
46} // namespace operations_research::math_opt
void set_primal_status(::operations_research::math_opt::FeasibilityStatusProto value)
Definition result.pb.h:1786
void set_dual_status(::operations_research::math_opt::FeasibilityStatusProto value)
Definition result.pb.h:1810
::operations_research::math_opt::TerminationProto *PROTOBUF_NONNULL mutable_termination()
Definition result.pb.h:2728
::operations_research::math_opt::SolveStatsProto *PROTOBUF_NONNULL mutable_solve_stats()
Definition result.pb.h:2964
::operations_research::math_opt::ProblemStatusProto *PROTOBUF_NONNULL mutable_problem_status()
Definition result.pb.h:2064
void set_detail(Arg_ &&arg, Args_... args)
void set_reason(::operations_research::math_opt::TerminationReasonProto value)
Definition result.pb.h:2256
An object oriented wrapper for quadratic constraints in ModelStorage.
Definition gurobi_isv.cc:28
SolveResultProto ResultForIntegerInfeasible(const bool is_maximize, const int64_t bad_variable_id, const double lb, const double ub)