Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
lp_model_solve_parameters_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_LP_MODEL_SOLVE_PARAMETERS_TESTS_H_
15#define OR_TOOLS_MATH_OPT_SOLVER_TESTS_LP_MODEL_SOLVE_PARAMETERS_TESTS_H_
16
17#include <ostream>
18#include <utility>
19
20#include "gtest/gtest.h"
23
24namespace operations_research {
25namespace math_opt {
26
29 // If true, we EXPECT that the solver to return a value of exactly 0.0 for
30 // decisions variables >= 0 that take zero at the optimum on a very small
31 // problem. In general, simplex solvers are more likely to do this, but very
32 // few solvers actually guarantee this. All tests relying on this behavior are
33 // brittle and we should try to eliminate them.
36 // True if the solver supports warm starts on the primal solution only.
39
49
50 friend std::ostream& operator<<(
51 std::ostream& out, const LpModelSolveParametersTestParameters& params);
52};
53
54// Parameterized test suite that validates that an implementation of
55// SolverInterface::Solve() for a LP solver takes into account correctly the
56// input ModelSolveParametersProto.
57//
58// Usage:
59//
60// INSTANTIATE_TEST_SUITE_P(<Solver>LpModelSolveParametersTest,
61// LpModelSolveParametersTest,
62// testing::Values(
63// LpModelSolveParametersTestParameters(
64// SolverType::k<Solver>)));
65//
67 : public ::testing::TestWithParam<LpModelSolveParametersTestParameters> {};
68
69} // namespace math_opt
70} // namespace operations_research
71
72#endif // OR_TOOLS_MATH_OPT_SOLVER_TESTS_LP_MODEL_SOLVE_PARAMETERS_TESTS_H_
SolverType
The solvers supported by MathOpt.
Definition parameters.h:42
In SWIG mode, we don't want anything besides these top-level includes.
STL namespace.
friend std::ostream & operator<<(std::ostream &out, const LpModelSolveParametersTestParameters &params)
bool supports_primal_only_warm_starts
True if the solver supports warm starts on the primal solution only.
LpModelSolveParametersTestParameters(const SolverType solver_type, const bool exact_zeros, const bool supports_duals, const bool supports_primal_only_warm_starts, SolveParameters parameters={})