Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
elemental_matcher.h
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
14#ifndef OR_TOOLS_MATH_OPT_ELEMENTAL_ELEMENTAL_MATCHER_H_
15#define OR_TOOLS_MATH_OPT_ELEMENTAL_ELEMENTAL_MATCHER_H_
16
17#include <ostream>
18
19#include "absl/base/attributes.h"
20#include "ortools/base/gmock.h"
23
25
27 public:
28 using is_gtest_matcher = void;
29
30 explicit ElementalMatcher(const Elemental& expected
31 ABSL_ATTRIBUTE_LIFETIME_BOUND,
32 const ElementalDifferenceOptions& options);
33
34 bool MatchAndExplain(const Elemental& actual, std::ostream* os) const;
35
36 void DescribeTo(std::ostream* os) const;
37
38 void DescribeNegationTo(std::ostream* os) const;
39
40 private:
41 const Elemental* expected_;
43};
44
45inline testing::Matcher<const Elemental&> EquivToElemental(
46 const Elemental& expected ABSL_ATTRIBUTE_LIFETIME_BOUND,
47 const ElementalDifferenceOptions& options = {}) {
48 return ElementalMatcher(expected, options);
49}
50
51} // namespace operations_research::math_opt
52
53#endif // OR_TOOLS_MATH_OPT_ELEMENTAL_ELEMENTAL_MATCHER_H_
ElementalMatcher(const Elemental &expected ABSL_ATTRIBUTE_LIFETIME_BOUND, const ElementalDifferenceOptions &options)
bool MatchAndExplain(const Elemental &actual, std::ostream *os) const
An object oriented wrapper for quadratic constraints in ModelStorage.
Definition gurobi_isv.cc:28
testing::Matcher< const Elemental & > EquivToElemental(const Elemental &expected ABSL_ATTRIBUTE_LIFETIME_BOUND, const ElementalDifferenceOptions &options={})