Google OR-Tools v9.11
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-2024 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"
19#include "ortools/math_opt/result.pb.h"
21
23
24constexpr double kInf = std::numeric_limits<double>::infinity();
25
26SolveResultProto ResultForIntegerInfeasible(const bool is_maximize,
27 const int64_t bad_variable_id,
28 const double lb, const double ub) {
29 SolveResultProto result;
30 result.mutable_termination()->set_reason(TERMINATION_REASON_INFEASIBLE);
31 result.mutable_termination()->set_detail(
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), "]."));
36 result.mutable_solve_stats()->mutable_problem_status()->set_primal_status(
37 FEASIBILITY_STATUS_INFEASIBLE);
38 result.mutable_solve_stats()->mutable_problem_status()->set_dual_status(
39 FEASIBILITY_STATUS_UNDETERMINED);
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
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)
double objective_value
The value objective_vector^T * (solution - center_point).