Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
glop_utils.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 "absl/log/log.h"
19
20namespace operations_research {
21
23 switch (s) {
25 return MPSolver::OPTIMAL;
27 return MPSolver::FEASIBLE;
28
29 // Note(user): MPSolver does not have the equivalent of
30 // INFEASIBLE_OR_UNBOUNDED however UNBOUNDED is almost never relevant in
31 // applications, so we decided to report this status as INFEASIBLE since
32 // it should almost always be the case. Historically, we where reporting
33 // ABNORMAL, but that was more confusing than helpful.
34 //
35 // TODO(user): We could argue that it is infeasible to find the optimal of
36 // an unbounded problem. So it might just be simpler to completely get rid
37 // of the MpSolver::UNBOUNDED status that seems to never be used
38 // programmatically.
39 case glop::ProblemStatus::INFEASIBLE_OR_UNBOUNDED: // PASS_THROUGH_INTENDED
40 case glop::ProblemStatus::PRIMAL_INFEASIBLE: // PASS_THROUGH_INTENDED
43
44 case glop::ProblemStatus::DUAL_INFEASIBLE: // PASS_THROUGH_INTENDED
47
48 case glop::ProblemStatus::DUAL_FEASIBLE: // PASS_THROUGH_INTENDED
51
52 case glop::ProblemStatus::ABNORMAL: // PASS_THROUGH_INTENDED
53 case glop::ProblemStatus::IMPRECISE: // PASS_THROUGH_INTENDED
55 return MPSolver::ABNORMAL;
56 }
57 LOG(DFATAL) << "Invalid glop::ProblemStatus " << s;
58 return MPSolver::ABNORMAL;
59}
60
77
94
111
128
129} // namespace operations_research
@ FEASIBLE
feasible, or stopped by limit.
@ NOT_SOLVED
not been solved yet.
@ INFEASIBLE
proven infeasible.
@ ABNORMAL
abnormal, i.e., error of some kind.
OR-Tools root namespace.
MPSolver::ResultStatus GlopToMPSolverResultStatus(glop::ProblemStatus s)
Definition glop_utils.cc:22
glop::VariableStatus MPSolverToGlopVariableStatus(MPSolver::BasisStatus s)
Definition glop_utils.cc:78
glop::ConstraintStatus MPSolverToGlopConstraintStatus(MPSolver::BasisStatus s)
MPSolver::BasisStatus GlopToMPSolverConstraintStatus(glop::ConstraintStatus s)
Definition glop_utils.cc:95
MPSolver::BasisStatus GlopToMPSolverVariableStatus(glop::VariableStatus s)
Definition glop_utils.cc:61