Google OR-Tools v9.11
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-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
16namespace operations_research {
17
19 switch (s) {
21 return MPSolver::OPTIMAL;
23 return MPSolver::FEASIBLE;
24
25 // Note(user): MPSolver does not have the equivalent of
26 // INFEASIBLE_OR_UNBOUNDED however UNBOUNDED is almost never relevant in
27 // applications, so we decided to report this status as INFEASIBLE since
28 // it should almost always be the case. Historically, we where reporting
29 // ABNORMAL, but that was more confusing than helpful.
30 //
31 // TODO(user): We could argue that it is infeasible to find the optimal of
32 // an unbounded problem. So it might just be simpler to completely get rid
33 // of the MpSolver::UNBOUNDED status that seems to never be used
34 // programmatically.
35 case glop::ProblemStatus::INFEASIBLE_OR_UNBOUNDED: // PASS_THROUGH_INTENDED
36 case glop::ProblemStatus::PRIMAL_INFEASIBLE: // PASS_THROUGH_INTENDED
39
40 case glop::ProblemStatus::DUAL_INFEASIBLE: // PASS_THROUGH_INTENDED
43
44 case glop::ProblemStatus::DUAL_FEASIBLE: // PASS_THROUGH_INTENDED
47
48 case glop::ProblemStatus::ABNORMAL: // PASS_THROUGH_INTENDED
49 case glop::ProblemStatus::IMPRECISE: // PASS_THROUGH_INTENDED
51 return MPSolver::ABNORMAL;
52 }
53 LOG(DFATAL) << "Invalid glop::ProblemStatus " << s;
54 return MPSolver::ABNORMAL;
55}
56
73
90
107
124
125} // 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.
ProblemStatus
Different statuses for a given problem.
Definition lp_types.h:107
@ ABNORMAL
An error occurred during the solving process.
@ INVALID_PROBLEM
The input problem was invalid (see LinearProgram.IsValid()).
@ INIT
The solver didn't had a chance to prove anything.
In SWIG mode, we don't want anything besides these top-level includes.
MPSolver::ResultStatus GlopToMPSolverResultStatus(glop::ProblemStatus s)
Definition glop_utils.cc:18
glop::VariableStatus MPSolverToGlopVariableStatus(MPSolver::BasisStatus s)
Definition glop_utils.cc:74
glop::ConstraintStatus MPSolverToGlopConstraintStatus(MPSolver::BasisStatus s)
MPSolver::BasisStatus GlopToMPSolverConstraintStatus(glop::ConstraintStatus s)
Definition glop_utils.cc:91
MPSolver::BasisStatus GlopToMPSolverVariableStatus(glop::VariableStatus s)
Definition glop_utils.cc:57