![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
#include <attr_key.h>
Public Types | |
using | value_type = int64_t |
using | SymmetryT = Symmetry |
Public Member Functions | |
constexpr | AttrKey () |
Default constructor: values are uninitialized. | |
template<typename... Ints, typename = std::enable_if_t<(sizeof...(Ints) == n && (std::is_integral_v<Ints> && ...))>> | |
constexpr | AttrKey (const Ints... ids) |
template<ElementType... element_types, typename = std::enable_if_t<(sizeof...(element_types) == n)>> | |
constexpr | AttrKey (const ElementId< element_types >... ids) |
constexpr | AttrKey (std::array< value_type, n > ids) |
constexpr | AttrKey (const AttrKey &)=default |
constexpr AttrKey & | operator= (const AttrKey &)=default |
constexpr value_type | operator[] (const int dim) const |
Element access. | |
constexpr value_type & | operator[] (const int dim) |
constexpr const value_type * | begin () const |
Element iteration. | |
constexpr const value_type * | end () const |
template<int dim> | |
AttrKey< n - 1, NoSymmetry > | RemoveElement () const |
template<int dim, typename NewSymmetry> | |
AttrKey< n+1, NewSymmetry > | AddElement (const value_type elem) const |
Static Public Member Functions | |
static constexpr AttrKey | Canonicalize (AttrKey< n, NoSymmetry > key) |
Canonicalizes a non-canonical key, i.e., enforces the symmetries. | |
static absl::StatusOr< AttrKey > | FromRange (absl::Span< const int64_t > range) |
Creates a key from a range of n elements. | |
static constexpr int | size () |
Friends | |
template<int other_n, typename OtherSymmetry> | |
class | AttrKey |
constexpr bool | operator== (const AttrKey &l, const AttrKey &r) |
constexpr bool | operator< (const AttrKey &l, const AttrKey &r) |
constexpr bool | operator<= (const AttrKey &l, const AttrKey &r) |
constexpr bool | operator> (const AttrKey &l, const AttrKey &r) |
constexpr bool | operator>= (const AttrKey &l, const AttrKey &r) |
template<typename H> | |
H | AbslHashValue (H h, const AttrKey &a) |
template<typename Sink> | |
void | AbslStringify (Sink &sink, const AttrKey &key) |
AttrKey is printable for logging and tests. |
An attribute key for an attribute keyed on n elements. AttrKey is a value type.
Definition at line 39 of file attr_key.h.
using operations_research::math_opt::AttrKey< n, Symmetry >::SymmetryT = Symmetry |
Definition at line 42 of file attr_key.h.
using operations_research::math_opt::AttrKey< n, Symmetry >::value_type = int64_t |
Definition at line 41 of file attr_key.h.
|
inlineconstexpr |
Default constructor: values are uninitialized.
Definition at line 45 of file attr_key.h.
|
inlineexplicitconstexpr |
Definition at line 50 of file attr_key.h.
|
inlineexplicitconstexpr |
Definition at line 58 of file attr_key.h.
|
inlineconstexpr |
Definition at line 61 of file attr_key.h.
|
constexprdefault |
|
inline |
Adds element elem at dimension dim and returns the result. The result must respect NewSymmetry (we DCHECK this).
Definition at line 188 of file attr_key.h.
|
inlineconstexpr |
Element iteration.
Definition at line 102 of file attr_key.h.
|
inlinestaticconstexpr |
Canonicalizes a non-canonical key, i.e., enforces the symmetries.
Definition at line 67 of file attr_key.h.
|
inlineconstexpr |
Definition at line 103 of file attr_key.h.
|
inlinestatic |
Creates a key from a range of n elements.
Definition at line 72 of file attr_key.h.
|
constexprdefault |
|
inlineconstexpr |
Definition at line 95 of file attr_key.h.
|
inlineconstexpr |
Element access.
Definition at line 90 of file attr_key.h.
|
inline |
Removes the element at dimension dim from the key and returns a key with only remaining dimensions.
Definition at line 172 of file attr_key.h.
|
inlinestaticconstexpr |
Definition at line 87 of file attr_key.h.
|
friend |
Definition at line 207 of file attr_key.h.
|
friend |
Definition at line 157 of file attr_key.h.
|
friend |
AttrKey is printable for logging and tests.
Definition at line 163 of file attr_key.h.
|
friend |
This is much faster than using the default generated operator<.
Definition at line 122 of file attr_key.h.
|
friend |
This is much faster than using the default generated operator<.
Definition at line 135 of file attr_key.h.
|
friend |
AttrKey is comparable (ordering is lexicographic) and hashable.
This is much faster than using the default generated operator==.
Definition at line 112 of file attr_key.h.
|
friend |
Definition at line 148 of file attr_key.h.
|
friend |
Definition at line 152 of file attr_key.h.