Adiar 2.1.0
An External Memory Decision Diagram Library
Loading...
Searching...
No Matches
types.h
1#ifndef ADIAR_TYPES_H
2#define ADIAR_TYPES_H
3
4#include <optional>
5#include <utility>
6
7namespace adiar
8{
12 enum class assignment : signed char
13 {
15 False = 0,
17 True = 1,
19 None = -1
20 };
21
31 enum class replace_type : signed char
32 {
34 Non_Monotone = 3,
35
37 Monotone = 2,
38
39 /* TODO (faster version of 'Monotone'): `m(x) = ax + b` for some integers `a` and `b`. */
40 // Affine = 1,
41
43 Shift = 0,
44
46 Identity = -1
47 };
48
52 template <typename T1, typename T2>
53 using pair = std::pair<T1, T2>;
54
58 template <typename T1, typename T2>
59 constexpr pair<T1, T2>
60 make_pair(const T1& t1, const T2& t2)
61 {
62 return std::make_pair(t1, t2);
63 }
64
65 /*
69 template<typename T1, typename T2>
70 constexpr pair<T1, T2>
71 make_pair(T1 &&t1, T2 &&t2)
72 { return std::make_pair(std::move(t1), std::move(t2)); }
73 */
74
80 template <typename T>
81 using optional = std::optional<T>;
82
86 template <typename T>
87 constexpr optional<T>
89 {
90 return optional<T>();
91 }
92
96 template <typename T>
97 constexpr optional<T>
99 {
100 return std::make_optional(t);
101 }
102
103 /*
107 template<typename T>
108 constexpr optional<T>
109 make_optional(T &&t)
110 { return std::make_optional(std::move(t)); }
111 */
112}
113
114#endif // ADIAR_TYPES_H
consumer< ValueType > make_consumer(OutputIt &iter)
Wrap an iterator into a consumer function.
Definition functional.h:67
Core types.
Definition adiar.h:40
std::pair< T1, T2 > pair
A pair of values.
Definition types.h:53
replace_type
Possible guarantees of a variable permutation/remapping m of type int -> int.
Definition types.h:32
constexpr pair< T1, T2 > make_pair(const T1 &t1, const T2 &t2)
Create an adiar::pair, deducing the target type based on the types of the arguments.
Definition types.h:60
std::optional< T > optional
An optional value, i.e. a possibly existent value.
Definition types.h:81
constexpr optional< T > make_optional()
Create an empty adiar::optional, i.e. None.
Definition types.h:88
assignment
Possible values to assign a variable.
Definition types.h:13