Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::math_opt::codegen Namespace Reference

Language-agnostic utilities for Elemental codegen. More...

Classes

struct  AttrOpFunctionInfo
 Information about how to codegen a given AttrOp in a given language. More...
struct  CodegenAttrTypeDescriptor
 A struct to represent an attribute type descriptor during codegen. More...
class  CodeGenerator
 The code generator interface. More...
class  Type
 Representations for types. More...

Typedefs

using AttrOpFunctionInfos = std::array<AttrOpFunctionInfo, kNumAttrOps>

Enumerations

enum class  AttrOp {
  kGet , kSet , kIsNonDefault , kNumNonDefaults ,
  kGetNonDefaults , kNumOps
}
 The list of attribute operations supported by Elemental. More...

Functions

CodegenAttrTypeDescriptor::ValueType GetValueType (bool)
CodegenAttrTypeDescriptor::ValueType GetValueType (int64_t)
CodegenAttrTypeDescriptor::ValueType GetValueType (double)
template<ElementType element_type>
CodegenAttrTypeDescriptor::ValueType GetValueType (ElementId< element_type >)
template<typename Descriptor>
CodegenAttrTypeDescriptor MakeAttrTypeDescriptor ()
std::unique_ptr< CodeGeneratorC99Declarations ()
 Returns a generator for C99 declarations.
std::unique_ptr< CodeGeneratorC99Definitions ()
 Returns a generator for C99 definitions.
std::unique_ptr< CodeGeneratorPythonEnums ()
CodegenAttrTypeDescriptor GetTestDescriptor ()
AttrOpFunctionInfo GetTestFunctionInfo (bool with_key_parameter)

Variables

constexpr absl::string_view kOpNames [static_cast< int >(AttrOp::kNumOps)]
static constexpr int kNumAttrOps = static_cast<int>(AttrOp::kNumOps)

Detailed Description

Language-agnostic utilities for Elemental codegen.

The python code generator.

The C99 code generator.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Test descriptors. This avoids depending on attributes from attributes.h in the tests to decouple the codegen tests from attributes.h.

Typedef Documentation

◆ AttrOpFunctionInfos

Enumeration Type Documentation

◆ AttrOp

The list of attribute operations supported by Elemental.

Enumerator
kGet 
kSet 
kIsNonDefault 
kNumNonDefaults 
kGetNonDefaults 
kNumOps 

Do not use.

Definition at line 29 of file gen.h.

Function Documentation

◆ C99Declarations()

std::unique_ptr< CodeGenerator > operations_research::math_opt::codegen::C99Declarations ( )

Returns a generator for C99 declarations.

Definition at line 237 of file gen_c.cc.

◆ C99Definitions()

std::unique_ptr< CodeGenerator > operations_research::math_opt::codegen::C99Definitions ( )

Returns a generator for C99 definitions.

Definition at line 241 of file gen_c.cc.

◆ GetTestDescriptor()

CodegenAttrTypeDescriptor operations_research::math_opt::codegen::GetTestDescriptor ( )
inline

Definition at line 23 of file testing.h.

◆ GetTestFunctionInfo()

AttrOpFunctionInfo operations_research::math_opt::codegen::GetTestFunctionInfo ( bool with_key_parameter)
inline

Definition at line 31 of file testing.h.

◆ GetValueType() [1/4]

CodegenAttrTypeDescriptor::ValueType operations_research::math_opt::codegen::GetValueType ( bool )

Definition at line 82 of file gen.cc.

◆ GetValueType() [2/4]

CodegenAttrTypeDescriptor::ValueType operations_research::math_opt::codegen::GetValueType ( double )

Definition at line 90 of file gen.cc.

◆ GetValueType() [3/4]

template<ElementType element_type>
CodegenAttrTypeDescriptor::ValueType operations_research::math_opt::codegen::GetValueType ( ElementId< element_type > )

Element ids are untyped in wrapped APIs.

Definition at line 95 of file gen.cc.

◆ GetValueType() [4/4]

CodegenAttrTypeDescriptor::ValueType operations_research::math_opt::codegen::GetValueType ( int64_t )

Definition at line 86 of file gen.cc.

◆ MakeAttrTypeDescriptor()

template<typename Descriptor>
CodegenAttrTypeDescriptor operations_research::math_opt::codegen::MakeAttrTypeDescriptor ( )

Definition at line 101 of file gen.cc.

◆ PythonEnums()

std::unique_ptr< CodeGenerator > operations_research::math_opt::codegen::PythonEnums ( )

Returns a generator for python enums, independent of the actual implementation. These are used by the protocol.

Definition at line 157 of file gen_python.cc.

Variable Documentation

◆ kNumAttrOps

int operations_research::math_opt::codegen::kNumAttrOps = static_cast<int>(AttrOp::kNumOps)
staticconstexpr

Definition at line 39 of file gen.h.

◆ kOpNames

absl::string_view operations_research::math_opt::codegen::kOpNames[static_cast< int >(AttrOp::kNumOps)]
constexpr
Initial value:
= {
"Get", "Set", "IsNonDefault", "NumNonDefaults", "GetNonDefaults"}

Definition at line 115 of file gen.cc.