Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <stddef.h>
#include <functional>
#include <iosfwd>
#include <ostream>
#include <type_traits>
#include "absl/base/port.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "ortools/base/macros.h"
Go to the source code of this file.
Classes | |
class | util_intops::StrongInt< StrongIntName, _ValueType > |
struct | util_intops::StrongInt< StrongIntName, _ValueType >::Hasher |
class | util_intops::StrongIntRange< IntType > |
class | util_intops::StrongIntRange< IntType >::StrongIntRangeIterator |
Iterator over the indices. More... | |
struct | std::hash< util_intops::StrongInt< StrongIntName, ValueType > > |
Namespaces | |
namespace | util_intops |
namespace | std |
STL namespace. | |
Macros | |
#define | DEFINE_STRONG_INT_TYPE(int_type_name, value_type) |
#define | STRONG_INT_TYPE_ASSIGNMENT_OP(op) |
#define | STRONG_INT_TYPE_ARITHMETIC_OP(op) |
#define | STRONG_INT_TYPE_COMPARISON_OP(op) |
Functions | |
template<typename StrongIntName , typename ValueType > | |
std::ostream & | util_intops::operator<< (std::ostream &os, StrongInt< StrongIntName, ValueType > arg) |
template<typename Sink , typename... T> | |
void | util_intops::AbslStringify (Sink &sink, StrongInt< T... > arg) |
util_intops::STRONG_INT_TYPE_ARITHMETIC_OP (+) | |
util_intops::STRONG_INT_TYPE_ARITHMETIC_OP (-) | |
STRONG_INT_TYPE_ARITHMETIC_OP * | util_intops::STRONG_INT_TYPE_ARITHMETIC_OP (/);STRONG_INT_TYPE_ARITHMETIC_OP(<< |
util_intops::STRONG_INT_TYPE_ARITHMETIC_OP (> >) | |
util_intops::STRONG_INT_TYPE_ARITHMETIC_OP (%) | |
util_intops::STRONG_INT_TYPE_COMPARISON_OP (==) | |
util_intops::STRONG_INT_TYPE_COMPARISON_OP (!=) | |
util_intops::STRONG_INT_TYPE_COMPARISON_OP (<=) | |
util_intops::STRONG_INT_TYPE_COMPARISON_OP (>=) | |
template<typename IntType > | |
StrongIntRange< IntType > | util_intops::MakeStrongIntRange (IntType end) |
template<typename IntType > | |
StrongIntRange< IntType > | util_intops::MakeStrongIntRange (IntType begin, IntType end) |
Variables | |
class util_intops::StrongInt | util_intops::ABSL_ATTRIBUTE_PACKED |
#define DEFINE_STRONG_INT_TYPE | ( | int_type_name, | |
value_type ) |
Defines the StrongInt using value_type and typedefs it to int_type_name. The struct int_type_name ## tag trickery is needed to ensure that a new type is created per int_type_name.
Definition at line 168 of file strong_int.h.
#define STRONG_INT_TYPE_ARITHMETIC_OP | ( | op | ) |
– NON-MEMBER ARITHMETIC OPERATORS ---------------------------------------— We support only the +, -, *, and / operators with the same StrongInt and ValueType types. The reason is to allow simple manipulation on these IDs when used as indices in vectors and arrays.
NB: Although it is possible to do StrongInt * StrongInt and StrongInt / StrongInt, it is probably non-sensical from a dimensionality analysis perspective.
Definition at line 327 of file strong_int.h.
#define STRONG_INT_TYPE_ASSIGNMENT_OP | ( | op | ) |
– ASSIGNMENT OPERATORS ------------------------------------------------— We support the following assignment operators: =, +=, -=, *=, /=, <<=, >>= and %= for both ThisType and ValueType.
Definition at line 262 of file strong_int.h.
#define STRONG_INT_TYPE_COMPARISON_OP | ( | op | ) |
– NON-MEMBER COMPARISON OPERATORS ---------------------------------------— Static inline comparison operators. We allow all comparison operators among the following types (OP \in [==, !=, <, <=, >, >=]: StrongInt<StrongIntName, ValueType> OP StrongInt<StrongIntName, ValueType> StrongInt<StrongIntName, ValueType> OP ValueType ValueType OP StrongInt<StrongIntName, ValueType>
Definition at line 361 of file strong_int.h.