Google OR-Tools
v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
testing.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
// Test descriptors. This avoids depending on attributes from `attributes.h`
15
// in the tests to decouple the codegen tests from `attributes.h`.
16
#ifndef ORTOOLS_MATH_OPT_ELEMENTAL_CODEGEN_TESTING_H_
17
#define ORTOOLS_MATH_OPT_ELEMENTAL_CODEGEN_TESTING_H_
18
19
#include "
ortools/math_opt/elemental/codegen/gen.h
"
20
21
namespace
operations_research::math_opt::codegen
{
22
23
inline
CodegenAttrTypeDescriptor
GetTestDescriptor
() {
24
return
{.name =
"TestAttr2"
,
25
.value_type =
CodegenAttrTypeDescriptor::ValueType::kDouble
,
26
.num_key_elements = 2,
27
.symmetry =
"SomeSymmetry"
,
28
.attribute_names = {
"a_name"
,
"b_name"
}};
29
}
30
31
inline
AttrOpFunctionInfo
GetTestFunctionInfo
(
bool
with_key_parameter) {
32
return
{.return_type =
Type::Named
(
"ReturnType"
),
33
.has_key_parameter = with_key_parameter,
34
.extra_parameters = {
35
{{.type =
Type::Named
(
"ExtraParam"
), .name =
"extra_param"
}}}};
36
}
37
38
}
// namespace operations_research::math_opt::codegen
39
40
#endif
// ORTOOLS_MATH_OPT_ELEMENTAL_CODEGEN_TESTING_H_
operations_research::math_opt::codegen::Type::Named
static std::shared_ptr< Type > Named(std::string name)
Definition
gen.cc:68
gen.h
operations_research::math_opt::codegen
Definition
codegen.cc:29
operations_research::math_opt::codegen::GetTestFunctionInfo
AttrOpFunctionInfo GetTestFunctionInfo(bool with_key_parameter)
Definition
testing.h:31
operations_research::math_opt::codegen::GetTestDescriptor
CodegenAttrTypeDescriptor GetTestDescriptor()
Definition
testing.h:23
operations_research::math_opt::codegen::AttrOpFunctionInfo
Definition
gen.h:81
operations_research::math_opt::codegen::CodegenAttrTypeDescriptor
Definition
gen.h:42
operations_research::math_opt::codegen::CodegenAttrTypeDescriptor::ValueType::kDouble
@ kDouble
Definition
gen.h:49
ortools
math_opt
elemental
codegen
testing.h
Generated by
1.15.0