Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
mip_tests.h
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
14#ifndef OR_TOOLS_MATH_OPT_SOLVER_TESTS_MIP_TESTS_H_
15#define OR_TOOLS_MATH_OPT_SOLVER_TESTS_MIP_TESTS_H_
16
17#include <memory>
18#include <ostream>
19
20#include "gtest/gtest.h"
23
24namespace operations_research {
25namespace math_opt {
26
30
31 // The tested solver.
33
34 // True if the solver reports unbound MIPs as UNBOUNDED or DUAL_INFEASIBLE. If
35 // false, the solver is expected to return OTHER_ERROR.
36 //
37 // TODO(b/202159173): remove this when we start using the direct CP-SAT API
38 // and thus will be able to get proper details.
40};
41
42std::ostream& operator<<(std::ostream& out,
43 const SimpleMipTestParameters& params);
44
45// A suite of unit tests to validate that mandatory behavior for MIP solvers.
46//
47// To use these tests, in file <solver>_test.cc, write:
48// INSTANTIATE_TEST_SUITE_P(
49// <Solver>SimpleMipTest, SimpleMipTest,
50// testing::Values(SimpleMipTestParameters(SolverType::k<Solver>)));
51class SimpleMipTest : public ::testing::TestWithParam<SimpleMipTestParameters> {
52};
53
55 protected:
57
59 const Variable x_;
60 const Variable y_;
62 std::unique_ptr<IncrementalSolver> solver_;
63};
64
65} // namespace math_opt
66} // namespace operations_research
67
68#endif // OR_TOOLS_MATH_OPT_SOLVER_TESTS_MIP_TESTS_H_
std::unique_ptr< IncrementalSolver > solver_
Definition mip_tests.h:62
SolverType
The solvers supported by MathOpt.
Definition parameters.h:42
std::ostream & operator<<(std::ostream &ostr, const IndicatorConstraint &constraint)
In SWIG mode, we don't want anything besides these top-level includes.
SimpleMipTestParameters(SolverType solver_type, bool report_unboundness_correctly=true)
Definition mip_tests.cc:40